18 #include <vtkCellArray.h>
19 #include <vtkPoints.h>
20 #include <vtkPolyData.h>
21 #include <vtkPolygon.h>
22 #include <vtkSmartPointer.h>
38 this->SetInput(0, input);
44 if (idx + 1 > this->GetNumberOfInputs())
46 this->SetNumberOfRequiredInputs(idx + 1);
48 if (input != static_cast<InputType *>(this->ProcessObject::GetInput(idx)))
50 this->ProcessObject::SetNthInput(idx, const_cast<InputType *>(input));
57 if (this->GetNumberOfInputs() < 1)
64 if (this->GetNumberOfInputs() < 1)
74 unsigned int numberOfTimeSteps = inputContour->
GetTimeSteps();
75 surface->
Expand(numberOfTimeSteps);
77 for (
unsigned int currentTimeStep = 0; currentTimeStep < numberOfTimeSteps; currentTimeStep++)
98 auto end = inputContour->
IteratorEnd(currentTimeStep);
101 polygon->GetPointIds()->SetNumberOfIds(inputContour->
GetNumberOfVertices(currentTimeStep));
104 while (current != end)
108 vtkIdType
id = points->InsertNextPoint(
111 polygon->GetPointIds()->SetId(j,
id);
117 lines->InsertNextCell(2);
118 lines->InsertCellPoint(
id - 1);
119 lines->InsertCellPoint(
id);
130 if (inputContour->
IsClosed(currentTimeStep))
132 lines->InsertNextCell(2);
133 lines->InsertCellPoint(0);
137 polygons->InsertNextCell(polygon);
142 polyData->SetPoints(points);
143 polyData->SetPolys(polygons);
144 polyData->SetLines(lines);
145 polyData->BuildLinks();
Class for storing surfaces (vtkPolyData).
ContourModel is a structure of linked vertices defining a contour in 3D space. The vertices are store...
virtual void GenerateData() override
mitk::Point3D Coordinates
Coordinates in 3D space.
const InputType * GetInput(void)
unsigned int GetTimeSteps() const
Get the number of time steps from the TimeGeometry As the base data has not a data vector given by it...
VertexIterator IteratorBegin(int timestep=0) const
Returns a const VertexIterator at the start element of the contour.
void GenerateOutputInformation() override
~ContourModelToSurfaceFilter()
virtual void SetVtkPolyData(vtkPolyData *polydata, unsigned int t=0)
virtual void SetInput(const InputType *input)
bool IsClosed(int timestep=0) const
Return if the contour is closed or not.
VertexIterator IteratorEnd(int timestep=0) const
Returns a const VertexIterator at the end element of the contour.
Represents a single vertex of contour.
ContourModelToSurfaceFilter()
virtual void Expand(unsigned int timeSteps=1) override
Expands the TimeGeometry to a number of TimeSteps.
int GetNumberOfVertices(int timestep=0) const
Returns the number of vertices at a given timestep.
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.