VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Member Functions | Friends
makVrv::DtOsgChannel Class Reference

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

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

Public Member Functions

virtual ~DtOsgChannel ()
 
virtual void setSensorName (const std::string &sensorName)
 
virtual void setClearColor (float r, float g, float b, float a)
 
virtual void setWindow (DtWindow *view)
 
virtual const DtWindowwindow () const
 
virtual void setViewport (int x, int y, int width, int height)
 
virtual void clearFrameBufferIfChanged ()
 
virtual void getViewport (int &x, int &y, int &width, int &height) const
 
virtual void setCameraPosition (double x, double y, double z)
 
virtual void setCameraOrientation (double psi, double theta, double phi)
 
virtual void setCameraPositionAndOrientation (double x, double y, double z, double psi, double theta, double phi)
 
virtual void setCameraPositionAndOrientation (osg::Vec3d &pos, osg::Quat &orient)
 
virtual void getCameraPositionAndOrientation (osg::Vec3d &position, osg::Quat &rotation) const
 
virtual void setChannelEnabled (bool enabled, bool partial) override
 
virtual bool channelEnabled () const
 
virtual void stopUsingModelSet (DtModelSetId modelSet)
 
virtual void startUsingModelSet (DtModelSetId modelSet)
 
virtual void update ()
 
virtual void connectToObserver ()
 
virtual osgViewer::View & view ()
 
virtual DtCameraNodesceneCamera ()
 
virtual const DtCameraNodesceneCamera () const
 
virtual DtCameraNoderttCamera () const
 
virtual DtCameraNodeactiveMainCamera ()
 
virtual const DtCameraNodeactiveMainCamera () const
 
virtual DtCameraNodeoverlayCamera ()
 
virtual DtCameraNodenormalizedOverlayCamera ()
 
virtual void setRenderToTexture (bool enabled)
 
virtual void setRenderToTextureFormat (int format, int sourceFormat, int sourceType)
 
virtual osg::ref_ptr
< osg::Texture > 
allocateRenderTexture (int width, int height) const
 
virtual osg::ref_ptr
< osg::Texture > 
getRenderTexture ()
 
virtual osg::ref_ptr
< osg::Texture > 
getOcculsionTexture ()
 
virtual osg::ref_ptr
< osg::Texture > 
getDepthTexture () const
 
virtual void setDepthTextureUsesStencilBuffer (bool useStencil)
 
virtual bool depthTextureUsesStencilBuffer () const
 
virtual void setEnablePostProcessors (bool enable)
 
virtual bool getEnablePostProcessors ()
 
virtual bool useOldChannelOffsetCalcuation () const
 
virtual void setUseOldChannelOffsetCalcuation (bool enable)
 
virtual bool forceHdrLuminanceOverride ()
 
virtual void setForceHdrLuminanceOverride (bool force)
 
virtual void clearStateGraph (void)
 
virtual void setEnableHdrPassthrough (bool flag)
 
virtual bool enableHdrPassthrough ()
 
virtual void setHdrOutputScale (float scale)
 
virtual float hdrOutputScale ()
 
virtual void screenCapture ()
 
virtual void setOcclusionTextureEnabled (bool enabled)
 
virtual void initOcclusionTexture ()
 
virtual void updateCameraFrustumPlanes (std::vector< DtVector4< double > > &planes)
 
virtual void updateAcquisitionBoxFrustumPlanes (const int &boxCenterX, const int &boxCenterY, const int &boxWidth, const int &boxHeight, std::vector< DtVector4< double > > &planes)
 
virtual void setChannelSensor (DtOsgChannelSensor *extension)
 
virtual DtOsgChannelSensorfindChannelSensor ()
 
virtual void releaseResources (osg::State *gcState)
 
virtual void updateShowTracksUniform (bool value)
 
virtual std::vector< DtElementIDentitiesInFrustum () override
 
- Public Member Functions inherited from makVrv::DtChannel
virtual ~DtChannel ()
 
DtObserverObjectfindObserver () const
 
DtModelSetId currentModelSet () const
 
const DtChannelConfigurationconfiguration () const
 
virtual void setObserverName (const std::string &observerName)
 
virtual
DtChannelConfiguration::ProjectionResizePolicy 
projectionResizePolicy () const
 
std::string & observerName ()
 

Protected Types

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

Protected Member Functions

 DtOsgChannel (DtDe &de, DtOsgWindow *window, DtChannelConfiguration &config)
 
virtual void makeObserverToCameraMatrix (osg::Vec3d &orient, osg::Matrixd &offsetObserverToCamera, osg::Matrixd &observerToCamera)
 
virtual void makeObserverToCameraMatrix (osg::Quat &qObserverToWorld, osg::Matrixd &offsetObserverToCamera, osg::Matrixd &observerToCamera)
 
virtual double calculateEffectiveViewMagnification (double currentLeft, double currentRight, double currentTop, double currentBottom, double zNear) const
 
virtual void calculateNearFar (double &zNear, double &zFar)
 
virtual bool useAttachedForNearClip (double alt)
 
virtual double calculateNearClip (double alt, double zFar)
 
virtual double calculateFarClip (double alt)
 
virtual double calculateNearClipMagClamp (double zNear, double zFar, float magLevel=2.)
 
virtual void projectFor3D ()
 
virtual void projectFor2D ()
 
virtual void connectRttCameraToScene ()
 
virtual void slot_visualizerRootAdded (DtModelSetId modelSet, int visualType)
 
virtual void slot_shadowsRemoved ()
 
virtual void slot_observerModelSetChanged (DtObserverObject *observer, DtModelSetId modelSet)
 
virtual void slot_observerSettingChanged (DtObserverObject *observer, int setting, bool value)
 
virtual void slot_observerSettingRemoved (DtObserverObject *observer, int setting)
 
virtual void slot_observerLodCenterSettingsChanged (DtObserverObject *observer, const DtObserverObject::DtLodCenterSettings &settings)
 
virtual void slot_observerColorControlChanged (DtObserverObject *observer)
 
virtual void slot_projectionChanged (DtObserverObject *observer, bool is2D)
 
virtual void slot_windowConfigurationModified (const std::string &deName, const std::string &oldWindowName, const DtWindowConfiguration &config)
 
virtual void slot_channelConfigurationModified (const std::string &deName, const std::string &windowName, const std::string &oldChannelName, const DtChannelConfiguration &channelConfig)
 
virtual void slot_onCoordinateSystemChanged ()
 
virtual void slot_paperMapEnabledChanged (bool setting)
 
virtual void observerRemoved (const std::string &observerName)
 
virtual void updateMultiSampleOverrideSetting ()
 
virtual void getRenderTextureAttachmentInfo (unsigned int &level, unsigned int &face, unsigned int &sampleBuffers, unsigned int &samples)
 
virtual void initializeRenderTextureColor ()
 
virtual void initializeRenderTextureDepth ()
 
virtual void initializeRttCameraDepth ()
 
virtual void changedRttCameraFbo ()
 
virtual void enableLighting (osg::ref_ptr< osg::Camera > camera, bool enable)
 
virtual void calculateAndSetFocusPointDistance (double zNear, double zFar, double frustumLodRatio)
 
osgViewer::CompositeViewer * getOrCreateViewer ()
 
virtual void flipHorizontal (bool flip)
 
bool anyPointInFrustum (const std::vector< DtVector4< double >> &camPlanes, const std::vector< DtVector > &points) const
 
Initialization functions
virtual bool initialize ()
 
Create and initialize cameras
virtual void initializeNormalized2DCamera ()
 
virtual void initialize2DCamera (int w, int h)
 
virtual void initializeSceneCamera ()
 
virtual void initializeRenderTexture ()
 
virtual void initializeRTTCamera ()
 
virtual void clearRttCamera ()
 
virtual void recreateRTTCamera ()
 
Enables shadow casting for the channel object
virtual void setShadowState (bool enable)
 
virtual void addOverlayDrawablesToCameras ()
 
virtual void initializeSignalConnections ()
 
- Protected Member Functions inherited from makVrv::DtChannel
 DtChannel (DtDe &de, DtChannelConfiguration &)
 
virtual void observerAdded (const std::string &observerName)
 

Protected Attributes

osg::ref_ptr< osgViewer::View > myView
 
DtOsgWindowmyOsgWindow
 
DtOsgObserverObjectmyOsgObserverObject
 
int myRenderTextureFormat
 
int myRenderTextureSourceFormat
 
int myRenderTextureSourceType
 
bool myRenderTextureFormatDirty
 
bool mySensorInitialized
 
bool myChannelEnabled
 
osg::ref_ptr< osg::Group > myRoot
 
osg::ref_ptr< DtCameraNodemySceneCamera
 
osg::ref_ptr< DtCameraNodemy2DCamera
 
osg::ref_ptr< DtCameraNodemyNormalized2DCamera
 
osg::ref_ptr< osg::Texture > myRenderTexture
 
osg::ref_ptr< osg::Texture > myDepthTexture
 
osg::ref_ptr< osg::Texture > myOcclusionTexture
 
bool myDepthTextureUsesStencilBuffer
 
osg::ref_ptr< DtCameraNodemyRTTCamera
 
bool myIsUsingTrackballManipulator
 
bool myCoordinateSystemChanged
 
bool myRenderToTextureFlag
 
bool myShadowState
 
PostProcessorEffectList myPostProcessorEffects
 
osg::Node::NodeMask myOldSceneCameraNodeMask
 
osg::Node::NodeMask myOldRTTCameraNodeMask
 
DtLightmyFlashlight
 
bool myEnablePostProcessors
 
bool myUseOldChannelOffsetCalcuation
 
osg::ref_ptr
< osg::DatabaseRequestHandlerCallback > 
myDatabasePagerCallback
 
bool myEnableHdrPassthrough
 
bool myForceHdrLuminanceOverride
 
float myHdrOutputScale
 
bool myFrameBufferNeedsClear
 
bool myLastMirrorMode
 
double myPreviousClampedNearClipDistance
 
double myLastEffectiveViewMagnification
 
int myLastNumMultiSamplesOverride
 
std::vector< osg::Vec3d > myFocusPoints
 
std::bitset< 7 > myIncludedFocusPoints
 
int myLastFocusPointAttempted
 
DtOsgChannelSensormyChannelSensor
 
