[vtkusers] Re: vtkPlaneWidget
Goodwin Lawlor
goodwin.lawlor at ucd.ie
Wed Sep 15 14:28:30 EDT 2004
Hi Jim,
I just added this bug report today:
http://www.vtk.org/Bug/bug.php?op=show&bugid=1167
Its a request to enable resizing of the handles of 3d widgets when the user
zooms in and out. Basically, the SizeHandles() method is used as a callback
for an observer of the renderer's StartEvent.
In addition to resizing the handles with a callback, the whole widget could
be resized along these lines:
1. Save widget Normal and Center
2. Find the x and y bounds of the viewport in world coords. See
SizeHandles() for this. You can scale them down, if you like, by some
factor.
3. Set NormalToZAxisOn (z bounds will be ignored)
4. Call vtkPlaneWidget::PlaceWidget(double bds[6]) with the scaled viewport
bounds and whatever zmin/zmax bounds
5. Set NormalToZAxisOff
6. Set Normal and Center back to the ones saved in 1.
The code in vtkCubeAxesActor2D::RenderOpaqueGeometry may also give you some
ideas about how to do this.
hth
Goodwin
"James Robinson" <j.robinson at kepler-systems.com> wrote in message
news:20040915170616.9643F2BE3E at public.kitware.com...
Dear All,
I am struggling to find an easy way (outside of creating a new object) to
get vtkPlaneWidget to behave in a certain way. As it stands it has a nice
feature which automatically sizes the handles according to the viewport.
What I am doing is using the vtkPlaneWidget to control a cut plane (thru a
finite element mesh). What would be nice is that the vtkPlaneWidget would
stay a constant size (say roughly 1/3 the viewport) even as the user zooms
in and out. Any ideas how this might be done?
Jim
Jim Robinson
+ 42 Rivergrove,
Glanmire,
Co. Cork,
Eire
' +353 21 4822028
+353 87 2393010
- jrobinson at eircom.net
_______________________________________________
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