VR-Forces 4.0.4 Class Documentation
include/vrvCore/DtOverlayGroupManager.h
Go to the documentation of this file.
00001 /*****************************************************************************
00002  * Copyright (c) 2012 MAK Technologies, Inc.
00003  * All rights reserved.
00004  *****************************************************************************/
00005 
00009 
00010 #pragma once
00011 
00012 #include <vrvCore/vrvCore.h>
00013 
00014 #include <vrvUtil/DtVirtualBaseClass.h>
00015 #include <vrvUtil/DtSignalConnectionManager.h>
00016 
00017 #include <boost/unordered_map.hpp>
00018 
00019 #include <list>
00020 
00021 namespace makVrv
00022 {
00023 
00024    class DtBaseConnection;
00025 
00037    class DT_DLL_VRVCORE DtOverlayGroupManager : public DtVirtualBaseClass
00038    {
00039    public:
00040 
00042       enum OverlayGroupId
00043       {
00044          HiddenGroup = 0,
00045          DefaultGroup = 1,
00046          UnusedLowGroup = 2,
00047          GroupsGroup = 500000,
00048          UnusedHighGroup = 1000000,
00049       };
00050 
00052       typedef std::list<std::string> GroupRangeList;
00053 
00054    public:
00055 
00058       static DtOverlayGroupManager& instance( DtDe& de );
00059 
00062       static DtOverlayGroupManager& instance( DtBaseConnection& sim );
00063 
00065       static void copyInstance( DtBaseConnection& sim, DtDe& de );
00066 
00068       virtual ~DtOverlayGroupManager();
00069 
00083       inline void initializeDefaultGroupSets()
00084       {
00085          addOverlayGroupSet( "hoverGroupSet" );
00086          addOverlayGroupSet( "selectedGroupSet" );
00087          addOverlayGroupSet( "iconsGroupSet" );
00088          addOverlayGroupSet( "rangeInfoGroupSet" );
00089          addOverlayGroupSet( "entityInfoPinnedGroupSet" );
00090          addOverlayGroupSet( "symbolDecorationGroupSet" );
00091       }
00092 
00095       virtual void addOverlayGroupSet( const std::string& name );
00096 
00100       virtual void addOverlayGroupSetUnder( const std::string& name,
00101          const std::string& beforeName );
00102 
00106       virtual void addOverlayGroupSetAbove( const std::string& name,
00107          const std::string& afterName );
00108 
00111       virtual const GroupRangeList& overlayGroupSets() const;
00112 
00116       virtual GroupRangeList& overlayGroupSets();
00117 
00123       virtual unsigned int nextGroupId( const std::string& groupSetName );
00124 
00125    protected:
00126 
00127       template <typename ManagerClass>
00128       friend ManagerClass& defaultManagerInstanceFunction(DtDe&,bool);
00129 
00130       template <typename ManagerClass>
00131       friend void defaultManagerRegisterInstanceFunction(DtDe&,ManagerClass*);
00132 
00134       DtOverlayGroupManager();
00135 
00137       DtOverlayGroupManager( DtDe& de );
00138 
00140       DtOverlayGroupManager( const DtOverlayGroupManager& copy );
00141 
00145       virtual void initializeGroupIdGenerators();
00146 
00147    protected:
00148 
00153       class DtOverlayGroupIdGenerator
00154       {
00155       public:
00156 
00161          DtOverlayGroupIdGenerator( const std::string& name,
00162             unsigned int minId, unsigned int maxId );
00163 
00169          unsigned int nextGroupId();
00170 
00171       protected:
00172 
00173          std::string myGroupName;
00174 
00175          unsigned int myNextId;
00176 
00177          unsigned int myMinId;
00178          unsigned int myMaxId;
00179 
00180       };
00181 
00182    protected:
00183 
00185       typedef boost::unordered_map<std::string,DtOverlayGroupIdGenerator*>
00186          GroupIdGeneratorList;
00187 
00188       GroupIdGeneratorList myGroupIdGenerators;
00189 
00190       GroupRangeList myOverlayGroupRanges;
00191 
00192       DtDe* myOptionalDe;
00193 
00194       unsigned int myNextGroupId;
00195 
00196       bool myModificationsLockedFlag;
00197 
00198    };
00199 
00200 }

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)