LVRMeshBufferBridge.hpp
Go to the documentation of this file.
1 
34 #ifndef LVRMESHBUFFERBRIDGE_H_
35 #define LVRMESHBUFFERBRIDGE_H_
36 
37 #include "lvr2/io/MeshBuffer.hpp"
40 
41 #include <vtkSmartPointer.h>
42 #include <vtkActor.h>
43 #include <vtkActorCollection.h>
44 
45 #include <boost/shared_ptr.hpp>
46 
47 namespace lvr2
48 {
49 
51 {
52 
55 
56 public:
59 
60  virtual ~LVRMeshBufferBridge();
61 
62  vtkSmartPointer<vtkActor> getMeshActor();
63  vtkSmartPointer<vtkActor> getWireframeActor();
64  vtkSmartPointer<vtkActorCollection> getTexturedActors();
65  size_t getNumTriangles();
66  size_t getNumVertices();
67  bool hasTextures();
68 
69  void setBaseColor(float r, float g, float b);
70  void setOpacity(float opacityValue);
72  void setVisibility(bool visible);
73  void setShading(int shader);
74 
75  size_t getNumColoredFaces();
76  size_t getNumTexturedFaces();
77  size_t getNumTextures();
78 
79 protected:
80  void computeMeshActor(MeshBufferPtr meshbuffer);
81  size_t m_numVertices;
82  size_t m_numFaces;
83  vtkSmartPointer<vtkActor> m_meshActor;
84  vtkSmartPointer<vtkActor> m_wireframeActor;
85  vtkSmartPointer<vtkActorCollection> m_texturedActors;
87 
90  size_t m_numTextures;
91 
92  void computeMaterialGroups(vector<MaterialGroup*>& matGroups, vector<MaterialGroup*>& colorMatGroups);
93  void remapTexturedIndices(MaterialGroup* g, vector<Vec >& vertices, vector<Vec >& texCoords, vector<int>& indices);
94  void remapIndices(vector<MaterialGroup*> g, vector<Vec >& vertices, vector<VecUChar >& colors, vector<int>& indices);
95 
96 
97  vtkSmartPointer<vtkActor> getTexturedActor(MaterialGroup* g);
98  vtkSmartPointer<vtkActor> getColorMeshActor(vector<MaterialGroup*> groups);
99 
100  vtkSmartPointer<vtkTexture> getTexture(int index);
101 
102 private:
103 
104 };
105 
106 typedef boost::shared_ptr<LVRMeshBufferBridge> MeshBufferBridgePtr;
107 
108 } /* namespace lvr2 */
109 
110 #endif /* LVRMESHBUFFERBRIDGE_H_ */
std::shared_ptr< MeshBuffer > MeshBufferPtr
Definition: MeshBuffer.hpp:217
vtkSmartPointer< vtkActor > getMeshActor()
vtkSmartPointer< vtkActor > getColorMeshActor(vector< MaterialGroup *> groups)
vtkSmartPointer< vtkActor > m_meshActor
vtkSmartPointer< vtkTexture > getTexture(int index)
void setOpacity(float opacityValue)
void remapTexturedIndices(MaterialGroup *g, vector< Vec > &vertices, vector< Vec > &texCoords, vector< int > &indices)
boost::shared_ptr< LVRMeshBufferBridge > MeshBufferBridgePtr
vtkSmartPointer< vtkActor > getTexturedActor(MaterialGroup *g)
void computeMeshActor(MeshBufferPtr meshbuffer)
void remapIndices(vector< MaterialGroup *> g, vector< Vec > &vertices, vector< VecUChar > &colors, vector< int > &indices)
vtkSmartPointer< vtkActorCollection > getTexturedActors()
vtkSmartPointer< vtkActor > m_wireframeActor
vtkSmartPointer< vtkActorCollection > m_texturedActors
void computeMaterialGroups(vector< MaterialGroup *> &matGroups, vector< MaterialGroup *> &colorMatGroups)
vtkSmartPointer< vtkActor > getWireframeActor()
LVRMeshBufferBridge(MeshBufferPtr meshbuffer)
void setBaseColor(float r, float g, float b)


lvr2
Author(s): Thomas Wiemann , Sebastian Pütz , Alexander Mock , Lars Kiesow , Lukas Kalbertodt , Tristan Igelbrink , Johan M. von Behren , Dominik Feldschnieders , Alexander Löhr
autogenerated on Mon Feb 28 2022 22:46:08