SoTVizViewer Class Reference
[TerrainViz]

TerrainViz Abstract base class for SoTVizViewer. More...

#include <TerrainViz/viewer/SoTVizViewer.h>

Inheritance diagram for SoTVizViewer:
SoXtConstrainedViewer SoTVizCameraManager SoXtFullViewer SoXtViewer SoXtRenderArea SoStereoViewer SoXtGLWidget SoXtComponent

List of all members.

Public Types

enum  speedUnits {
  KILOMETERS_PER_HOUR,
  METERS_PER_SECOND,
  MILES_PER_HOUR
}

Public Member Functions

 SoTVizViewer (SoWidget parent=NULL, const char *name=NULL, SbBool buildwithDefaultTools=TRUE, SbBool buildInsideParent=TRUE, SoXtFullViewer::BuildFlag flag=BUILD_ALL, SoXtViewer::Type type=BROWSER)
 ~SoTVizViewer ()
virtual void setFlyMode (SbBool onOff)
virtual SbBool isFlyMode () const
virtual void setInvertedControlsMode (SbBool onOff)
virtual SbBool isInvertedControlsMode () const
virtual void setMaxRollAngle (float newAngle)
virtual float getMaxRollAngle () const
virtual void setElevationRelativeSpeedMode (SbBool onOff)
virtual SbBool isElevationRelativeSpeedMode () const
virtual void setSpeedUnit (SoTVizViewer::speedUnits newSpeedUnit=SoTVizViewer::KILOMETERS_PER_HOUR)
virtual SoTVizViewer::speedUnits getSpeedUnit () const
virtual void setSpeedModulationCoeff (float newCoeff)
virtual float getSpeedModulationCoeff () const
virtual void setMaxSpeed (float newSpeed, SbBool autoMaxSpeed=FALSE)
virtual float getMaxSpeed () const
virtual void setBorderRespect (SbBool onOff)
virtual void setConstantElevationMode (SbBool onOff, SbBool resetElevation=FALSE)
virtual void setTargetRelativeElevation (double newElevation)
virtual void setMinimumElevation (double newMinimalElevation)
virtual void setTerrain (SoNode *t)
void setNorth (SbVec3f &newNorth)
SbVec3f getNorth () const
virtual void openControls ()
virtual SoTVizNavigationToolsgetTerrainNavigationTools () const
virtual void setTerrainNavigationToolsVisibility (SbBool onOff)
virtual SbBool getTerrainNavigationToolsVisibility () const
virtual void setTerrainNavigationToolsInteractivity (SbBool onOff)
virtual SbBool getTerrainNavigationToolsInteractivity () const
virtual void setSceneGraph (SoNode *)
virtual void setCamera (SoCamera *)
virtual SoCameragetCamera () const
virtual void setHeadlight (SbBool)
virtual void setUpDirection (SbVec3f &newUpDirection)
virtual SbVec3f getUpDirection () const
virtual void viewAll ()
virtual void resetToHomePosition ()
virtual void setViewing (SbBool onOff)
virtual void setCursorEnabled (SbBool onOff)

Detailed Description

TerrainViz Abstract base class for SoTVizViewer.

This class is a constrained viewer that has been customized for terrain viewing. The environment variable TVIZ_VIEWER_DATA_PATH should specify the directory where the .iv files for navigation tools are located (typically $OIVHOME/data/TerrainViz/viewer).

You can add different types of nodes to this viewer:

Note: This viewer is not compatible with Qt.

SEE ALSO

SoXtConstrainedViewer, SoWinConstrainedViewer, SoTVizCameraManager

Deprecated:

Deprecated since Open Inventor 9500
No longer supported.

Member Enumeration Documentation

Enumerator:
KILOMETERS_PER_HOUR 

Speed is in Km/h.

METERS_PER_SECOND 

Speed is in m/s.

MILES_PER_HOUR 

Speed is in mph.


Constructor & Destructor Documentation

SoTVizViewer::SoTVizViewer ( SoWidget  parent = NULL,
const char *  name = NULL,
SbBool  buildwithDefaultTools = TRUE,
SbBool  buildInsideParent = TRUE,
SoXtFullViewer::BuildFlag  flag = BUILD_ALL,
SoXtViewer::Type  type = BROWSER 
)

Constructor.

SoTVizViewer::~SoTVizViewer (  ) 

Destructor.


Member Function Documentation

virtual SoCamera* SoTVizViewer::getCamera (  )  const [virtual]

