Tool class for easily building a basic OpenInventor application without using existing viewer classes. More...
#include <Inventor/ViewerComponents/nodes/SceneInteractor.h>
Public Types | |
enum | CameraMode { PERSPECTIVE, ORTHOGRAPHIC } |
Public Member Functions | |
SceneInteractor () | |
virtual | ~SceneInteractor () |
void | adjustClippingPlanes (const SbViewportRegion &vpRegion) |
void | viewAll (const SbViewportRegion &viewport) |
void | viewAxis (const SbVec3f &direction, const SbVec3f &up) |
SoCameraInteractor * | getCameraInteractor () |
SoCamera * | getCamera () const |
virtual void | setCameraMode (SceneInteractor::CameraMode mode) |
SceneInteractor::CameraMode | getCameraMode () |
void | enableHeadLight (bool enabled) |
bool | isHeadLightEnabled () |
Tool class for easily building a basic OpenInventor application without using existing viewer classes.
The SceneInteractor is a simple extension of the SoSeparator node that allows handling of Open Inventor events. This class should be overridden as it provides only empty event handlers.
This node is intended to be used as the root of a scene graph. The SceneInteractor is a custom SoSeparator whose children are:
The SceneInteractor uses an instance of SoCameraInteractor in order to manipulate the camera in response to OpenInventor events.
Class diagram of the SceneInteractor showing the relationship between the SoEventCallback, the SoCamera, the SoDirectionalLight (used as headlight) and the SoCameraInteractor.
Detail of the scene graph rooted by a SceneInteractor:
Notes:
SceneExaminer, SoCameraInteractor
SceneInteractor::SceneInteractor | ( | ) |
Constructor.
virtual SceneInteractor::~SceneInteractor | ( | ) | [virtual] |
Destructor.
void SceneInteractor::adjustClippingPlanes | ( | const SbViewportRegion & | vpRegion | ) |
Adjust near and far clipping planes to minimize clipping of objects in the scene.
This adjustment, based on the bounding box of the scene, ensures that shapes will not be clipped and also that depth buffer precision is maximized. This method should be called before each render traversal.
void SceneInteractor::enableHeadLight | ( | bool | enabled | ) |
Enable or disable headlight.
SoCamera* SceneInteractor::getCamera | ( | ) | const |
Returns the current camera.
SoCameraInteractor* SceneInteractor::getCameraInteractor | ( | ) |
Returns the current camera interactor.
SceneInteractor::CameraMode SceneInteractor::getCameraMode | ( | ) |
Returns the current camera mode.
bool SceneInteractor::isHeadLightEnabled | ( | ) |
Returns if headlight is enabled.
virtual void SceneInteractor::setCameraMode | ( | SceneInteractor::CameraMode | mode | ) | [virtual] |
Set camera to perspective or orthographic.
Reimplemented in SceneExaminer.
void SceneInteractor::viewAll | ( | const SbViewportRegion & | viewport | ) |
Moves the camera to be aligned with the given direction vector while keeping the "up" direction of the camera parallel to the specified up vector.