[vtkusers] Set plane normal/center of vtkImplicitPlaneWidget manually

David Doria daviddoria+vtk at gmail.com
Wed Jan 27 08:20:37 EST 2010


On Wed, Jan 27, 2010 at 4:17 AM, circass <circass at gmail.com> wrote:
>
> Try to take axes Extents of ImageData and calculate the slice number for each
> axes then use setSlice
>
> method of imlicitimageplane ( if it exists :) )
>
>
>
> superzz wrote:
>>
>> Sorry, I meant vtkImplicitPlaneWidget. But misspelt it to
>> vtkImagePlaneWidget.
>>
>> Neither SetNormal nor SetOrigin work for vtkImplicitPlaneWidget. No matter
>> what values I pass to SetNormal and SetOrigin. Its origin is always
>> (0,0,0) and normal is (0,0,1). But NormalToX/Y/ZAxisOn work. Is it a bug?
>>
>> Thanks
>>
>> superZZ
>>
>>
>> David Doria-2 wrote:
>>>
>>> On Thu, Jan 21, 2010 at 9:04 PM, superzz <jxdw_zlf at yahoo.com.cn> wrote:
>>>
>>>>
>>>> Hello
>>>> How to set plane of vtkImagePlaneWidget manually? I tried
>>>> vtkImagePlaneWidget->GetPlane(), then update plane center and normal to
>>>> specified values. But the plane on screen kept unchanged.
>>>>
>>>> Thanks
>>>>
>>>> superZZ
>>>>
>>>>
>>> You can change the origin like this:
>>>
>>> http://www.cmake.org/Wiki/VTK/Examples/Widgets/ImagePlaneWidget
>>>
>>> But VTK never has a "SetNormal" function for this type of this (which has
>>> always annoyed me). There are SetPoint1 and SetPoint2 functions to set
>>> two
>>> of the other corners of the planar patch. I believe this is because they
>>> want to allow non-rectangular patches - but it seems to me that there
>>> should
>>> definitely be a way to convert from an origin+normal (surely the form
>>> everyone thinks in) to an origin+p1+p2.
>>>
>>> Hope this helps.
>>>
>>> David
>>>
>>> _______________________________________________
>>> 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


superzz,

Generally you can set properties of widgets using the
XYZRepresentation class. For example, in this demo:
http://www.vtk.org/Wiki/VTK/Examples/Widgets/ImplicitPlaneWidget2

the vtkImplicitPlaneRepresentation is used to set the properties, then
the representation is assigned to the widget. HOWEVER, in this case,
SetOrigin doesn't seem to do anything. Bill made this example, maybe
he can comment?

Thanks,

David



More information about the vtkusers mailing list