VR-Forces 4.0.4 Class Documentation
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
makVrv::DtOsgChannel Class Reference

This class provides the OSG-specific implementation of a DtChannel. More...

Inheritance diagram for makVrv::DtOsgChannel:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 DtOsgChannel (DtDe &de, DtWindow *window, DtChannelConfiguration &config)
 Called by Creator object.
virtual ~DtOsgChannel ()
 DTOR.
virtual void setClearColor (float r, float g, float b, float a)
 Set the clear color for the channel.
virtual void setWindow (DtWindow *view)
 Set the window the channel is displayed on.
virtual const DtWindowwindow () const
 Get the window the channel is displayed on.
virtual void setViewport (int x, int y, int width, int height)
 Set the viewport.
virtual void getViewport (int &x, int &y, int &width, int &height) const
 Get the viewport.
virtual void setCameraPosition (double x, double y, double z)
 Set the camera position.
virtual void setCameraOrientation (double psi, double theta, double phi)
 Set the camera orientation.
virtual void setCameraPositionAndOrientation (double x, double y, double z, double psi, double theta, double phi)
 Set camera position and orientation.
virtual void setCameraPositionAndOrientation (osg::Vec3d &pos, osg::Quat &orient)
virtual void getCameraPositionAndOrientation (osg::Vec3d &position, osg::Quat &rotation) const
 Get the camera position and orientation.
virtual void update ()
 Update a channel.
virtual void connectToObserver ()
 Set up based on current observer parameters, such as modelSet and is2D.
virtual void setDynamicNearFar (bool enable)
 Set to use dynamic near far planes.
virtual void setNearFarRatio (double ratio)
 Set to the reation of the near and far planes when using dynamic near far planes.
virtual void setCameraObject (DtCameraObject *cameraObject)
 This method is called when the slave creates a channel and therefore a DtCameraObject.
virtual void setParentCameraObject (DtCameraObject *cameraObject)
 This method is called when this channel is locked to another "parent" channel.
virtual void setProjectionMatrixAsPerspective (double fovy, double aspectRatio, double zNear, double zFar)
 Create a symmetrical perspective projection, See OpenGL gluPerspective documentation for further details.
virtual void setProjectionMatrixAsFrustum (double left, double right, double bottom, double top, double zNear, double zFar)
 Set to a perspective projection.
virtual osgViewer::View & view ()
 Window accessor.
virtual osg::Camera * camera ()
 Accessor for the 3D camera.
virtual const osg::Camera * camera () const
virtual osg::Camera * overlayCamera ()
 Accessor for the 2D overlay camera.
*virtual void setProjectionResizePolicy (DtChannelConfiguration::ProjectionResizePolicy policy)
 Set the policy used to determine if and how the projection matrix should be adjusted on window resizes.
virtual void updateProjection ()
 This method is called when ever the channel's projection matrix needs to be updated.
void projectionUnitsToFrustum (DtChannelConfiguration::ProjectionUnits units, double &left, double zNear, double &right, double &top, double &bottom)
virtual void connectChannelToScene ()
 Set the channel's scene graph root.
virtual bool processMouseEvent (const DtMouseEvent &ev)
 attempt to handle a mouse event with the channel's overlay
virtual bool processKeyboardEvent (const DtKeyEvent &ev)
 attempt to handle a keyboard event with the channel's overlay
void getWorldToWindowMatrix (osg::Matrix &worldToWindowMatrix) const
 Get the channel's dynamic overlay if any.
virtual void projectToScreen (double dbX, double dbY, double dbZ, double &screenX, double &screenY, double &screenZ)
 project the given local (Or database) coordinates into screen coordinates
virtual void projectToWorld (double screenX, double screenY, double &dbX, double &dbY, double &dbZ)
 project the local world coordinates given screen coordinates
virtual void warpMouse (float pixelX, float pixelY)
virtual const std::string & name ()
 Returns the channel's name as defined in its configuration.

Protected Types

typedef std::map< int,
DtChannelSpecificGroup * > 
VisualTypeMap

Protected Member Functions

void makeObserverToCameraMatrix (osg::Vec3d &orient, osg::Matrixd &offsetObserverToCamera)
void makeObserverToCameraMatrix (osg::Quat &qObserverToWorld, osg::Matrixd &offsetObserverToCamera)
virtual void calculateNearFar (double &zNear, double &zFar)
 Calculates near/far depending on visual mode.
virtual void projectFor3D ()
 Projects frustum matrix for 3D viewing.
virtual void projectFor2D ()
 Projects ortho matrix for 2D viewing.
virtual void stopUsingModelSet (int modelSet)
virtual void startUsingModelSet (int modelSet)
virtual void slot_visualizerRootAdded (int modelSet, int visualType)
 called by signal when a new visualizer root is added
virtual void slot_observerModelSetChanged (DtObserverObject *observer, int modelSet)
 Called by signal when an observer's model set changes.
virtual void slot_observerSettingChanged (DtObserverObject *observer, int setting, bool value)
 Called by signal when an observer's visual setting changes.
virtual void slot_observerSettingRemoved (DtObserverObject *observer, int setting)
 Called by signal when an observer's visual setting is removed.
virtual void slot_channelAdded (DtChannelManager *mgr, DtChannel *channel)
 slot to be called when a new channel is added
virtual void slot_channelDestroyed (DtChannelManager *mgr, DtChannel *channel)
 slot to be called when a channel is removed
virtual void slot_windowConfigurationModified (const std::string &deName, const std::string &oldWindowName, const DtWindowConfiguration &config)
 slot to be called when the window configuration changes.
void slot_onCoordinateSystemChanged ()
 receive signals from the shared state about coordinate system changes
virtual void throttleDatabasePager (DtChannelManager *mgr, DtChannel *channel)
 slot to be called when a channel is added or removed.

Protected Attributes

osg::ref_ptr< osgViewer::View > myView
DtOsgWindowmyOsgWindow
osg::ref_ptr< osg::Camera > my2DCamera
osg::ref_ptr< osg::Camera > myNormalized2DCamera
bool myOverlayNeedsResize
bool myIsUsingTrackballManipulator
bool myCoordinateSystemChanged

Detailed Description

This class provides the OSG-specific implementation of a DtChannel.

Examples

Member Typedef Documentation

typedef std::map< int, DtChannelSpecificGroup*> makVrv::DtOsgChannel::VisualTypeMap [protected]

Constructor & Destructor Documentation

Called by Creator object.

virtual makVrv::DtOsgChannel::~DtOsgChannel ( ) [virtual]

DTOR.


Member Function Documentation

virtual void makVrv::DtOsgChannel::setClearColor ( float  r,
float  g,
float  b,
float  a 
) [virtual]

Set the clear color for the channel.

Implements makVrv::DtChannel.

virtual void makVrv::DtOsgChannel::setWindow ( DtWindow view) [virtual]

Set the window the channel is displayed on.

Exceptions:
DtCorruptedStateif the window pointer is NULL or is not a DtOsgView

Implements makVrv::DtChannel.

virtual const DtWindow* makVrv::DtOsgChannel::window ( ) const [virtual]

Get the window the channel is displayed on.

Implements makVrv::DtChannel.

virtual void makVrv::DtOsgChannel::setViewport ( int  x,
int  y,
int  width,
int  height 
) [virtual]

Set the viewport.

Implements makVrv::DtChannel.

virtual void makVrv::DtOsgChannel::getViewport ( int &  x,
int &  y,
int &  width,
int &  height 
) const [virtual]

Get the viewport.

Implements makVrv::DtChannel.

virtual void makVrv::DtOsgChannel::setCameraPosition ( double  x,
double  y,
double  z 
) [virtual]

Set the camera position.

Implements makVrv::DtChannel.

virtual void makVrv::DtOsgChannel::setCameraOrientation ( double  psi,
double  theta,
double  phi 
) [virtual]

Set the camera orientation.

virtual void makVrv::DtOsgChannel::setCameraPositionAndOrientation ( double  x,
double  y,
double  z,
double  psi,
double  theta,
double  phi 
) [virtual]

Set camera position and orientation.

