gwnavruntime/queries/ipathfinderquery.h Source File

ipathfinderquery.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 
8 // Primary contact: JUBA - secondary contact: NOBODY
9 #ifndef Navigation_IPathFinderQuery_H
10 #define Navigation_IPathFinderQuery_H
11 
16 #include "gwnavruntime/path/path.h"
19 
20 namespace Kaim
21 {
22 
23 class ScopedDisplayList;
24 
28 {
29  PATHFINDER_DO_NOT_COMPUTE_CHANNELS,
30  PATHFINDER_DO_COMPUTE_CHANNELS,
31 };
32 
36 class IPathFinderQuery : public ITimeSlicedQuery
37 {
38 public:
40  enum PathFinderResult
41  {
48  };
49 
50  // ---------------------------------- Public Member Functions ----------------------------------
51 
53  virtual ~IPathFinderQuery() {}
54 
55  Path* GetPath() const;
56  ChannelArray* GetChannelArray() const;
57  const Vec3f& GetStartPos() const;
58 
59  void SetNavigationProfileId(KyUInt32 navigationProfileId);
60  KyUInt32 GetNavigationProfileId() const;
61 
62  // ---------------------------------- Virtual Member Functions ----------------------------------
63 
65  virtual const Vec3f* GetDestination() const = 0;
66 
68  virtual void GetPathFinderTextResult(String&) const {}
69 
71  virtual void DisplayPropagationBounds(ScopedDisplayList&) const {}
72 
73  virtual PathFinderResult GetPathFinderResult() const = 0;
74 protected:
75  void SetPath(Path* path);
76  void BindToDatabase(Database* database);
77 public:
78  // ---------------------------------- Public Data Members ----------------------------------
79 
81  Ptr<Path> m_path;
82 
83  KyUInt32 m_navigationProfileId;
84 
87 
89 
90  bool m_enableAdvancedVisualDebug;
91 };
92 
93 KY_INLINE IPathFinderQuery::IPathFinderQuery()
95  , m_path(KY_NULL)
96  , m_navigationProfileId(0)
97  , m_computeChannelMode(PATHFINDER_DO_NOT_COMPUTE_CHANNELS)
98  , m_dataBaseChangeIdx(0)
99  , m_enableAdvancedVisualDebug(false)
100 {}
101 KY_INLINE void IPathFinderQuery::BindToDatabase(Database* database)
102 {
104  m_enableAdvancedVisualDebug = false;
105 }
106 
107 KY_INLINE Path* IPathFinderQuery::GetPath() const { return m_path; }
108 KY_INLINE const Vec3f& IPathFinderQuery::GetStartPos() const { return m_startPos3f; }
109 
110 KY_INLINE void IPathFinderQuery::SetNavigationProfileId(KyUInt32 navigationProfileId) { m_navigationProfileId = navigationProfileId; }
111 KY_INLINE KyUInt32 IPathFinderQuery::GetNavigationProfileId() const { return m_navigationProfileId; }
112 KY_INLINE void IPathFinderQuery::SetPath(Path* path) { m_path = path; }
113 
116 class ScopedSetPathNavigationProfile
117 {
118 public:
119  ScopedSetPathNavigationProfile(IPathFinderQuery* query) : m_query(query) {}
120  ~ScopedSetPathNavigationProfile()
121  {
122  if (m_query->m_path)
123  m_query->m_path->SetNavigationProfileId(m_query->GetNavigationProfileId());
124  }
125  IPathFinderQuery* m_query;
126 };
127 
128 }
129 
130 #endif //Navigation_IPathFinderQuery_H
131 
ChannelComputerConfig m_channelComputerConfig
The parameter set specific to Channels computation.
Definition: ipathfinderquery.h:103
Base class for all pathfinder queries.
Definition: ipathfinderquery.h:38
#define KyFloat32MAXVAL
The maximum value that can be stored in the KyFloat32 variable type.
Definition: types.h:227
PathFinderQueryComputeChannelMode
This enum tells if the PathFinderQuery should compute Channels around path sections laying on the Nav...
Definition: ipathfinderquery.h:28
KyUInt32 m_dataBaseChangeIdx
Stores the revision of the Database when the Path has been computed.
Definition: ipathfinderquery.h:105
virtual void DisplayPropagationBounds(ScopedDisplayList &) const
Fill the displayList with display info that may help to understand a PathFinderFailure (mainly propag...
Definition: ipathfinderquery.h:82
Class that aggregates parameters that allow to configure the channel computation of a Bot...
Definition: channelcomputerconfig.h:76
#define KY_NULL
Null value.
Definition: types.h:247
The IPathFinderQuery ended prematurely due to changes into NavData.
Definition: ipathfinderquery.h:50
This class aggregates Channels along a Path.
Definition: channelarray.h:31
Ptr< Path > m_path
The Path found by the query.
Definition: ipathfinderquery.h:98
Vec3f m_startPos3f
The starting position for the Path request.
Definition: ipathfinderquery.h:97
PathFinderQueryComputeChannelMode m_computeChannelMode
The mode toggling Channels computation.
Definition: ipathfinderquery.h:102
The IPathFinderQuery has been completed but no Path has been found.
Definition: ipathfinderquery.h:49
The IPathFinderQuery has been completed and a Path has been found.
Definition: ipathfinderquery.h:48
This class is a runtime container for all NavData that represents the world from the point of view of...
Definition: database.h:64
virtual void GetPathFinderTextResult(String &) const
Fills the String with an explanation of the result. Use this to debug your pathfinder query...
Definition: ipathfinderquery.h:79
Definition: gamekitcrowddispersion.h:20
void BindToDatabase(Database *database)
Should be called by the derived class before Initializing the query It sets m_database to the provide...
Definition: iquery.h:364
PathFinderResult
Enumerates the possible status of a IPathFinderQuery.
Definition: ipathfinderquery.h:43
unsigned int KyUInt32
Type used internally to represent an unsigned 32-bit integer.
Definition: types.h:36
The IPathFinderQuery is initialized but has not been processed.
Definition: ipathfinderquery.h:46
The IPathFinderQuery is currently under process.
Definition: ipathfinderquery.h:47
The IPathFinderQuery is not yet initialized.
Definition: ipathfinderquery.h:45
The class representing a path.
Definition: path.h:42
This class defines a three-dimensional vector whose coordinates are stored using floating-point numbe...
Definition: vec3f.h:23
virtual const Vec3f * GetDestination() const =0
This function is virtual because not all the PathFinders have a preset destination, it may return KY_NULL.