35 TypeSpatializedPointCollectorInAABB,
36 TypeTriangleFromPosAndTriangleSeed,
37 TypeNearestBorderHalfEdgeFromPos,
41 TypeInsidePosFromOutsidePos,
42 TypeMultipleFloorTrianglesFromPos,
43 TypeRayCanGoOnSegment,
46 TypeFindFirstVisiblePositionOnPath,
47 TypeBestGraphVertexPathFinderQuery,
48 TypeMakeNavFloorStitchQuery,
52 TypeTagVolumesFromPos,
53 TypeMultiDestinationPathFinderQuery,
54 TypeCircleArcSplineComputation,
65 QueryStat_Spatialization,
68 QueryStat_ProgressOnPath,
69 QueryStat_PathValidityInterval,
70 QueryStat_TargetOnPathIsStillVisible,
71 QueryStat_TargetOnPathShortcutForward,
72 QueryStat_TargetOnPathSearchBackward,
82 PerformQueryStat_Count,
83 PerformQueryStat_Unspecified = PerformQueryStat_Count,
100 QueryPushedAsCommand,
104 enum QueryProcessMode
106 QueryProcessMode_Sync,
107 QueryProcessMode_ASync
114 class IOnDone :
public RefCountBase<IOnDone, MemStat_Query>
119 virtual void OnDone() = 0;
123 class IQuery :
public RefCountBase<IQuery, MemStat_Query>
184 virtual void Advance(WorkingMemory* workingMemory) = 0;
196 virtual Ptr<BaseBlobHandler> CreateQueryBlobHandler() {
return nullptr; }
197 virtual void BuildQueryBlob(Kaim::BaseBlobHandler* ) {}
198 virtual void InitFromQueryBlob(World* ,
void* ) {}
201 static const char* GetQueryTypeName(
QueryType queryType);
209 KY_LOG_ERROR_IF(database ==
nullptr, (
"The database you are bounding the query to is null."));
210 KY_LOG_ERROR_IF(
CanBeInitialized() ==
false, (
"You cannot bind a query to a database while it is in a QueryQueue."));
222 KY_LOG_ERROR_IF(
m_database ==
nullptr, (
"This query must have been bound to a valid database before calling Initialize"));
223 KY_LOG_ERROR_IF(
CanBeInitialized() ==
false, (
"You cannot initialize a query while it is in a QueryQueue."));
249 IAtomicQuery() : m_performQueryStat(PerformQueryStat_Unspecified) {}
253 void SetPerformQueryStat(
PerformQueryStat performQueryStat) { m_performQueryStat = performQueryStat; }
277 m_lastAdvanceFrameIdx = 0;
KyUInt32 PerformQueryBlocking(WorkingMemory *workingMemory=nullptr)
Calls Advance() untill the query is done.
Definition: iquery.cpp:58
std::uint32_t KyUInt32
uint32_t
Definition: types.h:29
QueryProcessStatus m_processStatus
Modified by the query within Advance(). Do not modify.
Definition: iquery.h:231
Base class for all the queries that do not need to be time-sliced.
Definition: iquery.h:245
QueryQueue processes queries in an asynchronous, time-sliced way, within a QueryQueueArray.
Definition: queryqueue.h:73
CommonQueryResult
Enumerates the result codes that are common to all queries.
Definition: iquery.h:293
virtual void Advance(WorkingMemory *workingMemory)=0
This function is called by the QueryQueue to process one step on the query.
void * GetTraverseLogicUserData() const
Gets m_traverseLogicUserData.
Definition: iquery.h:170
virtual void ReleaseWorkingMemoryOnCancelDuringProcess(WorkingMemory *workingMemory)=0
Called when a query is canceled in FlushCommands while its status is QueryInProcess to make sure that...
bool IsSafeToReadResult() const
Returns true if the query has been processed, is no longer in a queue, and OnDone (if there is one) h...
Definition: iquery.h:144
bool CanBeInitialized() const
In the case of a query processed in a QueryQueue, this must be tested before initializing the query...
Definition: iquery.h:134
Ptr< IOnDone > m_onDone
The optional IOnDone instance to be called. Must be set manually by the user. See IOnDone...
Definition: iquery.h:232
#define KY_DEFINE_NEW_DELETE_OPERATORS(MemStat)
This macro defines new and delete operators.
Definition: memory.h:132
Base class for all the queries that need to be time-sliced.
Definition: iquery.h:262
QueryType
Enumerates all the type of query.
Definition: iquery.h:25
This class is a runtime container for all NavData that represents the world from the point of view of...
Definition: database.h:57
Small interface class that you have to derive from and set to an IQuery to get the IOnDone::OnDone() ...
Definition: iquery.h:114
Navigation return code class.
Definition: types.h:108
The Autodesk Navigation namespace.
Definition: gamekitcrowddispersion.cpp:17
Indicates that the query has not yet been initialized.
Definition: iquery.h:295
QueryProcessStatus
Enumerates all the processing status a query can have.
Definition: iquery.h:87
void BindToDatabase(Database *database)
Should be called by the derived class before Initializing the query Sets m_database and sets m_traver...
Definition: iquery.h:207
bool IsInAQueryQueue() const
Returns true if the query is currently registered in a QueryQueue.
Definition: iquery.h:139
KyResult SendVisualDebug()
Sends the query to the NavigationLab.
Definition: iquery.cpp:74
QueryStatusInQueue m_inQueueStatus
Used by the QueryQueue. Do not modify.
Definition: iquery.h:239
PerformQueryStat
Definition: iquery.h:62
QueryQueue * m_queue
Updated by the QueryQueue. Do not modify.
Definition: iquery.h:238
Indicates that the query has not yet been launched.
Definition: iquery.h:296
void * m_traverseLogicUserData
This userData is typically passed by the Bot.
Definition: iquery.h:236
can be used sporadically to differentiate from PerformQueryStat_Unspecified
Definition: iquery.h:80
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:273
void Initialize()
Should be called by the derived class prior to perform the query or to push it in a QueryQueue...
Definition: iquery.h:220
Database * m_database
The database on which the query will be performed. Set in Initialize(), do not directly modify...
Definition: iquery.h:235
Abstract class for all queries.
Definition: iquery.h:123
virtual QueryType GetType() const =0
Get query type.
void OnDone()
Calls m_onDone IOnDone::OnDone() if m_onDone is not null.
Definition: iquery.h:155
QueryStatusInQueue
Enumerates the different states a query may have in a QueryQueue.
Definition: iquery.h:97
void SetTraverseLogicUserData(void *traverseLogicUserData)
Sets m_traverseLogicUserData for queries that have a custom TraverseLogic, useless otherwise...
Definition: iquery.h:167