[vtkusers] vtkPlaneWidget

Jeff Lee jeff at cdnorthamerica.com
Thu Aug 5 11:41:30 EDT 2004



James Robinson wrote:

>Jeff,
>
>Many thanks. However, it doesn't seem to do anything (positive).
>
>I have put:
>    pPlaneWidget->SetOrigin(origin) ;
>    pPlaneWidget->UpdatePlacement() ;
>    pPlaneWidget->SetNormal(normal) ;
>
>Into my code and now I get:
>
>Origin: x 95.249390, y 0.000002, z 105.012161
>Normal: x 0.000000, y 1.0000000, z 0.0000000
>
>The significance of the coordinates of the new origin I cannot see? In
>addition, if I change the order to:
>
>    pPlaneWidget->SetOrigin(origin) ;
>    pPlaneWidget->SetNormal(normal) ;
>    pPlaneWidget->UpdatePlacement() ;
>
>I get a slightly different output (still not correct).
>  
>
hmm, this is exactly what I do to update the plane - SetOrigin, 
SetNormal, UpdatePlacement, and then a Render() to refresh the screen.  
has the plane widget been EnabledOn()'ed and PlaceWidget()'ed when you 
try the above?  Otherwise I'm stumped.  Good luck,
-Jeff

>Finally, regardless of these new (seemingly arbitrary values for the origin)
>it changes nothing in the window in terms of the actual widget placement.
>
>Any more advice welcomed.
>
>
>Jim
>
>
>James C Robinson, PhD, Chartered Engineer,
>CEO,
>Kepler Engineering Software Ltd.,
>+     42 Rivergrove,
>         Glanmire,
>         Co. Cork,
>         Eire
>'     +353 21 4822028
>         +353 87 2393010
>6      +353 21 4822028
>-    j.robinson at kepler-systems.com 
>
>-----Original Message-----
>From: Jeff Lee [mailto:jeff at cdnorthamerica.com] 
>Sent: 05 August 2004 16:20
>To: j.robinson at kepler-systems.com
>Cc: Vtk Users
>Subject: Re: [vtkusers] vtkPlaneWidget
>
>Did you try
>pPlaneWidget->UpdatePlacement() after SetOrigin and SetNormal
>-J
>
>James Robinson wrote:
>
>  
>
>>Dear All,
>>
>>Thanks to John (Biddiscombe) I am able to control my vtkCutter using 
>>the vtkPlaneWidget. However, I also want to be able to do the reverse 
>>- i.e. take the vtkPlane setup from the vtkCutter and apply them to 
>>the vtkPlaneWidget (as I have already other menu driven controls to 
>>manipulate the vtkPlane). My attempt at doing this is:
>>
>>void CSampleDoc::UpdatePlaneWidget()
>>
>>{
>>
>>// This method is to update the plane widget from the vtkPlane used as 
>>the
>>
>>// implicit function for the vtkCutter
>>
>>vtkFloatingPointType normal[3] ;
>>
>>vtkFloatingPointType origin[3] ;
>>
>>pPlane->GetOrigin(origin) ;
>>
>>pPlane->GetNormal(normal) ;
>>
>>CString message, dummy ;
>>
>>message.Format("Origin:- x %lf, y %lf, z 
>>%lf\n",origin[0],origin[1],origin[2]) ;
>>
>>dummy.Format("Normal:- x %lf, y %lf, z 
>>%lf\n",normal[0],normal[1],normal[2]) ;
>>
>>message += dummy ;
>>
>>AfxMessageBox(message) ;
>>
>>pPlaneWidget->SetOrigin(origin) ;
>>
>>pPlaneWidget->SetNormal(normal) ;
>>
>>pPlaneWidget->GetOrigin(origin) ;
>>
>>pPlaneWidget->GetNormal(normal) ;
>>
>>message.Format("Origin:- x %lf, y %lf, z 
>>%lf\n",origin[0],origin[1],origin[2]) ;
>>
>>dummy.Format("Normal:- x %lf, y %lf, z 
>>%lf\n",normal[0],normal[1],normal[2]) ;
>>
>>message += dummy ;
>>
>>AfxMessageBox(message) ;
>>
>>}
>>
>>This yields:
>>
>>Origin: x 100.000000, y 100.0000000, z 10.0000000
>>
>>Normal: x 0.000000, y 1.0000000, z 0.0000000
>>
>>For the vtkPlane - which is what I have set up.
>>
>>However, the output from the vtkPlaneWidget is:
>>
>>Origin: x 100.000000, y 10.0000000, z -100.0000000
>>
>>Normal: x 0.000000, y 1.0000000, z 0.0000000
>>
>>So the origin coordinates seem to have been mixed up. In addition, it 
>>doesn't show the vtkPLaneWidget in this position (rather the normal is 
>>1,0,0 and the origin (center??) seems alright??
>>
>>Any advice would be appreciated.
>>
>>Regards,
>>
>>Jim
>>
>>*James C Robinson*, PhD, Chartered Engineer,
>>
>>+ 42 Rivergrove,
>>
>>Glanmire,
>>
>>Co. Cork,
>>
>>Eire
>>
>>' +353 21 4822028
>>
>>+353 87 2393010
>>
>>6 +353 21 4822028
>>
>>- j.robinson at kepler-systems.com
>>
>>------------------------------------------------------------------------
>>
>>_______________________________________________
>>This is the private VTK discussion list. 
>>Please keep messages on-topic. Check the FAQ at:
>>    
>>
><http://public.kitware.com/cgi-bin/vtkfaq>
>  
>
>>Follow this link to subscribe/unsubscribe:
>>http://www.vtk.org/mailman/listinfo/vtkusers
>> 
>>
>>    
>>
>
>_______________________________________________
>This is the private VTK discussion list. 
>Please keep messages on-topic. Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
>Follow this link to subscribe/unsubscribe:
>http://www.vtk.org/mailman/listinfo/vtkusers
>
>
>  
>



More information about the vtkusers mailing list