1 /*---------------------------------------------------------------------------*\
2 * OpenSG NURBS Library *
5 * Copyright (C) 2001-2006 by the University of Bonn, Computer Graphics Group*
7 * http://cg.cs.uni-bonn.de/ *
9 * contact: edhellon@cs.uni-bonn.de, guthe@cs.uni-bonn.de, rk@cs.uni-bonn.de *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
15 * This library is free software; you can redistribute it and/or modify it *
16 * under the terms of the GNU Library General Public License as published *
17 * by the Free Software Foundation, version 2. *
19 * This library is distributed in the hope that it will be useful, but *
20 * WITHOUT ANY WARRANTY; without even the implied warranty of *
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
22 * Library General Public License for more details. *
24 * You should have received a copy of the GNU Library General Public *
25 * License along with this library; if not, write to the Free Software *
26 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
37 \*---------------------------------------------------------------------------*/
38 #ifndef _OSG_BEZIERTENSORSURFACE_H_
39 #define _OSG_BEZIERTENSORSURFACE_H_
44 #include "OSGDrawableDef.h"
45 #include "OSGConfig.h"
53 #include "OSGdctptypes.h"
54 #include "OSGBezierCurve3D.h"
58 class BezierTensorSurface
;
60 typedef std::vector
<BezierTensorSurface
> beziersurfacevector
;
61 typedef std::vector
<beziersurfacevector
> beziersurfacematrix
;
64 class OSG_DRAWABLE_DLLMAPPING BezierTensorSurface
67 DCTPVec4dmatrix control_points
; //control points of the surface
70 inline BezierTensorSurface(void );
71 inline BezierTensorSurface(const DCTPVec4dmatrix
&cps
);
72 inline BezierTensorSurface(const BezierTensorSurface
&bts
);
73 inline ~BezierTensorSurface(void );
76 int setControlPointMatrix(const DCTPVec4dmatrix
& cps
); //ok, acts like its name says
79 inline DCTPVec4dmatrix
& getControlPointMatrix(void);
81 //some REAL functionality
82 Vec3d
computewdeCasteljau(Vec2d uv
, int &error
); //compute curve at parameter value t
83 Vec3d
computeLinearApproximation(Vec2d uv
, int &error
); //ok like its name sayz
84 int midPointSubDivision(beziersurfacematrix
&newbeziers
); //subdivide surface at midpoint into 4 bezier surfaces
85 int midPointSubDivision(beziersurfacevector
&newbeziers
); //subdivide surface at midpoint into 4 bezier surfaces
86 int midPointSubDivisionU(BezierTensorSurface
&newsurface
);
87 int midPointSubDivisionV(BezierTensorSurface
&newsurface
);
92 #include "OSGBezierTensorSurface.inl"
94 #endif //BezierTensorSurface.h