21 #include <vtkAppendPolyData.h> 22 #include <vtkAssembly.h> 23 #include <vtkCellArray.h> 24 #include <vtkFollower.h> 25 #include <vtkLinearTransform.h> 26 #include <vtkPolyData.h> 27 #include <vtkPolyDataMapper.h> 28 #include <vtkPolygon.h> 29 #include <vtkProp3DCollection.h> 30 #include <vtkRenderer.h> 31 #include <vtkTubeFilter.h> 34 #include <vtkPolyDataMapper.h> 35 #include <vtkProperty.h> 88 vtkPoints *points = vtkPoints::New();
89 vtkCellArray *lines = vtkCellArray::New();
93 auto contourIt = contourVec.begin();
95 vtkIdType firstPointIndex = 0, lastPointIndex = 0;
97 vtkIdType ptIndex = 0;
98 while (contourIt != contourVec.end())
109 unsigned int counter = 0;
111 firstPointIndex = ptIndex;
112 while (pointsIt != contourPoints->End())
114 if (counter % 2 == 0)
116 Contour::BoundingBoxType::PointType point;
117 point = pointsIt.Value();
118 points->InsertPoint(ptIndex, point[0], point[1], point[2]);
119 if (ptIndex > firstPointIndex)
121 vtkIdType cell[2] = {ptIndex - 1, ptIndex};
122 lines->InsertNextCell((vtkIdType)2, cell);
124 lastPointIndex = ptIndex;
131 if (nextContour->GetClosed())
133 vtkIdType cell[2] = {lastPointIndex, firstPointIndex};
134 lines->InsertNextCell((vtkIdType)2, cell);
147 double rgba[4] = {0.0f, 1.0f, 0.0f, 0.6f};
149 m_Actor->GetProperty()->SetColor(rgba);
BoundingBoxType::PointsContainerIterator PointsContainerIterator
vtkPolyData * m_ContourSet
void GenerateDataForRenderer(mitk::BaseRenderer *renderer) override
Generate the data needed for rendering into renderer.
virtual DataNode * GetDataNode() const
Get the DataNode containing the data to map. Method only returns valid DataNode Pointer if the mapper...
vtkTubeFilter * m_TubeFilter
Organizes the rendering process.
virtual const mitk::ContourSet * GetInput()
Stores vertices for drawing a contour.
BaseData * GetData() const
Get the data object (instance of BaseData, e.g., an Image) managed by this DataNode.
vtkPolyDataMapper * m_VtkPolyDataMapper
bool GetVisibility(bool &visible, const mitk::BaseRenderer *renderer, const char *propertyKey="visible") const
Convenience access method for visibility properties (instances of BoolProperty with property-key "vis...
vtkProp * GetVtkProp(mitk::BaseRenderer *renderer) override
PathType::InputType InputType
unsigned long GetMTime() const override
Get the modified time of the last change of the contents this data object or its geometry.
std::map< unsigned long, Contour::Pointer > ContourVectorType
BoundingBoxType::PointsContainer::Pointer PointsContainerPointer
unsigned long GetCurrentWorldPlaneGeometryUpdateTime()
Get timestamp of last call of SetCurrentWorldPlaneGeometry.
~ContourSetVtkMapper3D() override