V-ART
mesh.h
Go to the documentation of this file.
1 
5 #ifndef VART_MESH_H
6 #define VART_MESH_H
7 
8 #include "vart/point4d.h"
9 #include "vart/material.h"
10 #include <vector>
11 
12 #ifdef WIN32
13 #include <windows.h>
14 #endif
15 #ifdef VART_OGL
16 #include <GL/gl.h>
17 #endif
18 
19 namespace VART {
30  class Mesh {
31  friend std::ostream& operator<<(std::ostream& output, const Mesh& mesh);
32  public:
33  // PUBLIC TYPES
36  friend std::ostream& operator<<(std::ostream& output, const MeshType mt);
37  // PUBLIC METHODS
39  Mesh();
40  Mesh(const Mesh& mesh);
41  //~ Mesh(MeshType type);
42  Mesh& operator=(const Mesh& mesh);
43 
46  bool DrawInstanceOGL() const;
47 
48  // \brief Draws the mesh assuming that its MeshObject is unoptimized.
49  // \param vertVec [in] The vector of vertices from the parent MeshObject.
50  // \return false if V-ART was not compiled with OpenGL support.
51  //~ bool DrawOglUnoptimized(const std::vector<Point4D>& vertVec) const;
52 
54  #ifdef VART_OGL
55  GLenum GetOglType() const { return GetOglType(type); }
56  #endif
57 
58  void IncrementIndices(unsigned int increment);
59 
60  // PUBLIC ATTRIBUTES
62  std::vector<unsigned int> indexVec;
64  std::vector<unsigned int> normIndVec;
67  private:
68  #ifdef VART_OGL
69  static GLenum GetOglType(MeshType type);
71  #endif
72  }; // end class declaration
73 } // end namespace
74 #endif
Header file for V-ART class "Material".
std::vector< unsigned int > normIndVec
indexes of the normals (for unoptimized meshes)
Definition: mesh.h:64
MeshType type
Definition: mesh.h:66
friend std::ostream & operator<<(std::ostream &output, const Mesh &mesh)
Mesh()
Creates an uninitialized mesh.
Definition: mesh.cpp:9
A mesh is part of an graphical object, in which faces are made of vertices according to some rule of ...
Definition: mesh.h:30
void IncrementIndices(unsigned int increment)
Returns the mesh type as OpenGL enum.
Definition: mesh.cpp:27
MeshType
Definition: mesh.h:34
Material properties for graphical objects.
Definition: material.h:16
std::vector< unsigned int > indexVec
indexes of the vertices (start at 0) defining faces
Definition: mesh.h:62
Header file for V-ART class "Point4D".
Mesh & operator=(const Mesh &mesh)
Definition: mesh.cpp:19
Material material
Definition: mesh.h:65
bool DrawInstanceOGL() const
Draws the mesh assuming that its MeshObject is optimized.
Definition: mesh.cpp:60