15 #include <vtkPolyData.h> 16 #include <vtkPointData.h> 17 #include <vtkProperty.h> 19 #include <vtkRenderer.h> 20 #include <vtkMatrix4x4.h> 21 #include <vtkArrowSource.h> 36 m_rMrr = Transform3D::Identity();
57 connect(mMesh.get(), &
Mesh::meshChanged,
this, &GraphicalGeometric::meshChangedSlot);
60 this->meshChangedSlot();
61 this->transformChangedSlot();
62 this->clipPlanesChangedSlot();
67 void GraphicalGeometric::clipPlanesChangedSlot()
74 std::vector<vtkPlanePtr> mPlanes;
75 mPlanes =
mMesh->getAllClipPlanes();
76 for (
unsigned i=0; i<mPlanes.size(); ++i)
104 this->transformChangedSlot();
107 void GraphicalGeometric::meshChangedSlot()
110 if(
mMesh->showGlyph())
120 mMesh->updateVtkPolyDataWithTexture();
125 if(
mMesh->getUseColorFromPolydataScalars())
141 dest->SetPointSize(src.
mVisSize->getValue());
147 dest->SetAmbient(src.
mAmbient->getValue());
148 dest->SetDiffuse(src.
mDiffuse->getValue());
149 dest->SetSpecular(src.
mSpecular->getValue());
151 dest->SetLineWidth(src.
mLineWidth->getValue());
156 void GraphicalGeometric::transformChangedSlot()
191 mGraphics->setRenderer(view->getRenderer());
196 mGraphics->setRenderer(NULL);
201 mGraphics->setMesh(mesh);
206 return mGraphics->getMesh();
210 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 mLineWidth
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.