Returns a pointer to the camera.

Reimplemented from SoTVizCameraManager.

virtual float SoTVizViewer::getMaxRollAngle (  )  const [virtual]

Returns the maximum roll angle.

virtual float SoTVizViewer::getMaxSpeed (  )  const [virtual]

Returns the maximum speed allowed.

SbVec3f SoTVizViewer::getNorth (  )  const

Returns the north direction.

virtual float SoTVizViewer::getSpeedModulationCoeff (  )  const [virtual]

Returns the speed modulation coefficient.

virtual SoTVizViewer::speedUnits SoTVizViewer::getSpeedUnit (  )  const [virtual]

Returns the speed units used.

virtual SoTVizNavigationTools* SoTVizViewer::getTerrainNavigationTools (  )  const [virtual]

Returns a pointer to the internal SoTVizNavigationTools instance.

This is useful for adding or removing interface elements.

virtual SbBool SoTVizViewer::getTerrainNavigationToolsInteractivity (  )  const [virtual]

Returns TRUE if navigation tools are interactive.

virtual SbBool SoTVizViewer::getTerrainNavigationToolsVisibility (  )  const [virtual]

Returns TRUE if navigation tools are visible.

virtual SbVec3f SoTVizViewer::getUpDirection (  )  const [inline, virtual]

Returns the up direction of the viewer.

Reimplemented from SoTVizCameraManager.

virtual SbBool SoTVizViewer::isElevationRelativeSpeedMode (  )  const [virtual]

Returns TRUE if distance feedback on speed is active.

virtual SbBool SoTVizViewer::isFlyMode (  )  const [virtual]

Returns TRUE if flying mode is active.

virtual SbBool SoTVizViewer::isInvertedControlsMode (  )  const [virtual]

Returns TRUE if flying mode is reversed.

virtual void SoTVizViewer::openControls (  )  [virtual]

Shows the viewer controls interface.

You can control the visibility of the controls interface using setTerrainNavigationToolsVisibility.

virtual void SoTVizViewer::resetToHomePosition (  )  [virtual]

Restores the camera values.

Reimplemented from SoXtConstrainedViewer.

virtual void SoTVizViewer::setBorderRespect ( SbBool  onOff  )  [virtual]

Prevents the camera from going outside the terrain borders.

Reimplemented from SoTVizCameraManager.

virtual void SoTVizViewer::setCamera ( SoCamera  )  [virtual]

Sets the edited camera.

Setting the camera is only needed if the first camera found in the scene when setting the scene graph isn't the one the programmer really wants to edit.

Reimplemented from SoXtConstrainedViewer.

virtual void SoTVizViewer::setConstantElevationMode ( SbBool  onOff,
SbBool  resetElevation = FALSE 
) [virtual]

Turns constant elevation mode on/off.

Default = FALSE. If ConstantElevationMode is TRUE, then the camera moves at a fixed height relative to the terrain. That is, the camera position (X,Y,Z) has

Z = terrainHeight(X,Y) + offset

where offset is fixed at the current height when ConstantElevationMode is set to TRUE.

Reimplemented from SoTVizCameraManager.

virtual void SoTVizViewer::setCursorEnabled ( SbBool  onOff  )  [virtual]

Sets whether the viewer is allowed to change the cursor over the renderArea window.

When disabled, the cursor is undefined by the viewer and will not change as the mode of the viewer changes. When re-enabled, the viewer will reset it to the appropriate icon. Disabling the cursor enables the application to set the cursor directly on the viewer window or on any parent widget of the viewer. This can be used when setting a busy cursor on the application shell. This value is inherited from SoXtViewer, default = TRUE.

Reimplemented from SoXtViewer.

virtual void SoTVizViewer::setElevationRelativeSpeedMode ( SbBool  onOff  )  [virtual]

Sets a multiplier on speed based on distance between camera and ground.

This feedback is active by default.

virtual void SoTVizViewer::setFlyMode ( SbBool  onOff  )  [virtual]

Switches the navigation mode between walk mode (default) and flying mode.

virtual void SoTVizViewer::setHeadlight ( SbBool   )  [virtual]

Turns the headlight on/off.

Default = on.

Reimplemented from SoXtFullViewer.

virtual void SoTVizViewer::setInvertedControlsMode ( SbBool  onOff  )  [virtual]

Reverses the up and down directions in flying mode.

Default is FALSE.

