VR-Forces 4.8 Class Documentation
 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) 2013 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 
26 // const int RangeRingVersion = 200; // Future expansion
27 const int RangeRingVersion = 100;
28 
31 {
32 public:
33 
34  // default constructor
36 
37  // destructor
38  virtual ~DtRangeItem_V1();
39 
40  // copy constructor
41  DtRangeItem_V1(const DtRangeItem_V1& orig);
42 
43  // assignment operator
44  DtRangeItem_V1& operator=(const DtRangeItem_V1& orig);
45 
46  virtual const char* setFromNet(const char* buffer);
47  virtual char* setToNet(char* buffer) const;
48 
49  virtual int netRepSize() const;
50 
51  bool operator==(const DtRangeItem_V1& rhs) const
52  {
53  return ((myRange == rhs.myRange) &&
54  (myType == rhs.myType) &&
55  (myName == rhs.myName) &&
56  (myOffsetPosition[0] == rhs.myOffsetPosition[0]) &&
57  (myOffsetPosition[1] == rhs.myOffsetPosition[1]) &&
58  (myOffsetPosition[2] == rhs.myOffsetPosition[2]));
59  }
60 
61  DtNetFloat32 myRange;
62  DtNetInt32 myType;
63  DtNet64Vector myOffsetPosition;
65 };
66 
68 {
69 public:
70  virtual ~DtRangeItems_V1();
71 
72  virtual int netRepSize() const;
73  virtual char* setFromNet(const char* buffer);
74  virtual char* setToNet(char* buffer) const;
75 
76  typedef std::vector<DtRangeItem_V1> RangeItems;
77 
79 };
80 
82 {
83 public:
84 
85  // default constructor
86  DtRangeItem();
87 
88  // destructor
89  virtual ~DtRangeItem();
90 
91  // copy constructor
92  DtRangeItem(const DtRangeItem& orig);
93  DtRangeItem(const DtRangeItem_V1& orig);
94 
95  // assignment operator
96  DtRangeItem& operator=(const DtRangeItem& orig);
97  DtRangeItem& operator=(const DtRangeItem_V1& orig);
98 
99  virtual const char* setFromNet(const char* buffer);
100  virtual char* setToNet(char* buffer) const;
101 
102  virtual int netRepSize() const;
103 
104  bool operator==(const DtRangeItem& rhs) const
105  {
106  return ((myRange == rhs.myRange) &&
107  (myType == rhs.myType) &&
108  (myName == rhs.myName) &&
109  (myColor == rhs.myColor) &&
110  (myWedgeSizes == rhs.myWedgeSizes) &&
111  (myOffsetPosition[0] == rhs.myOffsetPosition[0]) &&
112  (myOffsetPosition[1] == rhs.myOffsetPosition[1]) &&
113  (myOffsetPosition[2] == rhs.myOffsetPosition[2]));
114  }
115 
116  DtNetFloat32 myRange;
117  DtNetInt32 myType;
118  DtNet64Vector myOffsetPosition;
120 
122  DtNetInt32 myColor;
123  std::vector<DtNetFloat32> myWedgeSizes;
124 
125  // Future expansion
126  /*
128  DtNetFloat32 myAzimuthCenter;
129  DtNetFloat32 myAzimuthSweep;
130 
131  DtNetFloat32 myElevationCenter;
132  DtNetFloat32 myElevationSweep;
133  */
134 };
135 
137 {
138 public:
139  virtual ~DtRangeItems();
140 
141  virtual int netRepSize() const;
142  virtual char* setFromNet(const char* buffer);
143  virtual char* setToNet(char* buffer) const;
144 
145  typedef std::vector<DtRangeItem> RangeItems;
146 
148 };
DtNetInt32 myColor
Version 100.
Definition: rangeItem.h:122
DtNet64Vector myOffsetPosition
Definition: rangeItem.h:63
Definition: rangeItem.h:30
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
DtNetInt32 myType
Definition: rangeItem.h:62
Definition: rangeItem.h:67
const int RangeItemMissileSystem
Definition: rangeItem.h:19
const int RangeItemIndirectFire
Definition: rangeItem.h:18
const int RangeItemSensorRange
Definition: rangeItem.h:21
Definition: rangeItem.h:81
bool operator==(const DtRangeItem &rhs) const
Definition: rangeItem.h:104
DtNet64Vector myOffsetPosition
Definition: rangeItem.h:118
DtNetFloat32 myRange
Definition: rangeItem.h:61
const int RangeItemMaximumSensorRange
Definition: rangeItem.h:22
std::vector< DtRangeItem_V1 > RangeItems
Definition: rangeItem.h:76
Definition: rangeItem.h:136
std::vector< DtNetFloat32 > myWedgeSizes
Definition: rangeItem.h:123
std::vector< DtRangeItem > RangeItems
Definition: rangeItem.h:145
bool operator==(const DtRangeItem_V1 &rhs) const
Definition: rangeItem.h:51
const int RangeItemBallisticGun
Definition: rangeItem.h:17
#define DT_DLL_vrfExtProtocol
Definition: vrfExtProtocolDefines.h:23
const int RangeRingVersion
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 myType
Definition: rangeItem.h:117
RangeItems myRangeItems
Definition: rangeItem.h:78
DtString myName
Definition: rangeItem.h:119
const int RangeItemRangeProperty
Definition: rangeItem.h:20
DtString myName
Definition: rangeItem.h:64
RangeItems myRangeItems
Definition: rangeItem.h:147
DtNetFloat32 myRange
Definition: rangeItem.h:116

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)