GlobeEngine
LineFeatureObject.h
Go to the documentation of this file.
1 
8 #ifndef GlobeEngine_LineFeatureObject_h
9 #define GlobeEngine_LineFeatureObject_h
10 
11 #include <vector>
12 #include "FeatureObject.h"
13 #include "MultiLineObject.h"
14 #include "BufferArray.h"
15 #include "MortonOrder.h"
16 #include "ClusterGrid.h"
17 #include "StyleCollection.h"
18 
19 namespace geGIS {
20 
22  {
23 
24  public:
27  void clear() override;
28  void create(std::shared_ptr<ge::Shader> _shader, std::string _name, vmml::Vector3f _color);
29  void create(std::shared_ptr<ge::Shader> _shader, std::string _name, const GLuint _uid, const GLuint _guid, vmml::Vector3f _color, vmml::Vector3d _position, vmml::Vector3d _scale, vmml::Vector3d _rotations);
30  void recreateMultiLineObject(std::string _name);
31  virtual void update() override;
32  virtual void draw(std::shared_ptr<ge::Camera> _cam) override;
33  virtual void createVAO(enum geData::MultiLineObject::GEOMETRYMODE _in);
34 
35  /* load geometry functions */
36  void load2DLines(geGIS::FeatureRange _range);
37  void load3DLines(geGIS::FeatureRange _range);
39 
40  void setExtrusionXZ(double _input);
41  void setExtrusionY(double _input);
42  void setLineThickness(float _input);
43  float getLineThickness() const;
44  enum GEOMETRYDRAWMODE getDrawMode() const{ return this->drawMode; };
45  int getGraphPointCount() const;
46 
47  void addPolyline(std::shared_ptr<geData::PolyLine> _polyline);
48  const std::shared_ptr<geData::PolyLine> getEntity(int _idx) const;
49  virtual void performAnimationStep();
50 
51  vmml::Vector4d expandBoundWith2DPoint(ge::Vertex2d _point, vmml::Vector4d _bound);
53  ge::Vertex4d expandBoundWithRadius(ge::Vertex4d _point, ge::Vertex4d _bound, double _radius);
54 
55  // overrides
56  void resetColor();
57  void setColor(vmml::Vector3f _color) override;
58  void setUID(GLuint _input) override;
59  void setGroupID(GLuint _input) override;
60  void setScale(vmml::Vector3d _scale) override;
61  void setPosition(vmml::Vector3d _position) override;
62  void setRotation(vmml::Vector3d _rotations) override;
63  void setColorPerVertex(unsigned int _in) override;
64 
65  // GPU Feature buffer properties for morton curves
67  GLuint getGPUFeatureBufferHandle(GLuint _layer);
68  unsigned int getGPUFeatureMaxDepth();
69  void loadAttributeGPUBuffer(int _bufferLayerID, std::shared_ptr<StyleCollection> _styling, bool _spaceFillingCurve);
70  std::vector<size_t> loadMortonOrderForGPUBuffer(const std::vector<ge::Vertex2d>& _linesegmentList, ge::AABB3f _AABB);
71  void copyLineSegmentToGPUBuffer(int _bufferLayerID, bool _spaceFillingCurve);
72  void copyBoundsArrayToGPUBuffer(int _bufferLayerID);
75  vmml::Vector4d getBounds2DWithLineWidth();
76 
77  // GPU Feature buffer properties for clustered shading
78  void createGPUFeatureBufferForClusteredShading(vmml::Vector2ui _clusterCount, double _linewidth, std::shared_ptr<StyleCollection> _styling);
80  vmml::Vector2f getClusterSize();
81 
83 
84  private:
85  void create() override;
86  void createVAO(enum GEOMETRYDRAWMODE _in) override {};
87  void clearInitial();
88  ge::Vertex4d setBoundCorrectly(ge::Vertex2d _p1, ge::Vertex2d _p2);
89 
90  protected:
91 
92  std::shared_ptr<geData::MultiLineObject> multilineGeometry;
93  double lineThickness;
94 
95  // GPU Feature buffer properties
96 #ifdef __APPLE__
98 #else
100 #endif
101  std::vector<size_t> resMorton;
102 
103  unsigned int gpuFeatureMaxLevel;
104  unsigned int gpulineSegmentCount;
106  /* set up line information */
107  std::vector<ge::Vertex2d> gpulinesegmentList;
108 
109  // array to copy the bounds
110  std::vector<ge::Vertex4d> boundsFinal;
111 
112  // GPU Feature buffer for clustered shading properties
114 
115  // polygon rendering
117  void loadPolygonAttributesToGPUBuffer(int _bufferLayerID, bool _spaceFillingCurve);
118 
119  };
120 }
121 
122 #endif
unsigned int gpuFeatureMaxLevel
Definition: LineFeatureObject.h:103
GEOMETRYDRAWMODE drawMode
Definition: FeatureObject.h:146
void load2DPolygonsWithLimitedLines(geGIS::FeatureRange _entityRange, geGIS::FeatureRange _lineRange)
Definition: LineFeatureObject.cpp:633
void copyBoundsArrayToGPUBuffer(int _bufferLayerID)
Definition: LineFeatureObject.cpp:451
void copyLineSegmentToGPUBuffer(int _bufferLayerID, bool _spaceFillingCurve)
Definition: LineFeatureObject.cpp:327
unsigned int getGPUFeatureMaxDepth()
Definition: LineFeatureObject.cpp:605
vmml::Vector4d getBounds2DWithLineWidth()
Definition: LineFeatureObject.cpp:104
GEOMETRYDRAWMODE
Definition: FeatureObject.h:37
GLuint getGPUFeatureBufferHandle(GLuint _layer)
Definition: LineFeatureObject.cpp:609
void setScale(vmml::Vector3d _scale) override
Definition: LineFeatureObject.cpp:753
void setPosition(vmml::Vector3d _position) override
Definition: LineFeatureObject.cpp:763
const ClusterGridTextures * getClusterHandles()
Definition: LineFeatureObject.cpp:265
ClusterGrid cgrid
Definition: LineFeatureObject.h:113
Definition: ClusterGrid.h:17
Definition: ClusterGrid.h:19
void createGPUFeatureBufferAsMortonCurve()
Definition: LineFeatureObject.cpp:288
void createClusteredMortonLineSegmentBounds()
Definition: LineFeatureObject.cpp:193
int getGraphPointCount() const
Definition: LineFeatureObject.cpp:705
enum GEOMETRYDRAWMODE getDrawMode() const
Definition: LineFeatureObject.h:44
void createLineSegmentListForGPUBuffer()
Definition: LineFeatureObject.cpp:272
void loadPolygonAttributesToGPUBuffer(int _bufferLayerID, bool _spaceFillingCurve)
Definition: LineFeatureObject.cpp:526
unsigned int gpulineSegmentListPointCount
Definition: LineFeatureObject.h:105
Definition: ClusterGrid.h:27
std::vector< size_t > loadMortonOrderForGPUBuffer(const std::vector< ge::Vertex2d > &_linesegmentList, ge::AABB3f _AABB)
Definition: LineFeatureObject.cpp:308
std::shared_ptr< geData::MultiLineObject > multilineGeometry
Definition: LineFeatureObject.h:92
void load3DLines(geGIS::FeatureRange _range)
Definition: LineFeatureObject.cpp:623
float getLineThickness() const
Definition: LineFeatureObject.cpp:700
double lineThickness
Definition: LineFeatureObject.h:93
void setUID(GLuint _input) override
Definition: LineFeatureObject.cpp:731
Definition: FeatureObject.h:28
const std::shared_ptr< geData::PolyLine > getEntity(int _idx) const
Definition: LineFeatureObject.cpp:677
Definition: AxisAlignedBoundingBox.h:22
LineFeatureObject()
Definition: LineFeatureObject.cpp:9
Definition: BufferArray.h:18
ge::Vertex4d expandBoundWithRadius(ge::Vertex4d _point, ge::Vertex4d _bound, double _radius)
Definition: LineFeatureObject.cpp:596
void setColor(vmml::Vector3f _color) override
Definition: LineFeatureObject.cpp:712
ge::Vertex4d expandBound(ge::Vertex4d _point, ge::Vertex4d _bound)
Definition: LineFeatureObject.cpp:587
vmml::Vector2f getClusterSize()
void createMortonLineSegmentBounds()
Definition: LineFeatureObject.cpp:382
std::vector< size_t > resMorton
Definition: LineFeatureObject.h:101
virtual void update() override
Definition: LineFeatureObject.cpp:76
void clear() override
Definition: LineFeatureObject.cpp:20
void resetColor()
Definition: LineFeatureObject.cpp:720
void create(std::shared_ptr< ge::Shader > _shader, std::string _name, vmml::Vector3f _color)
Definition: LineFeatureObject.cpp:39
unsigned int gpulineSegmentCount
Definition: LineFeatureObject.h:104
void recreateMultiLineObject(std::string _name)
Definition: LineFeatureObject.cpp:67
void addPolyline(std::shared_ptr< geData::PolyLine > _polyline)
Definition: LineFeatureObject.cpp:671
void createGPUFeatureBufferForClusteredShading(vmml::Vector2ui _clusterCount, double _linewidth, std::shared_ptr< StyleCollection > _styling)
Definition: LineFeatureObject.cpp:111
std::vector< ge::Vertex4d > boundsFinal
Definition: LineFeatureObject.h:110
~LineFeatureObject()
Definition: LineFeatureObject.cpp:14
void setGroupID(GLuint _input) override
Definition: LineFeatureObject.cpp:742
GEOMETRYMODE
Definition: MultiLineObject.h:27
void loadAttributeGPUBuffer(int _bufferLayerID, std::shared_ptr< StyleCollection > _styling, bool _spaceFillingCurve)
Definition: LineFeatureObject.cpp:465
virtual void createVAO(enum geData::MultiLineObject::GEOMETRYMODE _in)
Definition: LineFeatureObject.cpp:100
void load2DLines(geGIS::FeatureRange _range)
Definition: LineFeatureObject.cpp:613
Definition: LineFeatureObject.h:21
bool fillLineFeature
Definition: LineFeatureObject.h:116
virtual void performAnimationStep()
Definition: LineFeatureObject.cpp:88
Definition: VBOVertex.h:51
ge::ShaderStorageBufferArray gpuFeatureInfo
Definition: LineFeatureObject.h:99
Definition: VBOVertex.h:228
virtual void draw(std::shared_ptr< ge::Camera > _cam) override
Definition: LineFeatureObject.cpp:93
vmml::Vector4d expandBoundWith2DPoint(ge::Vertex2d _point, vmml::Vector4d _bound)
Definition: LineFeatureObject.cpp:577
std::vector< ge::Vertex2d > gpulinesegmentList
Definition: LineFeatureObject.h:107
void setRotation(vmml::Vector3d _rotations) override
Definition: LineFeatureObject.cpp:774
void setLineThickness(float _input)
Definition: LineFeatureObject.cpp:692
void setExtrusionXZ(double _input)
Definition: LineFeatureObject.cpp:682
void setColorPerVertex(unsigned int _in) override
Definition: LineFeatureObject.cpp:784
void setExtrusionY(double _input)
Definition: LineFeatureObject.cpp:687