VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes | Private Types | Private Member Functions | Private Attributes
makVrv::DtWeatherLayerGroup Class Reference

A group node which serves as a root for weather layers. More...

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

Public Member Functions

 DtWeatherLayerGroup (DtDe &de)
 CTOR. More...
 
 DtWeatherLayerGroup (const DtWeatherLayerGroup &orig, const osg::CopyOp &opr)
 Copy constructor needed because it is derived from osg::Group. More...
 
virtual ~DtWeatherLayerGroup ()
 DTOR. More...
 
virtual osg::Object * clone (const osg::CopyOp &copyop) const
 required functions for derriving from osg::Group More...
 
virtual osg::Object * cloneType () const
 
virtual void releaseWeatherEffectGLObjects (osg::State *state) const
 Release all gl objects used by weather effect objects. More...
 
virtual void deleteGeode ()
 Tell the group to delete its specific children. More...
 
virtual osg::Node * getOrCreateSensorNode ()
 
virtual void removeLayer (DtUniqueID layerId)
 Remove a weather layer. More...
 
virtual void removeAllLayers ()
 Remove all the weather layers. More...
 
virtual void addLayer (DtWeatherLayer *layer)
 Adds a weather layer. More...
 
virtual DtWeatherLayergetLayer (DtUniqueID layerId)
 Gets a weather layer associated with the given ID. More...
 
virtual void setWind (float windDirectionRad, float windSpeedMps)
 Sets the current wind to use for weather layers. More...
 
virtual void setLayerIntensity (DtUniqueID layerId, float level)
 Sets the intensity level of a weather layer. More...
 
virtual void drawWeatherEffects (DtWeatherEffect::DrawData &drawData)
 Draw all weather effects. More...
 
virtual float timeStep () const
 Returns the last simulation timestep. More...
 

Protected Member Functions

void connectSignals ()
 Connects all the signals, non-virtural, called in the ctor. More...
 
void disconnectSignals ()
 Disconnects all the signals, non-virtural, called in the dtor. More...
 
virtual void slot_simulationUpdate ()
 Signal handler to run a simulation update. More...
 
virtual void traverse (osg::NodeVisitor &nv)
 Traverse. More...
 
virtual void cullUpdate (osg::Camera *cam)
 Update draw objects for current camera. More...
 
virtual void computeBasis (const osg::Vec3d &inGeocentricPos, osg::Matrixd &rotOut)
 Computes a basis rotation matrix for the given geocentric position. More...
 

Protected Attributes

DtDemyDe
 
osg::ref_ptr< osg::Geode > myEffectGeode
 
osg::ref_ptr
< makVrv::DtWeatherEffectDrawable
myEffectDrawable
 
std::vector< osg::Vec4d > myCullingPlanes
 
double myLastTime
 
float myTimeStep
 
float myWindDirectionRad
 
float myWindSpeedMps
 
DtJobSplittermyJobSplitter
 

Private Types

typedef std::map< DtUniqueID,
DtWeatherLayer * > 
WeatherLayerMap
 These are mutable because it's used as part of the const drawImplementation. More...
 

Private Member Functions

 DtWeatherLayerGroup (const DtWeatherLayerGroup &other)
 Copy Constructor not implemented - Copy not allowed. More...
 
DtWeatherLayerGroupoperator= (const DtWeatherLayerGroup &other)
 Assignment Operator not implemented - Assignment not allowed. More...
 

Private Attributes

WeatherLayerMap myMutableWeatherLayerMap
 

Detailed Description

A group node which serves as a root for weather layers.

This group node is the top level node in the scenegraph for weather layers. The node also serves as the main interface to create and modify weather layers. There is 1 geode under this node for drawing weather layer effects.

This class hooks into the simulation update which updates all active weather layer effects. Weather layer effects queue update jobs which are updated in parallel using a job splitter. There is also a post update for each weather layer for items that cannot use multithreading (currently intersection tests).

During scenegraph culling, this class calls cull methods on individual weather layers. If a weather layer effect is not culled, it submits a sort job to a job splitter and finally the queued sorting jobs are ran in parallel.

Member Typedef Documentation

These are mutable because it's used as part of the const drawImplementation.

This type defines a map with an id key to a weather layer.

Constructor & Destructor Documentation

makVrv::DtWeatherLayerGroup::DtWeatherLayerGroup ( DtDe de)

CTOR.

makVrv::DtWeatherLayerGroup::DtWeatherLayerGroup ( const DtWeatherLayerGroup orig,
const osg::CopyOp &  opr 
)

Copy constructor needed because it is derived from osg::Group.

virtual makVrv::DtWeatherLayerGroup::~DtWeatherLayerGroup ( )
virtual

DTOR.

makVrv::DtWeatherLayerGroup::DtWeatherLayerGroup ( const DtWeatherLayerGroup other)
private

