gwnavruntime/queries/trianglefromposandtriangleseedquery.h Source File

trianglefromposandtriangleseedquery.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_TriangleFromPosAndTriangleSeed_H
10 #define Navigation_TriangleFromPosAndTriangleSeed_H
11 
15 
16 
17 
18 namespace Kaim
19 {
20 
21 class NavHalfEdgeRawPtr;
22 template <class T> class WorkingMemArray;
23 
24 
27 {
30 
34 
36 };
37 
38 
45 class TriangleFromPosAndTriangleSeedQuery : public IAtomicQuery
46 {
47 public:
48  // ---------------------------------- Public Member Functions ----------------------------------
49 
50  static QueryType GetStaticType() { return TypeTriangleFromPosAndTriangleSeed; }
51  virtual QueryType GetType() const { return TypeTriangleFromPosAndTriangleSeed; }
52 
53  TriangleFromPosAndTriangleSeedQuery();
54  virtual ~TriangleFromPosAndTriangleSeedQuery() {}
55 
56  // ---------------------------------- Functions to set up the query ----------------------------------
57 
61  void BindToDatabase(Database* database);
62 
68  void Initialize(const NavTrianglePtr& seedTrianglePtr, const Vec3f& pos);
69 
70  // ---------------------------------- Query framework functions ----------------------------------
71 
72  virtual void Advance(WorkingMemory* workingMemory);
73 
77  void PerformQuery(WorkingMemory* workingMemory = KY_NULL);
78 
79  // ---------------------------------- Accessors ----------------------------------
80 
81  TriangleFromPosAndTriangleSeedResult GetResult() const;
82  const Vec3f& GetInputPos() const;
83  const NavTrianglePtr& GetSeedTrianglePtr() const;
84  const NavTrianglePtr& GetResultTrianglePtr() const;
85 
86 public: // internal
87  void SetInputIntegerPos(const WorldIntegerPos& integerPos);
88  const WorldIntegerPos& GetInputIntegerPos() const;
89  void PerformQueryWithInputCoordPos(WorkingMemory* workingMemory);
90 
91 private :
92  void SetResult(TriangleFromPosAndTriangleSeedResult result);
93  void GetNearestTrianglePtrFromTriangleSeed_Crown();
94  bool IsPointInsideCurrentTriangle(const NavHalfEdgeRawPtr& currentOutComingEdge) const;
95 
96 private:
97  WorldIntegerPos m_inputIntegerPos;
98 
99  NavTrianglePtr m_seedTrianglePtr;
100 
101  Vec3f m_inputPos3f;
102 
105  NavTrianglePtr m_resultTrianglePtr;
106 
108 };
109 
110 }
111 
113 
114 
115 
116 #endif //Navigation_TriangleFromPosAndTriangleSeed_H
117 
Indicates that insufficient working memory caused the query to stop.
Definition: trianglefromposandtriangleseedquery.h:33
NavTrianglePtr m_seedTrianglePtr
A NavTrianglePtr that identifies the triangle that will be the seed for the propagation.
Definition: trianglefromposandtriangleseedquery.h:124
Indicates the query has not yet been initialized.
Definition: trianglefromposandtriangleseedquery.h:28
Vec3f m_inputPos3f
The position on the (X,Y) plane used to retrieve the nearest triangle. The altitude of this point is ...
Definition: trianglefromposandtriangleseedquery.h:126
Indicates the query was successfully completed; a triangle was found.
Definition: trianglefromposandtriangleseedquery.h:35
#define KY_NULL
Null value.
Definition: types.h:247
Indicates the query has not yet been launched.
Definition: trianglefromposandtriangleseedquery.h:29
TriangleFromPosAndTriangleSeedResult
Enumerates the possible results of a TriangleFromPosAndTriangleSeedQuery.
Definition: trianglefromposandtriangleseedquery.h:26
Indicates that no triangle could be found.
Definition: trianglefromposandtriangleseedquery.h:32
QueryType
Enumerates all the type of query.
Definition: iquery.h:29
NavTrianglePtr m_resultTrianglePtr
Updated during processing to store the nearest triangle found to m_inputPos3f.
Definition: trianglefromposandtriangleseedquery.h:130
Definition: gamekitcrowddispersion.h:20
virtual void Advance(WorkingMemory *workingMemory)
This function is called by the QueryQueue to process one step on the query.
Definition: trianglefromposandtriangleseedquery.inl:11
Indicates that the query has not yet been initialized.
Definition: iquery.h:346
void BindToDatabase(Database *database)
Binds the query with the specified Database, clears all the inputs and outputs and sets all other par...
TriangleFromPosAndTriangleSeedResult m_result
Updated during processing to indicate the result of the query.
Definition: trianglefromposandtriangleseedquery.h:132
Indicates that the query has not yet been launched.
Definition: iquery.h:347
void PerformQuery(WorkingMemory *workingMemory=0)
Performs the query.
void Initialize()
Should be called by the derived class before trying to perform the query or to push it in a QueryQueu...
Definition: iquery.h:372
Indicates an invalid NavTrianglePtr was provided as the seed point; the query cannot be processed...
Definition: trianglefromposandtriangleseedquery.h:31