VR-Forces 5.0.1 Developer's Guide
 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 };
Definition: simulationObjectCategoryInformation.h:25
const Categories & categories() const
Returns the category information as a map.
Definition: simulationObjectCategoryInformation.h:99
The DtSimulationObjectCategoryInformation class is a class that will read the comma delimited categor...
Definition: simulationObjectCategoryInformation.h:22
DtString displayName
Definition: simulationObjectCategoryInformation.h:56
CategoryInformation()
Definition: simulationObjectCategoryInformation.h:27
DT_DLL_terrainCS bool operator==(const DtDegMinSec &lhs, const DtDegMinSec &rhs)
CategoryInformation(const CategoryInformation &orig)
Definition: simulationObjectCategoryInformation.h:28
bool operator!=(const DtSimulationObjectCategoryInformation &orig) const
Definition: simulationObjectCategoryInformation.h:107
CategoryInformation & operator=(const CategoryInformation &rhs)
Definition: simulationObjectCategoryInformation.h:39
bool visible
Definition: simulationObjectCategoryInformation.h:55
bool operator==(const CategoryInformation &rhs) const
Definition: simulationObjectCategoryInformation.h:31
DtString iconFilename
Definition: simulationObjectCategoryInformation.h:53
bool operator!=(const CategoryInformation &rhs) const
Definition: simulationObjectCategoryInformation.h:37
DtString category
Definition: simulationObjectCategoryInformation.h:54
Categories myCategories
Definition: simulationObjectCategoryInformation.h:117
const int DtSpecialAllTagRank
Not used by default, but, you cal add a special &quot;all&quot; tag that will be used as an all filter...
Definition: simulationObjectCategoryInformation.h:18
#define DT_DLL_vrfutil
This file is used to determine how to build Disable inconsistent dll linkage warning Visual Studio 6...
Definition: vrfutilDefines.h:34
bool topLevelTag
Definition: simulationObjectCategoryInformation.h:52
std::map< DtString, CategoryInformation > Categories
Definition: simulationObjectCategoryInformation.h:59
int rank
Definition: simulationObjectCategoryInformation.h:51

Document ID: Generated on Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)