VR-Forces 4.7 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
simulationObjectCategoryInformation.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2017 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
6 #pragma once
7 
9 #include <vlutil/vlString.h>
10 #include <vlutil/vlFilename.h>
11 
12 #include <map>
13 
14 class DtFilename;
15 
18 const int DtSpecialAllTagRank = -100;
19 
23 {
24 public:
26  {
27  CategoryInformation() : rank(100), topLevelTag(false), visible(true) {};
28  CategoryInformation(const CategoryInformation& orig) : rank(orig.rank), visible(orig.visible), topLevelTag(orig.topLevelTag), iconFilename(orig.iconFilename), category(orig.category),
29  displayName(orig.displayName) {};
30 
31  bool operator==(const CategoryInformation& rhs) const
32  {
33  return ((rank == rhs.rank) && (topLevelTag == rhs.topLevelTag) && (iconFilename == rhs.iconFilename) && (category == rhs.category) && (visible == rhs.visible)
34  && (displayName == rhs.displayName));
35  }
36 
37  bool operator!=(const CategoryInformation& rhs) const { return !(*this == rhs); };
38 
40  {
41  category = rhs.category;
42  rank = rhs.rank;
43  topLevelTag = rhs.topLevelTag;
44  iconFilename = rhs.iconFilename;
45  visible = rhs.visible;
46  displayName = rhs.displayName;
47 
48  return *this;
49  }
50 
51  int rank;
55  bool visible;
57  };
58 
59  typedef std::map<DtString, CategoryInformation> Categories;
60 
61 public:
65 
68 
72  virtual bool load(const DtFilename&, bool clear = false);
73 
75  virtual void clear();
76 
78  virtual bool save(const DtFilename&);
79 
82  virtual void addCategoryInformation(const DtString&, int rank = 100, bool topLevelTag = false, const DtString& iconFilename = "", bool visible = true,
83  const DtString& displayName = "");
84  virtual void addCategoryInformation(const DtString&, const CategoryInformation& cat);
85 
87  virtual void removeCategoryInformation(const DtString&);
88 
90  virtual bool hasCategory(const DtString&) const;
91 
93  virtual bool isTopLevelTag(const DtString& cat) const;
94 
96  virtual CategoryInformation categoryInformation(const DtString&) const;
97 
99  const Categories& categories() const
100  {
101  return myCategories;
102  }
103 
105 
108  {
109  return !(*this == orig);
110  }
111 
113  static DtFilename categoriesFilename();
114  static void setCategoriesFilename(const DtFilename&);
115 
116 protected:
118 };

Document ID: Generated on Fri Apr 26 21:53:14 EDT 2019 from SVN revision 197883
Copyright © 2005-2019 VT MAK. All Rights Reserved (www.mak.com)