VR-Forces 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 <vrfutil/rwColor.h>
10 #include <vlutil/vlString.h>
11 #include <vlutil/vlFilename.h>
12 
13 #include <map>
14 #include <set>
15 
16 class DtFilename;
17 
20 const int DtSpecialAllTagRank = 10000;
21 
25 {
26 public:
28  {
33  CategoryInformation() : rank(100), topLevelTag(0), visible(true), organizeOnListView(false) {};
34  CategoryInformation(const CategoryInformation& orig) : rank(orig.rank), visible(orig.visible), topLevelTag(orig.topLevelTag), iconFilename(orig.iconFilename), category(orig.category),
35  displayName(orig.displayName), organizeOnListView(orig.organizeOnListView), color(orig.color) {};
36 
37  bool operator==(const CategoryInformation& rhs) const
38  {
39  return ((rank == rhs.rank) && (topLevelTag == rhs.topLevelTag) && (iconFilename == rhs.iconFilename) && (category == rhs.category) && (visible == rhs.visible)
40  && (displayName == rhs.displayName) && (organizeOnListView == rhs.organizeOnListView) && (color == rhs.color));
41  }
42 
43  bool operator!=(const CategoryInformation& rhs) const { return !(*this == rhs); };
44 
46  {
47  category = rhs.category;
48  rank = rhs.rank;
49  topLevelTag = rhs.topLevelTag;
50  iconFilename = rhs.iconFilename;
51  visible = rhs.visible;
52  displayName = rhs.displayName;
53  organizeOnListView = rhs.organizeOnListView;
54  color = rhs.color;
55 
56  return *this;
57  }
58 
60  int rank;
65  bool visible;
67  };
68 
69  typedef std::map<DtString, CategoryInformation> Categories;
70 
71 public:
75 
78 
82  virtual bool load(const DtFilename&, bool clear = false);
83 
85  virtual void clear();
86 
88  virtual bool save(const DtFilename&);
89 
92  virtual void addCategoryInformation(const DtString&, int rank = 100, int topLevelTag = 0, const DtString& iconFilename = "", bool visible = true,
93  const DtString& displayName = "", bool organizeOnListView = false, const DtRwColor& color = DtRwColor());
94  virtual void addCategoryInformation(const DtString&, const CategoryInformation& cat);
95 
97  virtual void removeCategoryInformation(const DtString&);
98 
100  virtual bool hasCategory(const DtString&) const;
101 
103  virtual int topLevelTag(const DtString& cat) const;
104 
106  virtual std::set<DtString> topLevelTags(int level = 1) const;
107 
109  virtual CategoryInformation categoryInformation(const DtString&) const;
110 
112  const Categories& categories() const
113  {
114  return myCategories;
115  }
116 
118 
121  {
122  return !(*this == orig);
123  }
124 
126  static DtFilename categoriesFilename();
127  static void setCategoriesFilename(const DtFilename&);
128 
129 protected:
131 };
Definition: simulationObjectCategoryInformation.h:27
const Categories & categories() const
Returns the category information as a map.
Definition: simulationObjectCategoryInformation.h:112
The DtSimulationObjectCategoryInformation class is a class that will read the comma delimited categor...
Definition: simulationObjectCategoryInformation.h:24
DtString displayName
Definition: simulationObjectCategoryInformation.h:66
CategoryInformation()
Top level tag is also the level of tag 0 - Normal tag category 1 - Highest level tag 2 - Secondard le...
Definition: simulationObjectCategoryInformation.h:33
DT_DLL_VRVCORE DtTaitBryan level(const DtCoordinateSystem &cs, const DtVector &localOrigin, double topoHeading)
Returns a level orientation with the topographic heading.
DT_DLL_terrainCS bool operator==(const DtDegMinSec &lhs, const DtDegMinSec &rhs)
CategoryInformation(const CategoryInformation &orig)
Definition: simulationObjectCategoryInformation.h:34
bool operator!=(const DtSimulationObjectCategoryInformation &orig) const
Definition: simulationObjectCategoryInformation.h:120
bool organizeOnListView
Definition: simulationObjectCategoryInformation.h:64
CategoryInformation & operator=(const CategoryInformation &rhs)
Definition: simulationObjectCategoryInformation.h:45
DtRwColor color
Definition: simulationObjectCategoryInformation.h:59
Reader-Writer color specified by red, green, blue components.
Definition: rwColor.h:19
int topLevelTag
Definition: simulationObjectCategoryInformation.h:61
bool visible
Definition: simulationObjectCategoryInformation.h:65
bool operator==(const CategoryInformation &rhs) const
Definition: simulationObjectCategoryInformation.h:37
DtString iconFilename
Definition: simulationObjectCategoryInformation.h:62
bool operator!=(const CategoryInformation &rhs) const
Definition: simulationObjectCategoryInformation.h:43
DtString category
Definition: simulationObjectCategoryInformation.h:63
Categories myCategories
Definition: simulationObjectCategoryInformation.h:130
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:20
#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
std::map< DtString, CategoryInformation > Categories
Definition: simulationObjectCategoryInformation.h:69
int rank
Definition: simulationObjectCategoryInformation.h:60

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)