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_ */
TexturedMesh.hpp
lvr2::MeshBufferBridgePtr
boost::shared_ptr< LVRMeshBufferBridge > MeshBufferBridgePtr
Definition: LVRMeshBufferBridge.hpp:106
lvr2::LVRMeshBufferBridge::setOpacity
void setOpacity(float opacityValue)
Definition: LVRMeshBufferBridge.cpp:222
lvr2::LVRMeshBufferBridge::m_texturedActors
vtkSmartPointer< vtkActorCollection > m_texturedActors
Definition: LVRMeshBufferBridge.hpp:85
lvr2::LVRMeshBufferBridge::getColorMeshActor
vtkSmartPointer< vtkActor > getColorMeshActor(vector< MaterialGroup * > groups)
Definition: LVRMeshBufferBridge.cpp:662
lvr2::BaseVector< float >
lvr2::LVRMeshBufferBridge
Definition: LVRMeshBufferBridge.hpp:50
lvr2::LVRMeshBufferBridge::getMeshBuffer
MeshBufferPtr getMeshBuffer()
Definition: LVRMeshBufferBridge.cpp:121
lvr2::LVRMeshBufferBridge::m_meshActor
vtkSmartPointer< vtkActor > m_meshActor
Definition: LVRMeshBufferBridge.hpp:83
lvr2::LVRMeshBufferBridge::getTexture
vtkSmartPointer< vtkTexture > getTexture(int index)
Definition: LVRMeshBufferBridge.cpp:581
lvr2::LVRMeshBufferBridge::LVRMeshBufferBridge
LVRMeshBufferBridge(MeshBufferPtr meshbuffer)
Definition: LVRMeshBufferBridge.cpp:55
lvr2::LVRMeshBufferBridge::m_wireframeActor
vtkSmartPointer< vtkActor > m_wireframeActor
Definition: LVRMeshBufferBridge.hpp:84
lvr2::LVRMeshBufferBridge::getNumColoredFaces
size_t getNumColoredFaces()
Definition: LVRMeshBufferBridge.cpp:97
lvr2::LVRMeshBufferBridge::getNumTextures
size_t getNumTextures()
Definition: LVRMeshBufferBridge.cpp:106
lvr2::LVRMeshBufferBridge::setShading
void setShading(int shader)
Definition: LVRMeshBufferBridge.cpp:268
lvr2::MaterialGroup
Definition: TexturedMesh.hpp:46
lvr2::LVRMeshBufferBridge::m_numTexturedFaces
size_t m_numTexturedFaces
Definition: LVRMeshBufferBridge.hpp:89
lvr2::LVRMeshBufferBridge::~LVRMeshBufferBridge
virtual ~LVRMeshBufferBridge()
Definition: LVRMeshBufferBridge.cpp:126
lvr2::LVRMeshBufferBridge::m_numFaces
size_t m_numFaces
Definition: LVRMeshBufferBridge.hpp:82
lvr2::LVRMeshBufferBridge::m_numTextures
size_t m_numTextures
Definition: LVRMeshBufferBridge.hpp:90
lvr2::LVRMeshBufferBridge::hasTextures
bool hasTextures()
Definition: LVRMeshBufferBridge.cpp:730
lvr2::LVRMeshBufferBridge::remapTexturedIndices
void remapTexturedIndices(MaterialGroup *g, vector< Vec > &vertices, vector< Vec > &texCoords, vector< int > &indices)
Definition: LVRMeshBufferBridge.cpp:353
lvr2::LVRMeshBufferBridge::computeMaterialGroups
void computeMaterialGroups(vector< MaterialGroup * > &matGroups, vector< MaterialGroup * > &colorMatGroups)
Definition: LVRMeshBufferBridge.cpp:285
lvr2::LVRMeshBufferBridge::setVisibility
void setVisibility(bool visible)
Definition: LVRMeshBufferBridge.cpp:235
lvr2::LVRMeshBufferBridge::getTexturedActors
vtkSmartPointer< vtkActorCollection > getTexturedActors()
Definition: LVRMeshBufferBridge.cpp:627
lvr2::LVRMeshBufferBridge::getWireframeActor
vtkSmartPointer< vtkActor > getWireframeActor()
Definition: LVRMeshBufferBridge.cpp:275
lvr2::LVRMeshBufferBridge::setBaseColor
void setBaseColor(float r, float g, float b)
Definition: LVRMeshBufferBridge.cpp:75
scripts.create_png.colors
colors
Definition: create_png.py:41
MeshBuffer.hpp
lvr2::LVRMeshBufferBridge::getTexturedActor
vtkSmartPointer< vtkActor > getTexturedActor(MaterialGroup *g)
Definition: LVRMeshBufferBridge.cpp:517
lvr2::LVRMeshBufferBridge::m_numVertices
size_t m_numVertices
Definition: LVRMeshBufferBridge.hpp:81
lvr2::LVRMeshBufferBridge::getMeshActor
vtkSmartPointer< vtkActor > getMeshActor()
Definition: LVRMeshBufferBridge.cpp:280
lvr2::LVRMeshBufferBridge::computeMeshActor
void computeMeshActor(MeshBufferPtr meshbuffer)
Definition: LVRMeshBufferBridge.cpp:131
lvr2
Definition: BaseBufferManipulators.hpp:39
lvr2::MeshBufferPtr
std::shared_ptr< MeshBuffer > MeshBufferPtr
Definition: MeshBuffer.hpp:217
lvr2::LVRMeshBufferBridge::getNumVertices
size_t getNumVertices()
Definition: LVRMeshBufferBridge.cpp:116
lvr2::LVRMeshBufferBridge::getNumTexturedFaces
size_t getNumTexturedFaces()
Definition: LVRMeshBufferBridge.cpp:102
lvr2::LVRMeshBufferBridge::remapIndices
void remapIndices(vector< MaterialGroup * > g, vector< Vec > &vertices, vector< VecUChar > &colors, vector< int > &indices)
Definition: LVRMeshBufferBridge.cpp:435
GlTexture.hpp
lvr2::LVRMeshBufferBridge::getNumTriangles
size_t getNumTriangles()
Definition: LVRMeshBufferBridge.cpp:111
lvr2::LVRMeshBufferBridge::m_numColoredFaces
size_t m_numColoredFaces
Definition: LVRMeshBufferBridge.hpp:88
lvr2::LVRMeshBufferBridge::m_meshBuffer
MeshBufferPtr m_meshBuffer
Definition: LVRMeshBufferBridge.hpp:86


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 Wed Mar 2 2022 00:37:24