VR-Forces 4.1 Class Documentation
DtObserverSettingsManager.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2010 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 /******************************************************************************
6 ** $RCSfile: DtObserverSettingsManager.h,v $ $Revision: 1.16 $ $State: Exp $
7 ******************************************************************************/
8 
12 
13 #pragma once
14 #include <vrvCore/vrvCore.h>
19 #include <vector>
20 #include <map>
21 #include <string>
22 
23 namespace makVrv
24 {
25  class DtDe;
26  class DtObserverSettingsDisplayNameProvider;
27  class DtObserverSettingsToolTipProvider;
28  class DtStringKeyConverter;
29 
40  {
41  public:
43 
45  {
46  Global = 0,
47  ShowMainModel = 1,
68  ShowTacticalSmoke
69  };
70 
72  typedef std::vector<int> GlobalSettingsList;
73  typedef std::vector<int> ProjectionSettingsList;
74  typedef std::vector<int> ModelSetSettingsList;
75 
77  static DtObserverSettingsManager& instance(DtDe& de);
78 
80  virtual ~DtObserverSettingsManager();
81 
83  int registerGlobalObserverSetting( const std::string& stringKey,
84  const std::string& iconName="" );
85 
87  void registerGlobalObserverSetting( const std::string& stringKey,
88  int intKey, const std::string& iconName="" );
89 
92  int registerProjectionSpecificObserverSetting( const std::string&
93  stringKey, bool is2D, const std::string& iconName="" );
94 
97  void registerProjectionSpecificObserverSetting( const std::string& stringKey,
98  int intKey, bool is2D, const std::string& iconName="" );
99 
102  int registerModelSetSpecificObserverSetting( const std::string& stringKey,
103  ModelSetList modelSets, const std::string& iconName="" );
104 
106  void registerModelSetSpecificObserverSetting( const std::string& stringKey,
107  int intKey, ModelSetList modelSets, const std::string& iconName="" );
108 
111  int lookupObserverSettingIntKey( const std::string& stringKey ) const;
112 
115  const std::string* findObserverSettingStringKey( int intKey ) const;
116 
118  const std::string* findObserverSettingDisplayName( int intKey ) const;
119 
122  const std::string* findObserverSettingToolTip( int intKey ) const;
123 
125  const std::string* findObserverSettingIcon( int intKey ) const;
126 
128  const GlobalSettingsList& globalSettings() const;
129 
131  const ProjectionSettingsList& projectionSpecificSettings( bool is2D ) const;
132 
134  const ModelSetSettingsList& modelSetSpecificSettings( int modelSet ) const;
135 
139  bool isSettingValid( bool projection, int modelSet, int settingKey );
140 
142  inline DtObserverSettingsDisplayNameProvider& displayNameProvider() const
143  {
144  return *myDisplayNameProvider;
145  }
146 
147  protected:
148 
149  void registerSettingKey( ModelSetList modelSets, int key );
150 
153 
154  // Stuff needed by multiple public functions
155  void registerProjectionSetting( bool projection, int key );
156  void registerModelSetSetting( int modelSet, int key );
157  void registerIconName( int key, const std::string& iconName );
158 
159  protected:
160 
161  typedef std::map<bool, ProjectionSettingsList> ProjectionSettingsMap;
162  typedef std::map<int, ModelSetSettingsList> ModelSetSettingsMap;
163  typedef std::map<int, std::string> IconNameMap;
164  typedef std::map<int, bool> InclusionMap;
165 
169  DtObserverSettingsToolTipProvider* myToolTipProvider;
174 
178  };
179 
183  {
184  public:
187 
190 
194  static DtObserverSettingsManagerCreator& instance(DtDe& de);
195 
197  virtual DtObserverSettingsManager* create(DtDe&);
198  };
199 }

Document ID: Generated on Tue Jan 29 18:21:16 EST 2013 from SVN revision 123193
Copyright © 2005-2013 VT MÄK Inc. All Rights Reserved (www.mak.com)