VR-Forces Development_Version Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DtObserverSettingsManager.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Copyright (c) 2014 MAK Technologies, Inc.
3  * All rights reserved.
4  *****************************************************************************/
5 
9 
10 #pragma once
14 
15 #include <vrvUtil/DtUnicode.h>
16 
17 #include <vector>
18 
19 namespace makVrv
20 {
21  class DtDe;
22  class DtObserverSettingsDisplayNameProvider;
23  class DtObserverSettingsToolTipProvider;
24  class DtStringKeyConverter;
25 
36  {
37  public:
39 
41  {
42  Global = 0,
43  ShowMainModel = 1,
46  EnableViewControl, // Deprecated. Use DtApplicationSettingsManager
49  ShowWakes, // Obsolete with Triton Wakes
74  USER_START = 500 // if the user wants to extend enum
75  };
76 
78  typedef std::vector<int> GlobalSettingsList;
79  typedef std::vector<int> ProjectionSettingsList;
80  typedef std::vector<int> ModelSetSettingsList;
81 
83  static DtObserverSettingsManager& instance(DtDe& de);
84 
86  virtual ~DtObserverSettingsManager();
87 
89  int registerGlobalObserverSetting( const std::string& stringKey,
90  const std::string& iconName="" );
91 
93  void registerGlobalObserverSetting( const std::string& stringKey,
94  int intKey, const std::string& iconName="" );
95 
98  int registerProjectionSpecificObserverSetting( const std::string&
99  stringKey, bool is2D, const std::string& iconName="" );
100 
103  void registerProjectionSpecificObserverSetting( const std::string& stringKey,
104  int intKey, bool is2D, const std::string& iconName="" );
105 
108  int registerModelSetSpecificObserverSetting( const std::string& stringKey,
109  ModelSetList modelSets, const std::string& iconName="" );
110 
112  void registerModelSetSpecificObserverSetting( const std::string& stringKey,
113  int intKey, ModelSetList modelSets, const std::string& iconName="" );
114 
117  int lookupObserverSettingIntKey( const std::string& stringKey ) const;
118 
121  const std::string* findObserverSettingStringKey( int intKey ) const;
122 
124  const DtUnicode* findObserverSettingDisplayName( int intKey ) const;
125 
128  const DtUnicode* findObserverSettingToolTip( int intKey ) const;
129 
131  const std::string* findObserverSettingIcon( int intKey ) const;
132 
134  const GlobalSettingsList& globalSettings() const;
135 
137  const ProjectionSettingsList& projectionSpecificSettings( bool is2D ) const;
138 
140  const ModelSetSettingsList& modelSetSpecificSettings( int modelSet ) const;
141 
148  bool isSettingValid( bool projection, int modelSet, int settingKey );
149 
151  inline DtObserverSettingsDisplayNameProvider& displayNameProvider() const
152  {
153  return *myDisplayNameProvider;
154  }
155 
156  protected:
157 
158  void registerSettingKey( ModelSetList modelSets, int key );
159 
162 
163  // Stuff needed by multiple public functions
164  void registerProjectionSetting( bool projection, int key );
165  void registerModelSetSetting( int modelSet, int key );
166  void registerIconName( int key, const std::string& iconName );
167 
168  protected:
169 
170  typedef std::map<bool, ProjectionSettingsList> ProjectionSettingsMap;
171  typedef std::map<int, ModelSetSettingsList> ModelSetSettingsMap;
172  typedef std::map<int, std::string> IconNameMap;
173  typedef std::map<int, bool> InclusionMap;
174 
178  DtObserverSettingsToolTipProvider* myToolTipProvider;
183 
187  };
188 
192  {
193  public:
196 
199 
203  static DtObserverSettingsManagerCreator& instance(DtDe& de);
204 
206  virtual DtObserverSettingsManager* create(DtDe&);
207  };
208 }

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)