GlobeEngine
PolyLineExt.h
Go to the documentation of this file.
1 //
2 // PolyLineExt.hpp
3 // GlobeEngine
4 //
5 // Created by Alireza Amiraghdam on 21/03/17.
6 //
7 //
8 
9 #ifndef GlobeEngine_PolyLineExt_h
10 #define GlobeEngine_PolyLineExt_h
11 
12 #include <stdio.h>
13 #include "PolyLine.h"
14 #include "DrawableComponent.h"
15 #include "Timer.h"
16 
17 namespace geClimateViewer {
19  private:
20  std::vector<vmml::Vector3d> points;
21  vmml::Vector3f position;
22  vmml::Vector3f color;
23 
24  const std::pair<int, double> findMaximumDistance(int _firstIndex,int _secondIndex) const;
25 
26 
27  public:
28  void clear();
29  void create();
30  void draw(std::shared_ptr<ge::Camera> _cam);
31  void update();
32  void createVAO();
33 
34  void setBack(const vmml::Vector3d& _back);
35  const vmml::Vector3d& getBack() const;
36  const vmml::Vector3d& getBackback() const;
37  void push_back(vmml::Vector3f _point);
38  void pop_back();
39 
40  vmml::Vector3d pointAt(int _inx);
41  const std::vector<vmml::Vector3d>& getVec() const;
42 
43  unsigned int getPointCount() const;
44  unsigned int getLineCount() const;
45  void setPosition(vmml::Vector3f _p){position=_p;};
46  void setColor(vmml::Vector3f _c){color=_c;};
47 
48  //vmml::Vector4f getBoudingBox();
49  float geometricLength();
50 
51  static bool lineIntersection(vmml::Vector3f _p0, vmml::Vector3f _p1,vmml::Vector3f _p2, vmml::Vector3f _p3, vmml::Vector3f &_intersect);
52  void checkIntersections(vmml::Vector3f _p0, vmml::Vector3f _p1,std::vector<vmml::Vector3f> &_intersections);
53 
54  std::shared_ptr<PolyLineExt> createSubLine(vmml::Vector3f _p0,vmml::Vector3f _p1) const;
55  //std::shared_ptr<PolyLineExt> chop(float _dt);
56  std::shared_ptr<PolyLineExt> createTessellatedLine(float _dt);
57 
58  void simplifyWithRDP(int _firstIndex,int _lastIndex,double epsilon);
59 
60  //Debug ge::Timer testtimer;
61  };
62 }
63 
64 // TODOTODOTODO
65 //PolyLineExt test1 = ...bla...
67 //test2.create(const test1&, int min, max);
68 //test2.create(const test1&, vmml::Vector3f _chopStart, vmml::Vector3f _chopEnd);
69 //test2.tessellate();
70 // instead of
71 //PolyLineExt test1 = ...bla...
72 //PolyLineExt test2 = createTessellatedLine();
73 
74 
75 #endif /* PolyLineExt_hpp */
Definition: DrawableComponent.h:25
std::shared_ptr< PolyLineExt > createSubLine(vmml::Vector3f _p0, vmml::Vector3f _p1) const
Definition: PolyLineExt.cpp:183
void create()
Definition: PolyLineExt.cpp:13
void setPosition(vmml::Vector3f _p)
Definition: PolyLineExt.h:45
void setColor(vmml::Vector3f _c)
Definition: PolyLineExt.h:46
const std::vector< vmml::Vector3d > & getVec() const
Definition: PolyLineExt.cpp:321
void createVAO()
Definition: PolyLineExt.cpp:48
void setBack(const vmml::Vector3d &_back)
Definition: PolyLineExt.cpp:285
unsigned int getPointCount() const
Definition: PolyLineExt.cpp:297
std::shared_ptr< PolyLineExt > createTessellatedLine(float _dt)
Definition: PolyLineExt.cpp:234
void draw(std::shared_ptr< ge::Camera > _cam)
Definition: PolyLineExt.cpp:17
Definition: PolyLineExt.h:18
void simplifyWithRDP(int _firstIndex, int _lastIndex, double epsilon)
Definition: PolyLineExt.cpp:350
vmml::Vector3d pointAt(int _inx)
Definition: PolyLineExt.cpp:317
float geometricLength()
Definition: PolyLineExt.cpp:124
const vmml::Vector3d & getBack() const
Definition: PolyLineExt.cpp:289
unsigned int getLineCount() const
Definition: PolyLineExt.cpp:301
void push_back(vmml::Vector3f _point)
Definition: PolyLineExt.cpp:305
static bool lineIntersection(vmml::Vector3f _p0, vmml::Vector3f _p1, vmml::Vector3f _p2, vmml::Vector3f _p3, vmml::Vector3f &_intersect)
Definition: PolyLineExt.cpp:134
const vmml::Vector3d & getBackback() const
Definition: PolyLineExt.cpp:293
void checkIntersections(vmml::Vector3f _p0, vmml::Vector3f _p1, std::vector< vmml::Vector3f > &_intersections)
Definition: PolyLineExt.cpp:152
Definition: ClimateViewerComposition.h:13
void pop_back()
Definition: PolyLineExt.cpp:309
void update()
Definition: PolyLineExt.cpp:44
void clear()
Definition: PolyLineExt.cpp:313