Main Page   Class Hierarchy   Compound List   File List   Compound Members  

tri_spline.h

00001 /*=====================================================================
00002         File: nurbs.cpp
00003      Purpose:       
00004     Revision: $Id: tri_spline.h,v 1.3 2003/01/13 19:42:34 philosophil Exp $
00005       Author: Philippe Lavoie          (3 Oct, 1996)
00006  Modified by: 
00007 
00008  Copyright notice:
00009           Copyright (C) 1996-1997 Philippe Lavoie
00010  
00011           This library is free software; you can redistribute it and/or
00012           modify it under the terms of the GNU Library General Public
00013           License as published by the Free Software Foundation; either
00014           version 2 of the License, or (at your option) any later version.
00015  
00016           This library is distributed in the hope that it will be useful,
00017           but WITHOUT ANY WARRANTY; without even the implied warranty of
00018           MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00019           Library General Public License for more details.
00020  
00021           You should have received a copy of the GNU Library General Public
00022           License along with this library; if not, write to the Free
00023           Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00024 =====================================================================*/
00025 #ifndef _TRIANGULAR_BSPLINE_H
00026 #define _TRIANGULAR_BSPLINE_H
00027 
00028 #include "nurbs_global.h"
00029 
00030 #include "point_nd.h"
00031 #include "hpoint_nd.h"
00032 #include "barray.h"
00033 
00034 #include "nurbs.h"
00035 #include "nurbsS.h"
00036 
00039 namespace PLib {
00040 
00041   template <class T, int D>
00042     class TriangularBSpline  {
00043     private:
00044       BasicArray<Point_nD<T,D> > cp;
00045       int deg ;
00046     public:
00047       TriangularBSpline(int degree);
00048       Point_nD<T,D>& b(int i, int j, int);
00049       Point_nD<T,D> b(int, int ,int) const ; 
00050       Point_nD<T,D> operator()(T u, T v) const;
00051 
00052     };
00053   
00054   template <class T, int D>
00055     class RTriangularBSpline {
00056     private:
00057       BasicArray<HPoint_nD<T,D> > cp;
00058       int deg ; 
00059     public:
00060       RTriangularBSpline(int degree);
00061       HPoint_nD<T,D>& b(int, int, int);
00062       HPoint_nD<T,D> b(int, int ,int) const ; 
00063       HPoint_nD<T,D> operator()(T u, T v) const;
00064 
00065       int writeVRML(const char* filename, const Color& color=whiteColor, int Nu=20, int Nv=20, int Nw=20) const;
00066       int writeVRML(ostream& fout, const Color& color=whiteColor, int Nu=20, int Nv=20, int Nw=20) const;
00067 
00068       void setDegree(int d) ;
00069     };
00070 
00071   template < class T, int D> void convert(const NurbsSurface<T,D>& surf, RTriangularBSpline<T,D> &t1, RTriangularBSpline<T,D> &t2) ;
00072 
00073 }
00074 
00075 
00076 #endif

Generated on Tue Jun 24 13:26:59 2003 for NURBS++ by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002