[vtkusers] How to set normal of vtkImagePlaneWidget ?

DL I inglis.dl at gmail.com
Tue Jun 23 09:37:33 EDT 2015


Hi,

there is no SetNormal() method but a plane normal can be defined from 3
points
and vtkImagePlaneWidget allows SetPoint1(), SetPoint2(), SetOrigin() .

try this (pseudocode):

if you define your normal from an origin, o and 2 other points p1, p2
such that p1 , p2 and o define a plane (and also 3 corners of the widget)
then a normal to the plane, n, can be found with
po1 = p1 - o;
po2 = p2 - o;
n = po1/||po1|| x po1/||po2||

where x is the cross product operator and ||.|| is the norm of a vector.
To set the widget's plane normal, you do so indirectly from p1, p2 and o:

w.SetPoint1(p1)
w.SetPoint2(p2)
w.SetOrigin(o)
w.UpdatePlacement()


best,
Dean



On Mon, Jun 22, 2015 at 10:14 PM, 沧海一粟 <liyihai2009 at qq.com> wrote:

> I just found method GetNormal() of vtkImagePlaneWidget, but no
> SetNormal(). I want to set the plane normal, how should I do it ?
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20150623/c039b221/attachment.html>


More information about the vtkusers mailing list