18 #include <vtkCellArray.h>
19 #include <vtkPoints.h>
20 #include <vtkProperty.h>
39 return m_LSH.GetLocalStorage(renderer)->m_Actor;
48 LocalStorage *localStorage = m_LSH.GetLocalStorage(renderer);
52 localStorage->
m_OutlinePolyData = this->CreateVtkPolyDataFromContour(inputContour);
54 this->ApplyContourProperties(renderer);
60 if (this->GetDataNode()->GetFloatProperty(
"contour.3D.width", lineWidth, renderer))
77 GetDataNode()->GetVisibility(visible, renderer,
"visible");
86 this->CalculateTimeStep(renderer);
88 LocalStorage *localStorage = m_LSH.GetLocalStorage(renderer);
91 if ((dataTimeGeometry == NULL) || (dataTimeGeometry->CountTimeSteps() == 0) ||
99 const DataNode *node = this->GetDataNode();
115 this->GenerateDataForRenderer(renderer);
125 unsigned int timestep = this->GetTimestep();
152 vtkIdType p1 = points->InsertNextPoint(currentControlPoint->
Coordinates[0],
155 vtkIdType p2 = points->InsertNextPoint(
158 lines->InsertNextCell(2);
159 lines->InsertCellPoint(p1);
160 lines->InsertCellPoint(p2);
166 if (inputContour->
IsClosed(timestep))
175 vtkIdType p2 = points->InsertNextPoint(
177 vtkIdType p1 = points->InsertNextPoint(
181 lines->InsertNextCell(2);
182 lines->InsertCellPoint(p1);
183 lines->InsertCellPoint(p2);
188 polyData->SetPoints(points);
190 polyData->SetLines(lines);
197 LocalStorage *localStorage = m_LSH.GetLocalStorage(renderer);
200 dynamic_cast<mitk::ColorProperty *
>(GetDataNode()->GetProperty(
"contour.color", renderer));
204 double red = colorprop->GetColor().GetRed();
205 double green = colorprop->GetColor().GetGreen();
206 double blue = colorprop->GetColor().GetBlue();
207 localStorage->
m_Actor->GetProperty()->SetColor(red, green, blue);
215 return m_LSH.GetLocalStorage(renderer);
226 m_Actor->SetMapper(m_Mapper);
236 Superclass::SetDefaultProperties(node, renderer, overwrite);
mitk::PropertyList * GetPropertyList(const mitk::BaseRenderer *renderer=nullptr) const
Get the PropertyList of the renderer. If renderer is NULL, the BaseRenderer-independent PropertyList ...
LocalStorage()
Default constructor of the local storage.
ContourModel is a structure of linked vertices defining a contour in 3D space. The vertices are store...
virtual void UpdateOutputInformation() override
Update the OutputInformation of a ContourModel object.
mitk::Point3D Coordinates
Coordinates in 3D space.
virtual unsigned long GetMTime() const override
Get the timestamp of the last change of the map or the last change of one of the properties store in ...
Organizes the rendering process.
mitk::ContourElement::VertexIterator VertexIterator
vtkSmartPointer< vtkTubeFilter > m_TubeFilter
virtual ~ContourModelMapper3D()
virtual const PlaneGeometry * GetCurrentWorldPlaneGeometry()
Get the current 2D-worldgeometry (m_CurrentWorldPlaneGeometry) used for 2D-rendering.
const mitk::TimeGeometry * GetTimeGeometry() const
Return the TimeGeometry of the data as const pointer.
virtual void ApplyContourProperties(mitk::BaseRenderer *renderer)
vtkSmartPointer< vtkPolyDataMapper > m_Mapper
Mapper of a 2D render window.
VertexIterator IteratorBegin(int timestep=0) const
Returns a const VertexIterator at the start element of the contour.
virtual unsigned long GetMTime() const override
Get the timestamp of the last change of the contents of this node or the referenced BaseData...
virtual void Update(mitk::BaseRenderer *renderer) override
Checks whether this mapper needs to update itself and generate data.
virtual vtkSmartPointer< vtkPolyData > CreateVtkPolyDataFromContour(mitk::ContourModel *inputContour)
The ColorProperty class RGB color property.
void AddProperty(const char *propertyKey, BaseProperty *property, const mitk::BaseRenderer *renderer=nullptr, bool overwrite=false)
Add the property (instance of BaseProperty) if it does not exist (or always ifoverwrite istrue) with ...
LocalStorage * GetLocalStorage(mitk::BaseRenderer *renderer)
Get the LocalStorage corresponding to the current renderer.
virtual unsigned int GetTimeStep() const
vtkSmartPointer< vtkPolyData > m_OutlinePolyData
bool IsClosed(int timestep=0) const
Return if the contour is closed or not.
const mitk::ContourModel * GetInput(void)
virtual vtkProp * GetVtkProp(mitk::BaseRenderer *renderer) override
itk::TimeStamp m_LastUpdateTime
Timestamp of last update of stored data.
unsigned long GetCurrentWorldPlaneGeometryUpdateTime()
Get timestamp of last call of SetCurrentWorldPlaneGeometry.
VertexIterator IteratorEnd(int timestep=0) const
Returns a const VertexIterator at the end element of the contour.
static void SetDefaultProperties(mitk::DataNode *node, mitk::BaseRenderer *renderer=NULL, bool overwrite=false)
Set the default properties for general image rendering.
Represents a single vertex of contour.
vtkSmartPointer< vtkActor > m_Actor
Actor of a 2D render window.
virtual bool IsValidTimeStep(TimeStepType timeStep) const =0
Test for the given time step if a geometry is availible.
void GenerateDataForRenderer(mitk::BaseRenderer *renderer) override
Generate the data needed for rendering into renderer.
Class for nodes of the DataTree.
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.