bool myShowTracksEnabled
 
DtIntersectorsContainermyIntersectors = nullptr
 
DtOsgEmptySceneLogomyEmptySceneLogo
 
- Protected Attributes inherited from makVrv::DtChannel
DtDemyDe
 
DtChannelConfigurationmyChannelConfiguration
 
DtSignalConnectionManager myConnections
 
DtModelSetId myModelSet
 
DtObserverObjectmyObserver
 
std::string myObserverName
 
DtChannelConfiguration::ProjectionResizePolicy myProjectionResizePolicy
 

Static Protected Attributes

static int theRunningCameraId
 

Private Member Functions

 DtOsgChannel ()
 
 DtOsgChannel (const DtOsgChannel &)
 
DtOsgChanneloperator= (const DtOsgChannel &)
 

Friends

class DtOsgChannelCreator
 

Gets the shadow quality for the channel object

typedef std::list< std::string > PostProcessorEffectList
 
boost::signalslib::signal
< void(int, int, int, int)> 
signal_viewportChanged
 
virtual int shadowQuality () const
 
virtual double lastEffectiveViewMagnification () const override
 
virtual std::vector< const
osg::Camera * > 
getShadowableCameras () const
 
virtual void setProjectionResizePolicy (DtChannelConfiguration::ProjectionResizePolicy policy)
 
virtual void updateProjection ()
 
virtual void projectionUnitsToFrustum (DtChannelConfiguration::ProjectionUnits units, double &left, double zNear, double &right, double &top, double &bottom) const
 
virtual void projectionUnitsToFrustumWithZoomAdjustment (DtChannelConfiguration::ProjectionUnits units, double &left, double zNear, double &right, double &top, double &bottom) const
 
virtual void connectChannelToScene ()
 
virtual bool processMouseEvent (const DtMouseEvent &ev)
 
virtual bool processKeyboardEvent (const DtKeyEvent &ev)
 
virtual void getWorldToWindowMatrix (osg::Matrix &worldToWindowMatrix) const
 
virtual void moveMouseToScreenLocation (float screenX, float screenY)
 
virtual void projectToScreen (double dbX, double dbY, double dbZ, double &screenX, double &screenY, double &screenZ) const override
 
virtual void projectToWorld (double screenX, double screenY, double &dbX, double &dbY, double &dbZ) const override
 
virtual DtIntersectorResult findWorldIntersection (double screenX, double screenY, DtIntersector::IntersectProperties properties=DtIntersector::AllNodes, std::vector< DtElementID > *ignoreList=0) override
 
virtual const std::string & name ()
 
virtual void addPostProcessEffect (const std::string &postProcessorEffect)
 
virtual void removePostProcessEffect (const std::string &postProcessorEffect)
 
virtual bool hasPostProcessEffect (const std::string &postProcessorEffect)
 
virtual void set3DCullVisitorParams (DtOsgCullVisitorParameters *params)
 
virtual void set2DCullVisitorParams (DtOsgCullVisitorParameters *params)
 

Member Typedef Documentation

typedef std::list<std::string> makVrv::DtOsgChannel::PostProcessorEffectList

Emitted when the channel's viewport changes dimensions.

Parameters are lower left x, y, width, and height, as in glViewport.

Constructor & Destructor Documentation

makVrv::DtOsgChannel::DtOsgChannel ( DtDe de,
DtOsgWindow window,
DtChannelConfiguration config 
)
protected

Called by Creator object.

Must call initialize() on an instance of this class before using it

virtual makVrv::DtOsgChannel::~DtOsgChannel ( )
virtual

DTOR.

makVrv::DtOsgChannel::DtOsgChannel ( )
private

Default Constructor not implemented.

makVrv::DtOsgChannel::DtOsgChannel ( const DtOsgChannel )
private

Copy Constructor not implemented - Copy not allowed.

Member Function Documentation

virtual bool makVrv::DtOsgChannel::initialize ( )
protectedvirtual

Initialize the channel.

Must call this on an instance of this class before using it. Returns false if initialization failed.

Reimplemented in makVrv::vrvScalableDisplay::DtScalableOsgChannel, makVrv::DtOculusChannel, makVrv::DtVirtualRealityChannel, and makVrv::DtExampleChannel.

virtual void makVrv::DtOsgChannel::initializeNormalized2DCamera ( )
protectedvirtual
virtual void makVrv::DtOsgChannel::initialize2DCamera ( int  w,
int  h 
)
protectedvirtual
virtual void makVrv::DtOsgChannel::initializeSceneCamera ( )
protectedvirtual
virtual void makVrv::DtOsgChannel::initializeRenderTexture ( )
protectedvirtual
virtual void makVrv::DtOsgChannel::initializeRTTCamera ( )
protectedvirtual
virtual void makVrv::DtOsgChannel::clearRttCamera ( )
protectedvirtual
virtual void makVrv::DtOsgChannel::recreateRTTCamera ( )
protectedvirtual
virtual void makVrv::DtOsgChannel::setShadowState ( bool  enable)
protectedvirtual

Add drawables to render overlays to their respective cameras.

virtual void makVrv::DtOsgChannel::addOverlayDrawablesToCameras ( )
protectedvirtual

Add drawables to render overlays to their respective cameras.

