19 #include <vtkCellArray.h>
20 #include <vtkPoints.h>
21 #include <vtkPolyLine.h>
22 #include <vtkProperty.h>
41 return m_LSH.GetLocalStorage(renderer)->m_Assembly;
50 LocalStorage *localStorage = m_LSH.GetLocalStorage(renderer);
54 if (contourModelSet != NULL)
58 vtkIdType baseIndex = 0;
70 while (vertIt != vertEnd)
72 points->InsertNextPoint((*vertIt)->Coordinates[0], (*vertIt)->Coordinates[1], (*vertIt)->Coordinates[2]);
77 vtkIdList *pointIds = line->GetPointIds();
80 pointIds->SetNumberOfIds(numPoints + 1);
82 for (vtkIdType i = 0; i < numPoints; ++i)
83 pointIds->SetId(i, baseIndex + i);
85 pointIds->SetId(numPoints, baseIndex);
87 cells->InsertNextCell(line);
89 baseIndex += numPoints;
95 polyData->SetPoints(points);
96 polyData->SetLines(cells);
100 actor->SetMapper(mapper);
102 mapper->SetInputData(polyData);
106 this->ApplyContourProperties(renderer);
107 this->ApplyContourModelSetProperties(renderer);
113 GetDataNode()->GetVisibility(visible, renderer,
"visible");
122 this->CalculateTimeStep(renderer);
124 LocalStorage *localStorage = m_LSH.GetLocalStorage(renderer);
126 if (this->GetTimestep() == -1)
131 const DataNode *node = this->GetDataNode();
147 this->GenerateDataForRenderer(renderer);
158 unsigned int timestep = this->GetTimestep();
160 LocalStorage *localStorage = m_LSH.GetLocalStorage(renderer);
173 LocalStorage *localStorage = m_LSH.GetLocalStorage(renderer);
174 DataNode *dataNode = this->GetDataNode();
176 if (dataNode != NULL)
182 localStorage->
m_Assembly->GetActors(collection);
183 collection->InitTraversal();
184 for (vtkIdType i = 0; i < collection->GetNumberOfItems(); i++)
186 vtkActor::SafeDownCast(collection->GetNextProp())->GetProperty()->SetLineWidth(lineWidth);
193 LocalStorage *localStorage = m_LSH.GetLocalStorage(renderer);
196 dynamic_cast<mitk::ColorProperty *
>(GetDataNode()->GetProperty(
"contour.color", renderer));
200 double red = colorprop->GetColor().GetRed();
201 double green = colorprop->GetColor().GetGreen();
202 double blue = colorprop->GetColor().GetBlue();
205 localStorage->
m_Assembly->GetActors(collection);
206 collection->InitTraversal();
207 for (vtkIdType i = 0; i < collection->GetNumberOfItems(); i++)
209 vtkActor::SafeDownCast(collection->GetNextProp())->GetProperty()->SetColor(red, green, blue);
219 return m_LSH.GetLocalStorage(renderer);
235 Superclass::SetDefaultProperties(node, renderer, overwrite);
LocalStorage()
Default constructor of the local storage.
mitk::PropertyList * GetPropertyList(const mitk::BaseRenderer *renderer=nullptr) const
Get the PropertyList of the renderer. If renderer is NULL, the BaseRenderer-independent PropertyList ...
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.
virtual void ApplyContourProperties(mitk::BaseRenderer *renderer)
LocalStorage * GetLocalStorage(mitk::BaseRenderer *renderer)
Get the LocalStorage corresponding to the current renderer.
virtual vtkProp * GetVtkProp(mitk::BaseRenderer *renderer) override
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 ...
VertexIterator End(int timestep=0) const
Returns a const VertexIterator at the end element of the contour.
Organizes the rendering process.
mitk::ContourElement::VertexIterator VertexIterator
virtual const PlaneGeometry * GetCurrentWorldPlaneGeometry()
Get the current 2D-worldgeometry (m_CurrentWorldPlaneGeometry) used for 2D-rendering.
virtual vtkSmartPointer< vtkPolyData > CreateVtkPolyDataFromContour(mitk::ContourModel *inputContour, mitk::BaseRenderer *renderer)
virtual ContourModelSetIterator Begin()
Return an iterator a the front.
virtual ContourModelSetIterator End()
Return an iterator a the front.
virtual unsigned long GetMTime() const override
Get the timestamp of the last change of the contents of this node or the referenced BaseData...
ContourModelListType::iterator ContourModelSetIterator
void GenerateDataForRenderer(mitk::BaseRenderer *renderer) override
Generate the data needed for rendering into renderer.
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 ...
const mitk::ContourModelSet * GetInput(void)
bool GetFloatProperty(const char *propertyKey, float &floatValue, const mitk::BaseRenderer *renderer=nullptr) const
Convenience access method for float properties (instances of FloatProperty)
ContourModelSetMapper3D()
virtual void Update(mitk::BaseRenderer *renderer) override
Checks whether this mapper needs to update itself and generate data.
static void SetDefaultProperties(mitk::DataNode *node, mitk::BaseRenderer *renderer=NULL, bool overwrite=false)
Set the default properties for general image rendering.
VertexIterator Begin(int timestep=0) const
Returns a const VertexIterator at the start element of the contour.
mitk::ContourModelToSurfaceFilter::Pointer m_contourToPolyData
unsigned long GetCurrentWorldPlaneGeometryUpdateTime()
Get timestamp of last call of SetCurrentWorldPlaneGeometry.
virtual void ApplyContourModelSetProperties(BaseRenderer *renderer)
virtual ~ContourModelSetMapper3D()
vtkSmartPointer< vtkAssembly > m_Assembly
Assembly of contours.
itk::TimeStamp m_LastUpdateTime
Timestamp of last update of stored data.
Class for nodes of the DataTree.
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.