gwnavruntime/database/databasetriangleiterator.h Source File

databasetriangleiterator.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 Database;
18 
23 {
24 public:
25  DatabaseNavFloorIterator(Database* database, const CellBox& cellBox = CellBox());
26 
27  bool IsValid() const { return m_navFloorRawPtr.IsValid(); }
28 
29  DatabaseNavFloorIterator& operator++();
30 
31  const NavFloorRawPtr& GetNavFloorRawPtr() const { return m_navFloorRawPtr; }
32 
33 private:
34  Database* m_database;
35  CellBox m_cellBox;
36 
38  NavFloorIdx m_floorIdx;
39  NavFloorRawPtr m_navFloorRawPtr;
40 };
41 
46 {
47 public:
48  DatabaseNavTriangleIterator(Database* database, const CellBox& cellBox = CellBox());
49 
50  bool IsValid() const { return m_navTriangleRawPtr.IsValid(); }
51 
52  DatabaseNavTriangleIterator& operator++();
53 
54  const NavTriangleRawPtr& GetNavTriangleRawPtr() const { return m_navTriangleRawPtr; }
55 
56 private:
57  DatabaseNavFloorIterator m_navFloorIterator;
58  NavTriangleIdx m_triangleIdx;
59  NavTriangleRawPtr m_navTriangleRawPtr;
60 };
61 
62 
67 {
68 public:
69  DatabaseNavHalfEdgeIterator(Database* database, const CellBox& cellBox = CellBox());
70 
71  bool IsValid() const { return m_navHalfEdgeRawPtr.IsValid(); }
72 
73  DatabaseNavHalfEdgeIterator& operator++();
74 
75  const NavHalfEdgeRawPtr& GetNavHalfEdgeRawPtr() const { return m_navHalfEdgeRawPtr; }
76 
77 private:
78  DatabaseNavFloorIterator m_navFloorIterator;
79  NavHalfEdgeIdx m_halfEdgeIdx;
80  NavHalfEdgeRawPtr m_navHalfEdgeRawPtr;
81 };
82 
83 
84 }
85 
bool IsValid() const
Returns m_navFloorRawPtr.IsValid(). NavHalfEdgeRawPtr validity can be changed when the NavMesh in the...
Definition: navhalfedgerawptr.inl:34
KyUInt32 NavTriangleIdx
An index that uniquely identifies a single triangle within the set of triangles owned by a NavFloor...
Definition: navmeshtypes.h:97
2d axis aligned box of 32bits integers. Very Important: CountX() returns m_max.x - m_min...
Definition: box2i.h:17
Box2i CellBox
A type that represents a bounding box around cells in a 2D grid.
Definition: navmeshtypes.h:31
Usage: for (Kaim::DatabaseNavFloorIterator iterator(database); iterator.IsValid(); ++iterator) { cons...
Definition: databasetriangleiterator.h:22
KyUInt32 NavHalfEdgeIdx
An index that uniquely identifies a single edge of a triangle within the set of edges owned by a NavF...
Definition: navmeshtypes.h:84
bool IsValid() const
Returns true if this object refers to a valid triangle.
Definition: navtrianglerawptr.h:52
This class is a runtime container for all NavData that represents the world from the point of view of...
Definition: database.h:57
KyUInt32 NavFloorIdx
An index that uniquely identifies a single NavFloor within the set of NavFloors owned by a NavCell...
Definition: navmeshtypes.h:112
The Autodesk Navigation namespace.
Definition: gamekitcrowddispersion.cpp:17
Identifies a single NavTriangle in a NavFloor.
Definition: navtrianglerawptr.h:21
bool IsValid() const
Returns true if this object refers to a valid NavFloor, which means a NavFloor:that exists...
Definition: navfloorrawptr.h:69
Usage: for (Kaim::DatabaseNavHalfEdgeIterator iterator(database); iterator.IsValid(); ++iterator) { K...
Definition: databasetriangleiterator.h:66
Each instance of this class uniquely identifies a single NavHalfEdge in a NavFloor.
Definition: navhalfedgerawptr.h:23
Usage: for (Kaim::DatabaseNavTriangleIterator iterator(database); iterator.IsValid(); ++iterator) { c...
Definition: databasetriangleiterator.h:45
Browse a box that is included in a bigger box.
Definition: box2iiterator.h:96
Each instance of this class uniquely identifies a single NavFloor.
Definition: navfloorrawptr.h:23