[vtkusers] Re: SetClippingPlanes() vs. SetClippingPlanes()

David Gobbi dgobbi at atamai.com
Fri Sep 15 15:26:20 EDT 2006


I think that I bit off more than I could chew.  The way that
the vtkPlaneCollection is used in the mapper subclasses,
it is not possible to always update it from a vtkPlanes object
when necessary.

This is quite a conundrum!  Maybe the BoxWidget and
similar widgets should provide both a vtkPlanes object
and a vtkPlaneCollection object.  The former will be used
with vtkClipPolyData and the latter will be used with
vtkAbstractMapper.

Another option would be to make vtkPlanes into a
subclass of vtkPlaneCollection, and make vtkPlaneCollection
into a subclass of vtkImplicitFunction.  That could get
ugly, though!

 - David


Lisa Avila wrote:
> Hi David,
>
> Just watch out - I expect this to break a test or two because we 
> probably rely on the fact that a copy is made. That is, I suspect 
> there is a test or two where we create a plane, add it as a clip 
> plane, change the values, add that plane, etc.
>
> Lisa
>
>
>
> David Gobbi wrote:
>> Hi Dean, Lisa,
>>
>> I hope you don't mind if I revive and old thread:
>> http://public.kitware.com/pipermail/vtkusers/2004-May/074167.html
>>
>> The vtkAbstractMapper has two SetClippingPlanes() methods.  One
>> takes a vtkPlaneCollection, the other takes a vtkPlanes implicit 
>> function.
>>
>> The method SetClippingPlanes(vtkPlanes *planes) does not work as
>> expected.  It makes an internal copy of the planes instead of storing
>> a pointer to vtkPlanes object.  So, if you get a vtkPlanes from a
>> vtkBoxWidget, and set them to the mapper, the mapper doesn't
>> update when the user interacts with the BoxWidget.
>>
>> I would like to fix this, if nobody objects.  It should be as simple as
>> storing a pointer to the vtkPlanes in a vtkAbstractMapper ivar
>> and checking the modified time of the vtkPlanes each time the
>> mapper updates.  I know that this will mean that the mapper will
>> store both a vtkPlaneCollection and a vtkPlanes, but there are ways
>> to deal with that.
>>
>> - David
>>
> _______________________________________________
> This is the private VTK discussion list. Please keep messages 
> on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>




More information about the vtkusers mailing list