15 #include <vtkPolyData.h> 16 #include <vtkPolyDataMapper.h> 17 #include <vtkProperty.h> 19 #include <vtkRenderer.h> 20 #include <vtkMatrix4x4.h> 22 #include <vtkPolyDataNormals.h> 24 #include <vtkStripper.h> 25 #include <vtkCellArray.h> 39 mMapper = vtkPolyDataMapperPtr::New();
41 mActor = vtkActorPtr::New();
57 view->getRenderer()->AddActor(
mActor);
62 view->getRenderer()->RemoveActor(
mActor);
71 disconnect(
mMesh.get(), SIGNAL(meshChanged()),
this, SLOT(meshChangedSlot()));
72 disconnect(
mMesh.get(), SIGNAL(transformChanged()),
this, SLOT(transformChangedSlot()));
77 connect(mMesh.get(), SIGNAL(meshChanged()),
this, SLOT(meshChangedSlot()));
78 connect(mMesh.get(), SIGNAL(transformChanged()),
this, SLOT(transformChangedSlot()));
79 this->meshChangedSlot();
80 this->transformChangedSlot();
90 return (
mMesh == mesh);
97 disconnect(
mSlicer.get(), SIGNAL(transformChanged(
Transform3D)),
this, SLOT(transformChangedSlot()));
102 connect(mSlicer.get(), SIGNAL(transformChanged(
Transform3D)),
this, SLOT(transformChangedSlot()));
103 this->transformChangedSlot();
107 void GeometricRep2D::meshChangedSlot()
110 mMapper->ScalarVisibilityOff();
114 mActor->GetProperty()->SetColor(
mMesh->getColor().redF(),
mMesh->getColor().greenF(),
mMesh->getColor().blueF());
116 mActor->GetProperty()->SetOpacity(
mMesh->getColor().alphaF());
119 mActor->GetProperty()->LightingOff();
124 void GeometricRep2D::transformChangedSlot()
133 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.