OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
loadpgrd.hpp
Go to the documentation of this file.
1 #ifndef OPENMW_ESM_PGRD_H
2 #define OPENMW_ESM_PGRD_H
3 
4 #include <string>
5 #include <vector>
6 
7 namespace ESM
8 {
9 
10 class ESMReader;
11 class ESMWriter;
12 
13 /*
14  * Path grid.
15  */
16 struct Pathgrid
17 {
18  static unsigned int sRecordId;
20  static std::string getRecordType() { return "Pathgrid"; }
21 
22  struct DATAstruct
23  {
24  int mX, mY; // Grid location, matches cell for exterior cells
25  short mS1; // ?? Usually but not always a power of 2. Doesn't seem
26  // to have any relation to the size of PGRC.
27  short mS2; // Number of path points.
28  }; // 12 bytes
29 
30  struct Point // path grid point
31  {
32  int mX, mY, mZ; // Location of point
33  unsigned char mAutogenerated; // autogenerated vs. user coloring flag?
34  unsigned char mConnectionNum; // number of connections for this point
35  short mUnknown;
36  Point& operator=(const float[3]);
37  Point(const float[3]);
38  Point();
39  Point(int x, int y, int z) : mX(x), mY(y), mZ(z) {}
40  }; // 16 bytes
41 
42  struct Edge // path grid edge
43  {
44  int mV0, mV1; // index of points connected with this edge
45  }; // 8 bytes
46 
47  std::string mCell; // Cell name
49 
50  typedef std::vector<Point> PointList;
52 
53  typedef std::vector<Edge> EdgeList;
55 
56  void load(ESMReader &esm, bool &isDeleted);
57  void save(ESMWriter &esm, bool isDeleted = false) const;
58 
59  void blank();
60 };
61 }
62 #endif
EdgeList mEdges
Definition: loadpgrd.hpp:54
Point & operator=(const float[3])
Definition: loadpgrd.cpp:11
unsigned char mConnectionNum
Definition: loadpgrd.hpp:34
Definition: esmreader.hpp:21
Definition: loadpgrd.hpp:22
short mUnknown
Definition: loadpgrd.hpp:35
std::vector< Point > PointList
Definition: loadpgrd.hpp:50
Point()
Definition: loadpgrd.cpp:30
int mV0
Definition: loadpgrd.hpp:44
short mS1
Definition: loadpgrd.hpp:25
int mX
Definition: loadpgrd.hpp:32
Definition: esmwriter.hpp:17
PointList mPoints
Definition: loadpgrd.hpp:51
short mS2
Definition: loadpgrd.hpp:27
DATAstruct mData
Definition: loadpgrd.hpp:48
void save(ESMWriter &esm, bool isDeleted=false) const
Definition: loadpgrd.cpp:128
static unsigned int sRecordId
Definition: loadpgrd.hpp:18
std::string mCell
Definition: loadpgrd.hpp:47
Point(int x, int y, int z)
Definition: loadpgrd.hpp:39
void load(ESMReader &esm, bool &isDeleted)
Definition: loadpgrd.cpp:35
Definition: loadpgrd.hpp:16
void blank()
Definition: loadpgrd.cpp:182
int mV1
Definition: loadpgrd.hpp:44
int mY
Definition: loadpgrd.hpp:32
int mZ
Definition: loadpgrd.hpp:32
Definition: loadpgrd.hpp:42
unsigned char mAutogenerated
Definition: loadpgrd.hpp:33
std::vector< Edge > EdgeList
Definition: loadpgrd.hpp:53
Definition: loadpgrd.hpp:30
int mY
Definition: loadpgrd.hpp:24
int mX
Definition: loadpgrd.hpp:24
static std::string getRecordType()
Return a string descriptor for this record type. Currently used for debugging / error logs only...
Definition: loadpgrd.hpp:20