15 #include <vtkPolyData.h> 16 #include <vtkPointData.h> 17 #include <vtkProperty.h> 19 #include <vtkRenderer.h> 20 #include <vtkMatrix4x4.h> 21 #include <vtkArrowSource.h> 35 m_rMrr = Transform3D::Identity();
56 connect(mMesh.get(), &
Mesh::meshChanged,
this, &GraphicalGeometric::meshChangedSlot);
59 this->meshChangedSlot();
60 this->transformChangedSlot();
61 this->clipPlanesChangedSlot();
66 void GraphicalGeometric::clipPlanesChangedSlot()
73 std::vector<vtkPlanePtr> mPlanes;
74 mPlanes =
mMesh->getAllClipPlanes();
75 for (
unsigned i=0; i<mPlanes.size(); ++i)
103 this->transformChangedSlot();
106 void GraphicalGeometric::meshChangedSlot()
109 if(
mMesh->showGlyph())
119 mMesh->updateVtkPolyDataWithTexture();
125 if(!
mMesh->getUseColorFromPolydataScalars())
135 dest->SetPointSize(src.
mVisSize->getValue());
141 dest->SetAmbient(src.
mAmbient->getValue());
142 dest->SetDiffuse(src.
mDiffuse->getValue());
143 dest->SetSpecular(src.
mSpecular->getValue());
149 void GraphicalGeometric::transformChangedSlot()
184 mGraphics->setRenderer(view->getRenderer());
189 mGraphics->setRenderer(NULL);
194 mGraphics->setMesh(mesh);
199 return mGraphics->getMesh();
203 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.