gwnavruntime/queries/raycangoonsegmentquery.h Source File

raycangoonsegmentquery.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_RayCanGoOnSegmentQuery_H
10 #define Navigation_RayCanGoOnSegmentQuery_H
11 
12 
15 
16 namespace Kaim
17 {
18 
19 class NavHalfEdgeRawPtr;
20 class RawNavTagSubSegment;
21 
26 template<class TraverseLogic>
28 {
29 public:
30  // ---------------------------------- Public Member Functions ----------------------------------
31 
33  virtual ~RayCanGoOnSegmentQuery() {}
34 
35  // ---------------------------------- Functions to set up the query ----------------------------------
36 
40  void BindToDatabase(Database* database);
41 
49  void Initialize(const Vec3f& startPos, const NavTrianglePtr& startTrianglePtr, const Vec3f& segmentStartPos, const Vec3f& segmentEndPos);
50 
51  // ---------------------------------- write accessors for query inputs ----------------------------------
52 
55  void SetQueryDynamicOutput(QueryDynamicOutput* queryDynamicOutput);
56 
57  // ---------------------------------- write accessors for query parameters ----------------------------------
58 
61  void SetPositionSpatializationRange(const PositionSpatializationRange& positionSpatializationRange);
62 
65  void SetComputeCostMode(ComputeCostMode computeCostMode);
66 
69  void SetDynamicOutputMode(DynamicOutputMode savingMode);
70 
71  // ---------------------------------- Query framework functions ----------------------------------
72 
73  virtual void Advance(WorkingMemory* workingMemory);
74 
78  void PerformQuery(WorkingMemory* workingMemory = KY_NULL);
79 
80  // ---------------------------------- Accessors ----------------------------------
81 
82  RayCanGoOnSegmentQueryResult GetResult() const;
83  const Vec3f& GetStartPos() const;
84  const Vec3f& GetSegmentStartPos() const;
85  const Vec3f& GetSegmentEndPos() const;
86  const NavTrianglePtr& GetStartTrianglePtr() const;
87  const NavTrianglePtr& GetArrivalTrianglePtr() const;
88  ComputeCostMode GetComputeCostMode() const;
89  KyFloat32 GetComputedCost() const;
90  DynamicOutputMode GetDynamicOutputMode() const;
91  QueryDynamicOutput* GetQueryDynamicOutput() const;
92 
93  const PositionSpatializationRange& GetPositionSpatializationRange() const;
94 
95 public : // internal
96  void PerformQueryWithInputCoordPos(WorkingMemory* workingMemory);
97  void SetStartIntegerPos(const WorldIntegerPos& startIntegerPos);
98  void SetSegmentStartIntegerPos(const WorldIntegerPos& segmentStartIntegerPos);
99  void SetSegmentEndIntegerPos(const WorldIntegerPos& segmentEndIntegerPos);
100  const WorldIntegerPos& GetStartIntegerPos() const;
101  const WorldIntegerPos& GetSegmentStartIntegerPos() const;
102  const WorldIntegerPos& GetSegmentEndIntegerPos() const;
103 };
104 
105 }
106 
108 
109 
110 
111 #endif //Navigation_RayCanGoOnSegmentQuery_H
112 
This class gather the data encountered along some query process.
Definition: querydynamicoutput.h:61
void SetDynamicOutputMode(DynamicOutputMode savingMode)
Write accessor for m_dynamicOutputMode.
Definition: raycangoonsegmentquery.inl:37
void SetQueryDynamicOutput(QueryDynamicOutput *queryDynamicOutput)
Write accessor for m_queryDynamicOutput.
Definition: raycangoonsegmentquery.inl:42
RayCanGoOnSegmentQueryResult
Enumerates the possible results of a RayCanGoOnSegmentQuery.
Definition: baseraycangoonsegmentquery.h:30
#define KY_NULL
Null value.
Definition: types.h:247
DynamicOutputMode
Enumerates possible ways of storing crossed data from a query in a QueryDynamicOutput object...
Definition: querydynamicoutput.h:26
void SetComputeCostMode(ComputeCostMode computeCostMode)
Write accessor for m_computeCostMode.
ComputeCostMode
Enumerates the possible ways a RayCanGoQuery can compute the cost of following the ray...
Definition: rayqueryutils.h:35
void BindToDatabase(Database *database)
Binds the query with the specified Database, clears all the inputs and outputs and sets all other par...
Definition: raycangoonsegmentquery.inl:19
This class is a runtime container for all NavData that represents the world from the point of view of...
Definition: database.h:64
void SetPositionSpatializationRange(const PositionSpatializationRange &positionSpatializationRange)
Write accessor for m_positionSpatializationRange.
Definition: raycangoonsegmentquery.inl:32
Definition: gamekitcrowddispersion.h:20
virtual void Advance(WorkingMemory *workingMemory)
This function is called by the QueryQueue to process one step on the query.
Definition: raycangoonsegmentquery.inl:97
Utilities for dealing with NavData coordinates, which are expressed in a world space based on integer...
Definition: worldintegerpos.h:21
The RayCanGoOnSegmentQuery class tests whether or not a ray (with a width of 0) can pass along a stra...
Definition: raycangoonsegmentquery.h:27
Each instance of this class uniquely identifies a single NavTriangle in a NavFloor.
Definition: navtriangleptr.h:22
void PerformQuery(WorkingMemory *workingMemory=0)
Performs the query.
Definition: raycangoonsegmentquery.inl:104
Base class for RayCanGoOnSegmentQuery.
Definition: baseraycangoonsegmentquery.h:46
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
float KyFloat32
Type used internally to represent a 32-bit floating-point number.
Definition: types.h:43
This class defines a three-dimensional vector whose coordinates are stored using floating-point numbe...
Definition: vec3f.h:23