VR-Forces 4.1 Class Documentation
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);
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 DtRwTemplatedListPtr<DtRwString>& 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  parentRegistry = NULL);
96  parentRegistry = NULL);
97 
99  DtEmbarkationSlotManager(const DtString& name, const
101  parentRegistry = NULL);
102 
103  DtEmbarkationSlotManager(const DtSymbolString& name, const
105  parentRegistry = NULL);
106 
107  virtual ~DtEmbarkationSlotManager();
108 
109  virtual void addSlot(int iSlot, const DtEmbarkationSlotEntry*);
112  virtual DtEmbarkationSlotInformation slotFor(const DtVrfObject* embarkingObject,
113  const DtVrfObject* hostObject) const;
114 
116  virtual DtEmbarkationSlotInformation entityEmbarkationSlotInformation(const DtVrfObject*) const;
117 
120  virtual bool blocked(int iSlot) const;
121  virtual void addSlotExclusion(const DtSlotExclusion&);
122 
124  virtual bool canEmbark(const DtEmbarkationSlotEntry*, const DtVrfObject*) const;
125 
127  virtual bool reserveSlot(int iSlot, const DtString&);
128 
129  virtual void addIngressPoint(const DtLoadPoint&);
131  virtual void ingressPoints(int iSlot, const DtVrfObject* embarkingObject,
132  const DtVrfObject* hostObject, DtEmbarkationSlotInformation& info) const;
133 
134  virtual void addEgressPoint(const DtLoadPoint&);
135  virtual void egressPoints(int iSlot, DtEmbarkationSlotInformation& info) const;
136 
138  virtual void giveUpSlot(int, const DtString&);
139 
141  virtual DtEmbarkationSlotManager* clone(const DtString& name, DtReaderWriterRegistry*
142  parentRegistry = NULL);
143 
147  virtual void calculateDisembarkPositions(const std::list<DtString>&, DtSimManager*);
148 
155  virtual DtVector nextDisembarkPosition(const DtVrfObject* parent, const DtVrfObject* disembarking,
156  const DtSimManager* simMgr, const DtVector& lastBodyPos, bool tasked, bool flipBodyX = false,
157  bool flipBodyY = false);
158 
161  virtual void setScalingFactor(double);
162  virtual double scalingFactor() const;
163 
164 protected:
167  virtual void calculateGridSize(const std::list<DtString>&, DtSimManager*);
168 
171  virtual void calculateGridCellSize(const std::list<DtString>&, DtSimManager*);
172 
175  virtual DtDcm finalPositionTransformationMatrix(const DtVrfObject* parent, const DtVector& lastBodyPos) const;
176 
177 protected:
179  virtual bool slotMatches(const DtLoadPoint*, int iSlot) const;
180 
182  virtual void putData(FILE *fp, int indentLevel = 0);
183 
184  virtual bool blocked(int iSlot, const DtSlotExclusion&) const;
185 
192  virtual const DtLoadPoint* bestIngressFor(const DtLoadPoint* ingressA,
193  const DtLoadPoint* ingressB, const DtVrfObject* embarkingObject,
194  const DtVrfObject* hostObject) const;
195 
198  virtual DtVector bodyPositionToLocalPosition(const DtVector& bodyPosition,
199  const DtVrfObject* body) const;
200 
201 protected:
206 
210 
213 
216 
219 
222 };
223 
225 {
226  return myReservedSlot;
227 }
228 
230 {
231  myReservedSlot = s;
232 }
233 
235 {
236  myReservedBy.add(new DtRwString("reserved-by", s));
237 }
238 
240 {
241  return myReservedBy;
242 }
243 
244 #endif

Document ID: Generated on Tue Jan 29 18:21:16 EST 2013 from SVN revision 123193
Copyright © 2005-2013 VT MÄK Inc. All Rights Reserved (www.mak.com)