virtual void SoTVizViewer::setMaxRollAngle ( float  newAngle  )  [virtual]

Sets the maximum roll angle.

Turning left/right while flying will cause rolling (a.k.a. banking) up to this maximum angle. A zero value prevents rolling. The default is 30 degrees.

virtual void SoTVizViewer::setMaxSpeed ( float  newSpeed,
SbBool  autoMaxSpeed = FALSE 
) [virtual]

Sets the maximum speed.

Active only if ElevationRelativeSpeed is FALSE (set with setElevationRelativeSpeedMode). Otherwise, maximum speed is computed using the speed modulation coefficient. See setSpeedModulationCoeff.
Default = m_terrainMaxSize*DEFAULT_TERRAINSIZE_TO_MAXSPEED*getToRealLength() where m_terrainMaxSize is the dimension of the largest side of the terrain data, DEFAULT_TERRAINSIZE_TO_MAXSPEED is 0.1, and getToRealLength() is expressed in m/s. If autoMaxSpeed is TRUE, then maximum speed will be automatically recomputed each time a new terrain is loaded.

virtual void SoTVizViewer::setMinimumElevation ( double  newMinimalElevation  )  [virtual]

Sets the minimum elevation of the camera.

Reimplemented from SoTVizCameraManager.

void SoTVizViewer::setNorth ( SbVec3f newNorth  ) 

Sets the north direction.

Default = (0,1,0) (Y).

virtual void SoTVizViewer::setSceneGraph ( SoNode  )  [virtual]

Sets the scene graph to render.

Whenever a new scene is supplied, the first camera encountered will be by default used as the edited camera. If the scene graph has no camera, a new camera will be created. See SoXtViewer for a more complete description of nodes that may be added when setSceneGraph is called.

Implements SoTVizCameraManager.

virtual void SoTVizViewer::setSpeedModulationCoeff ( float  newCoeff  )  [virtual]

Modulates maximum speed with a coefficient as follows:
If ElevationRelativeSpeed is TRUE, then
max_speed = relative_elevation * speed_modulation_coeff
Otherwise, max_speed is specified using setMaxSpeed.

virtual void SoTVizViewer::setSpeedUnit ( SoTVizViewer::speedUnits  newSpeedUnit = SoTVizViewer::KILOMETERS_PER_HOUR  )  [virtual]

Sets the speed units.

Default = KILOMETERS_PER_HOUR.

virtual void SoTVizViewer::setTargetRelativeElevation ( double  newElevation  )  [virtual]

Changes camera height in constant elevation mode.

The default is the current camera offset. The units are the units specified using SoTVizCameraManager::setIOLengthUnit.

Reimplemented from SoTVizCameraManager.

virtual void SoTVizViewer::setTerrain ( SoNode t  )  [virtual]

To be called if the terrain node is not the scene graph root specified by setScenegraph().

Reimplemented from SoTVizCameraManager.

virtual void SoTVizViewer::setTerrainNavigationToolsInteractivity ( SbBool  onOff  )  [virtual]

Sets the navigation tools interactive or not.

virtual void SoTVizViewer::setTerrainNavigationToolsVisibility ( SbBool  onOff  )  [virtual]

Sets the navigation tools visible or not.

virtual void SoTVizViewer::setUpDirection ( SbVec3f newUpDirection  )  [virtual]

Sets the up direction of the viewer.

Default = (0,0,1) (Z).

Reimplemented from SoTVizCameraManager.

virtual void SoTVizViewer::setViewing ( SbBool  onOff  )  [virtual]

Sets whether the viewer is turned on or off.

When turned on, events are consumed by the viewer. When viewing is off, events are processed by the viewer's render area. This means events will be sent down to the scene graph for processing (i.e., picking can occur). Note that if the application has registered an event callback, it will be invoked on every message, whether viewing is turned on or not. However, the return value of this callback (which specifies whether the callback handled the event or not) is ignored when viewing is on. That is, the viewer will process the event even if the callback already did. This is to ensure that the viewing paradigm is not broken (default viewing is on).

Reimplemented from SoXtFullViewer.

virtual void SoTVizViewer::viewAll (  )  [virtual]

Changes the camera position to view the entire scene (the camera zoom and orientation are not changed).

Reimplemented from SoXtViewer.


The documentation for this class was generated from the following file:

Open Inventor by FEI reference manual, generated on 19 Aug 2019
Copyright © FEI S.A.S. All rights reserved.
http://www.openinventor.com/