VR-Forces 4.3 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
vrfModelSetManager.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2014 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
8 
10 
11 #pragma once
12 
13 #include <vrfGuiCore/vrfGuiCore.h>
15 #include <vlpi/entityType.h>
18 #include <vrfutil/propertyUtils.h>
20 
21 #include <boost/signal.hpp>
22 
23 #include <string>
24 #include <map>
25 
26 class DtModelSet;
27 class DtModelSetEntry;
28 class DtString;
30 
31 namespace makVrv
32 {
33  class DtDe;
34 }
35 
36 namespace makVrf
37 {
38  class DtEntityMapperKey;
39 
42  {
43  public:
45  virtual ~DtVrfModelSetManager();
46 
48  static DtVrfModelSetManager& instance(makVrv::DtDe& de);
49 
50  public:
52  virtual bool load(const std::string&, bool reset = true, bool signal = true);
53 
56  virtual bool loadFromDirectory(const std::string& dataDirectory, const std::string& guiDirectory,
57  const std::string& platformsDirectory, bool reset = true, bool signal = true);
58 
60  virtual DtModelSetEntry* modelSetEntry(const DtEntityMapperKey& key) const;
61 
63  virtual bool canHoldSubordinates(const DtEntityMapperKey& key) const;
64 
66  virtual DtModelSetEntry* exactModelSetEntry(const DtEntityMapperKey& key) const;
67 
69  virtual DtEntityType nameToType(const DtString&) const;
70 
72  virtual bool isFavorite(const DtEntityMapperKey& key, int force) const;
73 
75  virtual DtModelSetEntry* addModelSetEntry(const DtString& label, const DtEntityMapperKey&,
76  const DtRwNLengthStringVector& cats);
77 
79  virtual void removeModelSetEntry(const DtEntityMapperKey& e);
80 
82  virtual std::string nameFor(const DtEntityMapperKey&) const;
83 
85  virtual std::string keywordsFor(const DtEntityMapperKey&) const;
86 
88  template <class T>
89  boost::optional<T> parameterPropertyFor(const DtEntityMapperKey& e,
90  const std::string& propertyName) const
91  {
92  DtRwProperties props("");
93 
95  settings->parameterPropertiesFor(DtEntityMapperKey(e), props);
96 
97  return findPropertyValue<T>(props, propertyName.c_str());
98  }
99 
102  virtual void setModelSet(DtModelSet*);
103 
106  virtual void setFavorite(const DtEntityMapperKey& key, bool b);
107 
110  virtual DtModelSet* loadFavoritesFor(const std::string&);
111 
114  virtual void mergeFavoritesInto(DtModelSet* favorite, DtModelSet* modelSet);
115 
117  virtual void mergeFavorites(DtModelSet* favorites);
118 
120  virtual DtModelSetEntry* favoriteFor(DtModelSetEntry*) const;
121 
123  virtual DtModelSet* modelSet();
124 
126  virtual DtModelSet modelSet() const;
127 
128  void setAutoSave(bool b)
129  {
130  myAutoSave = b;
131  }
132 
133  bool autoSave() const
134  {
135  return myAutoSave;
136  }
137 
138  protected:
140  virtual void clearModelSets();
141 
142  public:
143  boost::signal<void ()> signal_modelSetChanged;
144 
145  protected:
148 
149  typedef std::map<std::string, DtModelSet*> Favorites;
151 
153  };
154 }

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)