Vtkrenderwindow and vtkrenderwindow actor

VtkRenderWindowInteractor for rendering is happening on the window the mouse, keyboard, event event. This class provides platform-independent mechanisms for interacting with the render window, including picking and frame rate control. When vtkRenderWindowInteractor (in fact is he a subclass) observed in the platform of a certain event occurs, he through InvokeEvent () method to convert the incident to VTK events. This class acts as a platform specific base class to control the passing of mouse/keyboard/time messages, notifying VTKInteractorObserver and its subclasses. All observer objects, VTKInteractorObservers, registered with the interactor receive the event, and then all respond to it.
In fact, vtkRenderWindowInteractor works like this: This class will take in vtkRenderWindow associated with it (through vtkRenderWindowInteractor SetRenderWindow () method to join the render window) on the event, then vtkRenderWindowInteractor classes depending on the equipment and the operating system to instantiate an object, for example, Unix is vtkXRenderWindowInteractor, The Windows is vtkWin32RenderWindowInteractor. When vtkRenderWindowInteractor: : Start () method is invoked, the function of interception of the event is activated. Finally, the interception by the event will be sent to vtkRenderWindowInteractor: : InteractorStyle this instance for processing. InteractorStyle vtkRenderWindowInteractor is a protected data members in a class is vtkInteractorObserver types of pointer, and vtkInteractorObserver role is monitoring events on interaction, in this way, the interception by vtkRenderWindowInteractor messages have the end-result. If want to increase the new way of interaction in VTK, should start with vtkInteractorStyle derive a subclass, such as: vtkInteractorStyleTrackball, vtkInteractorStyleUser, vtkInteractorStyleJoystickActor, vtkInteractorStyleJoystickCamera, vtkInteractorStyleUser, etc. The interaction allows the user to customize the manner.

 

 
Application process: (1) a vtkRenderWindow object rWin (2) a iRen vtkRenderWindowInteractor object (3) a widget vtkWidget object
Is: iRen – & gt; setRenderWindow(rWin);
Widgets – & gt; setInteractor(iRen);
Iren takes care of the event conversion (you must specify which window’s event is converted), and then registers an observer widget with the Iren interactivator widget->; SetInteracotr (IREN), which is responsible for observing events that occur on the render window that IREN intercepts and performing relevant system custom actions when the event occurs.


Read More: