GlobeEngine
KPatchBase.h
Go to the documentation of this file.
1 
8 #ifndef GlobeEngine_KPatchBase_h
9 #define GlobeEngine_KPatchBase_h
10 
11 #include <memory>
12 
13 namespace geRaster {
14 
15  class KPatchBintree;
16 
17  class KPatchBase
18  {
19  public:
23 
24  KPatchBase();
25  ~KPatchBase();
26  void clear();
27  void create();
28  void createIndexArrays(int _points_per_edge, int _indexCount);
29 
30  static int calculateIndexCount(int _points_per_edge);// PatchOrientation type);
32  static KPatchBase::PatchMode getModeForPointsPerSide(int _pointPerSide);
33 
34  int getIndexCount() const;
35  const int* getIndexArrayX(PatchOrientation _type) const;
36  const int* getIndexArrayY(PatchOrientation _type) const;
37  const short* getIndexArrayXus(PatchOrientation _type) const;
38  const short* getIndexArrayYus(PatchOrientation _type) const;
39 
40  private:
41  void copyArraysToShort();
42  void set2DIndexArraysToTriangleStrips(PatchOrientation type);
43 
44  int points_per_edge;
45  int indexCount;
46  double saturatedError;
47  // Indexarray describing patch
48  int* indices;
49  //std::shared_ptr<int>* indices_sptr;
50  // in 2D version indices = x-coordinate
51  // indices_yDir = y-coordinate
52  int* indices_yDir;
53 
54  int* indexMap_x[8];
55  int* indexMap_y[8];
56  // short copy of the arrays above
57  short* indexMap_x_s[8];
58  short* indexMap_y_s[8];
59  TriangulationMode triMode;
60  };
61 }
62 #endif
Definition: KPatchBase.h:17
void createIndexArrays(int _points_per_edge, int _indexCount)
Definition: KPatchBase.cpp:75
Definition: KPatchBase.h:21
Definition: KPatchBase.h:20
Definition: KPatchBase.h:20
Definition: KPatchBase.h:21
Definition: KPatchBase.h:21
Definition: KPatchBase.h:20
TriangulationMode
Definition: KPatchBase.h:22
Definition: KPatchBase.h:13
KPatchBase()
Definition: KPatchBase.cpp:12
static KPatchBase::PatchMode getModeForPointsPerSide(int _pointPerSide)
Definition: KPatchBase.cpp:396
Definition: KPatchBase.h:20
~KPatchBase()
Definition: KPatchBase.cpp:26
const int * getIndexArrayX(PatchOrientation _type) const
Definition: KPatchBase.cpp:478
Definition: KPatchBase.h:21
Definition: KPatchBase.h:20
Definition: KPatchBintree.h:26
const short * getIndexArrayXus(PatchOrientation _type) const
Definition: KPatchBase.cpp:541
Definition: KPatchBase.h:20
Definition: KPatchBase.h:21
Definition: KPatchBase.h:20
Definition: KPatchBase.h:22
static int calculateIndexCount(int _points_per_edge)
Definition: KPatchBase.cpp:448
void clear()
Definition: KPatchBase.cpp:45
const short * getIndexArrayYus(PatchOrientation _type) const
Definition: KPatchBase.cpp:555
Definition: KPatchBase.h:21
Definition: KPatchBase.h:21
void create()
Definition: KPatchBase.cpp:70
PatchOrientation
Definition: KPatchBase.h:20
PatchMode
Definition: KPatchBase.h:21
static int calculatePointsPerSide(KPatchBase::PatchMode _mode)
Definition: KPatchBase.cpp:348
const int * getIndexArrayY(PatchOrientation _type) const
Definition: KPatchBase.cpp:492
Definition: KPatchBase.h:22
int getIndexCount() const
Definition: KPatchBase.cpp:473
Definition: KPatchBase.h:20