38 #include <vtkTransform.h> 40 #include <vtkProperty.h> 45 class LVRMeshBufferBridge;
60 m_meshBridge->getMeshActor()->GetProperty()->BackfaceCullingOff();
64 vtkSmartPointer<vtkProperty> prop = vtkProperty::New();
65 prop->BackfaceCullingOff();
66 m_meshBridge->getTexturedActors()->ApplyProperties(prop);
85 return (
m_meshBridge->getNumTriangles() > 0) ?
true :
false;
91 vtkSmartPointer<vtkTransform>
transform = vtkSmartPointer<vtkTransform>::New();
92 transform->PostMultiply();
93 transform->RotateX(pose.
r);
94 transform->RotateY(pose.
t);
95 transform->RotateZ(pose.
p);
96 transform->Translate(pose.
x, pose.
y, pose.
z);
104 vtkSmartPointer<vtkTransform> t = vtkSmartPointer<vtkTransform>::New();
105 vtkSmartPointer<vtkMatrix4x4> m = vtkSmartPointer<vtkMatrix4x4>::New();
109 const double* arr = transform.data();
111 for(
int i = 0; i < 16; i++)
118 m->SetElement(i / 4, j, v);
131 m_pointBridge->getPointCloudActor()->SetUserTransform(transform);
138 m_meshBridge->getMeshActor()->SetUserTransform(transform);
142 vtkSmartPointer<vtkActorCollection> col =
m_meshBridge->getTexturedActors();
143 col->InitTraversal();
144 for (
int i = 0; i < col->GetNumberOfItems(); i++)
146 col->GetNextActor()->SetUserTransform(transform);
172 vtkSmartPointer<vtkActor> actor =
m_meshBridge->getMeshActor();
173 renderer->AddActor(actor);
174 actor->GetProperty()->BackfaceCullingOff();
178 vtkSmartPointer<vtkActorCollection> collection =
m_meshBridge->getTexturedActors();
179 collection->InitTraversal();
180 for(vtkIdType i = 0; i < collection->GetNumberOfItems(); i++)
182 renderer->AddActor(collection->GetNextActor());
LVRModelBridge(ModelPtr model)
Constructor. Parses the model information and generates vtk actor instances for the given data...
void addActors(vtkSmartPointer< vtkRenderer > renderer)
Adds the generated actors to the given renderer.
void setTransform(const Transformd &transform)
MeshBufferBridgePtr m_meshBridge
void setNormalsVisibility(bool visible)
virtual ~LVRModelBridge()
Destructor.
Main class for conversion of LVR model instances to vtk actors. This class parses the internal model ...
Transform< double > Transformd
4x4 double precision transformation matrix
void removeActors(vtkSmartPointer< vtkRenderer > renderer)
Removes the generated actors from the given renderer.
PointBufferBridgePtr m_pointBridge
void doStuff(vtkSmartPointer< vtkTransform > transform)
std::shared_ptr< Model > ModelPtr
void setVisibility(bool visible)
void setPose(const Pose &pose)