36 #include <vtkPolyData.h>
37 #include <vtkPointData.h>
38 #include <vtkProperty.h>
40 #include <vtkRenderer.h>
41 #include <vtkMatrix4x4.h>
42 #include <vtkArrowSource.h>
56 m_rMrr = Transform3D::Identity();
80 this->meshChangedSlot();
81 this->transformChangedSlot();
82 this->clipPlanesChangedSlot();
87 void GraphicalGeometric::clipPlanesChangedSlot()
94 std::vector<vtkPlanePtr> mPlanes;
95 mPlanes =
mMesh->getAllClipPlanes();
96 for (
unsigned i=0; i<mPlanes.size(); ++i)
124 this->transformChangedSlot();
127 void GraphicalGeometric::meshChangedSlot()
130 if(
mMesh->showGlyph())
140 mMesh->updateVtkPolyDataWithTexture();
160 const MeshPropertyData& src =
mMesh->getProperties();
162 dest->SetPointSize(src.mVisSize->getValue());
163 dest->SetBackfaceCulling(src.mBackfaceCulling->getValue());
164 dest->SetFrontfaceCulling(src.mFrontfaceCulling->getValue());
165 dest->SetRepresentation(src.mRepresentation->getValue().toInt());
166 dest->SetEdgeVisibility(src.mEdgeVisibility->getValue());
168 dest->SetAmbient(src.mAmbient->getValue());
169 dest->SetDiffuse(src.mDiffuse->getValue());
170 dest->SetSpecular(src.mSpecular->getValue());
171 dest->SetSpecularPower(src.mSpecularPower->getValue());
176 void GraphicalGeometric::transformChangedSlot()
211 mGraphics->setRenderer(view->getRenderer());
216 mGraphics->setRenderer(NULL);
221 mGraphics->setMesh(mesh);
226 return mGraphics->getMesh();
230 return mGraphics->getMesh() == mesh;
Vector3D getColorAsVector3D(QColor color)
vtkSmartPointer< class vtkProperty > vtkPropertyPtr
Transform3D Transform3D
Transform3D is a representation of an affine 3D transform.
void transformChanged()
emitted when transform is changed
void setRenderer(vtkRendererPtr renderer)
void setMesh(MeshPtr mesh)
sets this reps mesh
static boost::shared_ptr< REP > wrap_new(REP *object, QString uid)
virtual ~GraphicalGeometric()
boost::shared_ptr< class View > ViewPtr
bool hasMesh(MeshPtr mesh) const
checks if this rep has the give mesh
MeshPtr getMesh()
gives this reps mesh
vtkSmartPointer< class vtkRenderer > vtkRendererPtr
Helper for rendering a a polydata in 3D.
virtual void addRepActorsToViewRenderer(ViewPtr view)
virtual void removeRepActorsFromViewRenderer(ViewPtr view)
GraphicalPolyData3DPtr mGraphicalPolyDataPtr
static GeometricRepPtr New(const QString &uid="")
Default implementation of Rep.
void setTransformOffset(Transform3D rMrr)
GraphicalGlyph3DDataPtr mGraphicalGlyph3DDataPtr
Helper for rendering a a glyph in 3D.
boost::shared_ptr< class Mesh > MeshPtr
MeshPtr getMesh()
gives this reps mesh
void setMesh(MeshPtr mesh)
sets this reps mesh
boost::shared_ptr< class GeometricRep > GeometricRepPtr