VR-Forces Development_Version Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator 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. More...

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

Classes

class  DtOverlayGroupIdGenerator
 Generates group ids for within the given range. More...

Public Types

enum  OverlayGroupId {
  HiddenGroup = 0, DefaultGroup = 1, UnusedLowGroup = 2, GroupsGroup = 500000,
  UnusedHighGroup = 1000000
}
 Enumerates the various special valued overlay group ids. More...
typedef std::list< std::string > GroupRangeList
 List type for the names and order of configured overlay group sets.

Public Member Functions

virtual ~DtOverlayGroupManager ()
 Virtual DTOR.
void initializeDefaultGroupSets ()
 Initialization of the default group sets used by VR-Vantage.
virtual void addOverlayGroupSet (const std::string &name)
 Adds a new set of overlay groups with the given name.
virtual void addOverlayGroupSetUnder (const std::string &name, const std::string &beforeName)
 Adds a new set of overlay groups below the specified set.
virtual void addOverlayGroupSetAbove (const std::string &name, const std::string &afterName)
 Adds a new set of overlay groups above the specified set.
virtual const GroupRangeListoverlayGroupSets () const
 Accessor for the list of configured overlay group sets (const).
virtual GroupRangeListoverlayGroupSets ()
 Accessor for the list of configured overlay group sets.
virtual unsigned int nextGroupId (const std::string &groupSetName)
 Returns the next available group id for the given set.
- Public Member Functions inherited from makVrv::DtVirtualBaseClass
 DtVirtualBaseClass ()
 Do nothing constructor.
virtual ~DtVirtualBaseClass ()
 Virtual do nothing destructor.

Static Public Member Functions

static DtOverlayGroupManagerinstance (DtDe &de)
 Instance method (for use in the main thread).
static DtOverlayGroupManagerinstance (DtBaseConnection &sim)
 Instance method (for use in the connection thread).
static void copyInstance (DtBaseConnection &sim, DtDe &de)
 Create a copy of the de's overlay group manager for the base connection.

Protected Types

typedef boost::unordered_map
< std::string,
DtOverlayGroupIdGenerator * > 
GroupIdGeneratorList
 Map type for mapping overlay group sets to their ID generators.

Protected Member Functions

 DtOverlayGroupManager ()
 Protected CTOR. (Use ::instance(..)).
 DtOverlayGroupManager (DtDe &de)
 Protected CTOR. (Use ::instance(..)).
 DtOverlayGroupManager (const DtOverlayGroupManager &copy)
 Protected CTOR. (Use ::instance(..)).
virtual void initializeGroupIdGenerators ()
 Initializes the group id generators for all configured sets.

Protected Attributes

GroupIdGeneratorList myGroupIdGenerators
GroupRangeList myOverlayGroupRanges
DtDemyOptionalDe
unsigned int myNextGroupId
bool myModificationsLockedFlag

Friends

template<typename ManagerClass >
ManagerClass & defaultManagerInstanceFunction (DtDe &, bool)
 default Manager instance function.
template<typename ManagerClass >
void defaultManagerRegisterInstanceFunction (DtDe &, ManagerClass *)
 Default implementation of how to register a manager, especially necessary when overriding the manager.

Detailed Description

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.

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.
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.

Befriend the manager instance functions for instance retreival/creation.

Befriend the manager instance functions for instance retrieval/creation.

  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.
  @code 

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.
  @code 

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.

  @code 

static void Manager::registerInstance(DtDe& de, Manager* mgr) { defaultManagerRegisterInstanceFunction(de,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 Tue Mar 8 22:13:38 EST 2016 from SVN revision 162938
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)