Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Class Members | File Members | Related Pages

vpmesh.h

Go to the documentation of this file.
00001 
00002 
00003 
00004 
00005 // ChangeLog is at the implementation file
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     // PUBLIC TYPES
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     // PUBLIC METHODS
00035         VPMesh();
00036         VPMesh(const VPMesh& mesh);
00037         //~ VPMesh(MeshType type);
00038         VPMesh& operator=(const VPMesh& mesh);
00039 
00042         bool DrawInstanceOGL() const;
00043 
00044         // \brief Draws the mesh assuming that its MeshObject is unoptimized.
00045         // \param vertVec [in] The vector of vertices from the parent MeshObject.
00046         // \return false if VPAT was not compiled with OpenGL support.
00047         //~ bool DrawOglUnoptimized(const std::vector<VPPoint4D>& vertVec) const;
00048 
00050         #ifdef VP_OGL
00051         GLenum GetOglType() const { return GetOglType(type); }
00052         #endif
00053 
00054         void IncrementIndices(unsigned int increment);
00055 
00056     // PUBLIC ATTRIBUTES
00057         std::vector<unsigned int> indexVec; // indexes of the vertices (start at 0)
00058         std::vector<unsigned int> normIndVec; // indexes of the normals (for unoptimized meshes)
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

Generated on Tue Sep 6 10:00:04 2005 for VPAT by  doxygen 1.4.4