00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef GLBEZIERPATCH_H
00019 #define GLBEZIERPATCH_H
00020
00021 #include "glbeziercurve.h"
00022
00032 namespace GLScene
00033 {
00034 class GLBezierPatch : public GLGeometricObject
00035 {
00036
00037
00038 std::vector<GLBezierCurve> curvesInU;
00039 std::vector<GLBezierCurve> curvesInV;
00040 GLuint nOfCPsU, nOfCPsV;
00041
00042 GLuint levelOfDetail;
00043
00044 public:
00045 static char startTag[20];
00046 static char endTag[20];
00047
00048 TYPE_NAME(GLBezierPatch);
00049
00050 GLBezierPatch();
00051 ~GLBezierPatch();
00052
00053 void setLOD(const GLuint);
00054 void addCurve(const GLBezierCurve&);
00055
00056 const GLVector pointAt(const GLfloat u, const GLfloat v) const;
00057 std::vector<GLVector>* pointsAt(const GLfloat u, const GLfloat samples) const;
00058 std::vector< std::vector<GLVector>* >* getGridOfPoints(const GLfloat samplesInU, const GLfloat samplesInV) const;
00059
00060 const GLVector normalAt(const GLfloat u, const GLfloat v) const;
00061 std::vector<GLVector>* normalsAt(const GLfloat u, const GLfloat samples) const;
00062 std::vector< std::vector<GLVector>* >* getGridOfNormals(const GLfloat samplesInU, const GLfloat samplesInV) const;
00063
00064
00065
00066
00067
00068
00069 virtual bool intersection( GLGeometricObject* obj ) { return obj->intersection((GLBezierPatch*)this); };
00070 virtual bool intersection( GLBezierPatch* ) { return false; };
00071 virtual bool inclusion( GLGeometricObject* ) { return false;};
00072
00073 void compileVertexArray() { };
00074 void render( );
00075 void renderForSelection(GLuint&);
00076
00077 void loadFromStream(std::istream&) {};
00078 void saveToStream(std::ostream&) {};
00079 };
00080
00081 };
00082 #endif