gwnavruntime/navgraph/identifiers/navgraphedgerawptr.h Source File

navgraphedgerawptr.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 
10 
11 namespace Kaim
12 {
13 
14 class NavTag;
15 
27 {
28  KY_DEFINE_NEW_DELETE_OPERATORS(MemStat_NavData)
29 
30 public:
32  NavGraphEdgeRawPtr(const NavGraphRawPtr& navGraphRawPtr, NavGraphEdgeSmartIdx edgeSmartIdx);
33  NavGraphEdgeRawPtr(const NavGraphVertexRawPtr& navGraphVertexRawPtr, KyUInt32 neighborIndex);
34 
36  bool IsValid() const;
37 
38  void Invalidate();
39 
40  bool operator ==(const NavGraphEdgeRawPtr& rhs) const;
41  bool operator !=(const NavGraphEdgeRawPtr& rhs) const;
42  bool operator < (const NavGraphEdgeRawPtr& rhs) const;
43  bool operator <=(const NavGraphEdgeRawPtr& rhs) const;
44 
45  // ---------------------------------- Member Functions for valid instance ----------------------------------
48 
52 
57 
58  NavGraph* GetNavGraph() const;
59  const NavGraphBlob* GetNavGraphBlob() const;
64  const NavGraphVertex& GetStartNavGraphVertex() const;
65  const NavGraphVertex& GetEndNavGraphVertex() const;
66  const Vec3f& GetStartNavGraphVertexPosition() const;
67  const Vec3f& GetEndNavGraphVertexPosition() const;
68  const NavTag& GetNavTag() const;
69 
70  template<class TraverseLogic>
71  bool CanBeTraversed(void* traverseLogicUserData, KyFloat32* costMultiplier = nullptr) const;
72 
73 public: // internal
74  template<class TraverseLogic>
75  bool CanBeTraversed(void* traverseLogicUserData, KyFloat32* costMultiplier, const LogicWithNoCustomCost&) const;
76  template<class TraverseLogic>
77  bool CanBeTraversed(void* traverseLogicUserData, KyFloat32* costMultiplier, const LogicWithCostPerNavTag&) const;
78  template<class TraverseLogic>
79  bool CanBeTraversed(void* traverseLogicUserData, KyFloat32* costMultiplier, const LogicWithCostPerTriangle&) const;
80 
81 public:
82  NavGraphRawPtr m_navGraphRawPtr;
83  NavGraphEdgeSmartIdx m_edgeSmartIdx;
84 };
85 
86 }
87 
89 
90 
The NavGraphBlob contains the static data of a NavGraph.
Definition: navgraphblob.h:19
NavGraphEdgeRawPtr GetOppositeNavGraphEdgeRawPtr() const
Return the opposite NavGraphEdgeRawPtr, if any exists.
Definition: navgraphedgerawptr.cpp:13
KyUInt32 NavGraphVertexIdx
An index that uniquely identifies a single vertex within the set of vertices owned by a NavGraph...
Definition: navgraphtypes.h:45
std::uint32_t KyUInt32
uint32_t
Definition: types.h:29
NavGraphVertexRawPtr GetEndNavGraphVertexRawPtr() const
Returns a NavGraphVertexRawPtr that identifies the ending NavGraphVertex of current instance...
Definition: navgraphedgerawptr.inl:37
const Vec3f & GetEndNavGraphVertexPosition() const
Returns the position of the ending NavGraphVertex of current instance.
Definition: navgraphedgerawptr.inl:29
const NavGraphVertex & GetEndNavGraphVertex() const
Returns the ending NavGraphVertex of current instance.
Definition: navgraphedgerawptr.inl:50
NavGraphVertexRawPtr GetStartNavGraphVertexRawPtr() const
Returns a NavGraphVertexRawPtr that identifies the starting NavGraphVertex of current instance...
Definition: navgraphedgerawptr.inl:31
NavGraph * GetNavGraph() const
Returns a reference to the NavGraph that contains this NavGraphEdge.
Definition: navgraphedgerawptr.inl:25
const NavGraphVertex & GetStartNavGraphVertex() const
Returns the starting NavGraphVertex of current instance.
Definition: navgraphedgerawptr.inl:32
void Invalidate()
Invalidates this object.
Definition: navgraphedgerawptr.inl:17
Each instance of this class uniquely identifies a single NavGraphEdge in a NavGraph.
Definition: navgraphedgerawptr.h:26
bool operator!=(const NavGraphEdgeRawPtr &rhs) const
Returns true if this object identifies an edge different from the one identified by rhs...
Definition: navgraphedgerawptr.inl:20
NavGraphVertexIdx GetStartVertexIdx() const
Returns the index of the starting NavGraphVertex of current instance within its NavGraph.
Definition: navgraphedgerawptr.inl:26
#define KY_DEFINE_NEW_DELETE_OPERATORS(MemStat)
This macro defines new and delete operators.
Definition: memory.h:132
Tag type used for function overloading in templates.
Definition: traverselogic.h:69
bool operator==(const NavGraphEdgeRawPtr &rhs) const
Returns true if this object identifies the same edge as rhs, or if both are invalid.
Definition: navgraphedgerawptr.inl:19
KyUInt32 GetEdgeNumberAroundStartVertex() const
All these function should be called only if IsValid() returns true.
Definition: navgraphedgerawptr.inl:27
This class uniquely identifies a NavGraph that has been loaded.
Definition: navgraphrawptr.h:29
The Autodesk Navigation namespace.
Definition: gamekitcrowddispersion.cpp:17
Tag type used for function overloading in templates.
Definition: traverselogic.h:59
const NavGraphBlob * GetNavGraphBlob() const
Returns a reference to the NavGraphBlob that contains this NavGraphEdge.
Definition: navgraphedgerawptr.inl:24
const Vec3f & GetStartNavGraphVertexPosition() const
Returns the position of the starting NavGraphVertex of current instance.
Definition: navgraphedgerawptr.inl:28
bool IsValid() const
Returns true if this object refers to a valid NavGraphEdge: i.e. a NavGraphEdge in a valid NavGraph...
Definition: navgraphedgerawptr.inl:16
NavGraphVertexIdx GetEndNavGraphVertexIdx() const
Returns the index of the ending NavGraphVertex of current instance within its NavGraph.
Definition: navgraphedgerawptr.inl:44
NavGraphEdgeRawPtr()
Constructs a new instance of this class. Creates an invalid NavGraphEdgeRawPtr.
Definition: navgraphedgerawptr.inl:10
Tag type used for function overloading in templates.
Definition: traverselogic.h:64
const NavTag & GetNavTag() const
Returns the NavTag associated to this NavGraphEdge.
Definition: navgraphedgerawptr.inl:55
Each instance of this class uniquely identifies a single NavGraphVertex in a NavGraph.
Definition: navgraphvertexrawptr.h:27
float KyFloat32
float
Definition: types.h:32
3d vector using 32bits floating points.
Definition: vec3f.h:16
This class is a runtime wrapper of a NavGraphBlob, it gathers all the runtime information associated ...
Definition: navgraph.h:22