Applying Properties and management of underlying VTK Objects is messed up in the current PointSetVtkMapper2D. Mathias and I will rewrite it to be more flexible and work as expected.
Our design is as follows:
PointSet stores a PointData for each Point. In PointData, different types of points can be specified (and other properties too). These types/properties should be used for visualization - use different models for different types for example.
Changes to PointData and to Properties should applied to the vtk objects immediately. This means that the mapper has to keep track of all vtk sources, properties, filters that affect the display of the PointSet.
In Detail:
Each Point in a PointSet has an ID.
The Mapper has a map: ID -> Pointer to vtkActor for that point
And following maps:
ID -> SphereSource*
ID -> CubeSource*
ID -> ConeSource*
ID -> CylinderSource*
And a pointer to the Tubefilter that generates the contour.
A "PointTypeLookupTable" describes which model should be used for which pointtype.
Whenever a PointData changes(, is added, deleted): the mapper looks up the ID in the Source maps that corresponds to the entry in the PointTypeLookupTable. If nothing is found, a new source is created and added to the map.
Then all other maps are searched and if an entry is found (=point existed before but type changed), it is deleted. The same applies to the pointsize property
In addition, a ColorLookupTable, OpacityLookupTable and VisibilityLookupTable can be used to change color, opacity and visibility per point. If they (or the global color, ... properties) change, the Point ID is searched in the ID->vtkActor map and the vtkProperty that belongs to the vtkActor is changed accordingly.
If contour properties are changed, the tubefilter (contoursize), tube actor (contourcolor,...) or tubepolydata (points added, removed, close contour) is updated. The contour can not have different properties per point, that's the scope of a VesselTree datastructure & mapper.
This will allow that different points are displayed as different 3D models, can have different colors, opacities, visibilities, point sizes and can change all these aspects through property changes and that the changes are visible immediately.
Any additions/comments/ideas?