27 #include <vtkAssembly.h> 28 #include <vtkProp3DCollection.h> 29 #include <vtkTubeFilter.h> 31 #include <vtkConeSource.h> 32 #include <vtkCubeSource.h> 33 #include <vtkCylinderSource.h> 34 #include <vtkPolyDataMapper.h> 35 #include <vtkProperty.h> 36 #include <vtkSphereSource.h> 37 #include <vtkTransformPolyDataFilter.h> 39 #include <vtkPolyDataAlgorithm.h> 91 assert(points->Size() == pointData->Size());
100 if (!points->IndexExists(
id))
104 if (it->second.first !=
nullptr)
105 it->second.first->Delete();
116 for (pIt = points->Begin(), pdIt = pointData->Begin(); pIt != itkPointSet->GetPoints()->End(); ++pIt, ++pdIt)
119 assert(pointID == pdIt->Index());
126 vtkActor *a =
nullptr;
128 bool specChanged = (!newPoint && data.pointSpec != aIt->second.second);
133 vtkPolyDataMapper *m = vtkPolyDataMapper::New();
135 m->UnRegister(
nullptr);
136 aIt =
m_PointActors.insert(std::make_pair(pointID, std::make_pair(a, data.pointSpec)))
142 a = aIt->second.first;
148 if (newPoint || specChanged)
150 vtkPolyDataAlgorithm *source =
nullptr;
151 switch (data.pointSpec)
172 auto *m =
dynamic_cast<vtkPolyDataMapper *
>(a->GetMapper());
173 assert(m !=
nullptr);
174 m->SetInputConnection(source->GetOutputPort());
175 aIt->second.second = data.pointSpec;
192 assert(points->Size() == pointData->Size());
196 assert(n !=
nullptr);
198 for (pIt = points->Begin(), pdIt = pointData->Begin(); pIt != itkPointSet->GetPoints()->End();
202 assert(pointID == pdIt->Index());
209 vtkActor *a = aIt->second.first;
210 assert(a !=
nullptr);
214 bool pointVisibility =
true;
215 bool visValueFound =
false;
218 if (visLTProp !=
nullptr)
226 visValueFound =
true;
233 if (visValueFound ==
false)
235 pointVisibility = n->
IsVisible(renderer,
"show points");
237 a->SetVisibility(pointVisibility);
241 bool opValueFound =
false;
244 if (opLTProp !=
nullptr)
259 if (opValueFound ==
false)
263 a->GetProperty()->SetOpacity(opacity);
267 float pointSize = 1.0;
269 switch (data.pointSpec)
302 aIt->second.first->SetPosition(pos[0], pos[1], pos[2]);
308 if (!n->
GetColor(color, renderer,
"selectedcolor"))
318 vtkLookupTable *d = c->GetVtkLookupTable();
319 double *e = d->GetTableValue(pointID);
326 if (!n->
GetColor(color, renderer,
"unselectedcolor"))
332 a->GetProperty()->SetColor(color[0], color[1], color[2]);
351 if (needGenerateData)
353 ls->UpdateGenerateDataTime();
390 Superclass::SetDefaultProperties(node, renderer, overwrite);
405 switch (aIt->second.second)
mitk::BaseProperty * GetProperty(const char *propertyKey, const mitk::BaseRenderer *renderer=nullptr, bool fallBackOnDataProperties=true) const
Get the property (instance of BaseProperty) with key propertyKey from the PropertyList of the rendere...
DataType::PointsContainerIterator PointsIterator
L * GetLocalStorage(mitk::BaseRenderer *forRenderer)
Retrieves a LocalStorage for a specific BaseRenderer.
DataType::PointDataContainer PointDataContainer
bool IsGenerateDataRequired(mitk::BaseRenderer *renderer, mitk::Mapper *mapper, mitk::DataNode *dataNode) const
virtual DataNode * GetDataNode() const
Get the DataNode containing the data to map. Method only returns valid DataNode Pointer if the mapper...
CylinderSourceMap m_CylinderSources
~EnhancedPointSetVtkMapper3D() override
bool GetFloatProperty(const char *propertyKey, float &floatValue, const mitk::BaseRenderer *renderer=nullptr) const
Convenience access method for float properties (instances of FloatProperty)
Organizes the rendering process.
ConeSourceMap m_ConeSources
struct for data of a point
EnhancedPointSetVtkMapper3D()
CubeSourceMap m_CubeSources
bool GetOpacity(float &opacity, const mitk::BaseRenderer *renderer, const char *propertyKey="opacity") const
Convenience access method for opacity properties (instances of FloatProperty)
vtkProp * GetVtkProp(mitk::BaseRenderer *renderer) override
void GenerateDataForRenderer(mitk::BaseRenderer *renderer) override
Generate the data needed for rendering into renderer.
DataType::PointIdentifier PointIdentifier
vtkTubeFilter * m_ContourSource
BaseData * GetData() const
Get the data object (instance of BaseData, e.g., an Image) managed by this DataNode.
Abstract base class for properties.
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 ...
bool IsVisible(const mitk::BaseRenderer *renderer, const char *propertyKey="visible", bool defaultIsOn=true) const
Convenience access method for visibility properties (instances of BoolProperty). Return value is the ...
The LookupTableProperty class Property to associate mitk::LookupTable to an mitk::DataNode.
Data structure which stores a set of points. Superclass of mitk::Mesh.
bool GetColor(float rgb[3], const mitk::BaseRenderer *renderer=nullptr, const char *propertyKey="color") const
Convenience access method for color properties (instances of ColorProperty)
ValueType GetTableValue(IdentifierType id) const
mitk::PointSet::PointIdentifier PointIdentifier
void RemoveEntryFromSourceMaps(mitk::PointSet::PointIdentifier pointID)
virtual DataType::Pointer GetPointSet(int t=0) const
returns the pointset
void ApplyColorAndOpacityProperties(mitk::BaseRenderer *renderer, vtkActor *actor) override
Apply color and opacity properties read from the PropertyList. Called by mapper subclasses.
static void SetDefaultProperties(mitk::DataNode *node, mitk::BaseRenderer *renderer=nullptr, bool overwrite=false)
DataType::PointsContainer PointsContainer
virtual const mitk::PointSet * GetInput()
int GetTimestep() const
Returns the current time step as calculated from the renderer.
SphereSourceMap m_SphereSources
LocalStorageHandler< BaseLocalStorage > m_LSH
specializations of GenericLookupTable
DataType::PointDataContainerIterator PointDataIterator
vtkAssembly * m_PropAssembly
Class for nodes of the DataTree.
void DeleteVtkObject(vtkObject *o)
void UpdateVtkTransform(mitk::BaseRenderer *renderer) override
Set the vtkTransform of the m_Prop3D for the current time step of renderer.