When you need to set Set camera position and orientation. When you need to set both, this a little more efficient than calling setCameraPosition and setCameraOrientation seperately.

virtual void makVrv::DtOsgChannel::setCameraPositionAndOrientation ( osg::Vec3d &  pos,
osg::Quat &  orient 
) [virtual]
virtual void makVrv::DtOsgChannel::getCameraPositionAndOrientation ( osg::Vec3d &  position,
osg::Quat &  rotation 
) const [virtual]

Get the camera position and orientation.

virtual void makVrv::DtOsgChannel::update ( ) [virtual]

Update a channel.

Implements makVrv::DtChannel.

virtual void makVrv::DtOsgChannel::connectToObserver ( ) [virtual]

Set up based on current observer parameters, such as modelSet and is2D.

Implements makVrv::DtChannel.

virtual void makVrv::DtOsgChannel::setDynamicNearFar ( bool  enable) [virtual]

Set to use dynamic near far planes.

Implements makVrv::DtChannel.

virtual void makVrv::DtOsgChannel::setNearFarRatio ( double  ratio) [virtual]

Set to the reation of the near and far planes when using dynamic near far planes.

Implements makVrv::DtChannel.

virtual void makVrv::DtOsgChannel::setCameraObject ( DtCameraObject cameraObject) [virtual]

This method is called when the slave creates a channel and therefore a DtCameraObject.

It gets pass the DtCameraObject associated with this channel. The channel owns the window, and the window owns the manipulator which controls the OSG camera. The manipulator needs the DtCameraObject so it can get the current values of the camera's position, orientation, etc. from the master.

Exceptions:
DtCorruptedStateif DtSlaveCameraController could not be retrieved from window.

Implements makVrv::DtChannel.

virtual void makVrv::DtOsgChannel::setParentCameraObject ( DtCameraObject cameraObject) [virtual]

This method is called when this channel is locked to another "parent" channel.

It gets passed the DtCameraObject associated with the parent channel. This passes the DtCameraObject to the manipulator.

Implements makVrv::DtChannel.

virtual void makVrv::DtOsgChannel::setProjectionMatrixAsPerspective ( double  fovy,
double  aspectRatio,
double  zNear,
double  zFar 
) [virtual]

Create a symmetrical perspective projection, See OpenGL gluPerspective documentation for further details.

Implements makVrv::DtChannel.

virtual void makVrv::DtOsgChannel::setProjectionMatrixAsFrustum ( double  left,
double  right,
double  bottom,
double  top,
double  zNear,
double  zFar 
) [virtual]

Set to a perspective projection.

Implements makVrv::DtChannel.

virtual osgViewer::View& makVrv::DtOsgChannel::view ( ) [virtual]

Window accessor.

virtual osg::Camera* makVrv::DtOsgChannel::camera ( ) [virtual]

Accessor for the 3D camera.

virtual const osg::Camera* makVrv::DtOsgChannel::camera ( ) const [virtual]
virtual osg::Camera* makVrv::DtOsgChannel::overlayCamera ( ) [virtual]

Accessor for the 2D overlay camera.

Set the policy used to determine if and how the projection matrix should be adjusted on window resizes.

Reimplemented from makVrv::DtChannel.

virtual void makVrv::DtOsgChannel::updateProjection ( ) [virtual]

This method is called when ever the channel's projection matrix needs to be updated.

Implements makVrv::DtChannel.

void makVrv::DtOsgChannel::projectionUnitsToFrustum ( DtChannelConfiguration::ProjectionUnits  units,
double &  left,
double  zNear,
double &  right,
double &  top,
double &  bottom 
)
virtual void makVrv::DtOsgChannel::connectChannelToScene ( ) [virtual]

Set the channel's scene graph root.

virtual bool makVrv::DtOsgChannel::processMouseEvent ( const DtMouseEvent ev) [virtual]

attempt to handle a mouse event with the channel's overlay

Implements makVrv::DtChannel.

virtual bool makVrv::DtOsgChannel::processKeyboardEvent ( const DtKeyEvent ev) [virtual]

attempt to handle a keyboard event with the channel's overlay

Implements makVrv::DtChannel.

