VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtCDBDatasetInfo.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright(c) 2025 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
11 
12 #pragma once
13 #include <utility>
14 #include <sstream>
15 #include <iostream>
16 #include <iomanip>
17 #include <boost/tuple/tuple.hpp>
18 #include <boost/tuple/tuple_comparison.hpp>
20 
21 namespace makVrv { namespace oe { namespace CDB
22 {
25  {
26  public:
27 
30  myDataset(0),
33  {
34  setStr();
35  };
37  DatasetInfo(int Dataset, int ComponentSelector1, int ComponentSelector2) :
38  myDataset(Dataset),
39  myComponentSelector1(ComponentSelector1),
40  myComponentSelector2(ComponentSelector2)
41  {
42  setStr();
43  };
44 
46  friend bool operator< (const DatasetInfo& lhs, const DatasetInfo& rhs)
47  {
48  return boost::tie(lhs.myDataset, lhs.myComponentSelector1, lhs.myComponentSelector2)
49  < boost::tie(rhs.myDataset, rhs.myComponentSelector1, rhs.myComponentSelector2); // keep the same order
50  }
52  friend bool operator== (const DatasetInfo& lhs, const DatasetInfo& rhs)
53  {
54  if (lhs.getDataset() == rhs.getDataset())
55  {
57  {
59  {
60  return true;
61  }
62  }
63  }
64  return false;
65  }
66 
68  std::string str() const { return myStringRepresentation; };
70  std::string strNoBracket() const
71  {
72  return myStringRepresentation.substr(1, myStringRepresentation.size() - 2);
73  };
74 
76  void setDatasetInfo(int Dataset, int ComponentSelector1, int ComponentSelector2)
77  {
78  myDataset = Dataset;
79  myComponentSelector1 = ComponentSelector1;
80  myComponentSelector2 = ComponentSelector2;
81  setStr();
82  };
84  void setDataset(int dataset) { myDataset = dataset; };
86  int getDataset() const { return myDataset; };
92  bool isLinearDataset() const
93  {
94  // linear datasets
96  {
97  // Man-Made Lineal Features
98  if ((myComponentSelector1 == 1 && myComponentSelector2 == 3) ||
99  // Natural Lineal Features
101  // Airport Lineal Features
103  {
104  return true;
105  }
106  }
108  {
109  // Man-Made Lineal Features
110  if ((myComponentSelector1 == 1 && myComponentSelector2 == 3) ||
111  // Tree Lineal Features
113  {
114  return true;
115  }
116  }
118  {
119  // Boundary Lineal Features
120  if ((myComponentSelector1 == 1 && myComponentSelector2 == 3) ||
121  // Location Lineal Features
122  (myComponentSelector1 == 2 && myComponentSelector2 == 3) ||
123  // Constraint Lineal Features
125  {
126  return true;
127  }
128  }
130  {
131  // Road Network Linear Features
133  {
134  return true;
135  }
136  }
138  {
139  // RailRoad Network Linear Features
141  {
142  return true;
143  }
144  }
146  {
147  // PowerLine Network Linear Features
149  {
150  return true;
151  }
152  }
154  {
155  // Hydrography Network Linear Features
157  {
158  return true;
159  }
160  }
161  return false;
162  }
164  bool isArealDataset() const
165  {
166  // GS datasets
168  {
169  // Man-Made Areal Features
170  if ((myComponentSelector1 == 1 && myComponentSelector2 == 5) ||
171  // Natural Areal Features
173  // Airport Areal Features
175  {
176  return true;
177  }
178  }
179  // GT datasets
181  {
182  // Man-Made Areal Features
183  if ((myComponentSelector1 == 1 && myComponentSelector2 == 5) ||
184  // Tree Areal Features
186  {
187  return true;
188  }
189  }
190 
191  // Geopolitical Areal Features
193  {
194  // Boundary Areal Features
196  {
197  return true;
198  }
199  // Location Areal Features
201  {
202  return true;
203  }
204  // Constaint Areal Features
206  {
207  return true;
208  }
209  }
210 
211  // Hydrography Network Areal Features
213  {
215  {
216  return true;
217  }
218  }
219  return false;
220  }
221 
222  private:
223 
225  void setStr()
226  {
227  std::stringstream format_stream_2;
228  format_stream_2 << "[D" << std::setfill('0') << std::setw(3) << myDataset; // dataset code
229  format_stream_2 << "_S" << std::setfill('0') << std::setw(3) << myComponentSelector1; // Component Selector 1
230  format_stream_2 << "_T" << std::setfill('0') << std::setw(3) << myComponentSelector2; // Component Selector 2
231  format_stream_2 << "]";
232  myStringRepresentation = format_stream_2.str();
233  };
234 
236  int myDataset;
243  };
244 } } } // namespace makVrv::oe::CDB
std::string myStringRepresentation
CDB Dataset string information representation ([Dxxx_Sxxx_Txxx])
Definition: DtCDBDatasetInfo.h:242
DatasetInfo()
CTOR.
Definition: DtCDBDatasetInfo.h:29
int getDataset() const
Return the CDB dataset code (Dxxx)
Definition: DtCDBDatasetInfo.h:86
static const int theDatasetCodeRailRoadNetwork
CDB Rail Road Network Dataset code (202)
Definition: DtCDBDatasets.h:113
Utility class to get CDB dataset information.
static const int theDatasetCodeGsFeature
CDB GS Feature Dataset code (100)
Definition: DtCDBDatasets.h:103
int myComponentSelector1
CDB component selector 1 (Sxxx)
Definition: DtCDBDatasetInfo.h:238
static const int theDatasetCodeHydrographyNetwork
CDB Hydrography Network Dataset code (204)
Definition: DtCDBDatasets.h:117
static const int theDatasetCodePowerLineNetwork
CDB Power Line Network Dataset code (203)
Definition: DtCDBDatasets.h:115
std::string str() const
Return the string representation of this dataset.
Definition: DtCDBDatasetInfo.h:68
void setDataset(int dataset)
Set the CDB dataset code (Dxxx)
Definition: DtCDBDatasetInfo.h:84
DatasetInfo(int Dataset, int ComponentSelector1, int ComponentSelector2)
CTOR.
Definition: DtCDBDatasetInfo.h:37
int getComponentSelector1() const
Return the CDB component selector 1 (Sxxx)
Definition: DtCDBDatasetInfo.h:88
static const int theDatasetCodeGtFeature
CDB GT Feature Dataset code (101)
Definition: DtCDBDatasets.h:105
CDB Dataset information class.
Definition: DtCDBDatasetInfo.h:24
std::string strNoBracket() const
Return the string representation of this dataset.
Definition: DtCDBDatasetInfo.h:70
void setStr()
Get the string representation of this dataset.
Definition: DtCDBDatasetInfo.h:225
int myComponentSelector2
CDB component selector 2 (Txxx)
Definition: DtCDBDatasetInfo.h:240
friend bool operator<(const DatasetInfo &lhs, const DatasetInfo &rhs)
Smaller than operator for the Dataset Info class.
Definition: DtCDBDatasetInfo.h:46
static const int theDatasetCodeGeoPolitical
CDB GeoPolitical Feature Dataset code (102)
Definition: DtCDBDatasets.h:107
void setDatasetInfo(int Dataset, int ComponentSelector1, int ComponentSelector2)
Change the dataset information.
Definition: DtCDBDatasetInfo.h:76
bool isLinearDataset() const
Return true if this dataset is a linear dataset (line features)
Definition: DtCDBDatasetInfo.h:92
int getComponentSelector2() const
Return the CDB component selector 2 (Txxx)
Definition: DtCDBDatasetInfo.h:90
bool isArealDataset() const
Return true if this dataset is an areal dataset.
Definition: DtCDBDatasetInfo.h:164
friend bool operator==(const DatasetInfo &lhs, const DatasetInfo &rhs)
== than operator for the Dataset Info class
Definition: DtCDBDatasetInfo.h:52
static const int theDatasetCodeRoadNetwork
CDB Road Network Dataset code (201)
Definition: DtCDBDatasets.h:111
int myDataset
CDB dataset code (Dxxx)
Definition: DtCDBDatasetInfo.h:233

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)