gwnavruntime/queries/blobs/astarquerydisplaylistbuilder.h Source File

astarquerydisplaylistbuilder.h
Go to the documentation of this file.
1 /*
2 * Copyright 2016 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 #pragma once
8 
13 
14 namespace Kaim
15 {
16 
17 class AStarQueryDisplayListBuilder : public QueryDisplayListBuilder<AStarQueryBlob, AStarQueryOutputBlob, AStarQueryDisplayListBuilder>
18 {
19 public:
20  void DoPushQueryShape(Color color)
21  {
22  m_displayList->PushArrowPyramid(m_query->m_startPos3f, m_query->m_destPos3f, color);
23  }
24 
25  void PushPropagationBox()
26  {
27  PropagationBoundDisplay::Box(m_displayList, m_query->m_startPos3f, m_query->m_destPos3f, m_query->m_propagationBoxExtent);
28  }
29 
30  void Push_PATH_NOT_FOUND()
31  {
32  PushQueryShape(Color::Red);
33  PushPropagationBox();
34  PushStartText(Color::Red, "Path not found !");
35  }
36 
37  void Push_PATH_FOUND()
38  {
39  PathDisplay::Display(m_displayList, &m_output->m_pathBlob);
40  if (m_output->m_abstractPathBlob.m_nodePositions.GetCount() != 0)
41  PathDisplay::Display(m_displayList, &m_output->m_abstractPathBlob);
42  }
43 
44  virtual void DoBuild(DisplayList* displayList, char* blob)
45  {
46  if (Init(displayList, blob) == false)
47  return;
48 
49  KY_PUSH_ERROR_ON_MISSING_EXPLICIT_CASE_LABEL
50  switch((AStarQueryResult)m_output->m_result)
51  {
52  case ASTAR_NOT_INITIALIZED : break;
53  case ASTAR_NOT_PROCESSED : Push_NOT_PROCESSED(); break;
54  case ASTAR_PROCESSING_TRAVERSAL : Push_PROCESSING("Processing TRAVERSAL"); break;
55  case ASTAR_PROCESSING_TRAVERSAL_DONE : Push_PROCESSING("Processing TRAVERSAL_DONE"); break;
56  case ASTAR_PROCESSING_ABSTRACT_PATH : Push_PROCESSING("Processing ABSTRACT_PATH"); break;
57  case ASTAR_PROCESSING_REFINING_INIT : Push_PROCESSING("Processing REFINING_INIT"); break;
58  case ASTAR_PROCESSING_REFINING_RESETCOST : Push_PROCESSING("Processing REFINING_RESETCOST"); break;
59  case ASTAR_PROCESSING_REFINING : Push_PROCESSING("Processing REFINING"); break;
60  case ASTAR_PROCESSING_PATHCLAMPING_INIT : Push_PROCESSING("Processing PATHCLAMPING_INIT"); break;
61  case ASTAR_PROCESSING_PATHCLAMPING : Push_PROCESSING("Processing PATHCLAMPING"); break;
62  case ASTAR_PROCESSING_PATHBUILDING : Push_PROCESSING("Processing PATHBUILDING"); break;
63  case ASTAR_PROCESSING_CHANNEL_INIT : Push_PROCESSING("Processing CHANNEL_INIT"); break;
64  case ASTAR_PROCESSING_CHANNEL_COMPUTE : Push_PROCESSING("Processing CHANNEL_COMPUTE"); break;
65  case ASTAR_DONE_START_OUTSIDE : Push_START_OUTSIDE(); break;
66  case ASTAR_DONE_START_NAVTAG_FORBIDDEN : Push_START_NAVTAG_FORBIDDEN(); break;
67  case ASTAR_DONE_END_OUTSIDE : Push_DEST_OUTSIDE(); break;
68  case ASTAR_DONE_END_NAVTAG_FORBIDDEN : Push_DEST_NAVTAG_FORBIDDEN(); break;
69  case ASTAR_DONE_PATH_NOT_FOUND : Push_PATH_NOT_FOUND(); break;
70  case ASTAR_DONE_NAVDATA_CHANGED : PushStartError("NavData changed!"); break;
71  case ASTAR_DONE_ERROR_LACK_OF_WORKING_MEMORY: Push_LACK_OF_WORKING_MEMORY(); break;
72  case ASTAR_DONE_COMPUTATION_ERROR : PushStartError("Computation Error!"); break;
73  case ASTAR_DONE_CHANNELCONFIG_ERROR : PushStartError("Channel Config Error!"); break;
74  case ASTAR_DONE_CHANNELCOMPUTATION_ERROR : PushStartError("Channel Computation Error"); break;
75  case ASTAR_DONE_DEST_IS_START_NO_PATH : PushStartError("startPos=destPos, no Path computed"); break;
76  case ASTAR_DONE_PATH_FOUND : Push_PATH_NOT_FOUND(); break;
77  case ASTAR_DONE_COMPUTATION_CANCELED : PushStartError("Query Canceled!"); break;
78  }
79  KY_POP_ERROR_ON_MISSING_EXPLICIT_CASE_LABEL
80  }
81 };
82 
83 }
84 
Indicates that a path could not be found between the start and destination points.
Definition: baseastarquery.h:48
Unused. Kept here for backward compatibility.
Definition: baseastarquery.h:41
Indicates that a computation error caused the query to stop.
Definition: baseastarquery.h:53
Indicates that insufficient working memory caused the query to stop.
Definition: baseastarquery.h:50
Indicates that a computation error caused the query to stop.
Definition: baseastarquery.h:51
Indicates that the refined path is being clamped to navMesh according to the altitude tolerance...
Definition: baseastarquery.h:39
Indicates that the NavTag at the starting point is forbidden.
Definition: baseastarquery.h:45
Indicates the query has not yet been launched.
Definition: baseastarquery.h:30
Indicates that the channel is initialized, the channel is being computed.
Definition: baseastarquery.h:42
Indicates that the NavTag at the destination point is forbidden.
Definition: baseastarquery.h:47
Indicates that the input channelComputerConfig is invalid.
Definition: baseastarquery.h:52
Indicates that the refining process is being initialized.
Definition: baseastarquery.h:35
Indicates that a NavMesh triangle could not be found for the starting point.
Definition: baseastarquery.h:44
Indicates that the Astar traversal algorithm has been launched, but has not yet completed.
Definition: baseastarquery.h:32
Indicates the query has not yet been initialized.
Definition: baseastarquery.h:29
Indicates that the refiner is done, but the path has not yet been clamped to the navMesh.
Definition: baseastarquery.h:38
Indicates that the computation has been canceled.
Definition: baseastarquery.h:54
The Autodesk Navigation namespace.
Definition: gamekitcrowddispersion.cpp:17
Indicates that the cost from nodes that are on navMesh are beeing recomputed since they may have been...
Definition: baseastarquery.h:36
Indicates that query starting location and ending location are equals. computing a Path would have le...
Definition: baseastarquery.h:56
Indicates that the query has stopped and must be relaunched because of a change in the NavData...
Definition: baseastarquery.h:49
Indicates that the clamping algorithm has completed, but the path has not yet been built...
Definition: baseastarquery.h:40
Indicates that the Astar traversal algorithm traversed AbstractGraph, and the Abstract path is being ...
Definition: baseastarquery.h:34
Indicates that the Astar traversal algorithm is finished, and that a path is found and is prepared to...
Definition: baseastarquery.h:33
Indicates that the destination point of the query is outside the NavMesh.
Definition: baseastarquery.h:46
Indicates that a path has been found between the start and destination.
Definition: baseastarquery.h:57
Indicates that the path found is being refined.
Definition: baseastarquery.h:37
AStarQueryResult
Enumerates the possible results of an AStarQuery.
Definition: baseastarquery.h:27