25 #include <vtkAppendPolyData.h>
26 #include <vtkAssembly.h>
27 #include <vtkCellArray.h>
28 #include <vtkFollower.h>
29 #include <vtkLinearTransform.h>
30 #include <vtkPolyData.h>
31 #include <vtkPolyDataMapper.h>
32 #include <vtkPolygon.h>
33 #include <vtkProp3DCollection.h>
34 #include <vtkRenderer.h>
35 #include <vtkTubeFilter.h>
38 #include <vtkPolyDataMapper.h>
39 #include <vtkProperty.h>
53 if (m_VtkPolyDataMapper)
54 m_VtkPolyDataMapper->Delete();
58 m_TubeFilter->Delete();
62 m_ContourSet->Delete();
78 GetDataNode()->GetVisibility(visible, renderer,
"visible");
82 m_Actor->VisibilityOff();
86 m_Actor->VisibilityOn();
99 vtkIdType firstPointIndex = 0, lastPointIndex = 0;
101 vtkIdType ptIndex = 0;
102 while (contourIt != contourVec.end())
113 unsigned int counter = 0;
115 firstPointIndex = ptIndex;
116 while (pointsIt != contourPoints->End())
118 if (counter % 2 == 0)
121 point = pointsIt.Value();
122 points->InsertPoint(ptIndex, point[0], point[1], point[2]);
123 if (ptIndex > firstPointIndex)
125 vtkIdType cell[2] = {ptIndex - 1, ptIndex};
126 lines->InsertNextCell((vtkIdType)2, cell);
128 lastPointIndex = ptIndex;
137 vtkIdType cell[2] = {lastPointIndex, firstPointIndex};
138 lines->InsertNextCell((vtkIdType)2, cell);
143 m_ContourSet->SetPoints(points);
144 m_ContourSet->SetLines(lines);
146 m_TubeFilter->SetInputData(m_ContourSet);
147 m_TubeFilter->SetRadius(1);
148 m_TubeFilter->Update();
149 m_VtkPolyDataMapper->SetInputConnection(m_TubeFilter->GetOutputPort());
151 double rgba[4] = {0.0f, 1.0f, 0.0f, 0.6f};
153 m_Actor->GetProperty()->SetColor(rgba);
154 m_Actor->SetMapper(m_VtkPolyDataMapper);
157 SetVtkMapperImmediateModeRendering(m_VtkPolyDataMapper);
BoundingBoxType::PointsContainerIterator PointsContainerIterator
vtkPolyData * m_ContourSet
virtual void GenerateDataForRenderer(mitk::BaseRenderer *renderer) override
Generate the data needed for rendering into renderer.
PathPointer GetContourPath() const
vtkTubeFilter * m_TubeFilter
ContourVectorType::iterator ContourIterator
Organizes the rendering process.
virtual const mitk::ContourSet * GetInput()
virtual ~ContourSetVtkMapper3D()
Stores vertices for drawing a contour.
vtkPolyDataMapper * m_VtkPolyDataMapper
virtual vtkProp * GetVtkProp(mitk::BaseRenderer *renderer) override
PathType::InputType InputType
PointsContainerPointer GetPoints() const
std::map< unsigned long, Contour::Pointer > ContourVectorType
BoundingBoxType::PointsContainer::Pointer PointsContainerPointer
unsigned long GetCurrentWorldPlaneGeometryUpdateTime()
Get timestamp of last call of SetCurrentWorldPlaneGeometry.
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.