VR-Forces 4.3 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
embarkationSlotManager.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2012 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
9 #ifndef DtEmbarkationSlotManager_H_
10 #define DtEmbarkationSlotManager_H_
11 
12 #include <vlutil/vlConfig.h>
13 #include <map>
14 #include "vrfobjparam/loadPoint.h"
17 #include "vrfutil/rwString.h"
18 #include "vrfutil/rwInt.h"
19 
21 class DtVrfObject;
22 class DtSimManager;
23 
26 {
27 public:
29  std::list<DtString> myReservedBy;
30 
31  void addReservedBy(const DtString&);
32  void removeReservedBy(const DtString&);
33  bool reservedBy(const DtString&) const;
34 
35 };
36 
38 {
39 public:
40  DtEmbarkationSlotInformation() : myEntry(NULL), mySlot(-1) {};
41 
43  {
44  myEntry = orig.myEntry;
45  mySlot = orig.mySlot;
46  myLoadPath = orig.myLoadPath;
47 
48  return *this;
49  }
50 
51 public:
53  int mySlot;
54  std::vector<DtVector> myLoadPath;
55 };
56 
58 {
59 public:
61  parentRegistry = NULL);
62  DtReservedSlot(const DtSymbolString& name, DtReaderWriterRegistry*
63  parentRegistry = NULL);
64 
66  DtReservedSlot(const DtString& name, const
68  parentRegistry = NULL);
69 
70  DtReservedSlot(const DtSymbolString& name, const
72  parentRegistry = NULL);
73 
74  virtual ~DtReservedSlot();
75 
76  int reservedSlot() const;
77  void setReservedSlot(int);
78 
79  const DtRwTemplatedStringList& reservedBy() const;
80  void addReservedBy(const DtString&);
81 
82 protected:
85 };
86 
87 typedef std::map<int, DtReservedEmbarkationSlotEntry> DtEmbarkationSlotEntryMap;
88 typedef std::vector<DtLoadPoint> DtLoadPathPoints;
89 
91 {
92 public:
94 
96  parentRegistry = NULL);
97  DtEmbarkationSlotManager(const DtSymbolString& name, DtReaderWriterRegistry*
98  parentRegistry = NULL);
99 
101  DtEmbarkationSlotManager(const DtString& name, const
103  parentRegistry = NULL);
104 
105  DtEmbarkationSlotManager(const DtSymbolString& name, const
107  parentRegistry = NULL);
108 
109  virtual ~DtEmbarkationSlotManager();
110 
111  virtual void addSlot(int iSlot, const DtEmbarkationSlotEntry*);
114  virtual DtEmbarkationSlotInformation slotFor(const DtVrfObject* embarkingObject,
115  const DtVrfObject* hostObject) const;
116 
118  virtual DtEmbarkationSlotInformation entityEmbarkationSlotInformation(const DtVrfObject*) const;
119 
122  virtual bool blocked(int iSlot) const;
123  virtual void addSlotExclusion(const DtSlotExclusion&);
124 
126  virtual bool canEmbark(const DtEmbarkationSlotEntry*, const DtVrfObject*) const;
127 
129  virtual bool reserveSlot(int iSlot, const DtString&);
130 
131  virtual void addIngressPoint(const DtLoadPoint&);
133  virtual void ingressPoints(int iSlot, const DtVrfObject* embarkingObject,
134  const DtVrfObject* hostObject, DtEmbarkationSlotInformation& info) const;
135 
136  virtual void addEgressPoint(const DtLoadPoint&);
137  virtual void egressPoints(int iSlot, DtEmbarkationSlotInformation& info) const;
138 
140  virtual void giveUpSlot(int, const DtString&);
141 
143  virtual DtEmbarkationSlotManager* clone(const DtString& name, DtReaderWriterRegistry*
144  parentRegistry = NULL);
145 
149  virtual void calculateDisembarkPositions(const std::list<DtString>&, DtSimManager*);
150 
157  virtual DtVector nextDisembarkPosition(const DtVrfObject* parent, const DtVrfObject* disembarking,
158  const DtSimManager* simMgr, const DtVector& lastBodyPos, bool tasked, bool flipBodyX = false,
159  bool flipBodyY = false);
160 
163  virtual void setScalingFactor(double);
164  virtual double scalingFactor() const;
165 
166 protected:
169  virtual void calculateGridSize(const std::list<DtString>&, DtSimManager*);
170 
173  virtual void calculateGridCellSize(const std::list<DtString>&, DtSimManager*);
174 
178  virtual DtDcm finalPositionTransformationMatrix(const DtVrfObject* parent, const DtVector& lastBodyPos) const;
179 
180 protected:
182  virtual bool slotMatches(const DtLoadPoint*, int iSlot) const;
183 
185  virtual void putData(FILE *fp, int indentLevel = 0);
186 
187  virtual bool blocked(int iSlot, const DtSlotExclusion&) const;
188 
195  virtual const DtLoadPoint* bestIngressFor(const DtLoadPoint* ingressA,
196  const DtLoadPoint* ingressB, const DtVrfObject* embarkingObject,
197  const DtVrfObject* hostObject) const;
198 
201  virtual DtVector bodyPositionToLocalPosition(const DtVector& bodyPosition,
202  const DtVrfObject* body) const;
203 
204 protected:
209 
213 
216 
219 
222 
225 };
226 
228 {
229  return myReservedSlot;
230 }
231 
233 {
234  myReservedSlot = s;
235 }
236 
238 {
239  myReservedBy.add(new DtRwString("reserved-by", s));
240 }
241 
243 {
244  return myReservedBy;
245 }
246 
247 #endif

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)