AW: [vtkusers] FW: Stopping rotation.
    de Boer Ingo 
    I.deBoer at polytec.de
       
    Tue Oct  7 09:43:38 EDT 2003
    
    
  
Hi Rupert,
> > Does anybody have any ideas as to how I can prevent a user from being able
> > to rotate an object in a render window, yet still allow scaling and
> > translation?
Make your own "vtkMyInteractorStyle" based on e.g. vtkInteractorStyleTrackballCamera.
Like this:
#include "vtkInteractorStyleTrackballCamera.h"
class vtkMyInteractorStyle : public vtkInteractorStyleTrackballCamera
{
public:
	static vtkMyInteractorStyle *New();
	void OnLeftButtonDown();
	void OnLeftButtonUp();
protected:
	vtkMyInteractorStyle();
};
vtkStandardNewMacro(vtkMyInteractorStyle);
vtkMyInteractorStyle::vtkMyInteractorStyle() : vtkInteractorStyleTrackballCamera()
{
}
void vtkMyInteractorStyle::OnLeftButtonDown()
{
}
void vtkMyInteractorStyle::OnLeftButtonUp()
{
}
Add the interactor to your renderer, like
m_pvtkWin32RenderWI->SetInteractorStyle(m_pvtkMyInteractorStyle);
greets
  Ingo
    
    
More information about the vtkusers
mailing list