gwnavruntime/navgraph/identifiers/navgraphedgerawptr.h Source File

navgraphedgerawptr.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_NavGraphEdgeRawPtr_H
10 #define Navigation_NavGraphEdgeRawPtr_H
11 
13 
14 namespace Kaim
15 {
16 
17 class NavTag;
18 
29 class NavGraphEdgeRawPtr
30 {
31  KY_DEFINE_NEW_DELETE_OPERATORS(MemStat_NavData)
32 
33 public:
35  NavGraphEdgeRawPtr(const NavGraphRawPtr& navGraphRawPtr, NavGraphEdgeSmartIdx edgeSmartIdx);
36  NavGraphEdgeRawPtr(const NavGraphVertexRawPtr& navGraphVertexRawPtr, KyUInt32 neighborIndex);
37 
39  bool IsValid() const;
40 
41  void Invalidate();
42 
43  bool operator ==(const NavGraphEdgeRawPtr& rhs) const;
44  bool operator !=(const NavGraphEdgeRawPtr& rhs) const;
45  bool operator < (const NavGraphEdgeRawPtr& rhs) const;
46  bool operator <=(const NavGraphEdgeRawPtr& rhs) const;
47 
48  // ---------------------------------- Member Functions for valid instance ----------------------------------
51 
55 
59  NavGraphEdgeRawPtr GetOppositeNavGraphEdgeRawPtr() const;
60 
61  NavGraph* GetNavGraph() const;
62  const NavGraphBlob* GetNavGraphBlob() const;
67  const NavGraphVertex& GetStartNavGraphVertex() const;
68  const NavGraphVertex& GetEndNavGraphVertex() const;
69  const Vec3f& GetStartNavGraphVertexPosition() const;
70  const Vec3f& GetEndNavGraphVertexPosition() const;
71  const NavTag& GetNavTag() const;
72 
73  template<class TraverseLogic>
74  bool CanBeTraversed(void* traverseLogicUserData, KyFloat32* costMultiplier = KY_NULL) const;
75 
76 public: // internal
77  template<class TraverseLogic>
78  bool CanBeTraversed(void* traverseLogicUserData, KyFloat32* costMultiplier, const LogicWithoutCostMultipler&) const;
79  template<class TraverseLogic>
80  bool CanBeTraversed(void* traverseLogicUserData, KyFloat32* costMultiplier, const LogicWithCostMultiplerPerNavTag&) const;
81  template<class TraverseLogic>
82  bool CanBeTraversed(void* traverseLogicUserData, KyFloat32* costMultiplier, const LogicWithCostMultiplerPerTriangle&) const;
83 
84 public:
85  NavGraphRawPtr m_navGraphRawPtr;
86  NavGraphEdgeSmartIdx m_edgeSmartIdx;
87 };
88 
89 }
90 
91 #include "gwnavruntime/navgraph/identifiers/navgraphedgerawptr.inl"
92 
93 #endif //Navigation_NavGraphEdgeRawPtr_H
94 
The NavGraphBlob contains the static data of a NavGraph.
Definition: navgraphblob.h:21
NavGraphEdgeRawPtr GetOppositeNavGraphEdgeRawPtr() const
Return the opposite NavGraphEdgeRawPtr, if any exists.
KyUInt32 NavGraphVertexIdx
An index that uniquely identifies a single vertex within the set of vertices owned by a NavGraph...
Definition: navgraphtypes.h:47
NavGraphVertexRawPtr GetEndNavGraphVertexRawPtr() const
Returns a NavGraphVertexRawPtr that identifies the ending NavGraphVertex of current instance...
Definition: navgraphedgerawptr.inl:40
const Vec3f & GetEndNavGraphVertexPosition() const
Returns the position of the ending NavGraphVertex of current instance.
Definition: navgraphedgerawptr.inl:32
const NavGraphVertex & GetEndNavGraphVertex() const
Returns the ending NavGraphVertex of current instance.
Definition: navgraphedgerawptr.inl:53
NavGraphVertexRawPtr GetStartNavGraphVertexRawPtr() const
Returns a NavGraphVertexRawPtr that identifies the starting NavGraphVertex of current instance...
Definition: navgraphedgerawptr.inl:34
NavGraph * GetNavGraph() const
Returns a reference to the NavGraph that contains this NavGraphEdge.
Definition: navgraphedgerawptr.inl:28
const NavGraphVertex & GetStartNavGraphVertex() const
Returns the starting NavGraphVertex of current instance.
Definition: navgraphedgerawptr.inl:35
#define KY_NULL
Null value.
Definition: types.h:247
void Invalidate()
Invalidates this object.
Definition: navgraphedgerawptr.inl:20
Each instance of this class uniquely identifies a single NavGraphEdge in a NavGraph.
Definition: navgraphedgerawptr.h:33
NavGraphVertexIdx GetStartVertexIdx() const
Returns the index of the starting NavGraphVertex of current instance within its NavGraph.
Definition: navgraphedgerawptr.inl:29
KyUInt32 GetEdgeNumberAroundStartVertex() const
Returns the index of the edge around its starting vertex.
Definition: navgraphedgerawptr.inl:30
This class uniquely identifies a NavGraph that has been loaded.
Definition: navgraphrawptr.h:33
Definition: gamekitcrowddispersion.h:20
#define KY_DEFINE_NEW_DELETE_OPERATORS(MemStat)
This macro defines new and delete operators.
Definition: memory.h:137
const NavGraphBlob * GetNavGraphBlob() const
Returns a reference to the NavGraphBlob that contains this NavGraphEdge.
Definition: navgraphedgerawptr.inl:27
const Vec3f & GetStartNavGraphVertexPosition() const
Returns the position of the starting NavGraphVertex of current instance.
Definition: navgraphedgerawptr.inl:31
bool IsValid() const
Returns true if this object refers to a valid NavGraphEdge: i.e. a NavGraphEdge in a valid NavGraph...
Definition: navgraphedgerawptr.inl:19
NavGraphVertexIdx GetEndNavGraphVertexIdx() const
Returns the index of the ending NavGraphVertex of current instance within its NavGraph.
Definition: navgraphedgerawptr.inl:47
unsigned int KyUInt32
Type used internally to represent an unsigned 32-bit integer.
Definition: types.h:36
const NavTag & GetNavTag() const
Returns the NavTag associated to this NavGraphEdge.
Definition: navgraphedgerawptr.inl:58
Each instance of this class uniquely identifies a single NavGraphVertex in a NavGraph.
Definition: navgraphvertexrawptr.h:36
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
This class is a runtime wrapper of a NavGraphBlob, it gathers all the runtime information associated ...
Definition: navgraph.h:27