changed: gcc8 base update
[opensg.git] / Source / System / NodeCores / Drawables / Nurbs / Internal / OSGBezierTensorSurface.h
blob4c3e5de059a6d5be43aa1e721ccd0531c5bbcefa
1 /*---------------------------------------------------------------------------*\
2 * OpenSG NURBS Library *
3 * *
4 * *
5 * Copyright (C) 2001-2006 by the University of Bonn, Computer Graphics Group*
6 * *
7 * http://cg.cs.uni-bonn.de/ *
8 * *
9 * contact: edhellon@cs.uni-bonn.de, guthe@cs.uni-bonn.de, rk@cs.uni-bonn.de *
10 * *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
13 * License *
14 * *
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. *
18 * *
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. *
23 * *
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. *
27 * *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
30 * Changes *
31 * *
32 * *
33 * *
34 * *
35 * *
36 * *
37 \*---------------------------------------------------------------------------*/
38 #ifndef _OSG_BEZIERTENSORSURFACE_H_
39 #define _OSG_BEZIERTENSORSURFACE_H_
40 #ifdef __sgi
41 #pragma once
42 #endif
44 #include "OSGDrawableDef.h"
45 #include "OSGConfig.h"
48 #include <iostream>
49 #include <fstream>
50 #include <iomanip>
51 #include <vector>
53 #include "OSGdctptypes.h"
54 #include "OSGBezierCurve3D.h"
56 OSG_BEGIN_NAMESPACE
58 class BezierTensorSurface;
60 typedef std::vector<BezierTensorSurface> beziersurfacevector;
61 typedef std::vector<beziersurfacevector> beziersurfacematrix;
64 class OSG_DRAWABLE_DLLMAPPING BezierTensorSurface
66 protected:
67 DCTPVec4dmatrix control_points; //control points of the surface
69 public:
70 inline BezierTensorSurface(void );
71 inline BezierTensorSurface(const DCTPVec4dmatrix &cps);
72 inline BezierTensorSurface(const BezierTensorSurface &bts);
73 inline ~BezierTensorSurface(void );
75 //setup functions
76 int setControlPointMatrix(const DCTPVec4dmatrix& cps); //ok, acts like its name says
78 //query functions
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);
90 OSG_END_NAMESPACE
92 #include "OSGBezierTensorSurface.inl"
94 #endif //BezierTensorSurface.h