[vtk-developers] implementing vtkPolyData::ComputeBounds() ?

Sebastien BARRE sebastien at barre.nom.fr
Sat Jul 29 12:49:36 EDT 2000


Hi

I was wondering why vtkPolyData::ComputeBounds() is not implemented ? Is it 
OK if I take care of this ?

Rational : suppose that given a polygonal object A, I use a vtkClipPolyData 
filter to extract two other polygonal objects B, and C, which will have 
different topologies (and most probably different extents).

If I query the bounds of B and C using GetBounds(), or use vtkOulineFilter 
to display very simple bounding boxes, I'll get ... the bounds of A. This 
is no surprise because both A, B and C share the *same* points (vtkPoints), 
and as A, B, C are vtkPolyData derived from vtkPointSet, GetBounds() use 
vtkPointSet::ComputeBounds(), which computes the bounds by iterating over 
the *points*.

I'm a bit confused with that. If the only "visible" thing (or real data) is 
defined in vtkPolyData by its cells, I guess ComputeBounds() should reflect 
this too, am I right ?

I used to circumvent the problem by defining a function in Tcl, but it's 
soooooooo slow (GetCellsBounds() is not available in Tcl).

Therefore, may I implement this vtkPolyData::ComputeBounds() feature ? The 
bounds will be much more accurate. I'm asking first because GetBounds() is 
used in so many files that I may have missed the "big picture".

Thanks 




More information about the vtk-developers mailing list