VR-Forces 4.3 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
spotReportState.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2013 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
12 
28 
29 #pragma once
30 
31 #include <vrfGuiCore/vrfGuiCore.h>
33 #include <vrvCore/DtEntityState.h>
34 #include <vrvCore/DtStateView.h>
35 #include <vrvUtil/DtMessage.h>
36 #include <matrix/vlVector.h>
37 #include <matrix/vlTaitBryan.h>
38 
39 namespace makVrf
40 {
41  static const char DtThisIsSpotReportData[] = "DtThisIsSpotReportData";
42 
44  {
45  public:
46 
50 
52  virtual ~DtSpotReportState();
53 
54  const DtSimpleTypedDictionary& dictionary() const
55  {
56  return mySpotReportDictionary;
57  }
58 
60  {
61  return mySpotReportDictionary;
62  }
63 
64  bool addObservedBy(makVrv::DtUniqueID s);
65  void removeObservedBy(makVrv::DtUniqueID s);
66  bool observedBy(makVrv::DtUniqueID s) const;
67  const std::set<makVrv::DtUniqueID>& observedBy() const
68  {
69  return myObservedBy;
70  }
71 
72  double simulationTimeSent() const
73  {
74  return mySpotReportDictionary.doubleValue("SimulationTime");
75  }
76 
80  void setType(const std::string& t)
81  {
82  myType = t;
83  }
84 
85  const std::string& type() const
86  {
87  return myType;
88  }
89 
91  void setName(const std::string& name)
92  {
93  myName = name;
94  }
95 
96  const std::string& name() const
97  {
98  return myName;
99  }
100 
101  bool operator==(const DtSpotReportState&) const;
102 
103  public:
104  std::string myType;
105  std::string myName;
106 
108  DtTaitBryan myOrientation;
110  std::vector<DtVector> myLocations;
111  std::set<makVrv::DtUniqueID> myObservedBy;
113  };
114 
117 
120 
121  template <typename T>
122  makVrv::DtMessage& operator>>( makVrv::DtMessage& msg, std::set<T>& state )
123  {
124  int size;
125  msg >> size;
126 
127  int i;
128 
129  for (i = 0; i < size; i++)
130  {
131  T t;
132  msg >> t;
133 
134  state.insert(t);
135  }
136 
137  return msg;
138  }
139 
140  template <typename T>
141  makVrv::DtMessage& operator<<( makVrv::DtMessage& msg, const std::set<T>& state )
142  {
143  int size = state.size();
144  msg << size;
145 
146  typename std::set<T>::const_iterator iter = state.begin();
147  while (iter != state.end())
148  {
149  msg << *iter;
150  ++iter;
151  }
152 
153  return msg;
154  }
155 
158 }

Document ID: Generated on Wed Mar 11 21:20:57 EDT 2015 from SVN revision 150940
Copyright © 2005-2014 VT MÄK. All Rights Reserved (www.mak.com)