VR-Forces 5.0.1 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 | Friends
makVrv::DtOverlayGroupManager Class Reference

Manages the allocation of overlay groups. Overlay groups are used to determine the draw order of sprites on a 2D overlay. This manager configures overlay group sets and allocates group ids within those sets. The separate group sets allow for all overlay widgets of a specific type to be ordered above or below widgets of a different type. The allocation of different group IDs to each widget within a group ensures that the widget's different components don't fight to be on top. When the first call to nextGroupId( const std::string& ) is made, the configured sets are allocated id ranges, and further modifications to the group sets is prohibited.

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

Classes

class  DtOverlayGroupIdGenerator
 

Public Types

enum  OverlayGroupId {
  HiddenGroup = 0, DefaultGroup = 1, UnusedLowGroup = 2, GroupsGroup = 500000,
  UnusedHighGroup = 1000000
}
 
typedef std::list< std::string > GroupRangeList
 

Public Member Functions

virtual DtOverlayGroupManagerclone ()
 
virtual ~DtOverlayGroupManager ()
 
void initializeDefaultGroupSets ()
 
virtual void addOverlayGroupSet (const std::string &name)
 
virtual void addOverlayGroupSetUnder (const std::string &name, const std::string &beforeName)
 
virtual void addOverlayGroupSetAbove (const std::string &name, const std::string &afterName)
 
virtual const GroupRangeListoverlayGroupSets () const
 
virtual GroupRangeListoverlayGroupSets ()
 
virtual unsigned int nextGroupId (const std::string &groupSetName)
 
- Public Member Functions inherited from makVrv::DtVirtualBaseClass
 DtVirtualBaseClass ()
 
virtual ~DtVirtualBaseClass ()
 

Static Public Member Functions

static DtOverlayGroupManagerinstance (DtDe &de)
 
static DtOverlayGroupManagerinstance (DtBaseConnection &sim)
 
static void copyInstance (DtBaseConnection &sim, DtDe &de)
 

Protected Types

typedef boost::unordered_map
< std::string,
DtOverlayGroupIdGenerator * > 
GroupIdGeneratorList
 

Protected Member Functions

 DtOverlayGroupManager ()
 
 DtOverlayGroupManager (DtDe &de)
 
 DtOverlayGroupManager (const DtOverlayGroupManager &copy)
 
virtual void initializeGroupIdGenerators ()
 

Protected Attributes

GroupIdGeneratorList myGroupIdGenerators
 
GroupRangeList myOverlayGroupRanges
 
DtDemyOptionalDe
 
unsigned int myNextGroupId
 
bool myModificationsLockedFlag
 

Friends

template<typename ManagerClass >
ManagerClass & defaultManagerInstanceFunction (DtDe &, bool)
 
template<typename ManagerClass >
void defaultManagerRegisterInstanceFunction (DtDe &, ManagerClass *)
 

Member Typedef Documentation

typedef std::list<std::string> makVrv::DtOverlayGroupManager::GroupRangeList

List type for the names and order of configured overlay group sets.

typedef boost::unordered_map<std::string,DtOverlayGroupIdGenerator*> makVrv::DtOverlayGroupManager::GroupIdGeneratorList
protected

Map type for mapping overlay group sets to their ID generators.

Member Enumeration Documentation

Enumerates the various special valued overlay group ids.

Enumerator
HiddenGroup 
DefaultGroup 
UnusedLowGroup 
GroupsGroup 
UnusedHighGroup 

Constructor & Destructor Documentation

virtual makVrv::DtOverlayGroupManager::~DtOverlayGroupManager ( )
virtual

Virtual DTOR.

makVrv::DtOverlayGroupManager::DtOverlayGroupManager ( )
protected

Protected CTOR. (Use ::instance(..)).

makVrv::DtOverlayGroupManager::DtOverlayGroupManager ( DtDe de)
protected

Protected CTOR. (Use ::instance(..)).

makVrv::DtOverlayGroupManager::DtOverlayGroupManager ( const DtOverlayGroupManager copy)
protected

Protected CTOR. (Use ::instance(..)).

Member Function Documentation

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

Instance method (for use in the main thread).

Returns
the overlay group manager for the given de.
static DtOverlayGroupManager& makVrv::DtOverlayGroupManager::instance ( DtBaseConnection sim)
static

Instance method (for use in the connection thread).

Returns
the overlay group manager for the given sim.
virtual DtOverlayGroupManager* makVrv::DtOverlayGroupManager::clone ( )
virtual

Clone function so derived classes can be used with copyInstance.

static void makVrv::DtOverlayGroupManager::copyInstance ( DtBaseConnection sim,
DtDe de 
)
static

Create a copy of the de's overlay group manager for the base connection.

