GlobeEngine
DrawablePolyLine.h
Go to the documentation of this file.
1 //
2 // DrawablePolyline.h
3 // GlobeEngine
4 //
5 // Created by Mathias Thöny on 27.12.11.
6 // Copyright (c) 2011 University of Zurich. All rights reserved.
7 //
8 
9 #ifndef GlobeEngine_DrawablePolyLine_h
10 #define GlobeEngine_DrawablePolyLine_h
11 
12 #include "PolyLine.h"
13 #include "VBOVertex.h"
14 #include "OpenGL_Includes.h"
15 #include "DrawableComponent.h"
16 
17 namespace geData {
19  {
20 
21  public:
22  /* 0 = line,
23  1 = triangulated with overlaps,
24  2 = triangulated as nice ribbon,
25  3 = gputriangulated
26  */
32 
35  void clear();
36  void create() {};
37  void create(std::vector<vmml::Vector3d> _points);
38  void create(std::shared_ptr<geData::PolyLine> _polyLine);
39  void create(int _pointCount, double* _points);
40  void create(int _pointCount, const vmml::Vector3d* _points);
41  void create(int _pointCount, double* _points_x, double* _points_y, double* _points_alti, int _start);
42  void update();
43  void createVAO(GEOMETRYDRAWMODE _in);
44  void createTriangleIndices();
45  void createRibbonIndices();
49  void recreate(int _pointCount, double* _points);
50  void recreate(int _pointCount, const vmml::Vector3d* _points);
51 
52  /* 0=line, 1=lineWithThickness, 2=triangulated, 3=gputriangulated */
54  return this->drawMode;
55  };
56 
57  // inherited
58  void draw(std::shared_ptr<ge::Camera> _cam);
59  void drawWithOcclusionQueries(DrawableComponent::RENDERSTATE _state, std::shared_ptr<ge::Camera> _cam);
60  void drawWithMultipleLines(std::shared_ptr<ge::Camera> _cam);
61 
62  bool isNeedingRefinement() const;
63  void isNeedingRefinement(bool _in);
64 
65  // protected methods
66  void setLineThickness(double _thickness);
67  void activateGPUSplineInterpolation(bool _in);
68 
69  void setGPUSplineKnotVectorSize(int _size);
70  private:
71  void computeIntervals(int* u, int n, int t);
72  void clearInitial();
73  void getOpenGLError(std::string _input);
74 
75  GEOMETRYDRAWMODE drawMode;
76  // Spline property
77  bool needsRefinement;
78 
79  // Ribbon info
80  unsigned int triangleCount;
81  // occlusion queries
82  // 0=not set 1=requested 2=finished
83  // pixels showed the ground truth
84  GLuint occlusionGroundTruth;
85  GLuint renderPixelInLastFrame;
86  GLuint checkForOcclusionResult;
87 
88  // GPU splines activated
89  bool gpusplinesOn;
90  int gpusplinesKnotVectorSize;
91 
92  };
93 }
94 #endif
Definition: DrawableComponent.h:25
void setupGeometryBuffersWithBSPlineInformation()
Definition: DrawablePolyLine.cpp:245
void createRibbonIndices()
Definition: DrawablePolyLine.cpp:471
Definition: AvalancheTrainingSimulationEngine.h:39
void activateGPUSplineInterpolation(bool _in)
Definition: DrawablePolyLine.cpp:578
GEOMETRYDRAWMODE
Definition: DrawablePolyLine.h:27
Definition: DrawablePolyLine.h:27
Definition: DrawablePolyLine.h:18
void clear()
Definition: DrawablePolyLine.cpp:14
void drawWithOcclusionQueries(DrawableComponent::RENDERSTATE _state, std::shared_ptr< ge::Camera > _cam)
Definition: DrawablePolyLine.cpp:540
Definition: DrawablePolyLine.h:30
Definition: DrawablePolyLine.h:31
void setupGeometryBuffersAsRibbons()
Definition: DrawablePolyLine.cpp:343
void draw(std::shared_ptr< ge::Camera > _cam)
Definition: DrawablePolyLine.cpp:520
void createVAO(GEOMETRYDRAWMODE _in)
Definition: DrawablePolyLine.cpp:148
void createTriangleIndices()
Definition: DrawablePolyLine.cpp:457
void recreate(int _pointCount, double *_points)
Definition: DrawablePolyLine.cpp:103
void update()
Definition: DrawablePolyLine.cpp:32
Definition: PolyLine.h:24
DrawablePolyLine()
Definition: DrawablePolyLine.cpp:4
void setGPUSplineKnotVectorSize(int _size)
Definition: DrawablePolyLine.cpp:583
void setLineThickness(double _thickness)
Definition: DrawablePolyLine.cpp:569
Definition: DrawablePolyLine.h:29
void create()
Definition: DrawablePolyLine.h:36
void drawWithMultipleLines(std::shared_ptr< ge::Camera > _cam)
Definition: DrawablePolyLine.cpp:483
Definition: DrawablePolyLine.h:28
void setupGeometryBuffersWithLineStripInformation()
Definition: DrawablePolyLine.cpp:226
~DrawablePolyLine()
Definition: DrawablePolyLine.cpp:9
bool isNeedingRefinement() const
Definition: DrawablePolyLine.cpp:559
enum GEOMETRYDRAWMODE getDrawMode() const
Definition: DrawablePolyLine.h:53