VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
diGuyNewAttributeRecord.h
Go to the documentation of this file.
1 /****************************************************************************
2  * Copyright (c) 2021 MAK Technologies, Inc.
3  * All rights reserved.
4  ****************************************************************************/
5 
6 #pragma once
7 
9 
10 #include <vlpi/netStructs.h>
11 
12 #if DtDIS
13 
14 #include <vl/packets/standardVariableRecordP.h>
15 #include <vl/genericVariableRecord.h>
16 
17 // Net attribute record for new extended attribute record.
19 {
20  bool operator == ( const DtNetDiGuyNewAttributeRecord& rhs ) const
21  {
22  return ( myParam1 == rhs.myParam1
23  && myParam2 == rhs.myParam2
24  && myParam3 == rhs.myParam3 );
25  }
26 
27  bool operator != ( const DtNetDiGuyNewAttributeRecord& rhs ) const
28  {
29  return ! operator == ( rhs );
30  }
31 
32  DtNetFloat32 myParam2;
33  DtNetU16 myParam3;
34  // Param1 is a string value that will require padding to 8-byte boundary
35  // Param1 is variable size. Needs to be at the end of net struct.
36  DtNetU8 myParam1[1];
37 
39 
40 // Attribute record for new extended attribute record.
42 {
43 public:
44 
47 
50 
52  DtDiGuyNewAttributeRecord( void* netBuffer, unsigned int size );
53 
55  virtual DtDiGuyNewAttributeRecord& operator = ( const DtDiGuyNewAttributeRecord& record );
56 
58  virtual DtStandardVariableRecord& operator = ( const DtStandardVariableRecord& other );
59 
61  virtual bool operator == ( const DtDiGuyNewAttributeRecord& record );
62 
64  virtual bool operator == ( const DtStandardVariableRecord& other );
65 
68  virtual unsigned int recordType() const;
69  virtual void setRecordType( unsigned int recordType );
71 
74  virtual unsigned int recordLength() const;
76  virtual void setRecordLength( unsigned int length );
78 
81  virtual void setParam1( const DtString& val );
82  virtual const char* param1() const;
84 
87  virtual void setParam2( float val );
88  virtual float param2() const;
90 
93  virtual void setParam3( short val );
94  virtual short param3() const;
96 
97  // Writes the network representation to the given address.
98  // The assumption is that this memory is allocated and is of the proper size.
99  virtual void writeRecord( void* addr ) const;
100 
103  virtual void setFromNet( const void* netRecord, unsigned int length, DtStandardVariableRetCode* retCode = NULL );
104 
106  virtual void printDataToStream( std::ostream& stream ) const;
107 
109  virtual unsigned int unpaddedNetsize() const;
110 
112  virtual DtStandardVariableRecord* clone() const;
113 
114 public:
115 
117  static DtStandardVariableRecord* create( void* addr, unsigned int length );
118 
120  static unsigned int recordTypeToUse();
121 
123  static void setRecordTypeToUse( unsigned int typeToUse );
124 
125 protected:
126 
127  std::vector<char> myRecordBuffer;
129 
130 protected:
131 
132  static const unsigned int theMinimumSize;
133 
134 };
135 
136 #else // DtDIS
137 // HLA:
138 
139 // Net attribute record for new diguy attribute.
141 {
142 public:
143 
144  DtString myParam1;
145  DtNetFloat32 myParam2;
146  DtNetU16 myParam3;
147 
150 
152  int netSize() const;
153 
155  void writeToBuffer( char* buffer ) const;
156 
158  void fillFromBuffer( const char* buffer, unsigned int bufferSize );
159 
160 };
161 
162 #endif // DtDIS
163 
DtNetU8 myParam1[1]
Definition: diGuyNewAttributeRecord.h:36
DtNetDiGuyNewAttributeRecord * myRecordPtr
Definition: diGuyNewAttributeRecord.h:128
voidpf void uLong size
Definition: ioapi.h:39
std::vector< char > myRecordBuffer
Definition: diGuyNewAttributeRecord.h:127
DT_DLL_terrainCS bool operator==(const DtDegMinSec &lhs, const DtDegMinSec &rhs)
Definition: diGuyNewAttributeRecord.h:18
static const unsigned int theMinimumSize
Definition: diGuyNewAttributeRecord.h:132
DtNetFloat32 myParam2
Definition: diGuyNewAttributeRecord.h:32
DtNetDiGuyNewAttributeRecord DtNetDiGuyNewAttributeRecord
voidpf stream
Definition: ioapi.h:39
DT_DLL_VRVCORE double length(const makVrv::DtCoordinateSystem &, const std::vector< DtVector > &vertices)
Returns the total distance of a segmented line defined by the provided vector of vertices. Coordinates are in local database coordinates. The coordinate system is used to convert between the local database coordinates and geocentric. All distance is in 2D – the Z value is ignored.
DT_DLL_terrainCS bool operator!=(const DtDegMinSec &lhs, const DtDegMinSec &rhs)
Definition: diGuyNewAttributeRecord.h:41
#define DT_DLL_vrfExtObjects
Definition: dllExport.h:23
DtNetU16 myParam3
Definition: diGuyNewAttributeRecord.h:33

Document ID: Generated on Tue Sep 24 19:28:17 EDT 2024 from SVN revision 269799
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)