Base class for building a basic OpenInventor application without using the classic 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 () |
Base class for building a basic OpenInventor application without using the classic 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. See, for example, SceneExaminer and SceneOrbiter.
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.
Default is true.
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] |
Select perspective or orthographic camera.
Default is perspective.
Reimplemented in SceneExaminer, and SceneOrbiter.
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.