virtual void makVrv::DtOsgChannel::initializeSignalConnections ( )
protectedvirtual

Connect channel's slots to signals from other objects.

All signal connections are managed by the member signal connection manager and automatically disconnected when this object is deleted

Reimplemented in makVrv::DtVirtualRealityChannel.

virtual void makVrv::DtOsgChannel::setSensorName ( const std::string &  sensorName)
virtual

Set the name of the sensor to use.

The special name defined by DtChannelManager::UseObserverSensor causes the channel to use the sensor specified by its observer

Implements makVrv::DtChannel.

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.

Reimplemented in makVrv::DtVirtualRealityChannel.

virtual void makVrv::DtOsgChannel::clearFrameBufferIfChanged ( )
virtual

If something that would mess with the area of the frame buffer outside the current channel needs to be cleaned up then this fucntion will clear the framebuffer. This happens when the viewport changes sizes.

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::setChannelEnabled ( bool  enabled,
bool  partial 
)
overridevirtual

Enable/Disable the channel. When a channel is disabled, it no longer renders or receives key/mouse events - unless partial is set to true. In that case, the channel osgViewer::View will not be removed from the compositeViewer (or added back on enable) which will cause it to receives key/mouse events. The reason for this option is that if you disable then re-enable a channel, needing to add the channel's View back into the compositeViewer, this may result in a significant stall (seconds). In the case of something like an IG use where there are no mouse or keyboard events involved, there is no need to pay this penalty; in that case, set partial to false when enabling and disabling.

Implements makVrv::DtChannel.

virtual bool makVrv::DtOsgChannel::channelEnabled ( ) const
virtual

Enable/Disable the channel. When a channel is disabled, it no longer renders or receives key/mouse events.

Implements makVrv::DtChannel.

virtual void makVrv::DtOsgChannel::stopUsingModelSet ( DtModelSetId  modelSet)
virtual

Stop rendering the specified model set on this channel. This differs from setChannelEnabled in that rendering can still happen in the channel if visuals are not part part of the model set rendering system. Examples of visuals that are rendered outside of the model set rendering system include the dynamic sky.

virtual void makVrv::DtOsgChannel::startUsingModelSet ( DtModelSetId  modelSet)
virtual

Start rendering the specified model set on this channel. This differs from setChannelEnabled in that rendering can still happen in the channel if visuals are not part part of the model set rendering system. Examples of visuals that are rendered outside of the model set rendering system include the dynamic sky.

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

Update a channel.

Implements makVrv::DtChannel.

Reimplemented in makVrv::DtOculusChannel.

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

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

Implements makVrv::DtChannel.

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

Window accessor.

virtual DtCameraNode* makVrv::DtOsgChannel::sceneCamera ( )
virtual

Accessor for the 3D camera.

virtual const DtCameraNode* makVrv::DtOsgChannel::sceneCamera ( ) const
virtual

Accessor for the 3D camera.

virtual DtCameraNode* makVrv::DtOsgChannel::rttCamera ( ) const
virtual

Accessor for RTT camera.

virtual DtCameraNode* makVrv::DtOsgChannel::activeMainCamera ( )
virtual

Accessor for which ever camera is currently the main render camera.

virtual const DtCameraNode* makVrv::DtOsgChannel::activeMainCamera ( ) const
virtual

Accessor for which ever camera is currently the main render camera.

virtual DtCameraNode* makVrv::DtOsgChannel::overlayCamera ( )
virtual

Accessor for the 2D overlay camera.

virtual DtCameraNode* makVrv::DtOsgChannel::normalizedOverlayCamera ( )
virtual

Accessor for the normalized 2D overlay camera.

virtual void makVrv::DtOsgChannel::setRenderToTexture ( bool  enabled)
virtual

Toggles whether this channel renders the scene to a texture.

Reimplemented in makVrv::DtVirtualRealityChannel.

virtual void makVrv::DtOsgChannel::setRenderToTextureFormat ( int  format,
int  sourceFormat,
int  sourceType 
)
virtual

sets the render to texture format for the rttCamera, this was separated from the setRenderToTexture format function so that the SensorFX module could use HDR rendere to texture

virtual osg::ref_ptr<osg::Texture> makVrv::DtOsgChannel::allocateRenderTexture ( int  width,
int  height 
) const
virtual

Allocate a new texture and set its size, allows custom channel (DtVirtualRealityChannel) to override.

Reimplemented in makVrv::DtVirtualRealityChannel.

virtual osg::ref_ptr<osg::Texture> makVrv::DtOsgChannel::getRenderTexture ( )
virtual

Gets the texture the scene was rendered to, if setRenderToTexture was enabled.

virtual osg::ref_ptr<osg::Texture> makVrv::DtOsgChannel::getOcculsionTexture ( )
virtual
virtual osg::ref_ptr<osg::Texture> makVrv::DtOsgChannel::getDepthTexture ( ) const
virtual

Returns the depth texture for this channel.

virtual void makVrv::DtOsgChannel::setDepthTextureUsesStencilBuffer ( bool  useStencil)
virtual

Set the depth texture in RTT mode to use a stencil buffer.

virtual bool makVrv::DtOsgChannel::depthTextureUsesStencilBuffer ( ) const
virtual

