[vtkusers] vtkBoxWidget Clip vs Scale

Bruno da Silva de Oliveira bruno at esss.com.br
Fri Dec 9 07:03:56 EST 2005


Hi,

Why don't you try vtkClipDataSet?

HTH,

C C wrote:

>How can we make a vtkBoxWidget clip its data, rather than scale?
>
>My approach was to:
>   1) comment out the scale transform within GetTransform()
>   2) use SetClippingPlanes() within my BoxWidget callback (get the
>widget's planes and set as my volume mapper's clipping planes)
>
>This *almost* works, but causes the data to RECENTER on each clip.  I
>require the position of the volume to remain absolute during clipping.
> If you are familiar with vtkBoxWidgets I would appreciate some
>guidance!
>
>a snippet from the callback function is provided below.  This is
>modelled after Step6 from the vtkTutorial:
>VTK/Examples/Tutorial/Step6/cxx/Cone6.cxx
>
>/////////////////////////////////////
>vtkTransform *t = vtkTransform::New();
>boxWidget->GetTransform(t);     //get the current transform from the boxwidget
>boxWidget->GetProp3D()->SetUserTransform(t);  //apply this transform
>to the box's prop (ie our volume)
>t->Delete();   //delete transform after applying it
>boxWidget->GetPlanes(planes);       //get our widget's planes
>mapper->SetClippingPlanes(planes);   //and clip our data's mapper with it
>////////////////////////////////////
>
>( as the names may imply, boxWidget is my vtkBoxWidget, planes is a
>vtkPlanes object, and mapper is a vtkVolumeTextureMapper3D of the
>dataset )
>
>thanks!
>_______________________________________________
>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
>
>  
>

-- 
Bruno da Silva de Oliveira
bruno at esss.com.br
ESSS - Engineering Simulation and Scientific Software
http://www.esss.com.br




More information about the vtkusers mailing list