gwnavruntime/queries/blobs/bestgraphvertexpathfinderquerydisplaylistbuilder.h Source File

bestgraphvertexpathfinderquerydisplaylistbuilder.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 
16 
17 namespace Kaim
18 {
19 
20 class BestGraphVertexPathFinderQueryDisplayListBuilder : public IDisplayListBuilder
21 {
22 private:
23  const BestGraphVertexPathFinderQueryBlob* m_query;
24  BestGraphVertexPathFinderQueryOutputBlob* m_output;
25  DisplayList* m_displayList;
26 
27 public:
28  BestGraphVertexPathFinderQueryDisplayListBuilder() { Clear(); }
29 
30 private:
31  void Clear()
32  {
33  m_query = nullptr;
34  m_output = nullptr;
35  m_displayList = nullptr;
36  }
37 
38 private:
39  void StartText(Color color, const char* text)
40  {
41  m_displayList->PushText(m_query->m_startPos3f.OffsetZ(1.0f), color, text);
42  }
43 
44  virtual void DoBuild(DisplayList* displayList, char* blob)
45  {
46  m_query = (BestGraphVertexPathFinderQueryBlob*)blob;
47  m_output = m_query->m_queryOutput.Ptr();
48  m_displayList = displayList;
49  if (m_output == nullptr)
50  return;
51 
52  switch ((BestGraphVertexPathFinderQueryResult)m_output->m_result)
53  {
55  break;
66  break;
67 
68  case BESTGRAPHVERTEX_DONE_START_OUTSIDE: StartText(Color::Red, "Start outside!"); break;
69  case BESTGRAPHVERTEX_DONE_START_NAVTAG_FORBIDDEN: StartText(Color::Red, "Start NavTag forbidden!"); break;
71  PropagationBoundDisplay::Cylinder(displayList, m_query->m_startPos3f, m_query->m_propagationRadius);
72  StartText(Color::Red, "Path not found !");
73  break;
74  case BESTGRAPHVERTEX_DONE_NAVDATA_CHANGED: StartText(Color::Red, "NavData changed!"); break;
75  case BESTGRAPHVERTEX_DONE_ERROR_LACK_OF_WORKING_MEMORY: StartText(Color::Red, "Lack of working memory!"); break;
76  case BESTGRAPHVERTEX_DONE_COMPUTATION_ERROR: StartText(Color::Red, "Computation Error"); break;
77  case BESTGRAPHVERTEX_DONE_CHANNELCONFIG_ERROR: StartText(Color::Red, "Channel Config Error"); break;
78  case BESTGRAPHVERTEX_DONE_CHANNELCOMPUTATION_ERROR : StartText(Color::Red, "Channel Computation Error"); break;
80  PathDisplay::Display(m_displayList, &m_output->m_pathBlob);
81  break;
82  case BESTGRAPHVERTEX_DONE_COMPUTATION_CANCELED: StartText(Color::Red, "Query Canceled"); break;
83  default: break;
84  }
85  }
86 };
87 
88 }
89 
Indicates that the input channelComputerConfig is invalid.
Definition: basebestgraphvertexpathfinderquery.h:39
Indicates the query has not yet been initialized.
Definition: basebestgraphvertexpathfinderquery.h:20
Indicates the query has not yet been launched.
Definition: basebestgraphvertexpathfinderquery.h:21
Indicates that the astar traversal algorithm has been launched, but has not yet completed.
Definition: basebestgraphvertexpathfinderquery.h:23
Indicates that insufficient working memory caused the query to stop.
Definition: basebestgraphvertexpathfinderquery.h:37
Indicates that the computation has been canceled.
Definition: basebestgraphvertexpathfinderquery.h:41
Indicates that the refiner is done, the channel is going to be initialized.
Definition: basebestgraphvertexpathfinderquery.h:30
Indicates that the refining process is being initialized.
Definition: basebestgraphvertexpathfinderquery.h:25
Indicates that the refined path is being clamped to navMesh according to the altitude tolerance...
Definition: basebestgraphvertexpathfinderquery.h:28
The Autodesk Navigation namespace.
Definition: gamekitcrowddispersion.cpp:17
Indicates that the clamping algorithm has completed, but the path has not yet been built...
Definition: basebestgraphvertexpathfinderquery.h:29
Indicates that the NavTag at the starting point is forbidden.
Definition: basebestgraphvertexpathfinderquery.h:34
Indicates that a path has been found between the start and destination.
Definition: basebestgraphvertexpathfinderquery.h:43
Indicates that a path could not be found between the start and destination points.
Definition: basebestgraphvertexpathfinderquery.h:35
Indicates that the channel is initialized, the channel is being computed.
Definition: basebestgraphvertexpathfinderquery.h:31
Indicates that a computation error caused the query to stop.
Definition: basebestgraphvertexpathfinderquery.h:40
Indicates that the astar traversal algorithm is finished, and that the path found is ready to be refi...
Definition: basebestgraphvertexpathfinderquery.h:24
BestGraphVertexPathFinderQueryResult
Enumerates the possible results of an BestGraphVertexPathFinderQuery.
Definition: basebestgraphvertexpathfinderquery.h:18
Indicates that the path found is being refined.
Definition: basebestgraphvertexpathfinderquery.h:26
Indicates that the query has stopped and must be relaunched because of a change in the NavData...
Definition: basebestgraphvertexpathfinderquery.h:36
Indicates that a NavMesh triangle could not be found for the starting point.
Definition: basebestgraphvertexpathfinderquery.h:33
Indicates that the refiner is done, but the path has not yet been clamped to the navMesh.
Definition: basebestgraphvertexpathfinderquery.h:27
Indicates that a computation error caused the query to stop.
Definition: basebestgraphvertexpathfinderquery.h:38