GlobeEngine
BundlingObject.h
Go to the documentation of this file.
1 
9 #ifndef GlobeEngine_BundlingObject_h
10 #define GlobeEngine_BundlingObject_h
11 
12 #include <string>
13 #include <vector>
14 #include "OpenGL_Includes.h"
15 #include "SceneBluePrint.h"
16 #include "PolyLine.h"
17 #include "DrawablePolyLine.h"
19 #include "LineFeatureObject.h"
20 
21 namespace geGIS {
23  {
24 
25  public:
28  void clear();
29  void create(std::shared_ptr<ReferenceSystem> _referenceSystem, vmml::Vector3f _color);
30  void create(std::shared_ptr<BundlingBlueprint> _blueprint, std::shared_ptr<ReferenceSystem> _referenceSystem);
31 
32  void loadData(std::string filename);
33  void update();
34  void draw(std::shared_ptr<ge::Camera> _cam);
35  void drawPaths(std::shared_ptr<ge::Camera> _cam);
36  void drawPathsWithOcclusionQueries(enum ge::DrawableComponent::RENDERSTATE _state, std::shared_ptr<ge::Camera> _cam);
37 
38  // spline access
39  int addPolyline(std::shared_ptr<geData::PolyLine> _polyline);
40  void updatePolyline(int _id, std::shared_ptr<geData::PolyLine> _polyline);
41 
42  unsigned int getBSplineCount() { return bsplines.size(); }
44  void addGPUBSpline(int _idx);
45  // path access
46  void addPath(geData::DouglasPeuckerDrawablePath* _pathLine, vmml::Vector3d _pos, std::shared_ptr<ge::Shader> _shader);
47 
51 
52  void setSplineShader(std::shared_ptr<ge::Shader> _shader);
53 
54  void setSplinesVisible(bool _in);
55  void setSplinesSegmentsDistance(float _in);
56  void setSplineLineThickness(float _in);
57  void setSplineSegmentDistanceFixed(bool _in);
58 
59  void setPathsVisible(bool _in);
60  void setPathLineThickness(bool _in);
61  void setPolynomDegree(int _value);
62 
63  void enableOcclusionQueries(bool _in);
64 
65  shpio::SHPFileExportContainer* getExportContainer(std::shared_ptr<ReferenceSystem> _referenceSystem);
66 
67  void setSplinePosition(float _input);
68  void setPathsPosition(float _input);
69  void enableInitialScan();
70  void disableInitialScan();
71  bool isInitialScanningOn();
72 
76 
77  void enableUpdatePathHeights(bool _in = true);
79 
80  void setMultipleSplineGeometry(bool _value);
81  void setGPUSplineShader(std::shared_ptr<ge::Shader> _shader);
82  void activateGPUSplineInterpolation(bool _in);
83  void performAnimationStep();
84 
85  private:
86  using ge::DrawableComponent::create; // implicitly hidden
87 
88  void createGPUBSplineIndices();
89  void setupGeometryBuffersWithGPUBSPlineInformation();
90  void updateSingleScan();
91  void updateInitialScan();
92  void updateBSplines();
93  void updateBSplineGeometry();
94  void refineAfterScan(int _idx);
95 
96  std::shared_ptr<BundlingBlueprint> blueprint;
97 
98  // spline properties
99  double segmentDistance;
100  bool fixSegmentDistance;
101  int polynomDegree;
102 
103  std::shared_ptr<ge::Shader> splineShader;
104  std::vector<geData::DrawablePolyLine*> bsplines;
105  std::vector<geData::DouglasPeuckerDrawablePath*> paths;
106 
107  std::shared_ptr<ge::Shader> gpusplineShader;
108  std::vector<geData::DrawablePolyLine*> gpusplines;
109 
110  // Rendering structures
111  GLsizei* lineStripLenght;
112 
113  bool splineSingleRendering;
114  bool gpusplinesOn;
115  //bool splineGeometryReady;
116  bool splineGeometryUpdateNecessary;
117  bool splineHeightUpdate;
118  bool pathInitialScanningDone;
119  bool pathInitialScanningInProgress;
120  bool updatePathHeights;
121 
122  double lineThickness;
123 
124  bool drawAsMultiLineObject;
125 
126  //custom animation
127  double animationValue;
128  vmml::Vector3f animationColor;
129  };
130 }
131 #endif
void enableUpdatePathHeights(bool _in=true)
Definition: BundlingObject.cpp:686
void activateGPUSplineInterpolation(bool _in)
Definition: BundlingObject.cpp:698
shpio::SHPFileExportContainer * getExportContainer(std::shared_ptr< ReferenceSystem > _referenceSystem)
Definition: BundlingObject.cpp:515
void addBSpline(geData::BSplineInterpolationResult *_res)
Definition: BundlingObject.cpp:353
void setSplineSegmentDistanceFixed(bool _in)
Definition: BundlingObject.cpp:637
void clear()
Definition: BundlingObject.cpp:29
void updatePolyline(int _id, std::shared_ptr< geData::PolyLine > _polyline)
Definition: BundlingObject.cpp:138
void setSplinePosition(float _input)
Definition: BundlingObject.cpp:406
void disableUpdatePathHeights()
Definition: BundlingObject.cpp:690
void disableInitialScan()
Definition: BundlingObject.cpp:678
void enableInitialScanProgress()
Definition: BundlingObject.cpp:653
Definition: PolyLine.h:18
void disableInitialScanProgress()
Definition: BundlingObject.cpp:661
void setPolynomDegree(int _value)
Definition: BundlingObject.cpp:632
void setPathsPosition(float _input)
Definition: BundlingObject.cpp:433
Definition: ClusterGrid.h:17
void enableOcclusionQueries(bool _in)
Definition: BundlingObject.cpp:397
BundlingObject()
Definition: BundlingObject.cpp:6
void enableInitialScan()
Definition: BundlingObject.cpp:674
void setSplineShader(std::shared_ptr< ge::Shader > _shader)
Definition: BundlingObject.cpp:505
Definition: DouglasPeuckerDrawablePath.h:69
Definition: BundlingObject.h:22
void setPathsVisible(bool _in)
Definition: BundlingObject.cpp:458
int addPolyline(std::shared_ptr< geData::PolyLine > _polyline)
Definition: BundlingObject.cpp:133
virtual void create()=0
RENDERSTATE
Definition: DrawableComponent.h:28
void setSplinesSegmentsDistance(float _in)
Definition: BundlingObject.cpp:500
void setPathLineThickness(bool _in)
Definition: BundlingObject.cpp:492
void setSplinesVisible(bool _in)
Definition: BundlingObject.cpp:445
bool isInitialScanInProgress()
Definition: BundlingObject.cpp:669
void performAnimationStep()
Definition: BundlingObject.cpp:642
void enableDrawAsMultiLineObject()
Definition: BundlingObject.cpp:703
void setSplineLineThickness(float _in)
Definition: BundlingObject.cpp:466
bool isInitialScanningOn()
Definition: BundlingObject.cpp:682
void drawPaths(std::shared_ptr< ge::Camera > _cam)
Definition: BundlingObject.cpp:178
~BundlingObject()
Definition: BundlingObject.cpp:14
void disableDrawAsMultiLineObject()
Definition: BundlingObject.cpp:708
void setMultipleSplineGeometry(bool _value)
Definition: BundlingObject.cpp:694
void addGPUBSpline(int _idx)
Definition: BundlingObject.cpp:326
void addPath(geData::DouglasPeuckerDrawablePath *_pathLine, vmml::Vector3d _pos, std::shared_ptr< ge::Shader > _shader)
Definition: BundlingObject.cpp:375
void update()
Definition: BundlingObject.cpp:212
void create(std::shared_ptr< ReferenceSystem > _referenceSystem, vmml::Vector3f _color)
Definition: BundlingObject.cpp:62
Definition: LineFeatureObject.h:21
unsigned int getBSplineCount()
Definition: BundlingObject.h:42
void loadData(std::string filename)
Definition: BundlingObject.cpp:77
bool isDrawnAsMultiLineObject()
Definition: BundlingObject.cpp:713
void draw(std::shared_ptr< ge::Camera > _cam)
Definition: BundlingObject.cpp:143
void setGPUSplineShader(std::shared_ptr< ge::Shader > _shader)
Definition: BundlingObject.cpp:510
void drawPathsWithOcclusionQueries(enum ge::DrawableComponent::RENDERSTATE _state, std::shared_ptr< ge::Camera > _cam)
Definition: BundlingObject.cpp:189