00001
00002
00003
00004
00005
00006
00007 #ifndef __VPMESH_H
00008 #define __VPMESH_H
00009
00010 #include "vppoint4d.h"
00011 #include "vpmaterial.h"
00012 #include <vector>
00013 #ifdef VP_OGL
00014 #include <GL/gl.h>
00015 #endif
00016
00027 class VPMesh {
00028 public:
00029
00030 enum MeshType { POINTS, LINES, LINE_STRIP, LINE_LOOP, TRIANGLES, TRIANGLE_STRIP,
00031 TRIANGLE_FAN, QUADS, QUAD_STRIP, POLYGON };
00032 friend std::ostream& operator<<(std::ostream& output, MeshType mt);
00033
00035 VPMesh();
00036 VPMesh(const VPMesh& mesh);
00037
00038 VPMesh& operator=(const VPMesh& mesh);
00039
00042 bool DrawInstanceOGL() const;
00043
00044
00045
00046
00047
00048
00050 #ifdef VP_OGL
00051 GLenum GetOglType() const { return GetOglType(type); }
00052 #endif
00053
00054 void IncrementIndices(unsigned int increment);
00055
00056
00057 std::vector<unsigned int> indexVec;
00058 std::vector<unsigned int> normIndVec;
00059 VPMaterial material;
00060 MeshType type;
00061 private:
00062 #ifdef VP_OGL
00063
00064 static GLenum GetOglType(MeshType type);
00065 #endif
00066 };
00067
00068 #endif