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();
77 connect(mMesh.get(), &
Mesh::meshChanged,
this, &GraphicalGeometric::meshChangedSlot);
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();
146 if(!
mMesh->getUseColorFromPolydataScalars())
156 dest->SetPointSize(src.
mVisSize->getValue());
162 dest->SetAmbient(src.
mAmbient->getValue());
163 dest->SetDiffuse(src.
mDiffuse->getValue());
164 dest->SetSpecular(src.
mSpecular->getValue());
170 void GraphicalGeometric::transformChangedSlot()
205 mGraphics->setRenderer(view->getRenderer());
210 mGraphics->setRenderer(NULL);
215 mGraphics->setMesh(mesh);
220 return mGraphics->getMesh();
224 return mGraphics->getMesh() == mesh;
Vector3D getColorAsVector3D(QColor color)
DoublePropertyPtr mVisSize
vtkSmartPointer< class vtkProperty > vtkPropertyPtr
Transform3D Transform3D
Transform3D is a representation of an affine 3D transform.
BoolPropertyPtr mFrontfaceCulling
DoublePropertyPtr mAmbient
void transformChanged()
emitted when transform is changed
void setRenderer(vtkRendererPtr renderer)
DoublePropertyPtr mSpecularPower
void setMesh(MeshPtr mesh)
sets this reps mesh
static boost::shared_ptr< REP > wrap_new(REP *object, QString uid)
virtual ~GraphicalGeometric()
DoublePropertyPtr mDiffuse
boost::shared_ptr< class View > ViewPtr
bool hasMesh(MeshPtr mesh) const
checks if this rep has the give mesh
StringPropertyPtr mRepresentation
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)
BoolPropertyPtr mBackfaceCulling
GraphicalPolyData3DPtr mGraphicalPolyDataPtr
static GeometricRepPtr New(const QString &uid="")
Default implementation of Rep.
void setTransformOffset(Transform3D rMrr)
ColorPropertyPtr mEdgeColor
GraphicalGlyph3DDataPtr mGraphicalGlyph3DDataPtr
BoolPropertyPtr mEdgeVisibility
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
DoublePropertyPtr mSpecular
boost::shared_ptr< class GeometricRep > GeometricRepPtr
Namespace for all CustusX production code.