Cutout Vis2012
TUWienVisualisierung2(SS2012)-AdaptiveCutaways
 All Classes Namespaces Functions Pages
MeshInstance.h
1 #ifndef _MESHINSTANCE_H_
2 #define _MESHINSTANCE_H_
3 
4 #include "Mesh.h"
5 #include "Material.h"
6 #include "Transformable.h"
7 #include "Shader.h"
8 #include "SceneNode.h"
9 #include "Renderable.h"
10 #include "Identifiable.h"
11 #include <vector>
12 #include <glm/glm.hpp>
13 
14 using namespace std;
15 
16 enum MaterialType {
17  COLOR_MATERIAL
18 };
19 
24 class MeshInstance : public Transformable, public Renderable, public Identifiable
25 {
26 public:
27  MeshInstance(Mesh* mesh);
28  virtual ~MeshInstance();
29 
30  virtual void setTransform(const glm::mat4& transform);
31  virtual const glm::mat4& getTransform();
32  Mesh* getMesh();
33 
34  virtual void render(Shader* shader);
35 
36  virtual void select();
37  virtual void deselect();
38 
39 private:
40  Mesh* _mesh;
41  Material* _material;
42  glm::mat4 _transform;
43 
44  static const Material* _defaultMaterial;
45 
46  MaterialType _materialType;
47 };
48 
49 
50 
51 #endif