[vtkusers] How I get all sides of the vtkBoxWidget, after rotation

-Daniel- ich_daniel at habmalnefrage.de
Thu Sep 6 05:54:52 EDT 2012


Hello,

I use vtkBoxWidget to cut objects. When I don't rotate this, all works fine.
Only after rotating the object is not trimmed correctly. (Because the
vtkPlane-Normal's are wrong set)

I use vtkPlanes for the boundaries of the box. Then receives
vtkPlaneCollection all vtkPlanes. 


/public vtkPlaneCollection setCubeCuts(CuttingBoxWidget widget) {
   double x1 = widget.getActorBounds()[0];
   double x2 = widget.getActorBounds()[1];
   double y1 = widget.getActorBounds()[2];
   double y2 = widget.getActorBounds()[3];
   double z1 = widget.getActorBounds()[4];
   double z2 = widget.getActorBounds()[5];
		
   vtkPlane sag_X1 = new vtkPlane(), sag_X2 = new vtkPlane(), cor_Y1 = new
vtkPlane(),
   cor_Y2 = new vtkPlane(), ax_Z1 = new vtkPlane(), ax_Z2 = new vtkPlane();
		
   sag_X1.SetNormal(1, 0, 0);
   sag_X1.SetOrigin(x1, 0, 0);
   sag_X2.SetNormal(-1, 0, 0);
   sag_X2.SetOrigin(x2, 0, 0);
   cor_Y1.SetNormal(0, 1, 0);
   cor_Y1.SetOrigin(0, y1, 0);
   cor_Y2.SetNormal(0, -1, 0);
   cor_Y2.SetOrigin(0, y2, 0);
   ax_Z1.SetNormal(0, 0, 1);
   ax_Z1.SetOrigin(0, 0, z1);
   ax_Z2.SetNormal(0, 0, -1);
   ax_Z2.SetOrigin(0, 0, z2);
		
   vtkPlaneCollection cubePlanes = new vtkPlaneCollection();
   cubePlanes.AddItem(sag_X1);
   cubePlanes.AddItem(sag_X2);
   cubePlanes.AddItem(cor_Y1);
   cubePlanes.AddItem(cor_Y2);
   cubePlanes.AddItem(ax_Z1);
   cubePlanes.AddItem(ax_Z2);
  
   return cubePlanes;
}/

How I get the "normals" from all sides of the vtkBoxWidget somehow ?





--
View this message in context: http://vtk.1045678.n5.nabble.com/How-I-get-all-sides-of-the-vtkBoxWidget-after-rotation-tp5715891.html
Sent from the VTK - Users mailing list archive at Nabble.com.



More information about the vtkusers mailing list