Copy Constructor not implemented - Copy not allowed.

Member Function Documentation

DtWeatherLayerGroup& makVrv::DtWeatherLayerGroup::operator= ( const DtWeatherLayerGroup other)
private

Assignment Operator not implemented - Assignment not allowed.

virtual osg::Object* makVrv::DtWeatherLayerGroup::clone ( const osg::CopyOp &  copyop) const
inlinevirtual

required functions for derriving from osg::Group

virtual osg::Object* makVrv::DtWeatherLayerGroup::cloneType ( ) const
inlinevirtual
virtual void makVrv::DtWeatherLayerGroup::releaseWeatherEffectGLObjects ( osg::State *  state) const
virtual

Release all gl objects used by weather effect objects.

virtual void makVrv::DtWeatherLayerGroup::deleteGeode ( )
virtual

Tell the group to delete its specific children.

virtual osg::Node* makVrv::DtWeatherLayerGroup::getOrCreateSensorNode ( )
virtual
virtual void makVrv::DtWeatherLayerGroup::removeLayer ( DtUniqueID  layerId)
virtual

Remove a weather layer.

Parameters
layerIdThe layer ID associated with the layer to be removed.
virtual void makVrv::DtWeatherLayerGroup::removeAllLayers ( )
virtual

Remove all the weather layers.

virtual void makVrv::DtWeatherLayerGroup::addLayer ( DtWeatherLayer layer)
virtual

Adds a weather layer.

Once added, this object will own the layer.

Parameters
layerThe layer to add.
virtual DtWeatherLayer* makVrv::DtWeatherLayerGroup::getLayer ( DtUniqueID  layerId)
virtual

Gets a weather layer associated with the given ID.

Parameters
layerIdThe ID of a layer that was previously added using addLayer().
virtual void makVrv::DtWeatherLayerGroup::setWind ( float  windDirectionRad,
float  windSpeedMps 
)
virtual

Sets the current wind to use for weather layers.

Parameters
windDirectionRadThe wind direction in radians.
windSpeedMpsThe wind speed in meters per second.
virtual void makVrv::DtWeatherLayerGroup::setLayerIntensity ( DtUniqueID  layerId,
float  level 
)
virtual

Sets the intensity level of a weather layer.

Parameters
layerIdThe ID of a layer.
levelThe intensity level (0.0 - 1.0).
virtual void makVrv::DtWeatherLayerGroup::drawWeatherEffects ( DtWeatherEffect::DrawData drawData)
virtual

Draw all weather effects.

virtual float makVrv::DtWeatherLayerGroup::timeStep ( ) const
virtual

Returns the last simulation timestep.

void makVrv::DtWeatherLayerGroup::connectSignals ( )
protected

Connects all the signals, non-virtural, called in the ctor.

void makVrv::DtWeatherLayerGroup::disconnectSignals ( )
protected

Disconnects all the signals, non-virtural, called in the dtor.

virtual void makVrv::DtWeatherLayerGroup::slot_simulationUpdate ( )
protectedvirtual

Signal handler to run a simulation update.

virtual void makVrv::DtWeatherLayerGroup::traverse ( osg::NodeVisitor &  nv)
protectedvirtual

Traverse.

virtual void makVrv::DtWeatherLayerGroup::cullUpdate ( osg::Camera *  cam)
protectedvirtual

Update draw objects for current camera.

Parameters
camThe current camera.
virtual void makVrv::DtWeatherLayerGroup::computeBasis ( const osg::Vec3d &  inGeocentricPos,
osg::Matrixd &  rotOut 
)
protectedvirtual

Computes a basis rotation matrix for the given geocentric position.

Parameters
inGeocentricPosThe geocentric reference position.
rotOutThe computed basis rotation transform.

Member Data Documentation

DtDe& makVrv::DtWeatherLayerGroup::myDe
protected
osg::ref_ptr<osg::Geode> makVrv::DtWeatherLayerGroup::myEffectGeode
protected
osg::ref_ptr<makVrv::DtWeatherEffectDrawable> makVrv::DtWeatherLayerGroup::myEffectDrawable
protected
std::vector<osg::Vec4d> makVrv::DtWeatherLayerGroup::myCullingPlanes
protected
double makVrv::DtWeatherLayerGroup::myLastTime
protected
float makVrv::DtWeatherLayerGroup::myTimeStep
protected
float makVrv::DtWeatherLayerGroup::myWindDirectionRad
protected
float makVrv::DtWeatherLayerGroup::myWindSpeedMps
protected
DtJobSplitter* makVrv::DtWeatherLayerGroup::myJobSplitter
protected
WeatherLayerMap makVrv::DtWeatherLayerGroup::myMutableWeatherLayerMap
mutableprivate

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

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)