VR-Forces 4.3 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
11 #include <vrvCore/vrvCore.h>
12 
16 
17 #include <vrvUtil/DtUnicode.h>
19 
20 #include <vector>
21 #include <map>
22 #include <string>
23 
24 namespace makVrv
25 {
26  class DtDe;
27  class DtObserverSettingsDisplayNameProvider;
28  class DtObserverSettingsToolTipProvider;
29  class DtStringKeyConverter;
30 
41  {
42  public:
44 
46  {
47  Global = 0,
48  ShowMainModel = 1,
54  ShowWakes, // Obsolete with Triton Wakes
77  USER_START = 500 // if the user wants to extend enum
78  };
79 
81  typedef std::vector<int> GlobalSettingsList;
82  typedef std::vector<int> ProjectionSettingsList;
83  typedef std::vector<int> ModelSetSettingsList;
84 
86  static DtObserverSettingsManager& instance(DtDe& de);
87 
89  virtual ~DtObserverSettingsManager();
90 
92  int registerGlobalObserverSetting( const std::string& stringKey,
93  const std::string& iconName="" );
94 
96  void registerGlobalObserverSetting( const std::string& stringKey,
97  int intKey, const std::string& iconName="" );
98 
101  int registerProjectionSpecificObserverSetting( const std::string&
102  stringKey, bool is2D, const std::string& iconName="" );
103 
106  void registerProjectionSpecificObserverSetting( const std::string& stringKey,
107  int intKey, bool is2D, const std::string& iconName="" );
108 
111  int registerModelSetSpecificObserverSetting( const std::string& stringKey,
112  ModelSetList modelSets, const std::string& iconName="" );
113 
115  void registerModelSetSpecificObserverSetting( const std::string& stringKey,
116  int intKey, ModelSetList modelSets, const std::string& iconName="" );
117 
120  int lookupObserverSettingIntKey( const std::string& stringKey ) const;
121 
124  const std::string* findObserverSettingStringKey( int intKey ) const;
125 
127  const DtUnicode* findObserverSettingDisplayName( int intKey ) const;
128 
131  const DtUnicode* findObserverSettingToolTip( int intKey ) const;
132 
134  const std::string* findObserverSettingIcon( int intKey ) const;
135 
137  const GlobalSettingsList& globalSettings() const;
138 
140  const ProjectionSettingsList& projectionSpecificSettings( bool is2D ) const;
141 
143  const ModelSetSettingsList& modelSetSpecificSettings( int modelSet ) const;
144 
151  bool isSettingValid( bool projection, int modelSet, int settingKey );
152 
154  inline DtObserverSettingsDisplayNameProvider& displayNameProvider() const
155  {
156  return *myDisplayNameProvider;
157  }
158 
159  protected:
160 
161  void registerSettingKey( ModelSetList modelSets, int key );
162 
165 
166  // Stuff needed by multiple public functions
167  void registerProjectionSetting( bool projection, int key );
168  void registerModelSetSetting( int modelSet, int key );
169  void registerIconName( int key, const std::string& iconName );
170 
171  protected:
172 
173  typedef std::map<bool, ProjectionSettingsList> ProjectionSettingsMap;
174  typedef std::map<int, ModelSetSettingsList> ModelSetSettingsMap;
175  typedef std::map<int, std::string> IconNameMap;
176  typedef std::map<int, bool> InclusionMap;
177 
181  DtObserverSettingsToolTipProvider* myToolTipProvider;
186 
190  };
191 
195  {
196  public:
199 
202 
206  static DtObserverSettingsManagerCreator& instance(DtDe& de);
207 
209  virtual DtObserverSettingsManager* create(DtDe&);
210  };
211 }

Document ID: Generated on Wed Mar 11 21:20:57 EDT 2015 from SVN revision 150940
Copyright © 2005-2014 VT MÄK. All Rights Reserved (www.mak.com)