Return if the depth texture should be using stencil buffer.

virtual int makVrv::DtOsgChannel::shadowQuality ( ) const
virtual

Emitted when the channel's viewport changes dimensions.

Parameters are lower left x, y, width, and height, as in glViewport.

virtual double makVrv::DtOsgChannel::lastEffectiveViewMagnification ( ) const
overridevirtual

Returns the last effective view magnification.

See Also
DtOsgChannel::calculateEffectiveViewMagnification

Implements makVrv::DtChannel.

virtual std::vector<const osg::Camera*> makVrv::DtOsgChannel::getShadowableCameras ( ) const
virtual

Used by DtOsgShadowTechnique::setChannelShadowState to determine which cameras should have shadows. Returns the scene camera and RTT camera by default; if other cameras are added this should be overridden to add to the list.

Reimplemented in makVrv::DtOculusChannel.

virtual void makVrv::DtOsgChannel::setProjectionResizePolicy ( DtChannelConfiguration::ProjectionResizePolicy  policy)
virtual

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.

Reimplemented in makVrv::DtVirtualRealityChannel, makVrv::DtOculusChannel, and makVrv::vrvScalableDisplay::DtScalableOsgChannel.

virtual void makVrv::DtOsgChannel::projectionUnitsToFrustum ( DtChannelConfiguration::ProjectionUnits  units,
double left,
double  zNear,
double right,
double top,
double bottom 
) const
virtual

Emitted when the channel's viewport changes dimensions.

Parameters are lower left x, y, width, and height, as in glViewport.

virtual void makVrv::DtOsgChannel::projectionUnitsToFrustumWithZoomAdjustment ( DtChannelConfiguration::ProjectionUnits  units,
double left,
double  zNear,
double right,
double top,
double bottom 
) const
virtual

Emitted when the channel's viewport changes dimensions.

Parameters are lower left x, y, width, and height, as in glViewport.

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.

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

Get the channel's dynamic overlay if any.

Get the camera's world to window matrix

virtual void makVrv::DtOsgChannel::moveMouseToScreenLocation ( float  screenX,
float  screenY 
)
virtual

Move the mouse pointer to the specified location in screen coordinates.

Implements makVrv::DtChannel.

virtual void makVrv::DtOsgChannel::projectToScreen ( double  dbX,
double  dbY,
double  dbZ,
double screenX,
double screenY,
double screenZ 
) const
overridevirtual

Project a point from world coordinates to screen coordinates.

Returns screen coordinates in screenX, screenY, screenZ

Implements makVrv::DtChannel.

virtual void makVrv::DtOsgChannel::projectToWorld ( double  screenX,
double  screenY,
double dbX,
double dbY,
double dbZ 
) const
overridevirtual

project the local world coordinates given screen coordinates

Implements makVrv::DtChannel.

virtual DtIntersectorResult makVrv::DtOsgChannel::findWorldIntersection ( double  screenX,
double  screenY,
DtIntersector::IntersectProperties  properties = DtIntersector::AllNodes,
std::vector< DtElementID > *  ignoreList = 0 
)
overridevirtual

Perform world intersection using non-normalized screen coordinates, in pixels.

Parameters
screenXThe X-component of the channel screen pixel coordinates.
screenYThe Y-component of the channel screen pixel coordinates.
propertiesThe properties which dictate which kind of nodes can be intersected, default is all node types.
ignoreListA list of element IDs which are associated with scene visuals that are not to be included in the intersection result even if those scene visuals were intersected.

Implements makVrv::DtChannel.

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

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

virtual void makVrv::DtOsgChannel::addPostProcessEffect ( const std::string &  postProcessorEffect)
virtual

Add post processor effect names to be enabled during the DtOsgChannel update function The order of the effects is set in the DtPostProcessorFactory.

Reimplemented in makVrv::DtVirtualRealityChannel.

virtual void makVrv::DtOsgChannel::removePostProcessEffect ( const std::string &  postProcessorEffect)
virtual

Remove post processor effect names to be enabled during the DtOsgChannel update function The order of the effects is set in the DtPostProcessorFactory.

virtual bool makVrv::DtOsgChannel::hasPostProcessEffect ( const std::string &  postProcessorEffect)
virtual

Returns true if postProcessorEffect has been added to the channel.

virtual void makVrv::DtOsgChannel::set3DCullVisitorParams ( DtOsgCullVisitorParameters params)
virtual

Emitted when the channel's viewport changes dimensions.

Parameters are lower left x, y, width, and height, as in glViewport.

virtual void makVrv::DtOsgChannel::set2DCullVisitorParams ( DtOsgCullVisitorParameters params)
virtual

Emitted when the channel's viewport changes dimensions.

Parameters are lower left x, y, width, and height, as in glViewport.

virtual void makVrv::DtOsgChannel::setEnablePostProcessors ( bool  enable)
virtual
virtual bool makVrv::DtOsgChannel::getEnablePostProcessors ( )
virtual
virtual bool makVrv::DtOsgChannel::useOldChannelOffsetCalcuation ( ) const
virtual
virtual void makVrv::DtOsgChannel::setUseOldChannelOffsetCalcuation ( bool  enable)
virtual
virtual bool makVrv::DtOsgChannel::forceHdrLuminanceOverride ( )
virtual

