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 | Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
makVrv::DtCloudCoverManager Class Reference

Defines the manager class that manages the different cloud cover configurations being used by VR-Vantage. The manager automatically creates two specialized cloud covers to be used by the VR-Vantage application to implement some out-of-the-box functionality.

The first specialized cloud cover is used for visualizing the clouds that are configured for local 'weather areas' that are published by VR-Forces. The name for this cloud cover is "External"

The second specialized cloud cover is used for visualizing the clouds that belong to the 'remote environment'. The 'remote environment' is used whenever the 'Listen to Remote Environment Settings' setting is enabled. The name for this cloud cover is provided by DtEnvironmentInterface::theRemoteEnvironmentName.

The two specialized cloud covers are initialized to have no cloud layers and their configuration is never written to disk, like other cloud covers.

API users may use the cloud cover manager to add cloud layers to existing cloud covers. There is a cloud cover for every environment configuration maintained by VR-Vantage. The cloud cover name matches the name of the environment configuration.

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

Classes

struct  CloudCoverData
 
struct  LayerIdData
 

Public Types

typedef std::vector
< DtCloudLayerId
CloudLayerIdList
 
typedef std::map< std::string,
CloudCoverData
CloudCoverCloudLayerIdMap
 

Public Member Functions

virtual ~DtCloudCoverManager ()
 
const CloudCoverCloudLayerIdMapcloudCoverMap () const
 
bool isValidCloudCover (const std::string &cloudCover) const
 
const CloudLayerIdListcloudLayerList (const std::string &cloudCover) const
 
bool isValidCloudLayer (DtCloudLayerId layerId) const
 
virtual std::string cloudCoverForLayer (DtCloudLayerId layerId) const
 
virtual const DtCloudLayercloudLayer (DtCloudLayerId layerId) const
 
virtual DtCloudLayercloudLayer (DtCloudLayerId layerId)
 
virtual bool getCloudLayerIdFromCloudCoverAndBaseMSL (const std::string &cloudCover, float baseMSLAltitude, DtCloudLayerId &result) const
 
virtual bool cloudLayerEnabled (DtCloudLayerId layerId) const
 
virtual void addCloudCover (const std::string &cloudCoverName)
 
virtual void removeCloudCover (const std::string &cloudCoverName)
 
virtual void renameCloudCover (const std::string &oldName, const std::string &newName)
 
virtual DtCloudLayerId addCloudLayer (const std::string &cloudCoverName, const DtCloudLayer &layer)
 
virtual DtCloudLayerId addCloudLayerByRecord (const std::string &cloudCoverName, const makArchives::DtCloudLayerRecord &layerRecord)
 
virtual bool deleteCloudLayer (DtCloudLayerId layerToDelete)
 
virtual bool changeCloudLayer (DtCloudLayerId layerId, const DtCloudLayer &newLayer)
 
virtual bool updateCloudLayerUsingRecord (DtCloudLayerId layerId, const makArchives::DtCloudLayerRecord &record)
 
virtual bool setCloudLayerPositionAndOrientation (DtCloudLayerId layerId, const DtVector &position, float orientation=0.)
 
virtual bool setCloudLayerEnabled (DtCloudLayerId layerId, bool enabled)
 
- Public Member Functions inherited from makVrv::DtVirtualBaseClass
 DtVirtualBaseClass ()
 
virtual ~DtVirtualBaseClass ()
 

Static Public Member Functions

static DtCloudCoverManagerinstance (DtDe &de)
 

Public Attributes

boost::signalslib::signal
< void(const std::string &)> 
signal_cloudCoverAdded
 
boost::signalslib::signal
< void(const std::string &)> 
signal_cloudCoverToBeRemoved
 
boost::signalslib::signal
< void(const std::string &)> 
signal_cloudCoverRemoved
 
boost::signalslib::signal
< void(DtCloudLayerId, bool)> 
signal_cloudLayerEnabledChanged
 
boost::signalslib::signal
< void(DtCloudLayerId, const
DtVector &, float)> 
signal_cloudLayerPositionAndOrientationChanged
 
boost::signalslib::signal
< void(DtCloudLayerId layerId,
const DtCloudLayer
&changedLayer)> 
signal_cloudLayerToBeModified
 
boost::signalslib::signal
< void(DtCloudLayerId layerId,
const DtCloudLayer &oldLayer)> 
signal_cloudLayerModified
 
boost::signalslib::signal
< void(DtCloudLayerId newLayer,
const std::string &coverName)> 
signal_cloudLayerAdded
 
boost::signalslib::signal
< void(DtCloudLayerId oldLayer)> 
signal_cloudLayerToBeRemoved
 
boost::signalslib::signal
< void(DtCloudLayerId oldLayer)> 
signal_cloudLayerRemoved
 

Protected Types

typedef std::unordered_map
< DtCloudLayerId, LayerIdData
CloudLayerIdMap
 

