VR-Forces 4.8 Class Documentation
 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

Represents the class that manages the different cloud covers supported by the vrf environment. More...

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

Classes

struct  CloudCoverData
 This is the data we track for each cloud cover. More...
 
struct  LayerIdData
 This is the data we'll keep in a map for each layer id. More...
 

Public Types

typedef std::list< DtCloudLayerIdCloudLayerIdList
 A simple list of cloud layer ids. More...
 
typedef std::map
< makArchives::DtCloudCoverType,
CloudCoverData
CloudCoverCloudLayerIdMap
 This map is created when a data file is read and updated as cloud layers are added or removed. More...
 

Public Member Functions

virtual ~DtCloudCoverManager ()
 
virtual void initialize ()
 Read default records and set up the 'External' cloud cover. More...
 
const DtSettingsBackupsettingsBackup () const
 
DtSettingsBackupsettingsBackup ()
 
virtual void loadDefaults (bool loadOnlyFactorySettings=false)
 Load the default cloud covers (from default_cloudClovers.clcx) More...
 
const CloudCoverCloudLayerIdMapcloudCoverMap () const
 Cloud Cover and Cloud Layer Accessors. More...
 
bool isValidCloudCover (makArchives::DtCloudCoverType cloudCover) const
 isValidCloudCover returns true if the cloud cover exists, false otherwise More...
 
bool isUserCloudCover (makArchives::DtCloudCoverType coverType) const
 isUserCloudCover indicates whether a cloud cover is from the user ID space DtCloudCoverType::DtCloudCoverTypeUserStart and up More...
 
virtual std::string cloudCoverName (makArchives::DtCloudCoverType cloudCover)
 Given a cloud cover type, get the type's name. More...
 
virtual
makArchives::DtCloudCoverType 
cloudCoverType (const std::string &cloudCoverName)
 Given a cloud cover name, look up the cloud cover. More...
 
