[vtkusers] (no subject)
fengfenghsy
fengfenghsy at 163.com
Sat Dec 18 13:52:55 EST 2004
Hello everyone!
I have met a problem, which has bothered me for nearly 20 days.
First look at the following code which used Tcl/Tk:
##########################################
vtkInteractorStyleTrackballCamera style
style AddObserver LeftButtonPressEvent {set MouseMotion 0; style OnLeftButtonDown}
style AddObserver MouseMoveEvent {set MouseMotion 1; style OnMouseMove}
vtkRenderer ren1
vtkRenderWindow renWin
renWin AddRenderer ren1
vtkRenderWindowInteractor iren
iren SetRenderWindow renWin
iren SetInteractorStyle style
##########################################
vtkInteractorStyleTrackballCamera allows the user to interactively manipulate (rotate, pan, etc.) the camera, the viewpoint of the scene. In trackball interaction, the magnitude of the mouse motion is proportional to the camera motion associated with a particular mouse binding. For example, small left-button motions cause small changes in the rotation of the camera around its focal point. For a 3-button mouse, the left button is for rotation, the right button for zooming, the middle button for panning, and ctrl + left button for spinning. (With fewer mouse buttons, ctrl + shift + left button is for zooming, and shift + left button is for panning.)
style AddObserver LeftButtonPressEvent {set MouseMotion 0; style OnLeftButtonDown}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~this function could set the variable MouseMotion to 0, and also keep the old LeftButtonDownPress style.
However if I use the function AddObserver in Visual C++. It`s easy to set the variable MouseMotion to 0, but hard to keep the OnleftButtonDown function working. The other two AddObserver function also have the same problem.
Could someone help me about this problem. Really thank you!
sincerealy
fengfenghsy
fengfenghsy at 163.com
2004-12-19
More information about the vtkusers
mailing list