void makVrv::DtOverlayGroupManager::initializeDefaultGroupSets ( )
inline

Initialization of the default group sets used by VR-Vantage. This method creates the default overlay group sets used by VR-Vantage. The default groups are (ordered from highest to lowest):

  • hoverGroupSet
  • selectedGroupSet
  • iconsGroupSet
  • rangeInfoGroupSet
  • entityInfoPinnedGroupSet
  • symbolDecorationGroupSet Users may add additional groups using the addOverlayGroupSet(..), addOverlayGroupSetUnder(..), and addOverlayGroupSetAbove(..) methods, or by modifying the list of groups directly using the overlayGroupSets() method.
virtual void makVrv::DtOverlayGroupManager::addOverlayGroupSet ( const std::string &  name)
virtual

Adds a new set of overlay groups with the given name. The new set is added under all other configured sets.

virtual void makVrv::DtOverlayGroupManager::addOverlayGroupSetUnder ( const std::string &  name,
const std::string &  beforeName 
)
virtual

Adds a new set of overlay groups below the specified set. The new set has the given name and is below the specified set but above all other sets below that one.

virtual void makVrv::DtOverlayGroupManager::addOverlayGroupSetAbove ( const std::string &  name,
const std::string &  afterName 
)
virtual

Adds a new set of overlay groups above the specified set. The new set has the given name and is above the specified set but below all other sets above that one.

virtual const GroupRangeList& makVrv::DtOverlayGroupManager::overlayGroupSets ( ) const
virtual

Accessor for the list of configured overlay group sets (const). Sets towards the beginning of the list are lower on the overlay.

virtual GroupRangeList& makVrv::DtOverlayGroupManager::overlayGroupSets ( )
virtual

Accessor for the list of configured overlay group sets. Sets towards the beginning of the list are lower on the overlay.

Exceptions
DtCorruptedStateif modifications to the manager are locked.
virtual unsigned int makVrv::DtOverlayGroupManager::nextGroupId ( const std::string &  groupSetName)
virtual

Returns the next available group id for the given set. Obtains the group id generator for the set with the given name and returns the group id returned by the generator's nextGroupId() method. If a group set with the given name could not be found, OverlayGroupId::DefaultGroup (1) is returned.

virtual void makVrv::DtOverlayGroupManager::initializeGroupIdGenerators ( )
protectedvirtual

Initializes the group id generators for all configured sets. Ranges for the individual group sets are allocated based on the number of sets configured.

Friends And Related Function Documentation

template<typename ManagerClass >
ManagerClass& defaultManagerInstanceFunction ( DtDe de,
bool  allowedInSlave 
)
friend

default Manager instance function. Manager requirements: 1) Static instance function 2) Protected DtSignalConnectionManager named myConnections. 3) Member functioned called loadDefaults which takes no arguments. and loads the default settings of the manager or factory from disk. 4) define defaultManagerInstanceFunction as friend. 5) define defaultManagerRegisterInstanceFunction as friend (see below). 5) Protected Constructor which only takes a DtDe reference.

Befriend the manager instance functions for instance retreival/creation.

Befriend the manager instance functions for instance retrieval/creation.

class Manager
{
public:
static Manager& instance(DtDe& de);
void loadDefaults();
protected:
template <typename ManagerClass>
friend ManagerClass& defaultManagerInstanceFunction(DtDe& de, bool);
template <typename ManagerClass>
friend void defaultManagerRegisterInstanceFunction(DtDe& de, ManagerClass* mgr)
Manager(DtDe&);
DtSignalConnectionManager myConnections;
};

Then simply in the implementation of instance call defaultManagerInstanceFunction with the de object and return the return value.

Manager& Manager::instance(DtDe& de)
{
return defaultManagerInstanceFunction<Manager>(de);
}
template<typename ManagerClass >
void defaultManagerRegisterInstanceFunction ( DtDe de,
ManagerClass *  mgr 
)
friend

Default implementation of how to register a manager, especially necessary when overriding the manager.

Befriend the manager instance functions for instance retreival/creation.

Befriend the manager instance functions for instance retrieval/creation.

static void Manager::registerInstance(DtDe& de, Manager* mgr)
{
}
...else where call.
// Assuming class NewManager : public Manager
Manager::registerInstance(de,new NewManager(de));

Member Data Documentation

GroupIdGeneratorList makVrv::DtOverlayGroupManager::myGroupIdGenerators
protected
GroupRangeList makVrv::DtOverlayGroupManager::myOverlayGroupRanges
protected
DtDe* makVrv::DtOverlayGroupManager::myOptionalDe
protected
unsigned int makVrv::DtOverlayGroupManager::myNextGroupId
protected
bool makVrv::DtOverlayGroupManager::myModificationsLockedFlag
protected

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

Document ID: Generated on Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)