Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members

glbezierpatch.h

00001 /***************************************************************************
00002                           glbezierpatch.h  -  description
00003                              -------------------
00004     begin                : Thu Jul 3 2003
00005     copyright            : (C) 2003 by Jacques Gasselin de Richebourg
00006     email                : jacquesgasselin@hotmail.com
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU Lesser General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
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       //the bezier curve rows that make the patch
00037       //they must be of equal order
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    /*   virtual GLVector getVectorToFurthestPoint(const GLVector& fromPoint)
00065       { return getPosition() - fromPoint; };
00066       virtual GLVector getVectorToNearestPoint(const GLVector& fromPoint)
00067       { return getPosition() - fromPoint; };                             */
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

Generated on Wed Feb 4 23:11:33 2004 by doxygen 1.3.3