GlobeEngine
SeedLinePoint.h
Go to the documentation of this file.
1 //
2 // SeedLinePoint.hpp
3 // GlobeEngine
4 //
5 // Created by Alireza Amiraghdam on 27/03/17.
6 //
7 //
8 
9 #ifndef GlobeEngine_SeedLinePoint_h
10 #define GlobeEngine_SeedLinePoint_h
11 
12 #include <stdio.h>
13 #include <memory>
14 #include <vmmlib/vmmlib.hpp>
15 #include "PolyLineExt.h"
16 
17 
18 namespace geClimateViewer {
19 
20  class SeedLine;
21  class SeedLinePoint: public std::enable_shared_from_this<SeedLinePoint>{
22  public:
23  SeedLinePoint(SeedLine *_seedLine){seedLine=_seedLine;line.setColor(vmml::Vector3f(0.0,0.0,0.0));};
24  void setPosition(vmml::Vector3f _p){position=_p;};
25  void setLeft(std::shared_ptr<SeedLinePoint> _left){left=_left;};
26  void setRight(std::shared_ptr<SeedLinePoint> _right){right=_right;};
27  std::shared_ptr<SeedLinePoint> &getRight(){return right;};
28  std::shared_ptr<SeedLinePoint> &getLeft(){return left;};
29  void step(std::shared_ptr<PolyLineExt> _nextPerpLine, bool _leftToRight);
30  void createLineVAO();
31  void drawLine(std::shared_ptr<ge::Camera> _cam);
32  std::shared_ptr<SeedLinePoint> rightAlive();
33  std::shared_ptr<SeedLinePoint> leftAlive();
34  bool isAlive(){return alive;};
35  void resetLine();
36  PolyLineExt &getLine(){return line;};
37  void kill(){alive=false;};
38  void setTemp(bool _temp){temp=_temp;};
39  bool beingDebugged=false;
40  float getStreamlineLength();
41 
42  private:
43  SeedLine *seedLine;
44  vmml::Vector3f position;
45  std::shared_ptr<SeedLinePoint> left=nullptr,right=nullptr;
46  PolyLineExt line;
47  bool alive=true;
48  bool temp=false;
49 
50 
51  };
52  typedef std::shared_ptr<SeedLinePoint> SeedLinePointptr;
53 
54 
55 
56 
57 
58 }
59 
60 #endif /* SeedLinePoint_hpp */
void resetLine()
Definition: SeedLinePoint.cpp:115
std::shared_ptr< SeedLinePoint > & getLeft()
Definition: SeedLinePoint.h:28
std::shared_ptr< SeedLinePoint > rightAlive()
Definition: SeedLinePoint.cpp:127
Definition: SeedLine.h:21
void setTemp(bool _temp)
Definition: SeedLinePoint.h:38
void setColor(vmml::Vector3f _c)
Definition: PolyLineExt.h:46
bool isAlive()
Definition: SeedLinePoint.h:34
void setRight(std::shared_ptr< SeedLinePoint > _right)
Definition: SeedLinePoint.h:26
bool beingDebugged
Definition: SeedLinePoint.h:39
Definition: SeedLinePoint.h:21
Definition: PolyLineExt.h:18
void kill()
Definition: SeedLinePoint.h:37
std::shared_ptr< SeedLinePoint > SeedLinePointptr
Definition: SeedLinePoint.h:52
void step(std::shared_ptr< PolyLineExt > _nextPerpLine, bool _leftToRight)
Definition: SeedLinePoint.cpp:16
void drawLine(std::shared_ptr< ge::Camera > _cam)
Definition: SeedLinePoint.cpp:112
float getStreamlineLength()
Definition: SeedLinePoint.cpp:124
SeedLinePoint(SeedLine *_seedLine)
Definition: SeedLinePoint.h:23
void createLineVAO()
Definition: SeedLinePoint.cpp:102
void setPosition(vmml::Vector3f _p)
Definition: SeedLinePoint.h:24
std::shared_ptr< SeedLinePoint > & getRight()
Definition: SeedLinePoint.h:27
std::shared_ptr< SeedLinePoint > leftAlive()
Definition: SeedLinePoint.cpp:136
Definition: ClimateViewerComposition.h:13
void setLeft(std::shared_ptr< SeedLinePoint > _left)
Definition: SeedLinePoint.h:25
PolyLineExt & getLine()
Definition: SeedLinePoint.h:36