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>
40 mMapper = vtkPolyDataMapperPtr::New();
42 mActor = vtkActorPtr::New();
58 view->getRenderer()->AddActor(
mActor);
63 view->getRenderer()->RemoveActor(
mActor);
72 disconnect(
mMesh.get(), SIGNAL(meshChanged()),
this, SLOT(meshChangedSlot()));
73 disconnect(
mMesh.get(), SIGNAL(transformChanged()),
this, SLOT(transformChangedSlot()));
78 connect(
mMesh.get(), SIGNAL(meshChanged()),
this, SLOT(meshChangedSlot()));
79 connect(
mMesh.get(), SIGNAL(transformChanged()),
this, SLOT(transformChangedSlot()));
80 this->meshChangedSlot();
81 this->transformChangedSlot();
91 return (
mMesh == mesh);
98 disconnect(
mSlicer.get(), SIGNAL(transformChanged(
Transform3D)),
this, SLOT(transformChangedSlot()));
103 connect(
mSlicer.get(), SIGNAL(transformChanged(
Transform3D)),
this, SLOT(transformChangedSlot()));
104 this->transformChangedSlot();
108 void GeometricRep2D::meshChangedSlot()
111 mMapper->ScalarVisibilityOff();
115 mActor->GetProperty()->SetColor(
mMesh->getColor().redF(),
mMesh->getColor().greenF(),
mMesh->getColor().blueF());
119 mActor->GetProperty()->LightingOff();
122 mActor->GetProperty()->SetLineWidth(
mMesh->getProperties().mLineWidth->getValue());
127 if(
settings()->value(
"View2D/useGPU2DRendering").toBool())
129 mActor->GetProperty()->SetOpacity(
mMesh->getColor().alphaF());
134 mActor->GetProperty()->SetOpacity(1.0);
140 void GeometricRep2D::transformChangedSlot()
149 mActor->SetUserMatrix(dMs.inv().getVtkMatrix());