void makVrv::DtOsgChannel::getWorldToWindowMatrix ( osg::Matrix &  worldToWindowMatrix) const

Get the channel's dynamic overlay if any.

Get the camera's world to window matrix

virtual void makVrv::DtOsgChannel::projectToScreen ( double  dbX,
double  dbY,
double  dbZ,
double &  screenX,
double &  screenY,
double &  screenZ 
) [virtual]

project the given local (Or database) coordinates into screen coordinates

Implements makVrv::DtChannel.

virtual void makVrv::DtOsgChannel::projectToWorld ( double  screenX,
double  screenY,
double &  dbX,
double &  dbY,
double &  dbZ 
) [virtual]

project the local world coordinates given screen coordinates

Implements makVrv::DtChannel.

virtual void makVrv::DtOsgChannel::warpMouse ( float  pixelX,
float  pixelY 
) [virtual]

Implements makVrv::DtChannel.

virtual const std::string& makVrv::DtOsgChannel::name ( ) [virtual]

Returns the channel's name as defined in its configuration.

void makVrv::DtOsgChannel::makeObserverToCameraMatrix ( osg::Vec3d &  orient,
osg::Matrixd &  offsetObserverToCamera 
) [protected]
void makVrv::DtOsgChannel::makeObserverToCameraMatrix ( osg::Quat &  qObserverToWorld,
osg::Matrixd &  offsetObserverToCamera 
) [protected]
virtual void makVrv::DtOsgChannel::calculateNearFar ( double &  zNear,
double &  zFar 
) [protected, virtual]

Calculates near/far depending on visual mode.

virtual void makVrv::DtOsgChannel::projectFor3D ( ) [protected, virtual]

Projects frustum matrix for 3D viewing.

virtual void makVrv::DtOsgChannel::projectFor2D ( ) [protected, virtual]

Projects ortho matrix for 2D viewing.

virtual void makVrv::DtOsgChannel::stopUsingModelSet ( int  modelSet) [protected, virtual]
virtual void makVrv::DtOsgChannel::startUsingModelSet ( int  modelSet) [protected, virtual]
virtual void makVrv::DtOsgChannel::slot_visualizerRootAdded ( int  modelSet,
int  visualType 
) [protected, virtual]

called by signal when a new visualizer root is added

virtual void makVrv::DtOsgChannel::slot_observerModelSetChanged ( DtObserverObject observer,
int  modelSet 
) [protected, virtual]

Called by signal when an observer's model set changes.

virtual void makVrv::DtOsgChannel::slot_observerSettingChanged ( DtObserverObject observer,
int  setting,
bool  value 
) [protected, virtual]

Called by signal when an observer's visual setting changes.

virtual void makVrv::DtOsgChannel::slot_observerSettingRemoved ( DtObserverObject observer,
int  setting 
) [protected, virtual]

Called by signal when an observer's visual setting is removed.

virtual void makVrv::DtOsgChannel::slot_channelAdded ( DtChannelManager mgr,
DtChannel channel 
) [protected, virtual]

slot to be called when a new channel is added

virtual void makVrv::DtOsgChannel::slot_channelDestroyed ( DtChannelManager mgr,
DtChannel channel 
) [protected, virtual]

slot to be called when a channel is removed

virtual void makVrv::DtOsgChannel::slot_windowConfigurationModified ( const std::string &  deName,
const std::string &  oldWindowName,
const DtWindowConfiguration config 
) [protected, virtual]

slot to be called when the window configuration changes.

receive signals from the shared state about coordinate system changes

virtual void makVrv::DtOsgChannel::throttleDatabasePager ( DtChannelManager mgr,
DtChannel channel 
) [protected, virtual]

slot to be called when a channel is added or removed.

Forces the database pager to limit the number of PagedLOD's so that the application is limited.


Member Data Documentation

osg::ref_ptr<osgViewer::View> makVrv::DtOsgChannel::myView [protected]
osg::ref_ptr<osg::Camera> makVrv::DtOsgChannel::my2DCamera [protected]
osg::ref_ptr<osg::Camera> makVrv::DtOsgChannel::myNormalized2DCamera [protected]

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

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)