VR-Forces 4.2 Class Documentation
DtVrfModelSetManager.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2012 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
8 
10 
11 #pragma once
12 
13 #include <vrfGuiCore/vrfGuiCore.h>
14 #include <vrvUtil/DtVirtualBaseClass.h>
15 
16 #include <boost/signal.hpp>
17 
18 #include <string>
19 #include <map>
20 
21 class DtModelSet;
22 class DtModelSetEntry;
23 class DtString;
25 
26 namespace makVrv
27 {
28  class DtDe;
29 }
30 
31 namespace makVrf
32 {
33  class DtEntityMapperKey;
34 
36  class DT_DLL_VRFGUICORE DtVrfModelSetManager : public makVrv::DtVirtualBaseClass
37  {
38  public:
39  DtVrfModelSetManager(makVrv::DtDe&);
40  virtual ~DtVrfModelSetManager();
41 
43  static DtVrfModelSetManager& instance(makVrv::DtDe& de);
44 
45  public:
47  virtual bool load(const std::string&, bool reset = true, bool signal = true);
48 
51  virtual bool loadFromDirectory(const std::string& dataDirectory, const std::string& guiDirectory,
52  bool reset = true, bool signal = true);
53 
55  virtual DtModelSetEntry* modelSetEntry(const DtEntityMapperKey& key) const;
56 
58  virtual DtModelSetEntry* exactModelSetEntry(const DtEntityMapperKey& key) const;
59 
61  virtual bool isFavorite(const DtEntityMapperKey& key, int force) const;
62 
64  virtual DtModelSetEntry* addModelSetEntry(const DtString& label, const DtEntityMapperKey&,
65  const DtRwNLengthStringVector& cats);
66 
68  virtual void removeModelSetEntry(const DtEntityMapperKey& e);
69 
71  virtual std::string nameFor(const DtEntityMapperKey&) const;
72 
74  virtual std::string keywordsFor(const DtEntityMapperKey&) const;
75 
78  virtual void setModelSet(DtModelSet*);
79 
82  virtual void setFavorite(const DtEntityMapperKey& key, bool b);
83 
86  virtual DtModelSet* loadFavoritesFor(const std::string&);
87 
90  virtual void mergeFavoritesInto(DtModelSet* favorite, DtModelSet* modelSet);
91 
93  virtual DtModelSetEntry* favoriteFor(DtModelSetEntry*) const;
94 
95  const DtModelSet* modelSet() const
96  {
97  return myModelSet;
98  }
99 
100  DtModelSet* modelSet()
101  {
102  return myModelSet;
103  }
104 
105  void setAutoSave(bool b)
106  {
107  myAutoSave = b;
108  }
109 
110  bool autoSave() const
111  {
112  return myAutoSave;
113  }
114 
115  protected:
117  virtual void clearModelSets();
118 
119  public:
120  boost::signal<void ()> signal_modelSetChanged;
121 
122  protected:
123  makVrv::DtDe& myDe;
127 
128  typedef std::map<std::string, DtModelSet*> Favorites;
130  };
131 }

Document ID: Generated on Sun Nov 24 19:49:21 EST 2013 from SVN revision 133924
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)