should the HDR post processor force the luminance scalar to 1.0 for this channel used for when the sky is turned off (XR mode)

virtual void makVrv::DtOsgChannel::setForceHdrLuminanceOverride ( bool  force)
virtual
virtual void makVrv::DtOsgChannel::clearStateGraph ( void  )
virtual

osg maintains an internal cache of StateSets in a StateGraph

virtual void makVrv::DtOsgChannel::setEnableHdrPassthrough ( bool  flag)
virtual

getter/setter for the whether the HDR post processor

virtual bool makVrv::DtOsgChannel::enableHdrPassthrough ( )
virtual
virtual void makVrv::DtOsgChannel::setHdrOutputScale ( float  scale)
virtual

set the hdr output scale to use with this channel it does not necessarily match the shared state when correlation is turned off

virtual float makVrv::DtOsgChannel::hdrOutputScale ( )
virtual

get the hdr output scale to use with this channel it does not necessarily match the shared state when correlation is turned off

virtual void makVrv::DtOsgChannel::screenCapture ( )
virtual

Takes Screen capture of the current channel.

Implements makVrv::DtChannel.

virtual void makVrv::DtOsgChannel::setOcclusionTextureEnabled ( bool  enabled)
virtual

enable or disable the creation of an occlusion texture, used for some screen space effects

virtual void makVrv::DtOsgChannel::initOcclusionTexture ( )
virtual

init occlusion texture, used for some screen space effects

virtual void makVrv::DtOsgChannel::updateCameraFrustumPlanes ( std::vector< DtVector4< double > > &  planes)
virtual

Get the Frustum planes for this channel.

Implements makVrv::DtChannel.

virtual void makVrv::DtOsgChannel::updateAcquisitionBoxFrustumPlanes ( const int boxCenterX,
const int boxCenterY,
const int boxWidth,
const int boxHeight,
std::vector< DtVector4< double > > &  planes 
)
virtual

Set the frustum planes for a subset of this channel Scales the channels projection values based on the box's values that are passed in.

Implements makVrv::DtChannel.

virtual void makVrv::DtOsgChannel::setChannelSensor ( DtOsgChannelSensor extension)
virtual

Set an extension.

virtual DtOsgChannelSensor* makVrv::DtOsgChannel::findChannelSensor ( )
inlinevirtual
virtual void makVrv::DtOsgChannel::releaseResources ( osg::State *  gcState)
virtual

called by the window manager when the last window is about to be destroyed in order to give the channel a chance to release it's resources before the final flush.

virtual void makVrv::DtOsgChannel::updateShowTracksUniform ( bool  value)
virtual

update the scene and rtt camera uniforms for the show tracks observer mode setting. This is used by the persistent tracks shader to hide/show the tracks.

virtual std::vector<DtElementID> makVrv::DtOsgChannel::entitiesInFrustum ( )
overridevirtual

Get a list of the entities within the frustum NOTE: This includes entities occluded by buildings, hills, etc. NOTE: You can use myDe.dataBank().elementData().attributeManager(). getElementDisplayName(entityId, name) to get the display names NOTE: You can use myDe.dataBank().elementData().findSceneObjectFromElementId(elementId); to get the DtSceneObject.

Implements makVrv::DtChannel.

virtual void makVrv::DtOsgChannel::makeObserverToCameraMatrix ( osg::Vec3d &  orient,
osg::Matrixd &  offsetObserverToCamera,
osg::Matrixd &  observerToCamera 
)
protectedvirtual
virtual void makVrv::DtOsgChannel::makeObserverToCameraMatrix ( osg::Quat &  qObserverToWorld,
osg::Matrixd &  offsetObserverToCamera,
osg::Matrixd &  observerToCamera 
)
protectedvirtual
virtual double makVrv::DtOsgChannel::calculateEffectiveViewMagnification ( double  currentLeft,
double  currentRight,
double  currentTop,
double  currentBottom,
double  zNear 
) const
protectedvirtual

The effective zoom calculation is: [effective zoom] = [user-provided view magnification] * [FOV Difference Ratio] where FOV Difference Ratio is a ratio measures how different the current FOV is from the default FOV. The range of this ratio is 1 and greater. If the current FOV is the same as the default FOV, this ratio is 1. If the current FOV is smaller than the default FOV, this ratio is greater than 1. The FOV Difference Ratio represents how much optical zoom a user is performing.

virtual void makVrv::DtOsgChannel::calculateNearFar ( double zNear,
double zFar 
)
protectedvirtual

Calculates near/far depending on visual mode.

virtual bool makVrv::DtOsgChannel::useAttachedForNearClip ( double  alt)
protectedvirtual

When using dynamic clipping plane calculations, determine if channel's view is attached to an entity and that entity should be taken into consideration.

virtual double makVrv::DtOsgChannel::calculateNearClip ( double  alt,
double  zFar 
)
protectedvirtual

Calculate the dynamic near clipping plane.

virtual double makVrv::DtOsgChannel::calculateFarClip ( double  alt)
protectedvirtual

Calculate the dynamic far clipping plane.

virtual double makVrv::DtOsgChannel::calculateNearClipMagClamp ( double  zNear,
double  zFar,
float  magLevel = 2. 
)
protectedvirtual

