[vtk-developers] Issue to get plane from vtkPlanes

Laurent Chauvin lchauvin at bwh.harvard.edu
Tue Jul 12 10:24:52 EDT 2011


Hello,

I was using vtkPlanes, and I needed to retrieve 2 planes (number 4 and 5).

When I was using:

planes->GetPlane(5) and planes->GetPlane(4)

and using this as argument for clipping, like this:

clip->SetClipFunction(planes->GetPlane(5));
clip2->SetClipFunction(planes->GetPlane(4));

But, when I was not doing clip2, everything was working good, but after
adding clip2, my first clip changed and become the same as the clip2.

So, I try this insted:

vtkPlane* plane1 = vtkPlane::New();
planes->GetPlane(4, plane1);

vtkPlane* plane2 = vtkPlane::New();
planes->GetPlane(5, plane2);

clip->SetClipFunction(plane1);
clip2->SetClipFunction(plane2);

And it works.
I don't really understand. Is there shared memory in these classes
(vtkPlanes, vtkClipPolyData) ?
I was thinking the vtkClipPolyData output was shared, so the clip2 write in
the same place than the clip, which could explain why they are the same
after second clipping.

Thank you.
Laurent.


-- 
Laurent Chauvin, MS
Surgical Planning Laboratory, Radiology
Brigham And Women's Hospital, Harvard Medical School
http://wiki.ncigt.org/index.php/User:Lchauvin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20110712/45b90ede/attachment.html>


More information about the vtk-developers mailing list