gwnavruntime/pathfollower/basepathprogresscomputer.h Source File

basepathprogresscomputer.h
Go to the documentation of this file.
1 /*
2 * Copyright 2015 Autodesk, Inc. All rights reserved.
3 * Use of this software is subject to the terms of the Autodesk license agreement and any attachments or Appendices thereto provided at the time of installation or download,
4 * or which otherwise accompanies this software in either electronic or hard copy form, or which is signed by you and accepted by Autodesk.
5 */
6 
7 // primary contact: LAPA - secondary contact: GUAL
8 #ifndef Navigation_BasePathProgressComputer_H
9 #define Navigation_BasePathProgressComputer_H
10 
14 
15 
16 namespace Kaim
17 {
18 
19 class Bot;
20 class IPathEventListObserver;
21 class IPositionOnPathValidator;
22 class PathEvent;
23 class PositionOnLivePath;
24 
32 class BasePathProgressComputer: public RefCountBase<BasePathProgressComputer, MemStat_PathFollowing>
33 {
34  KY_CLASS_WITHOUT_COPY(BasePathProgressComputer)
35 
36 public:
37  // ---------------------------------- Public Member Functions ----------------------------------
39  virtual ~BasePathProgressComputer();
40 
42  void SetPathEventListObserver(const Ptr<IPathEventListObserver>& m_pathEventListObserver);
43  Ptr<IPathEventListObserver> GetPathEventListObserver() { return m_pathEventListObserver; }
44 
46  void SetPositionOnPathCheckPointValidator(const Ptr<IPositionOnPathValidator>& positionOnPathCheckPointValidator);
47  Ptr<IPositionOnPathValidator> GetPositionOnPathCheckPointValidator() { return m_positionOnPathCheckPointValidator; }
48 
49  void CleanPathEventListOnNewPath(Bot* bot);
50 
51 
52  // ---------------------------------- Pure Virtual Functions ----------------------------------
53  virtual void Update(Bot* bot, KyFloat32 simulationTimeInSeconds) = 0;
54 
55 protected:
56  void ComputeProgressOnPath(Bot* bot);
57  bool MustEventBeValidated(Bot* bot, const PathEvent& pathEvent);
58  void FindUpperLimitOnPath(Bot* bot, PositionOnLivePath& positionOnPath);
59  void StopProgressAtUpperLimitOnPath(Bot* bot, const PositionOnLivePath& upperLimitOnPath);
60  bool CanProgressAfterEvent(Bot* bot); // called by ComputeProgressOnPath
61  void UpdateProgressOnPathStatus(Bot* bot); // called by ComputeProgressOnPath
62  void MoveForwardAfterCrossedBisectorPlanes(Bot* bot, const PositionOnLivePath& upperLimitOnPath); // called by ComputeProgressOnPath, should not be called if at upperBound or lastPathNode
63  void SnapProgressToNodeOrEvent(Bot* bot);
64 
65  void ComputePositionInChannel(Bot* bot);
66 
67 protected:
68  Ptr<IPathEventListObserver> m_pathEventListObserver;
69  Ptr<IPositionOnPathValidator> m_positionOnPathCheckPointValidator;
70 };
71 
72 
73 } // namespace Kaim
74 
75 #endif // Navigation_IPathFollower_H
void SetPathEventListObserver(const Ptr< IPathEventListObserver > &m_pathEventListObserver)
Sets the SetPathEventListObserver.
IPathEventListObservers are called when related PathEventList has just been created or is about to be...
Definition: ipatheventlistobserver.h:26
#define KY_CLASS_WITHOUT_COPY(ClassName)
Define to forbid copy constructor and copy assignment.
Definition: types.h:387
Definition: gamekitcrowddispersion.h:20
The abstract base class for PathProgressComputer classes.
Definition: basepathprogresscomputer.h:37
void SetPositionOnPathCheckPointValidator(const Ptr< IPositionOnPathValidator > &positionOnPathCheckPointValidator)
Sets the IPositionOnPathValidator to be used to validate target on path check points.
float KyFloat32
Type used internally to represent a 32-bit floating-point number.
Definition: types.h:43