const CloudLayerIdListcloudLayerList (makArchives::DtCloudCoverType 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. More...
 
bool isValidCloudLayer (DtCloudLayerId layerId) const
 isValidCloudLayer returns true if the cloud layer exists, false otherwise More...
 
virtual
makArchives::DtCloudCoverType 
cloudCoverForLayer (DtCloudLayerId layerId)
 What cloud cover is this layer id part of? Returns DtCloudCoverTypeUndefined if the layer id does not exist. More...
 
virtual const DtCloudLayercloudLayer (DtCloudLayerId layerId) const
 Get the cloud layer for the specified layer id This method throws DtInvalidInput if the layer does not exist. More...
 
virtual bool cloudLayerEnabled (DtCloudLayerId layerId) const
 Get the enable state of a cloud layer within it's cloud cover. More...
 
virtual
makArchives::DtCloudCoverType 
addCloudCover (const std::string &cloudCoverName)
 Cloud Cover and Cloud Layer mutators. More...
 
virtual void removeCloudCover (makArchives::DtCloudCoverType)
 Remove and existing cloud cover (and all its associated layers) More...
 
virtual DtCloudLayerId addCloudLayer (makArchives::DtCloudCoverType cloudCover, const DtCloudLayer &layer)
 Add a cloud layer to the specified cloud cover. More...
 
virtual bool deleteCloudLayer (DtCloudLayerId layerToDelete)
 Delete the cloud layer specified by layerToDelete. More...
 
virtual bool changeCloudLayer (DtCloudLayerId layerId, const DtCloudLayer &newLayer)
 Change the specified layer id to match the new layer. More...
 
virtual bool setCloudLayerPositionAndOrientation (DtCloudLayerId layerId, const DtVector &position, float orientation=0.)
 Modify the position of an existing cloud layer. More...
 
virtual bool setCloudLayerEnabled (DtCloudLayerId layerId, bool enabled)
 Set the enable state of a cloud layer within it's cloud cover. More...
 
virtual void getRecord (makArchives::DtCloudCoverListRecord &record)
 Settings Manager Infrastructure. More...
 
virtual void getSplitRecord (std::vector< makArchives::DtCloudCoverListRecord > &rec, std::vector< std::string > &fileNames)
 To support writing element definitions in folders as multiple files not implemented for DtCloudCoverManager. More...
 
virtual void addRecords (makArchives::DtCloudCoverListRecord &recs, makArchives::DtCloudCoverListRecord &combinedRec)
 To support writing element definitions in folders as multiple files not implemented for DtCloudCoverManager. More...
 
virtual void setFromRecord (const makArchives::DtCloudCoverListRecord &record)
 Set the list of cloud covers by a record. More...
 
virtual void slot_restored ()
 Slot called when settings are restored. More...
 
virtual void saveAsDefaults ()
 Called to save the current settings as the default settings. More...
 
virtual void exportSettings (const std::string &filename)
 Import / export the list of named cloud covers (.clcx file) More...
 
virtual void importSettings (const std::string &filename)
 
- Public Member Functions inherited from makVrv::DtVirtualBaseClass
 DtVirtualBaseClass ()
 Do nothing constructor. More...
 
virtual ~DtVirtualBaseClass ()
 Virtual do nothing destructor. More...
 

Static Public Member Functions

static DtCloudCoverManagerinstance (DtDe &de)
 Get an instance of the cloud cover manager. More...
 

Public Attributes

boost::signal< void()> signal_cloudCoverReset
 BOOST SIGNALS used to let clients know what has transpired in this manager. More...
 
boost::signal< void(makArchives::DtCloudCoverType,
const std::string &)> 
signal_cloudCoverAdded
 signal_cloudCoverAdded is raised when a new cloud cover is added More...
 
boost::signal< void(makArchives::DtCloudCoverType)> signal_cloudCoverToBeRemoved
 signal_cloudCoverToBeRemoved is raised just before a cloud cover is removed More...
 
boost::signal< void(makArchives::DtCloudCoverType)> signal_cloudCoverRemoved
 signal_cloudCoverRemoved is raised immediately after a cloud cover is removed More...
 
boost::signal< void(DtCloudLayerId,
bool)> 
signal_cloudLayerEnabledChanged
 signal_cloudLayerEnabledChanged is raised when the enabled state of a cloud layer within its cloud cover is enabled or disabled More...
 
boost::signal< void(DtCloudLayerId,
const DtVector &, float)> 
signal_cloudLayerPositionAndOrientationChanged
 signal_cloudLayerPositionChanged is raised when a cloud layer's position is modified More...
 
boost::signal< void(DtCloudLayerId
layerId, const DtCloudLayer
&changedLayer)> 
signal_cloudLayerToBeModified
 signal_cloudLayerToBeModified is raised when a cloud layer is about to be changed. More...
 
boost::signal< void(DtCloudLayerId
layerId, const DtCloudLayer
&oldLayer)> 
signal_cloudLayerModified
 signal_cloudLayerModified is raised when a cloud layer has changed. More...
 
boost::signal< void(DtCloudLayerId
newLayer,
makArchives::DtCloudCoverType
cover)> 
signal_cloudLayerAdded
 signal_cloudLayerAdded is raised when a cloud layer is added to a cloud cover More...
 
boost::signal< void(DtCloudLayerId
oldLayer)> 
signal_cloudLayerToBeRemoved
 signal_cloudLayerToBeRemoved is raised when a cloud layer is about to be removed from a cloud cover More...
 
boost::signal< void(DtCloudLayerId
oldLayer)> 
signal_cloudLayerRemoved
 signal_cloudLayerRemoved is raise when a cloud layer is removed from a cloud cover More...
 

Protected Types

typedef boost::unordered_map
< DtCloudLayerId, LayerIdData
CloudLayerIdMap
 This map is created when a data file is read and updated if cloud layers are added or removed. More...
 
typedef boost::unordered_map
< std::string,
makArchives::DtCloudCoverType
CloudCoverNameToCloudCoverMap
 

Protected Member Functions

 DtCloudCoverManager (makVrv::DtDe &)
 CTOR. More...
 
virtual void autoSave ()
 
virtual void autoSaveDefaultsIfNeeded ()
 
DtCloudLayerId allocateCloudLayerId ()
 
makArchives::DtCloudCoverType allocateCloudCoverType ()
 
virtual bool getCloudCoverRecord (makArchives::DtCloudCoverType cloudCover, makArchives::DtCloudCoverRecord &record) const
 Get a cloud cover record for the specified cloud cover type. Returns false if the cloud cover does not exist. More...
 
virtual void createExternalCloudCover ()
 

Protected Attributes

CloudLayerIdMap myCloudLayerIdMap
 
CloudCoverCloudLayerIdMap myCloudCoverCloudLayerIdMap
 
CloudCoverNameToCloudCoverMap myCloudCoverNameToCloudCoverMap
 
DtCloudLayerId myFreeCloudLayerId
 
DtDemyDe
 
DtRecordSettingsBackupInterfacemySettingsBackup
 
std::vector< boolmyUserCloudTypesAvailable
 

Detailed Description

Represents the class that manages the different cloud covers supported by the vrf environment.

It also creates and supports a special "External" cloud cover that can be used to add cloud layers. The "External" cover is initially empty and always shown. The 'External' cloud cover is never written to default_cloudCovers.clcx. API users may add cloud layers to augment existing cloud covers. It is also used the the VR-Link connections to display individual cloud layers published by VR-Forces.

Member Typedef Documentation

A simple list of cloud layer ids.

Each cloud layer read from a file or added through the API is assigned a unique cloud layer id

This map is created when a data file is read and 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.

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

Read default records and set up the 'External' cloud cover.

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

Cloud Cover and Cloud Layer Accessors.

cloudCoverMap returns the entire map of cloud covers and associated cloud layers

bool makVrv::DtCloudCoverManager::isValidCloudCover ( makArchives::DtCloudCoverType  cloudCover) const

isValidCloudCover returns true if the cloud cover exists, false otherwise

bool makVrv::DtCloudCoverManager::isUserCloudCover ( makArchives::DtCloudCoverType  coverType) const

isUserCloudCover indicates whether a cloud cover is from the user ID space DtCloudCoverType::DtCloudCoverTypeUserStart and up

virtual std::string makVrv::DtCloudCoverManager::cloudCoverName ( makArchives::DtCloudCoverType  cloudCover)
virtual

Given a cloud cover type, get the type's name.

Returns the string "Does Not Exist" if the cloud cover does not exist

virtual makArchives::DtCloudCoverType makVrv::DtCloudCoverManager::cloudCoverType ( const std::string &  cloudCoverName)
virtual

Given a cloud cover name, look up the cloud cover.

Returns DtCloudCoverTypeUndefined if the name isn't found

const CloudLayerIdList& makVrv::DtCloudCoverManager::cloudLayerList ( makArchives::DtCloudCoverType  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

isValidCloudLayer returns true if the cloud layer exists, false otherwise

virtual makArchives::DtCloudCoverType makVrv::DtCloudCoverManager::cloudCoverForLayer ( DtCloudLayerId  layerId)
virtual

What cloud cover is this layer id part of? Returns DtCloudCoverTypeUndefined if the layer id does not exist.

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

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

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

Get the enable state of a cloud layer within it's cloud cover.

If the layerId specified is not found, cloudLayerEnabled returns false;

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

Cloud Cover and Cloud Layer mutators.

Add a new cloud cover. addCloudCover allocates a new user-space cloud cover type a returns it. DtCloudCoverTypeUndefined is returned if the operation fails

virtual void makVrv::DtCloudCoverManager::removeCloudCover ( makArchives::DtCloudCoverType  )
virtual

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

virtual DtCloudLayerId makVrv::DtCloudCoverManager::addCloudLayer ( makArchives::DtCloudCoverType  cloudCover,
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 cover does not exist

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::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. setCloudLayerEnabled returns false if the layerId is not found, true otherwise.

virtual void makVrv::DtCloudCoverManager::getRecord ( makArchives::DtCloudCoverListRecord record)
virtual

Settings Manager Infrastructure.

Get the cloud cover list record that represents our cloud covers.

virtual void makVrv::DtCloudCoverManager::getSplitRecord ( std::vector< makArchives::DtCloudCoverListRecord > &  rec,
std::vector< std::string > &  fileNames 
)
inlinevirtual

To support writing element definitions in folders as multiple files not implemented for DtCloudCoverManager.

virtual void makVrv::DtCloudCoverManager::addRecords ( makArchives::DtCloudCoverListRecord recs,
makArchives::DtCloudCoverListRecord combinedRec 
)
inlinevirtual

To support writing element definitions in folders as multiple files not implemented for DtCloudCoverManager.

virtual void makVrv::DtCloudCoverManager::setFromRecord ( const makArchives::DtCloudCoverListRecord record)
virtual

Set the list of cloud covers by a record.

virtual void makVrv::DtCloudCoverManager::slot_restored ( )
virtual

Slot called when settings are restored.

virtual void makVrv::DtCloudCoverManager::saveAsDefaults ( )
virtual

Called to save the current settings as the default settings.

virtual void makVrv::DtCloudCoverManager::exportSettings ( const std::string &  filename)
virtual

Import / export the list of named cloud covers (.clcx file)

virtual void makVrv::DtCloudCoverManager::importSettings ( const std::string &  filename)
virtual
const DtSettingsBackup* makVrv::DtCloudCoverManager::settingsBackup ( ) const
inline
DtSettingsBackup* makVrv::DtCloudCoverManager::settingsBackup ( )
inline
virtual void makVrv::DtCloudCoverManager::loadDefaults ( bool  loadOnlyFactorySettings = false)
virtual

Load the default cloud covers (from default_cloudClovers.clcx)

virtual void makVrv::DtCloudCoverManager::autoSave ( )
protectedvirtual
virtual void makVrv::DtCloudCoverManager::autoSaveDefaultsIfNeeded ( )
protectedvirtual
DtCloudLayerId makVrv::DtCloudCoverManager::allocateCloudLayerId ( )
protected
makArchives::DtCloudCoverType makVrv::DtCloudCoverManager::allocateCloudCoverType ( )
protected
virtual bool makVrv::DtCloudCoverManager::getCloudCoverRecord ( makArchives::DtCloudCoverType  cloudCover,
makArchives::DtCloudCoverRecord record 
) const
protectedvirtual

Get a cloud cover record for the specified cloud cover type. Returns false if the cloud cover does not exist.

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

Member Data Documentation

boost::signal<void()> makVrv::DtCloudCoverManager::signal_cloudCoverReset

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

signal_cloudCoverReset is raised when a new (or restored) set of sky records is read

boost::signal<void(makArchives::DtCloudCoverType, const std::string&)> makVrv::DtCloudCoverManager::signal_cloudCoverAdded

signal_cloudCoverAdded is raised when a new cloud cover is added

boost::signal<void(makArchives::DtCloudCoverType)> makVrv::DtCloudCoverManager::signal_cloudCoverToBeRemoved

signal_cloudCoverToBeRemoved is raised just before a cloud cover is removed

boost::signal<void(makArchives::DtCloudCoverType)> makVrv::DtCloudCoverManager::signal_cloudCoverRemoved

signal_cloudCoverRemoved is raised immediately after a cloud cover is removed

boost::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::signal<void(DtCloudLayerId, const DtVector&, float)> makVrv::DtCloudCoverManager::signal_cloudLayerPositionAndOrientationChanged

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

boost::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::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::signal<void(DtCloudLayerId newLayer, makArchives::DtCloudCoverType cover)> makVrv::DtCloudCoverManager::signal_cloudLayerAdded

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

boost::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::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
CloudCoverNameToCloudCoverMap makVrv::DtCloudCoverManager::myCloudCoverNameToCloudCoverMap
protected
DtCloudLayerId makVrv::DtCloudCoverManager::myFreeCloudLayerId
protected
DtDe& makVrv::DtCloudCoverManager::myDe
protected
DtRecordSettingsBackupInterface* makVrv::DtCloudCoverManager::mySettingsBackup
protected
std::vector<bool> makVrv::DtCloudCoverManager::myUserCloudTypesAvailable
protected

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)