[vtkusers] [Simplest Way To] : modify geometry *locally* (ghosts ?)

Sebastien BARRE seb-ml-vtk at barre.nom.fr
Fri Sep 8 12:26:40 EDT 2000


Hi

Here is one other :)

Given a PolyData S (a polyhedric surface), I'd like to apply a local 
transformation to *some* of the points of S, basically these points where 
the scalar data = 1 (the other being 0).

The problem is, I'd like *not* to change the topology of my cells, thus 
some cells will use the points A and B, where only B might be part of the 
local transformation.


solution a) : new filter
++++
write a simple filter that loops over the points where scalar = 1, and 
apply the transform. Disadvantage : I do not want to write a new filter F' 
every time I need a filter F to work on a subset of my points, a more 
general solution would be nice.


solution b) : select the points, then apply the transform
++++
vtkThesholdPoints : can not use that filter, because it generates a new set 
of point, thus after applying the transform I'll be into trouble to replace 
them in S.


solution c) : build a new PolyData S', then merge it with S
++++
Find a class that is able to create a new and simple PolyData S' using the 
*same* set of points of S but whose cells correspond to the selection only. 
Then use a filter that works on the points *used* by the cells, leaving the 
other points untouched. For example, create a set of vertices corresponding 
to the points where scalar = 1, then apply the transform "on" the vertices. 
When it's done, use a filter to build a new polydata using the cells from S 
(topology), and the points from S' (geometry)

Problems :
	- is there a class that is able to create vertices where scalar = x ?

	- the vtkPolyDataFilter transforms *every point*, not the points used by 
its cells. I do not know why it has been design that way (any clue ?). 
Furthermore, I see a performance penalty in that behaviour, especially if a 
big set of points is shared by many PolyData (for example, sub-anatomic 
parts of  medical set) : I do agree that a new set of points should be 
generated (with the same Id's), but I guess we could implement a test so 
that an expensive transform (warp, spline) should only be applied to the 
points owned by the cells ? We had the same problems with 
vtkPolyData::ComputeBounds, I fixed it recently, maybe the same solution 
would apply ?

	- the vtkMergeFilter will merge different stuff from object, but cannot 
extract point and cells from different datasets (it refers them as a single 
Geometry entity).

solution d)
++++
Using the vtkDicer ? I do not see any way to control how specific points 
should belong to a "piece" or not. Furthermore, it just generates 
scalar/field data indicating which piece the points belongs to, which is 
similar to my scalar info = 0/1, thus the problem remains the same.


solution e)
++++
something related to the new ghost feature ? I'm lacking documentation, and 
I do not know how stable it is.









More information about the vtkusers mailing list