GlobeEngine
QuadPatchField.h
Go to the documentation of this file.
1 
8 #ifndef GlobeEngine_Raster_QuadPatchField_h
9 #define GlobeEngine_Raster_QuadPatchField_h
10 
11 #include "OpenGL_Includes.h"
12 #include "DrawableComponent.h"
13 #include "MBlockQuadtree.h"
14 #include "MBlock.h"
15 //#include "ArrayTree.h"
16 #include "BufferArray.h"
17 #include "Buffer.h"
18 #include "DrawCommand.h"
19 #include "Timer.h"
20 #include "TerrainConfigStructs.h"
21 #include "DrawCommand.h"
22 
23 namespace geRaster {
24 
26  {
27  // Assuming symetric xy patches
28  struct QuadPatchInfo
29  {
30  GLuint verticesPerSide;
31  int triangleCountPerRow;
32  int quadPatchIndexCount;
33  };
34 
35  // describes the 9 patch types
36  enum PatchType {FULL = 0, BOTTOM, UP , RIGHT, LEFT, UPRIGHT, UPLEFT, BOTTOMLEFT, BOTTOMRIGHT};
37 
38  public:
41  void clear();
42  void clearInitial();
43  void create() {};
44  void create(std::shared_ptr<MBlockQuadtree> _quadtree, short _max_lod, double _max_dist_error,geRaster::TerrainVis::VisualizationMode _mode, vmml::Vector3d _pos);
45 
46  void createGeometry();
47 
48  void draw(std::shared_ptr<ge::Camera> _cam);
49  void update() {};
51 
52  void rescale(float _input);
53 
55 
56  private:
57  void drawPrimitives();
58  // draw state
59  std::shared_ptr<MBlockQuadtree> quadtree;
60 
62 
63  float rescaleValue;
64 
65  TriangulationGPUBuffer backbuffer;
66  QuadPatchInfo patchInfo;
67 
68  //int visibleMBlockCount;
69 
70 #ifndef GENGINE_GL_BELOW_410
71  std::shared_ptr<ge::DrawArraysInstancedCommand> drawInstancedCommand;
72 #endif
73  ge::UniformBufferArray triangulationInfo;
74 
75  };
76 
77 }
78 #endif
79 
Definition: DrawableComponent.h:25
~QuadPatchField()
Definition: QuadPatchField.cpp:14
void update()
Definition: QuadPatchField.h:49
void setVisualizationType(TerrainVis::VisualizationMode _input)
Definition: QuadPatchField.cpp:268
Definition: KPatchBase.h:13
Definition: BufferArray.h:18
void clear()
Definition: QuadPatchField.cpp:19
void rescale(float _input)
Definition: QuadPatchField.cpp:263
Definition: QuadPatchField.h:25
void clearInitial()
Definition: QuadPatchField.cpp:24
void draw(std::shared_ptr< ge::Camera > _cam)
Definition: QuadPatchField.cpp:196
Definition: TerrainConfigStructs.h:41
QuadPatchField()
Definition: QuadPatchField.cpp:8
void create()
Definition: QuadPatchField.h:43
VisualizationMode
Definition: TerrainConfigStructs.h:17
void storeInfoToUniformBuffers()
Definition: QuadPatchField.cpp:45
void createGeometry()
Definition: QuadPatchField.cpp:61