VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
rangeItem.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2025 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
6 #pragma once
7 
8 #include <vlpi/netStructs.h>
9 #include <vector>
10 
11 // class DtRangeItem:
12 //
13 // Item that will define a range object used in the system
14 
16 const int RangeItemUnknown = 0;
17 const int RangeItemBallisticGun = 1;
18 const int RangeItemIndirectFire = 2;
19 const int RangeItemMissileSystem = 3;
20 const int RangeItemRangeProperty = 4;
21 const int RangeItemSensorRange = 5;
23 const int RangeItemGeneric = 7;
24 
27 const int RangeRingVersion_V1 = 0;
28 const int RangeRingVersion_V2 = 100;
29 const int RangeRingVersion_V3 = 200;
30 const int RangeRingVersion = RangeRingVersion_V3; // current version
31 // const int RangeRingVersion = 300; // Future expansion
32 
34 
35 // This corresponds to version 000
37 {
38 public:
39 
40  // default constructor
42 
43  // destructor
44  virtual ~DtRangeItem_V1();
45 
46  // copy constructor
47  DtRangeItem_V1(const DtRangeItem_V1& orig);
48 
49  // assignment operator
50  DtRangeItem_V1& operator=(const DtRangeItem_V1& orig);
51 
52  virtual const char* setFromNet(const char* buffer);
53  virtual char* setToNet(char* buffer) const;
54 
55  virtual int netRepSize() const;
56 
57  bool operator==(const DtRangeItem_V1& rhs) const
58  {
59  return ((myRange == rhs.myRange) &&
60  (myType == rhs.myType) &&
61  (myName == rhs.myName) &&
62  (myOffsetPosition[0] == rhs.myOffsetPosition[0]) &&
63  (myOffsetPosition[1] == rhs.myOffsetPosition[1]) &&
64  (myOffsetPosition[2] == rhs.myOffsetPosition[2]));
65  }
66 
67  DtNetFloat32 myRange;
68  DtNetInt32 myType;
69  DtNet64Vector myOffsetPosition;
71 };
72 
73 // This corresponds to version 000
75 {
76 public:
77  virtual ~DtRangeItems_V1();
78 
79  virtual int netRepSize() const;
80  virtual char* setFromNet(const char* buffer);
81  virtual char* setToNet(char* buffer) const;
82 
83  typedef std::vector<DtRangeItem_V1> RangeItems;
84 
86 };
87 
88 // This corresponds to version 100
90 {
91 public:
92 
93  // default constructor
95 
96  // destructor
97  virtual ~DtRangeItem_V2();
98 
99  // copy constructor
100  DtRangeItem_V2(const DtRangeItem_V2& orig);
101  DtRangeItem_V2(const DtRangeItem_V1& orig);
102 
103  // assignment operator
104  DtRangeItem_V2& operator=(const DtRangeItem_V2& orig);
105  DtRangeItem_V2& operator=(const DtRangeItem_V1& orig);
106 
107  virtual const char* setFromNet(const char* buffer);
108  virtual char* setToNet(char* buffer) const;
109 
110  virtual int netRepSize() const;
111 
112  bool operator==(const DtRangeItem_V2& rhs) const
113  {
114  return ((myRange == rhs.myRange) &&
115  (myType == rhs.myType) &&
116  (myName == rhs.myName) &&
117  (myColor == rhs.myColor) &&
118  (myWedgeSizes == rhs.myWedgeSizes) &&
119  (myOffsetPosition[0] == rhs.myOffsetPosition[0]) &&
120  (myOffsetPosition[1] == rhs.myOffsetPosition[1]) &&
121  (myOffsetPosition[2] == rhs.myOffsetPosition[2]));
122  }
123 
124  DtNetFloat32 myRange;
125  DtNetInt32 myType;
126  DtNet64Vector myOffsetPosition;
128 
130  DtNetInt32 myColor;
131  std::vector<DtNetFloat32> myWedgeSizes;
132 };
133 
134 // This corresponds to version 100
136 {
137 public:
138  virtual ~DtRangeItems_V2();
139 
140  virtual int netRepSize() const;
141  virtual char* setFromNet(const char* buffer);
142  virtual char* setToNet(char* buffer) const;
143 
144  typedef std::vector<DtRangeItem_V2> RangeItems;
145 
147 };
148 
150 {
151 public:
152 
153  // default constructor
154  DtRangeItem();
155 
156  // destructor
157  virtual ~DtRangeItem();
158 
159  // copy constructor
160  DtRangeItem(const DtRangeItem& orig);
161  DtRangeItem(const DtRangeItem_V2& orig);
162  DtRangeItem(const DtRangeItem_V1& orig);
163 
164  // assignment operator
165  DtRangeItem& operator=(const DtRangeItem& orig);
166  DtRangeItem& operator=(const DtRangeItem_V2& orig);
167  DtRangeItem& operator=(const DtRangeItem_V1& orig);
168 
169  virtual const char* setFromNet(const char* buffer);
170  virtual char* setToNet(char* buffer) const;
171 
172  virtual int netRepSize() const;
173 
174  bool operator==(const DtRangeItem& rhs) const
175  {
176  return ((myRange == rhs.myRange) &&
177  (myType == rhs.myType) &&
178  (myId == rhs.myId) &&
179  (myColor == rhs.myColor) &&
180  (myWedgeSizes == rhs.myWedgeSizes));
181  }
182 
183  DtNetFloat32 myRange;
184  DtNetInt16 myType;
185  DtNetInt16 myId;
186 
188  DtNetInt32 myColor;
189  std::vector<DtNetFloat32> myWedgeSizes;
190 
194 
195  // Future expansion
196  /*
198  DtNetFloat32 myAzimuthCenter;
199  DtNetFloat32 myAzimuthSweep;
200 
201  DtNetFloat32 myElevationCenter;
202  DtNetFloat32 myElevationSweep;
203  */
204 };
205 
207 {
208 public:
209  virtual ~DtRangeItems();
210 
211  virtual int netRepSize() const;
212  virtual char* setFromNet(const char* buffer);
213  virtual char* setToNet(char* buffer) const;
214 
215  typedef std::vector<DtRangeItem> RangeItems;
216 
218 };
DtNetFloat32 myRange
Definition: rangeItem.h:124
DtNetInt32 myColor
Version 100.
Definition: rangeItem.h:188
DtNet64Vector myOffsetPosition
Definition: rangeItem.h:69
Definition: rangeItem.h:36
DtNetInt16 myType
Definition: rangeItem.h:184
const int RangeItemUnknown
Pre-defined series of types that can be used to identify what type of range item this is...
Definition: rangeItem.h:16
std::vector< DtRangeItem_V2 > RangeItems
Definition: rangeItem.h:144
DtNetInt32 myType
Definition: rangeItem.h:68
Definition: rangeItem.h:74
DtNet64Vector myOffsetPosition
Definition: rangeItem.h:126
Definition: rangeItem.h:89
const int RangeItemMissileSystem
Definition: rangeItem.h:19
const int RangeRingVersion_V1
Since there is no versioning of the range item in the first iteration, use this as a version index of...
Definition: rangeItem.h:27
DtNetInt32 myColor
Version 100.
Definition: rangeItem.h:130
const int RangeItemIndirectFire
Definition: rangeItem.h:18
const int RangeItemSensorRange
Definition: rangeItem.h:21
Definition: rangeItem.h:149
bool operator==(const DtRangeItem &rhs) const
Definition: rangeItem.h:174
DtString myName
Definition: rangeItem.h:127
Definition: rangeItem.h:135
DtNetFloat32 myRange
Definition: rangeItem.h:67
const int RangeItemMaximumSensorRange
Definition: rangeItem.h:22
std::vector< DtRangeItem_V1 > RangeItems
Definition: rangeItem.h:83
Definition: rangeItem.h:206
DtNetInt32 myType
Definition: rangeItem.h:125
std::vector< DtNetFloat32 > myWedgeSizes
Definition: rangeItem.h:189
std::vector< DtRangeItem > RangeItems
Definition: rangeItem.h:215
bool operator==(const DtRangeItem_V1 &rhs) const
Definition: rangeItem.h:57
const int RangeItemBallisticGun
Definition: rangeItem.h:17
#define DT_DLL_vrfExtProtocol
Definition: vrfExtProtocolDefines.h:23
RangeItems myRangeItems
Definition: rangeItem.h:146
bool operator==(const DtRangeItem_V2 &rhs) const
Definition: rangeItem.h:112
const int RangeRingVersion
Definition: rangeItem.h:30
RangeItems myRangeItems
Definition: rangeItem.h:85
std::vector< DtNetFloat32 > myWedgeSizes
Definition: rangeItem.h:131
DtString myName
Name has been deprecated and is not put on the network. This is put here solely to store the value if...
Definition: rangeItem.h:193
const int RangeItemRangeProperty
Definition: rangeItem.h:20
DtString myName
Definition: rangeItem.h:70
RangeItems myRangeItems
Definition: rangeItem.h:217
const int RangeRingVersion_V2
Definition: rangeItem.h:28
DtNetFloat32 myRange
Definition: rangeItem.h:183
const int RangeRingVersion_V3
Definition: rangeItem.h:29
const int RangeItemGeneric
Definition: rangeItem.h:23
DtNetInt16 myId
Definition: rangeItem.h:185

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)