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) 2025 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) override;
65 
68  virtual unsigned int recordType() const override;
69  virtual void setRecordType(unsigned int recordType) override;
71 
74  virtual unsigned int recordLength() const override;
76  virtual void setRecordLength(unsigned int length) override;
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 override;
100 
103  virtual void setFromNet(const void *netRecord, unsigned int length,
104  DtStandardVariableRetCode *retCode = NULL) override;
105 
107  virtual void printDataToStream(std::ostream &stream) const override;
108 
110  virtual unsigned int unpaddedNetsize() const override;
111 
113  virtual DtStandardVariableRecord *clone() const override;
114 
115 public:
116 
118  static DtStandardVariableRecord* create( void* addr, unsigned int length );
119 
121  static unsigned int recordTypeToUse();
122 
124  static void setRecordTypeToUse( unsigned int typeToUse );
125 
126 protected:
127 
128  std::vector<char> myRecordBuffer;
130 
131 protected:
132 
133  static const unsigned int theMinimumSize;
134 
135 };
136 
137 #else // DtDIS
138 // HLA:
139 
140 // Net attribute record for new diguy attribute.
142 {
143 public:
144 
145  DtString myParam1;
146  DtNetFloat32 myParam2;
147  DtNetU16 myParam3;
148 
151 
153  int netSize() const;
154 
156  void writeToBuffer( char* buffer ) const;
157 
159  void fillFromBuffer( const char* buffer, unsigned int bufferSize );
160 
161 };
162 
163 #endif // DtDIS
164 
DtNetU8 myParam1[1]
Definition: diGuyNewAttributeRecord.h:36
DtNetDiGuyNewAttributeRecord * myRecordPtr
Definition: diGuyNewAttributeRecord.h:129
voidpf void uLong size
Definition: ioapi.h:39
std::vector< char > myRecordBuffer
Definition: diGuyNewAttributeRecord.h:128
DT_DLL_terrainCS bool operator==(const DtDegMinSec &lhs, const DtDegMinSec &rhs)
Definition: diGuyNewAttributeRecord.h:18
static const unsigned int theMinimumSize
Definition: diGuyNewAttributeRecord.h:133
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 Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)