When the NEAR_FAR_DYNAMIC_CLAMP_NEAR_CLIP policy is enabled, this is called with the calculated near and far dynamic clipping planes. It returns the new (possibly clamped) near clipping plane. If the current view magnification is less than magLevel, then zNear is returned unchanged.

virtual void makVrv::DtOsgChannel::projectFor3D ( )
protectedvirtual

Projects frustum matrix for 3D viewing.

Reimplemented in makVrv::DtVirtualRealityChannel, and makVrv::DtOculusChannel.

virtual void makVrv::DtOsgChannel::projectFor2D ( )
protectedvirtual

Projects ortho matrix for 2D viewing.

Reimplemented in makVrv::DtVirtualRealityChannel.

virtual void makVrv::DtOsgChannel::connectRttCameraToScene ( )
protectedvirtual

This method is called by initializeRTTCamera and connectChannelToScene to handle the scene setup (including the overlay cameras) for the rtt camera.

virtual void makVrv::DtOsgChannel::slot_visualizerRootAdded ( DtModelSetId  modelSet,
int  visualType 
)
protectedvirtual

called by signal when a new visualizer root is added

virtual void makVrv::DtOsgChannel::slot_shadowsRemoved ( )
protectedvirtual

Called by signal when the renderer removes all shadows.

virtual void makVrv::DtOsgChannel::slot_observerModelSetChanged ( DtObserverObject observer,
DtModelSetId  modelSet 
)
protectedvirtual

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

virtual void makVrv::DtOsgChannel::slot_observerSettingChanged ( DtObserverObject observer,
int  setting,
bool  value 
)
protectedvirtual

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

virtual void makVrv::DtOsgChannel::slot_observerSettingRemoved ( DtObserverObject observer,
int  setting 
)
protectedvirtual

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

virtual void makVrv::DtOsgChannel::slot_observerLodCenterSettingsChanged ( DtObserverObject observer,
const DtObserverObject::DtLodCenterSettings settings 
)
protectedvirtual

Called by signal when an observer's lod center settings have changed.

virtual void makVrv::DtOsgChannel::slot_observerColorControlChanged ( DtObserverObject observer)
protectedvirtual

Receives signals from the observer object state when the color control settings change.

virtual void makVrv::DtOsgChannel::slot_projectionChanged ( DtObserverObject observer,
bool  is2D 
)
protectedvirtual

Called by signal when an observer's projection (3D/2D) changes.

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

slot to be called when the window configuration changes.

Reimplemented in makVrv::DtVirtualRealityChannel.

virtual void makVrv::DtOsgChannel::slot_channelConfigurationModified ( const std::string &  deName,
const std::string &  windowName,
const std::string &  oldChannelName,
const DtChannelConfiguration channelConfig 
)
protectedvirtual

slot to be called when the channel configuration changes.

virtual void makVrv::DtOsgChannel::slot_onCoordinateSystemChanged ( )
protectedvirtual

receive signals from the shared state about coordinate system changes

virtual void makVrv::DtOsgChannel::slot_paperMapEnabledChanged ( bool  setting)
protectedvirtual

Receives signals from the shared state about paper map feature changes (i.e. osgEarth mask layer feature being enabled or disabled)

virtual void makVrv::DtOsgChannel::observerRemoved ( const std::string &  observerName)
protectedvirtual

connects to signal_observerRemoved so the channel can update it's observer when the observer is removed.

Reimplemented from makVrv::DtChannel.

virtual void makVrv::DtOsgChannel::updateMultiSampleOverrideSetting ( )
protectedvirtual

helper function for getting the imgui setting for the multi sample override

virtual void makVrv::DtOsgChannel::getRenderTextureAttachmentInfo ( unsigned int level,
unsigned int face,
unsigned int sampleBuffers,
unsigned int samples 
)
protectedvirtual

Get the rtt camera attachment values, allows custom channels (DtVirtualRealityChannel) to override.

Reimplemented in makVrv::DtVirtualRealityChannel.

virtual void makVrv::DtOsgChannel::initializeRenderTextureColor ( )
protectedvirtual

Create and initialize render texture color buffer.

virtual void makVrv::DtOsgChannel::initializeRenderTextureDepth ( )
protectedvirtual

Create and initialize render texture depth buffer.

virtual void makVrv::DtOsgChannel::initializeRttCameraDepth ( )
protectedvirtual

Initialize the depth settings for the RTT camera.

virtual void makVrv::DtOsgChannel::changedRttCameraFbo ( )
protectedvirtual

Called after changes to the RTT camera FBO setting.

virtual void makVrv::DtOsgChannel::enableLighting ( osg::ref_ptr< osg::Camera >  camera,
bool  enable 
)
protectedvirtual
virtual void makVrv::DtOsgChannel::calculateAndSetFocusPointDistance ( double  zNear,
double  zFar,
double  frustumLodRatio 
)
protectedvirtual

Calculate the focus point if the lod scale center is enabled and the zoom magnification is higher than the limit.

osgViewer::CompositeViewer* makVrv::DtOsgChannel::getOrCreateViewer ( )
protected

Returns the CompositeViewer for the channel. The function can return NULL and will create a CompositeViewer, if needed.

