gwnavruntime/database/databasetriangleiterator.h Source File

databasetriangleiterator.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 
9 #ifndef Navigation_DatabaseTriangleIterator_H
10 #define Navigation_DatabaseTriangleIterator_H
11 
12 #include "gwnavruntime/math/box2iiterator.h"
15 
16 namespace Kaim
17 {
18 
19 class Database;
20 
21 class DatabaseTriangleIterator
22 {
23 public:
24  DatabaseTriangleIterator(Database* database = KY_NULL, const CellBox& cellBox = CellBox());
25  void Init(Database* database, const CellBox& cellBox = CellBox());
26 
27  bool IsValid() const;
28 
29  NavTrianglePtr GetNavTrianglePtr() const;
30 
31  DatabaseTriangleIterator& operator++();
32 
33 private:
34  void Invalidate();
35 
36 private:
37  Ptr<Database> m_database;
38  KyUInt32 m_navDataChangeIdx; // used to ensure database didn't change between two calls
39  CellBox m_cellBox;
40  Box2iIteratorInBiggerRowMajorBox m_boxIterator;
41  NavFloorIdx m_activeNavFloorIdx;
42  NavTriangleIdx m_triangleIdx;
43 };
44 
45 }
46 
47 #endif
KyUInt32 NavTriangleIdx
An index that uniquely identifies a single triangle within the set of triangles owned by a NavFloor...
Definition: navmeshtypes.h:100
Box2i CellBox
A type that represents a bounding box around cells in a 2D grid.
Definition: navmeshtypes.h:34
#define KY_NULL
Null value.
Definition: types.h:247
KyUInt32 NavFloorIdx
An index that uniquely identifies a single NavFloor within the set of NavFloors owned by a NavCell...
Definition: navmeshtypes.h:115
Definition: gamekitcrowddispersion.h:20
unsigned int KyUInt32
Type used internally to represent an unsigned 32-bit integer.
Definition: types.h:36