open-dis-cpp
GriddedDataPdu.h
1 #pragma once
2 
3 #include <dis6/EntityID.h>
4 #include <dis6/EntityType.h>
5 #include <dis6/Orientation.h>
6 #include <dis6/GridAxisRecord.h>
7 #include <vector>
8 #include <dis6/SyntheticEnvironmentFamilyPdu.h>
9 #include <dis6/utils/DataStream.h>
10 #include <dis6/opendis6_export.h>
11 
12 
13 namespace DIS
14 {
15 // Section 5.3.11.2: Information about globat, spatially varying enviornmental effects. This requires manual cleanup; the grid axis records are variable sized. UNFINISHED
16 
17 // Copyright (c) 2007-2009, MOVES Institute, Naval Postgraduate School. All rights reserved.
18 //
19 // @author DMcG, jkg
20 
21 class OPENDIS6_EXPORT GriddedDataPdu : public SyntheticEnvironmentFamilyPdu
22 {
23 protected:
26 
28  unsigned short _fieldNumber;
29 
31  unsigned short _pduNumber;
32 
34  unsigned short _pduTotal;
35 
37  unsigned short _coordinateSystem;
38 
40  unsigned char _numberOfGridAxes;
41 
43  unsigned char _constantGrid;
44 
47 
50 
52  unsigned long long _sampleTime;
53 
55  unsigned int _totalValues;
56 
58  unsigned char _vectorDimension;
59 
61  unsigned short _padding1;
62 
64  unsigned char _padding2;
65 
67  std::vector<GridAxisRecord> _gridDataList;
68 
69 
70  public:
72  virtual ~GriddedDataPdu();
73 
74  virtual void marshal(DataStream& dataStream) const;
75  virtual void unmarshal(DataStream& dataStream);
76 
77  EntityID& getEnvironmentalSimulationApplicationID();
78  const EntityID& getEnvironmentalSimulationApplicationID() const;
79  void setEnvironmentalSimulationApplicationID(const EntityID &pX);
80 
81  unsigned short getFieldNumber() const;
82  void setFieldNumber(unsigned short pX);
83 
84  unsigned short getPduNumber() const;
85  void setPduNumber(unsigned short pX);
86 
87  unsigned short getPduTotal() const;
88  void setPduTotal(unsigned short pX);
89 
90  unsigned short getCoordinateSystem() const;
91  void setCoordinateSystem(unsigned short pX);
92 
93  unsigned char getNumberOfGridAxes() const;
94 
95  unsigned char getConstantGrid() const;
96  void setConstantGrid(unsigned char pX);
97 
98  EntityType& getEnvironmentType();
99  const EntityType& getEnvironmentType() const;
100  void setEnvironmentType(const EntityType &pX);
101 
102  Orientation& getOrientation();
103  const Orientation& getOrientation() const;
104  void setOrientation(const Orientation &pX);
105 
106  unsigned long long getSampleTime() const;
107  void setSampleTime(unsigned long long pX);
108 
109  unsigned int getTotalValues() const;
110  void setTotalValues(unsigned int pX);
111 
112  unsigned char getVectorDimension() const;
113  void setVectorDimension(unsigned char pX);
114 
115  unsigned short getPadding1() const;
116  void setPadding1(unsigned short pX);
117 
118  unsigned char getPadding2() const;
119  void setPadding2(unsigned char pX);
120 
121  std::vector<GridAxisRecord>& getGridDataList();
122  const std::vector<GridAxisRecord>& getGridDataList() const;
123  void setGridDataList(const std::vector<GridAxisRecord>& pX);
124 
125 
126 virtual int getMarshalledSize() const;
127 
128  bool operator ==(const GriddedDataPdu& rhs) const;
129 };
130 }
131 
132 // Copyright (c) 1995-2009 held by the author(s). All rights reserved.
133 // Redistribution and use in source and binary forms, with or without
134 // modification, are permitted provided that the following conditions
135 // are met:
136 //
137 // * Redistributions of source code must retain the above copyright
138 // notice, this list of conditions and the following disclaimer.
139 // * Redistributions in binary form must reproduce the above copyright
140 // notice, this list of conditions and the following disclaimer
141 // in the documentation and/or other materials provided with the
142 // distribution.
143 // * Neither the names of the Naval Postgraduate School (NPS)
144 // Modeling Virtual Environments and Simulation (MOVES) Institute
145 // (http://www.nps.edu and http://www.MovesInstitute.org)
146 // nor the names of its contributors may be used to endorse or
147 // promote products derived from this software without specific
148 // prior written permission.
149 //
150 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
151 // AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
152 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
153 // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
154 // COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
155 // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
156 // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
157 // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
158 // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
159 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
160 // ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
161 // POSSIBILITY OF SUCH DAMAGE.
unsigned short _pduNumber
sequence number for the total set of PDUS used to transmit the data
Definition: GriddedDataPdu.h:31
unsigned char _vectorDimension
total number of data values at each grid point.
Definition: GriddedDataPdu.h:58
Symbolic names as defined in 5.1.4.
Definition: AcknowledgePdu.h:8
unsigned short _pduTotal
Total number of PDUS used to transmit the data.
Definition: GriddedDataPdu.h:34
a class to support managing a network buffer.
Definition: DataStream.h:28
Orientation _orientation
orientation of the data grid
Definition: GriddedDataPdu.h:49
unsigned char _numberOfGridAxes
number of grid axes for the environmental data
Definition: GriddedDataPdu.h:40
Definition: GriddedDataPdu.h:21
unsigned int _totalValues
total number of all data values for all pdus for an environmental sample
Definition: GriddedDataPdu.h:55
EntityType _environmentType
type of environment
Definition: GriddedDataPdu.h:46
unsigned long long _sampleTime
valid time of the enviormental data sample, 64 bit unsigned int
Definition: GriddedDataPdu.h:52
Definition: EntityID.h:15
unsigned short _fieldNumber
unique identifier for each piece of enviornmental data
Definition: GriddedDataPdu.h:28
Definition: Orientation.h:15
unsigned short _padding1
padding
Definition: GriddedDataPdu.h:61
EntityID _environmentalSimulationApplicationID
environmental simulation application ID
Definition: GriddedDataPdu.h:25
Definition: EntityType.h:15
unsigned char _constantGrid
are domain grid axes identidal to those of the priveious domain update?
Definition: GriddedDataPdu.h:43
unsigned char _padding2
padding
Definition: GriddedDataPdu.h:64
Definition: SyntheticEnvironmentFamilyPdu.h:16
std::vector< GridAxisRecord > _gridDataList
Grid data ^^^This is wrong.
Definition: GriddedDataPdu.h:67
unsigned short _coordinateSystem
coordinate system of the grid
Definition: GriddedDataPdu.h:37