VR-Forces 5.0.2 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 Member Functions | Protected Attributes | Private Member Functions | Private Attributes
makVrv::DtWeatherLayerGroup Class Reference

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.

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

Public Member Functions

 DtWeatherLayerGroup (DtDe &de)
 
 DtWeatherLayerGroup (const DtWeatherLayerGroup &orig, const osg::CopyOp &opr)
 
virtual ~DtWeatherLayerGroup ()
 
virtual osg::Object * clone (const osg::CopyOp &copyop) const
 
virtual osg::Object * cloneType () const
 
virtual void releaseGLObjects (osg::State *state=0) const override
 
virtual void deleteGeode ()
 
virtual osg::Node * getOrCreateSensorNode ()
 
virtual void registerLayer (DtWeatherLayer *layer, bool global=false)
 
virtual void unregisterLayer (DtWeatherLayer *layer)
 
virtual void setGlobalWind (float windDirectionRad, float windSpeedMps)
 
virtual void drawWeatherEffects (DtWeatherEffect::DrawData &drawData)
 
virtual float timeStep () const
 
virtual void registerWeatherEffectsObject (DtOsgWeatherEffectsObject *weatherEffectsObject)
 

Protected Member Functions

void connectSignals ()
 
void disconnectSignals ()
 
virtual void slot_groundSnowAccumulationChanged (float value)
 
virtual void slot_simulationUpdate ()
 
virtual void traverse (osg::NodeVisitor &nv)
 
virtual bool cullUpdate (osg::Camera *cam)
 
virtual void computeBasis (const osg::Vec3d &inGeocentricPos, osg::Matrixd &rotOut)
 

Protected Attributes

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

Private Member Functions

 DtWeatherLayerGroup ()=delete
 
 DtWeatherLayerGroup (const DtWeatherLayerGroup &other)=delete
 
DtWeatherLayerGroupoperator= (const DtWeatherLayerGroup &other)=delete
 

Private Attributes

std::vector< DtWeatherLayer * > myWeatherLayers
 
std::vector< DtWeatherLayer * > myGlobalWeatherLayers
 

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 ( )
privatedelete

Default Constructor not implemented.

makVrv::DtWeatherLayerGroup::DtWeatherLayerGroup ( const DtWeatherLayerGroup other)
privatedelete

Copy Constructor not implemented - Copy not allowed.

Member Function Documentation

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

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::releaseGLObjects ( osg::State *  state = 0) const
overridevirtual

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::registerLayer ( DtWeatherLayer layer,
bool  global = false 
)
virtual

Registers the layer for use with this group. unregisterLayer should be called by the layer owner when it no longer in use. This group does not own the layer obect. Set global to true if the layer does not belong to a local area.

Parameters
layerThe layer to register.
globalTrue if the layer is a used as a global effect.
virtual void makVrv::DtWeatherLayerGroup::unregisterLayer ( DtWeatherLayer layer)
virtual

Unregisters a previously registered layer from this group. This group does not own the layer obect.

Parameters
layerThe layer to unregister.
virtual void makVrv::DtWeatherLayerGroup::setGlobalWind ( float  windDirectionRad,
float  windSpeedMps 
)
virtual

Sets the current global wind to use for weather layers.

Parameters
windDirectionRadThe wind direction in radians.
windSpeedMpsThe wind speed in meters per second.
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.

virtual void makVrv::DtWeatherLayerGroup::registerWeatherEffectsObject ( DtOsgWeatherEffectsObject weatherEffectsObject)
virtual

called by the DtOsgWeatherEffectsObject constructor to register itself when it is created.

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_groundSnowAccumulationChanged ( float  value)
protectedvirtual

Signal to handle when the ground snow accumulation changes.

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 bool makVrv::DtWeatherLayerGroup::cullUpdate ( osg::Camera *  cam)
protectedvirtual

Update draw objects for current camera. Returns false if everything was culled.

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
std::vector<DtWeatherArea*> makVrv::DtWeatherLayerGroup::myDrawWeatherAreas
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
DtSignalConnectionManager makVrv::DtWeatherLayerGroup::myWeatherEffectsConnections
protected
std::vector<DtWeatherLayer*> makVrv::DtWeatherLayerGroup::myWeatherLayers
mutableprivate

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

std::vector<DtWeatherLayer*> makVrv::DtWeatherLayerGroup::myGlobalWeatherLayers
mutableprivate

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

Document ID: Generated on Sun Dec 4 20:22:03 EST 2022 from SVN revision 249613
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)