virtual void makVrv::DtOsgChannel::flipHorizontal ( bool  flip)
protectedvirtual

Flip the channel horizontally (ex. to help make a rear view mirror)

bool makVrv::DtOsgChannel::anyPointInFrustum ( const std::vector< DtVector4< double >> &  camPlanes,
const std::vector< DtVector > &  points 
) const
protected

Test if a set of points is within the viewing frustum Used for the entitiesInFrustum function.

DtOsgChannel& makVrv::DtOsgChannel::operator= ( const DtOsgChannel )
private

Assignment Operator not implemented - Copy not allowed.

Friends And Related Function Documentation

friend class DtOsgChannelCreator
friend

Member Data Documentation

boost::signalslib::signal<void(int, int, int, int)> makVrv::DtOsgChannel::signal_viewportChanged

Emitted when the channel's viewport changes dimensions.

Parameters are lower left x, y, width, and height, as in glViewport.

osg::ref_ptr<osgViewer::View> makVrv::DtOsgChannel::myView
protected
DtOsgWindow* makVrv::DtOsgChannel::myOsgWindow
protected
DtOsgObserverObject* makVrv::DtOsgChannel::myOsgObserverObject
protected
int makVrv::DtOsgChannel::myRenderTextureFormat
protected
int makVrv::DtOsgChannel::myRenderTextureSourceFormat
protected
int makVrv::DtOsgChannel::myRenderTextureSourceType
protected
bool makVrv::DtOsgChannel::myRenderTextureFormatDirty
protected
bool makVrv::DtOsgChannel::mySensorInitialized
protected
bool makVrv::DtOsgChannel::myChannelEnabled
protected
osg::ref_ptr<osg::Group> makVrv::DtOsgChannel::myRoot
protected
osg::ref_ptr<DtCameraNode> makVrv::DtOsgChannel::mySceneCamera
protected
osg::ref_ptr<DtCameraNode> makVrv::DtOsgChannel::my2DCamera
protected
osg::ref_ptr<DtCameraNode> makVrv::DtOsgChannel::myNormalized2DCamera
protected
osg::ref_ptr<osg::Texture> makVrv::DtOsgChannel::myRenderTexture
protected

The textures the 3D scene renders into when post processing is on.

osg::ref_ptr<osg::Texture> makVrv::DtOsgChannel::myDepthTexture
protected
osg::ref_ptr<osg::Texture> makVrv::DtOsgChannel::myOcclusionTexture
protected
bool makVrv::DtOsgChannel::myDepthTextureUsesStencilBuffer
protected
osg::ref_ptr<DtCameraNode> makVrv::DtOsgChannel::myRTTCamera
protected

Slave camera configured to render to myRenderTexture.

bool makVrv::DtOsgChannel::myIsUsingTrackballManipulator
protected
bool makVrv::DtOsgChannel::myCoordinateSystemChanged
protected
bool makVrv::DtOsgChannel::myRenderToTextureFlag
protected
bool makVrv::DtOsgChannel::myShadowState
protected
PostProcessorEffectList makVrv::DtOsgChannel::myPostProcessorEffects
protected
osg::Node::NodeMask makVrv::DtOsgChannel::myOldSceneCameraNodeMask
protected
osg::Node::NodeMask makVrv::DtOsgChannel::myOldRTTCameraNodeMask
protected
DtLight* makVrv::DtOsgChannel::myFlashlight
protected
bool makVrv::DtOsgChannel::myEnablePostProcessors
protected
bool makVrv::DtOsgChannel::myUseOldChannelOffsetCalcuation
protected
osg::ref_ptr<osg::DatabaseRequestHandlerCallback> makVrv::DtOsgChannel::myDatabasePagerCallback
protected
bool makVrv::DtOsgChannel::myEnableHdrPassthrough
protected
bool makVrv::DtOsgChannel::myForceHdrLuminanceOverride
protected
float makVrv::DtOsgChannel::myHdrOutputScale
protected
bool makVrv::DtOsgChannel::myFrameBufferNeedsClear
protected
bool makVrv::DtOsgChannel::myLastMirrorMode
protected
double makVrv::DtOsgChannel::myPreviousClampedNearClipDistance
protected
double makVrv::DtOsgChannel::myLastEffectiveViewMagnification
protected
int makVrv::DtOsgChannel::myLastNumMultiSamplesOverride
protected
std::vector<osg::Vec3d> makVrv::DtOsgChannel::myFocusPoints
protected
std::bitset<7> makVrv::DtOsgChannel::myIncludedFocusPoints
protected
int makVrv::DtOsgChannel::myLastFocusPointAttempted
protected
DtOsgChannelSensor* makVrv::DtOsgChannel::myChannelSensor
protected
bool makVrv::DtOsgChannel::myShowTracksEnabled
protected
DtIntersectorsContainer* makVrv::DtOsgChannel::myIntersectors = nullptr
protected
DtOsgEmptySceneLogo* makVrv::DtOsgChannel::myEmptySceneLogo
protected
int makVrv::DtOsgChannel::theRunningCameraId
staticprotected

This is used to give names to each camera created. This is appended to the camera name This is useful to differentiate cameras across different views.


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

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)