Protected Member Functions

 DtCloudCoverManager (makVrv::DtDe &)
 
virtual void initialize ()
 
DtCloudLayerId allocateCloudLayerId ()
 
virtual void createExternalCloudCover ()
 

Protected Attributes

CloudLayerIdMap myCloudLayerIdMap
 
CloudCoverCloudLayerIdMap myCloudCoverCloudLayerIdMap
 
DtCloudLayerId myFreeCloudLayerId
 
DtDemyDe
 

Member Typedef Documentation

A simple list of cloud layer ids. Each cloud layer added through the API is assigned a unique cloud layer id.

This map is updated as cloud layers are added or removed.

This map is created when a data file is read and updated if cloud layers are added or removed.

Constructor & Destructor Documentation

virtual makVrv::DtCloudCoverManager::~DtCloudCoverManager ( )
virtual
makVrv::DtCloudCoverManager::DtCloudCoverManager ( makVrv::DtDe )
protected

CTOR.

Member Function Documentation

static DtCloudCoverManager& makVrv::DtCloudCoverManager::instance ( DtDe de)
static

Get an instance of the cloud cover manager.

const CloudCoverCloudLayerIdMap& makVrv::DtCloudCoverManager::cloudCoverMap ( ) const

Cloud Cover and Cloud Layer Accessors.

Returns the entire map of cloud covers and associated cloud layers

bool makVrv::DtCloudCoverManager::isValidCloudCover ( const std::string &  cloudCover) const

Returns true if the cloud cover exists, false otherwise.

const CloudLayerIdList& makVrv::DtCloudCoverManager::cloudLayerList ( const std::string &  cloudCover) const

Get the list of cloud layer ids for the specified cloud cover. This method throws DtInvalidInput if the cloud cover does not exist.

bool makVrv::DtCloudCoverManager::isValidCloudLayer ( DtCloudLayerId  layerId) const

Returns true if the cloud layer exists, false otherwise.

virtual std::string makVrv::DtCloudCoverManager::cloudCoverForLayer ( DtCloudLayerId  layerId) const
virtual

Return the name of the cloud cover the cloud layer with the provided layer id is a part of. This method returns the empty string if the provided layer id is not a part of any cloud cover being maintained.

virtual const DtCloudLayer& makVrv::DtCloudCoverManager::cloudLayer ( DtCloudLayerId  layerId) const
virtual

Get the cloud layer for the specified layer id - const version. This method throws DtInvalidInput if the layer does not exist.

virtual DtCloudLayer& makVrv::DtCloudCoverManager::cloudLayer ( DtCloudLayerId  layerId)
virtual

Get the cloud layer for the specified layer id. This method throws DtInvalidInput if the layer does not exist.

virtual bool makVrv::DtCloudCoverManager::getCloudLayerIdFromCloudCoverAndBaseMSL ( const std::string &  cloudCover,
float  baseMSLAltitude,
DtCloudLayerId result 
) const
virtual

Get a list of cloud layer ids whose cloud layers are at the base MSL altitude, in meters, provided and are part of the cloud cover with the provided name.

virtual bool makVrv::DtCloudCoverManager::cloudLayerEnabled ( DtCloudLayerId  layerId) const
virtual

Get the enable state of a cloud layer within it's cloud cover. This method return false if the provided cloud layer id is not found.

virtual void makVrv::DtCloudCoverManager::addCloudCover ( const std::string &  cloudCoverName)
virtual

Cloud Cover and Cloud Layer mutators.

Add a new cloud cover.

virtual void makVrv::DtCloudCoverManager::removeCloudCover ( const std::string &  cloudCoverName)
virtual

Remove an existing cloud cover (and all its associated layers).

virtual void makVrv::DtCloudCoverManager::renameCloudCover ( const std::string &  oldName,
const std::string &  newName 
)
virtual

Rename an existing cloud cover.

virtual DtCloudLayerId makVrv::DtCloudCoverManager::addCloudLayer ( const std::string &  cloudCoverName,
const DtCloudLayer layer 
)
virtual

Add a cloud layer to the specified cloud cover. Returns the cloud layer id if added. Returns DtCloudLayerIdUndefined if the cloud layer could not be added.

virtual DtCloudLayerId makVrv::DtCloudCoverManager::addCloudLayerByRecord ( const std::string &  cloudCoverName,
const makArchives::DtCloudLayerRecord layerRecord 
)
virtual

Add a cloud layer to the specified cloud cover, using its record. Returns the cloud layer id if added. Returns DtCloudLayerIdUndefined if the cloud layer could not be added.

virtual bool makVrv::DtCloudCoverManager::deleteCloudLayer ( DtCloudLayerId  layerToDelete)
virtual

Delete the cloud layer specified by layerToDelete. Returns false if the layer is not found.

