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();
122 mActor->GetProperty()->SetLineWidth(
mMesh->getProperties().mLineWidth->getValue());
127 void GeometricRep2D::transformChangedSlot()
136 mActor->SetUserMatrix(dMs.inv().getVtkMatrix());