36 #include <vtkPolyData.h> 37 #include <vtkPolyDataMapper.h> 38 #include <vtkProperty.h> 40 #include <vtkRenderer.h> 41 #include <vtkMatrix4x4.h> 43 #include <vtkPolyDataNormals.h> 45 #include <vtkStripper.h> 46 #include <vtkCellArray.h> 60 mMapper = vtkPolyDataMapperPtr::New();
62 mActor = vtkActorPtr::New();
78 view->getRenderer()->AddActor(
mActor);
83 view->getRenderer()->RemoveActor(
mActor);
92 disconnect(
mMesh.get(), SIGNAL(meshChanged()),
this, SLOT(meshChangedSlot()));
93 disconnect(
mMesh.get(), SIGNAL(transformChanged()),
this, SLOT(transformChangedSlot()));
98 connect(mMesh.get(), SIGNAL(meshChanged()),
this, SLOT(meshChangedSlot()));
99 connect(mMesh.get(), SIGNAL(transformChanged()),
this, SLOT(transformChangedSlot()));
100 this->meshChangedSlot();
101 this->transformChangedSlot();
111 return (
mMesh == mesh);
118 disconnect(
mSlicer.get(), SIGNAL(transformChanged(
Transform3D)),
this, SLOT(transformChangedSlot()));
123 connect(mSlicer.get(), SIGNAL(transformChanged(
Transform3D)),
this, SLOT(transformChangedSlot()));
124 this->transformChangedSlot();
128 void GeometricRep2D::meshChangedSlot()
131 mMapper->ScalarVisibilityOff();
135 mActor->GetProperty()->SetColor(
mMesh->getColor().redF(),
mMesh->getColor().greenF(),
mMesh->getColor().blueF());
137 mActor->GetProperty()->SetOpacity(
mMesh->getColor().alphaF());
140 mActor->GetProperty()->LightingOff();
145 void GeometricRep2D::transformChangedSlot()
154 mActor->SetUserMatrix(dMs.inv().getVtkMatrix());
Transform3D Transform3D
Transform3D is a representation of an affine 3D transform.
bool hasMesh(MeshPtr mesh) const
checks if this rep has the give mesh
static boost::shared_ptr< REP > wrap_new(REP *object, QString uid)
vtkPolyDataMapperPtr mMapper
MeshPtr getMesh()
gives this reps mesh
void setSliceProxy(SliceProxyPtr slicer)
boost::shared_ptr< class View > ViewPtr
virtual void addRepActorsToViewRenderer(ViewPtr view)
void setMesh(MeshPtr mesh)
sets this reps mesh
virtual ~GeometricRep2D()
virtual void removeRepActorsFromViewRenderer(ViewPtr view)
Default implementation of Rep.
static GeometricRep2DPtr New(const QString &uid="")
boost::shared_ptr< class Mesh > MeshPtr
boost::shared_ptr< class GeometricRep2D > GeometricRep2DPtr
Namespace for all CustusX production code.