virtual bool makVrv::DtCloudCoverManager::changeCloudLayer ( DtCloudLayerId  layerId,
const DtCloudLayer newLayer 
)
virtual

Change the specified layer id to match the new layer. Returns false if the layer id is not found. This will cause the existing Silverlining layer to be replaced by a new one with the new layer's parameters. For cloud layers that need to be populated with clouds (what Silverlining calls 'seeding' such a change can cause a stall. Note that if you just want to change the position of a cloud layer, use setCloudLayerPosition instead, as this will modify the existing cloud layer instead of replacing it.

virtual bool makVrv::DtCloudCoverManager::updateCloudLayerUsingRecord ( DtCloudLayerId  layerId,
const makArchives::DtCloudLayerRecord record 
)
virtual

Cloud Cover and Cloud Layer mutators.

Add a new cloud cover.

virtual bool makVrv::DtCloudCoverManager::setCloudLayerPositionAndOrientation ( DtCloudLayerId  layerId,
const DtVector position,
float  orientation = 0. 
)
virtual

Modify the position of an existing cloud layer. Note that position and orientation are updated together.

virtual bool makVrv::DtCloudCoverManager::setCloudLayerEnabled ( DtCloudLayerId  layerId,
bool  enabled 
)
virtual

Set the enable state of a cloud layer within it's cloud cover. Note that this only affects the current sky if the specified cloud layer is part of the current cloud cover. This method returns false if the provided cloud layer id is not found, true otherwise.

virtual void makVrv::DtCloudCoverManager::initialize ( )
protectedvirtual

Set up the 'External' cloud cover.

DtCloudLayerId makVrv::DtCloudCoverManager::allocateCloudLayerId ( )
protected

Return the next available cloud layer id.

virtual void makVrv::DtCloudCoverManager::createExternalCloudCover ( )
protectedvirtual

Add information about the 'External' cloud cover to the manager.

Member Data Documentation

boost::signalslib::signal<void(const std::string&)> makVrv::DtCloudCoverManager::signal_cloudCoverAdded

BOOST SIGNALS used to let clients know what has transpired in this manager.

signal_cloudCoverAdded is raised when a new cloud cover is added

boost::signalslib::signal<void(const std::string&)> makVrv::DtCloudCoverManager::signal_cloudCoverToBeRemoved

signal_cloudCoverToBeRemoved is raised just before a cloud cover is removed

boost::signalslib::signal<void(const std::string&)> makVrv::DtCloudCoverManager::signal_cloudCoverRemoved

signal_cloudCoverRemoved is raised immediately after a cloud cover is removed

boost::signalslib::signal<void(DtCloudLayerId, bool)> makVrv::DtCloudCoverManager::signal_cloudLayerEnabledChanged

signal_cloudLayerEnabledChanged is raised when the enabled state of a cloud layer within its cloud cover is enabled or disabled

boost::signalslib::signal<void(DtCloudLayerId, const DtVector&, float)> makVrv::DtCloudCoverManager::signal_cloudLayerPositionAndOrientationChanged

signal_cloudLayerPositionChanged is raised when a cloud layer's position is modified

boost::signalslib::signal<void(DtCloudLayerId layerId, const DtCloudLayer& changedLayer)> makVrv::DtCloudCoverManager::signal_cloudLayerToBeModified

signal_cloudLayerToBeModified is raised when a cloud layer is about to be changed. The new layer state is provided, and the original can be looked up if needed from the layer id

boost::signalslib::signal<void(DtCloudLayerId layerId, const DtCloudLayer& oldLayer)> makVrv::DtCloudCoverManager::signal_cloudLayerModified

signal_cloudLayerModified is raised when a cloud layer has changed. The old layer state is provided, and the new one can be looked up if needed from the layer id

boost::signalslib::signal<void(DtCloudLayerId newLayer, const std::string& coverName)> makVrv::DtCloudCoverManager::signal_cloudLayerAdded

signal_cloudLayerAdded is raised when a cloud layer is added to a cloud cover

boost::signalslib::signal<void(DtCloudLayerId oldLayer)> makVrv::DtCloudCoverManager::signal_cloudLayerToBeRemoved

signal_cloudLayerToBeRemoved is raised when a cloud layer is about to be removed from a cloud cover

boost::signalslib::signal<void(DtCloudLayerId oldLayer)> makVrv::DtCloudCoverManager::signal_cloudLayerRemoved

signal_cloudLayerRemoved is raise when a cloud layer is removed from a cloud cover

CloudLayerIdMap makVrv::DtCloudCoverManager::myCloudLayerIdMap
protected
CloudCoverCloudLayerIdMap makVrv::DtCloudCoverManager::myCloudCoverCloudLayerIdMap
protected
DtCloudLayerId makVrv::DtCloudCoverManager::myFreeCloudLayerId
protected
DtDe& makVrv::DtCloudCoverManager::myDe
protected

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)