25#ifndef SO_GUI_ALGO_VIEWERS
26#define SO_GUI_ALGO_VIEWERS
37#include <Inventor/Gui/viewers/SoGuiConstrainedViewer.h>
38#include <Inventor/SbVec.h>
1023 void setMMode(
int mode );
1024 int getMMode()
const;
1027 int sheetProjProjectAndGetRotation(
const SbVec2f& newLocator,
SbRotation& rot );
1036 static void spinAnimationSensorCB(
void* v,
SoSensor* sensor );
1037 static void constrainedAnimationSensorCB(
void* v,
SoSensor* sensor );
1038 static void setFocalPointFinishCallback(
void* data,
void* v );
1039 static void mouseWheelMotionAlarmSensorCB(
void *data,
SoSensor *sensor);
1041 void rotateCameraAboutVwCenter(
const SbRotation& rot );
1042 void rotateCameraWithRotTarget(
const SbRotation& rot );
1043 void rotateCameraWithRotTargetCore(
const SbRotation& rot );
1044 void rotateCameraWithRotTargetDec(
const SbRotation& rot );
1045 void mouseWheelMotion_(
float newVal,
float &scaleFactor );
1046 void screenToFocalPlanePoint(
const SbVec2s &pxPoint,
SbVec3f &worldPoint,
SbPlane *focPlane = NULL );
1047 void screenNormToFocalPlanePoint(
const SbVec2f &normPoint,
SbVec3f &worldPoint,
SbPlane *fplane = NULL );
1048 void sheetProjProjectAndGetRotationCore(
const SbVec2f& newLocator,
SbRotation& rot );
1054 SbBool m_boxDrawing, m_boxSelection, m_firstActivation;
1058 SbVec2s m_locator, m_prevPos, m_startPos;
1075 int m_firstIndex, m_lastIndex;
1083 void computeTranslateValues();
1084 float m_transXspeed, m_transYspeed;
1087 float m_minSpeed, m_maxInc, m_speedLimit;
1088 float m_speed, m_maxSpeed, m_maxStraightSpeed;
1096 SbVec2f* m_lastRotStepLocator;
1097 double m_mouseAngularSpeed;
1099 SbVec3f *m_rotationTargetPosition;
Base class for representing projectors.
Class for representing a rotation.
Class for representation of a time.
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> 3D vector class.
Triggers a delegate once sometime in the future.
Abstract base class for camera nodes.
Node representing a directional light source.
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Selection node t...
Sensor class that can be attached to Open Inventor fields.
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Common algorithm...
virtual void recomputeSceneSize()
This can be used to let the viewer know that the scene graph has changed so that the viewer can recom...
virtual void rollCamera(const SbVec2s &newLocator)
Rolls the camera based on cursor motion.
virtual void adjustCameraClippingPlanes()
Auto clipping routine.
void interactiveCountInc()
Invokes the start viewing callbacks.
SbProjector * getSheetProjector() const
Returns the sheet projector.
SbBool isHeadlight()
Returns TRUE if the headlight is on.
virtual void setPreserveCameraHeightAngle(SbBool flag)
If TRUE, an SoPerspectiveCamera's heightAngle is preserved if the camera is changed to an SoOrthograp...
void startFlyAnimation()
Starts the walk animation.
SbVec2s getPreviousMousePositionLocator() const
Returns the previous mouse position in pixels.
SbVec2s getCurrentMousePositionLocator() const
Returns the current mouse position in pixels.
void setBoxSelectionMode(SbBool on)
Sets box selection mode.
ViewerTypes
Viewer type flags.
@ EXAMINER
Algorithms for examiner viewer.
@ PLANE
Algorithms for plane viewer.
@ WALK
Algorithms for walk viewer.
@ FLY
Algorithms for fly viewer.
@ UNKNOWN
Unknown: default value.
virtual void resetToHomePosition()
Restores the camera values.
DrawType
List of possible drawing types.
@ INTERACTIVE
Applies to rendering while interactive viewing.
@ STILL
Applies to static rendering.
void updateCameraFocalPoint()
Updates focal distance.
float getCurrentSpeed() const
Returns the current speed.
SoDirectionalLight * getHeadlight()
Returns the headlight node.
void resetRenderAction()
This method resets the render action cache.
void setBoxDrawingMode(SbBool on)
Sets box drawing mode.
void setMaxSpeedInc(float increment)
Sets maximum speed multiplier.
virtual void bottomWheelStart()
Initializes bottom thumb wheel.
void doCameraAnimation()
Does camera animation for constrained viewers.
virtual void computeSeekFinalOrientation()
Keeps the same camera rotation when seeking.
ZoomingType
List of possible zooming modes.
@ GIVENPOSITION
Uses as the zooming center a point provided by the application through the setCurrentMousePositionLoc...
@ AUTOCENTER
Around the viewport center.
void setSheetProjectionType(const ProjectorsType &projType)
Specifies the sheet projection to use for rotations.
void setMaxSpeed(float speed)
Sets the maximum speed.
float getSpeedLimit() const
Returns the speed limit.
virtual SoMPEGRenderer * getMPEGRecorder() const
Returns the recorder used for MPEG encoding.
virtual void doSpinAnimation()
Rotate the camera for spin animation.
virtual SoNode * getSceneGraph()
Returns the scene graph to render.
virtual void reverseDollyCamera(const SbVec2s &newLocator)
Same as dollyCamera but reversed.
SoGuiAlgoViewers::ViewerTypes getViewerType() const
Returns the current viewer type.
void activateSpinning()
Set sphere sheet starting point and resets the animation queue.
double getMouseAngularSpeed()
Returns the factor used to scale the rotation speed while interactively rotating the camera.
SbBool isConstrained() const
Returns TRUE if algorithms for constrained viewers are used.
SoGuiAlgoViewers::WalkViewerMode getWalkViewerAnimMode() const
Returns the current mode for the walk viewer camera animation.
virtual void spinConstrainedCamera(const SbVec2f &newLocator, int axisIndex)
Spin the camera based on cursor motion but constrained to rotation around one axis.
BufferType getBufferingType()
Returns the current buffering type in the main view.
SbPlane getCameraFocalPlane() const
Returns the camera focal position.
SbVec3f getCameraPositionLocator() const
Returns the camera position.
virtual void mouseWheelMotion(float newVal)
Makes the camera to zoom based on mouse wheel motion.
ProjectorsType
List of possible projection modes for the virtual trackball.
@ SPHERICAL
Spherical rotation (the classic Open Inventor algorithm).
@ CYLINDRICAL
Cylindrical rotation.
void setMaxStraightSpeed(float speed)
Sets the maximum straight speed.
virtual void setBufferingType(BufferType type)
Sets the current buffering type in the main view (default BUFFER_DOUBLE).
void startWalkAnimation()
Starts the walk animation.
void setPrevAnimTime(SbTime previous)
Sets the previous animation time.
ProjectorsType getSheetProjectionType() const
Returns the sheet projection used for rotations.
void setViewerType(ViewerTypes vType)
Sets the type of viewer used for the algorithms.
void stopWalkAnimation()
Stops the walk animation.
virtual void setViewing(SbBool flag)
Sets whether the viewer is turned on or off.
void viewZ(bool reverse=false)
Selects sagittal view.
void rotateCamera(const SbRotation &rot)
Rotates the camera around focal point by given incremental rotation (Given rotation is concatenated o...
SbBool isBoxSelection() const
Returns TRUE if box selection mode is enabled.
float getMaxSpeedInc() const
Returns maximum speed multiplier.
virtual void resetRotationTargetPosition()
Reset target position to default rotation around "focal point".
SoNode * getSceneRoot()
Returns the scene root of the viewer (drawstyle, camera and headlight + user scene graph) or the user...
void setPreviousMousePositionLocator(const SbVec2s &mousePosition)
Sets the previous mouse position.
void setConstrained(SbBool constrained)
Specifies whether algorithms for constrained viewers should be used.
virtual void setSeekMode(SbBool onOrOff)
Set the viewer into/out of seek mode (default OFF).
void calculateMaxSpeed()
Calculates the maximum speed of the animation.
void setCameraFocalPlane(const SbPlane &focalPlane)
Sets the camera focal plane.
void setWalkViewerAnimMode(WalkViewerMode mode)
Sets the camera animation for walk viewers regarding the mode.
float getMaxSpeed() const
Returns the maximum speed.
virtual void viewAll()
Changes the camera position to view the entire scene (the camera zoom or orientation isn't changed).
void viewY(bool reverse=false)
Selects frontal view.
virtual void setHeadlight(SbBool insertFlag)
Turns the headlight on/off (default on).
void setCurrentSpeed(float speed)
Sets the current speed.
DrawStyle getDrawStyle(DrawType type)
Returns the current drawing style in the main view.
float getMinSpeed() const
Returns the minimum speed.
virtual bool getRotationTargetPosition(SbVec3f &targetPos)
Query the camera target position for rotations.
void setPlane(const SbVec3f &newNormal, const SbVec3f &newRight)
Moves the camera to be aligned with the given plane.
virtual void setSceneGraph(SoNode *newScene)
Sets the scene graph to render.
void setStartMousePositionLocator(const SbVec2s &mousePosition)
Sets the mouse start position.
void enableShadows(bool onOrOff)
Adds an SoShadowGroup after the headlight and enables it if true.
virtual SbBool isCameraHeightAnglePreserved() const
Queries whether the SoPerspectiveCamera's heightAngle is preserved if the camera is changed to an SoO...
WalkViewerMode
Walk viewer mode flags.
@ WALK_MODE
Walking mode (default).
void interactiveCountDec()
Invokes the finish viewing callbacks.
virtual void panCamera(const SbVec2f &newLocator)
Pans the camera based on cursor motion.
void changeMaxStraightSpeed(SbBool increase)
Computes the maximum straight speed.
virtual void setRotationTargetPosition(const SbVec3f &targetPos)
Sets the camera target position for rotations.
SbBool isViewing() const
Returns TRUE if the viewer is in viewing mode.
void viewX(bool reverse=false)
Selects axial view.
float getMaxStraightSpeed() const
Returns the maximum straight speed.
SoCamera * getCamera()
Gets the edited camera.
void stopSpinAnimation()
Stops the spin animation.
void constrainCameraRotation(bool x=false, bool y=false, bool z=false)
Constrains the camera to spin around the specified axis.
void activateFlying()
Initializes flying animation.
void startSpinAnimation()
Starts the spin animation.
SbBool isBoxDrawing() const
Returns TRUE if box drawing mode is enabled.
virtual void dollyCamera(const SbVec2s &newLocator)
Moves the camera on the z axis based on cursor motion.
virtual void spinCamera(const SbVec2f &newLocator)
Spins the camera based on cursor motion.
virtual void bottomWheelMotion(float newVal)
Examiner and constrained viewers: Rotates the camera based on bottom wheel motion.
void setSpeedLimit(float limit)
Sets the speed limit.
virtual void leftWheelStart()
Initializes left thumb wheel.
void stopFlyAnimation()
Stops the walk animation.
SoType getCameraType()
Gets the camera type that will be created by the viewer if no cameras are found in the scene graph (s...
virtual void rightWheelMotion(float newVal)
Makes the camera to zoom based on right wheel motion.
virtual void saveHomePosition()
Saves the camera values.
SbVec2s getStartMousePositionLocator() const
Returns the mouse start position in pixels.
ZoomingType getZoomingType() const
Returns the zooming algorithm.
virtual void dollyCamera(float dist)
Moves the camera forward by the given amount.
void setZoomingType(const ZoomingType &zoomType)
Specifies the zooming algorithm to use.
BufferType
List of different buffering types.
@ BUFFER_SINGLE
Single buffer.
@ BUFFER_INTERACTIVE
Double buffer while interactive viewing.
@ BUFFER_DOUBLE
Double buffer.
virtual void toggleCameraType()
This routine will toggle the current camera from perspective to orthographic, and from orthographic b...
virtual void getDefaultRotationTargetPosition(SbVec3f &targetPos)
Gets the default camera target position for rotations.
void setCameraPositionLocator(const SbVec3f &camPosition)
Sets the camera position.
void setMinSpeed(float speed)
Sets the minimum speed.
virtual void setCameraType(SoType type)
Sets the camera type that will be created by the viewer if no cameras are found in the scene graph (s...
void setMouseAngularSpeed(double speedFactor)
Specifies the factor used to scale the rotation speed while interactively rotating the camera.
SbTime getPrevAnimTime() const
Returns the previous animation time.
virtual void leftWheelMotion(float newVal)
Examiner and constrained viewers: Rotates the camera based on left wheel motion.
void doBoxZoom(int x1, int y1, int x2, int y2)
Zooms to the region delimited by the box.
SbSphereSheetProjector * getSphereSheetProjector() const
Returns the sphere sheet projector and NULL if the current projection is not spherical.
void activatePanning()
Updates camera position when panning is actived.
DrawStyle
List of possible drawing styles.
@ VIEW_LOW_COMPLEXITY
Render low complexity and no texture.
@ VIEW_SAME_AS_STILL
Forces the INTERACTIVE draw style to match STILL.
@ VIEW_LINE
Wireframe draw style.
@ VIEW_BBOX
Bounding box draw style.
@ VIEW_LOW_RES_LINE
Low complexity wireframe + no depth clearing.
@ VIEW_POINT
Point draw style.
@ VIEW_NO_TEXTURE
Render without textures.
@ VIEW_HIDDEN_LINE
Render only the frontmost lines.
@ VIEW_LOW_RES_POINT
Low complexity point + no depth clearing.
SbBool isSeekMode()
Returns TRUE if viewer is in seek mode.
virtual void rightWheelStart()
Initializes right thumb wheel.
void rotateCamera()
Rotates the camera around focal point by given incremental rotation (Given rotation is concatenated o...
SoGuiAlgoViewers()
Constructor.
virtual void setMPEGRecorder(SoMPEGRenderer *recorder)
Sets the recorder used for MPEG encoding.
void setCurrentMousePositionLocator(const SbVec2s &mousePosition)
Sets the current mouse position.
virtual void setCamera(SoCamera *newCamera)
Sets the edited camera.
virtual void setDrawStyle(DrawType type, DrawStyle style)
Sets the current drawing style in the main view.
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Base class for g...
Abstract base class for all database nodes.
Abstract base class for Open Inventor sensors.
Group node that traverses one chosen child.
Stores runtime type information.