VR-Forces 4.6 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtObserverSettingsManager.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Copyright (c) 2016 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
75  USER_START = 500 // if the user wants to extend enum
76  };
77 
79  typedef std::vector<int> GlobalSettingsList;
80  typedef std::vector<int> ProjectionSettingsList;
81  typedef std::vector<int> ModelSetSettingsList;
82 
84  static DtObserverSettingsManager& instance(DtDe& de);
85 
87  virtual ~DtObserverSettingsManager();
88 
90  int registerGlobalObserverSetting( const std::string& stringKey,
91  const std::string& iconName="" );
92 
94  void registerGlobalObserverSetting( const std::string& stringKey,
95  int intKey, const std::string& iconName="" );
96 
99  int registerProjectionSpecificObserverSetting( const std::string&
100  stringKey, bool is2D, const std::string& iconName="" );
101 
104  void registerProjectionSpecificObserverSetting( const std::string& stringKey,
105  int intKey, bool is2D, const std::string& iconName="" );
106 
109  int registerModelSetSpecificObserverSetting( const std::string& stringKey,
110  ModelSetList modelSets, const std::string& iconName="" );
111 
113  void registerModelSetSpecificObserverSetting( const std::string& stringKey,
114  int intKey, ModelSetList modelSets, const std::string& iconName="" );
115 
118  int lookupObserverSettingIntKey( const std::string& stringKey ) const;
119 
122  const std::string* findObserverSettingStringKey( int intKey ) const;
123 
125  const DtUnicode* findObserverSettingDisplayName( int intKey ) const;
126 
129  const DtUnicode* findObserverSettingToolTip( int intKey ) const;
130 
132  const std::string* findObserverSettingIcon( int intKey ) const;
133 
135  const GlobalSettingsList& globalSettings() const;
136 
138  const ProjectionSettingsList& projectionSpecificSettings( bool is2D ) const;
139 
141  const ModelSetSettingsList& modelSetSpecificSettings( int modelSet ) const;
142 
149  bool isSettingValid( bool projection, int modelSet, int settingKey );
150 
152  inline DtObserverSettingsDisplayNameProvider& displayNameProvider() const
153  {
154  return *myDisplayNameProvider;
155  }
156 
157  protected:
158 
159  void registerSettingKey( ModelSetList modelSets, int key );
160 
163 
164  // Stuff needed by multiple public functions
165  void registerProjectionSetting( bool projection, int key );
166  void registerModelSetSetting( int modelSet, int key );
167  void registerIconName( int key, const std::string& iconName );
168 
169  protected:
170 
171  typedef std::map<bool, ProjectionSettingsList> ProjectionSettingsMap;
172  typedef std::map<int, ModelSetSettingsList> ModelSetSettingsMap;
173  typedef std::map<int, std::string> IconNameMap;
174  typedef std::map<int, bool> InclusionMap;
175 
179  DtObserverSettingsToolTipProvider* myToolTipProvider;
184 
188  };
189 
193  {
194  public:
197 
200 
204  static DtObserverSettingsManagerCreator& instance(DtDe& de);
205 
207  virtual DtObserverSettingsManager* create(DtDe&);
208  };
209 }

Document ID: Generated on Thu Apr 12 03:15:37 EDT 2018 from SVN revision 187986
Copyright © 2005-2018 VT MÄK. All Rights Reserved (www.mak.com)