GlobeEngine
CriticalRegion.h
Go to the documentation of this file.
1 //
2 // CriticalRegion.hpp
3 // GlobeEngine
4 //
5 // Created by Alireza Amiraghdam on 06/02/17.
6 //
7 //
8 
9 #ifndef GlobeEngine_CriticalRegion_h
10 #define GlobeEngine_CriticalRegion_h
11 
12 #include "CriticalRegion.h"
13 #include "CriticalEdge.h"
14 #include <stdio.h>
15 #include <memory>
16 #include <vector>
17 #include <vmmlib/vmmlib.hpp>
18 
19 #include "SHPObject.h"
20 
21 namespace geClimateViewer {
22 
23  class VectorFieldTopology;
24  class SeedLine;
25 
27  public:
29  vectorFieldTopology=_topology;
30  };
31  void initialize(CriticalPointptr &_point, CriticalEdgeptr _edge,bool _clockwise);
33  void regionIntersection(vmml::Vector3f _p0, vmml::Vector3f _p1,std::vector<vmml::Vector3f> &_intersections);
34  void perpLinesCreateVAO();
35  void perpLinesDraw(std::shared_ptr<ge::Camera> _cam);
36  bool insideRegion(vmml::Vector3f _point);
37  bool getLeftToRight(){return leftToRight;};
38  int getMainPerpLineIndex(){return mainPerpLineIndex;};
39  std::vector< std::shared_ptr<PolyLineExt> > &getPerpLines(){ return perpLines; };
41  VectorFieldTopology *getVectorFieldTopology(){return vectorFieldTopology;};
42  void streamLinesCreateVAO();
43  void resetStreamlines();
44  std::shared_ptr<SeedLine> &getSeedLineForward(){return seedLineForward;};
45  std::shared_ptr<SeedLine> &getSeedLineBackward(){return seedLineBackward;};
46  void highlightStreamline(int _line);
47  void streamLineDraw(std::shared_ptr<ge::Camera> _cam);
48 
49  // export of perpendicular lines to shape file
50  shpio::SHPFileExportContainer* getPerpLinesAsSHPContainer();
51 
52  bool getInitialized();
53  float getStreamlineLength();
54  void clearPerps();
55 
56  private:
57  std::shared_ptr<PolyLineExt> perimeter;
58  //std::vector<int> perimeterType;
59  bool clockwise=false;
60  VectorFieldTopology* vectorFieldTopology;
61  int indexSource=-1,indexSink=-1;
62  PolyLineExt cwLine,ccwLine;
63  std::vector< std::shared_ptr<PolyLineExt> > perpLines;
64  bool leftToRight=false;
65  int mainPerpLineIndex=-1;
66  void createCwAndCcwLines();
67  void createPerpLines();
68  void findLongestPerpLine();
69  void createSeedLine();
70  std::shared_ptr<SeedLine> seedLineForward,seedLineBackward;
71  int currStep=0;
72  bool initialized=false;
73 
74  //Debug ge::Timer testtimer;
75 
76  };
77 
78  typedef std::shared_ptr<CriticalRegion> CriticalRegionptr;
79 
80 }
81 #endif /* CriticalRegion_hpp */
void perpLinesCreateVAO()
Definition: CriticalRegion.cpp:391
void regionIntersection(vmml::Vector3f _p0, vmml::Vector3f _p1, std::vector< vmml::Vector3f > &_intersections)
Definition: CriticalRegion.cpp:375
void perpLinesDraw(std::shared_ptr< ge::Camera > _cam)
Definition: CriticalRegion.cpp:416
void streamLinesCreateVAO()
Definition: CriticalRegion.cpp:409
bool insideRegion(vmml::Vector3f _point)
Definition: CriticalRegion.cpp:441
void streamLineDraw(std::shared_ptr< ge::Camera > _cam)
Definition: CriticalRegion.cpp:424
CriticalRegion(VectorFieldTopology *_topology)
Definition: CriticalRegion.h:28
Definition: PolyLineExt.h:18
float getStreamlineLength()
Definition: CriticalRegion.cpp:431
std::vector< std::shared_ptr< PolyLineExt > > & getPerpLines()
Definition: CriticalRegion.h:39
std::shared_ptr< CriticalPoint > CriticalPointptr
Definition: CriticalPoint.h:18
void initialize(CriticalPointptr &_point, CriticalEdgeptr _edge, bool _clockwise)
Definition: CriticalRegion.cpp:17
bool getInitialized()
Definition: CriticalRegion.cpp:525
std::shared_ptr< CriticalEdge > CriticalEdgeptr
Definition: CriticalPoint.h:20
std::shared_ptr< SeedLine > & getSeedLineForward()
Definition: CriticalRegion.h:44
bool getLeftToRight()
Definition: CriticalRegion.h:37
void highlightStreamline(int _line)
Definition: CriticalRegion.cpp:500
Definition: CriticalRegion.h:26
void resetStreamlines()
Definition: CriticalRegion.cpp:493
void clearPerps()
Definition: CriticalRegion.cpp:369
void streamlinesStepForward()
Definition: CriticalRegion.cpp:466
Definition: ClimateViewerComposition.h:13
shpio::SHPFileExportContainer * getPerpLinesAsSHPContainer()
Definition: CriticalRegion.cpp:507
VectorFieldTopology * getVectorFieldTopology()
Definition: CriticalRegion.h:41
int getMainPerpLineIndex()
Definition: CriticalRegion.h:38
void calculatePerpsAndSeedLine()
Definition: CriticalRegion.cpp:361
std::shared_ptr< SeedLine > & getSeedLineBackward()
Definition: CriticalRegion.h:45
Definition: VectorFieldTopology.h:24
std::shared_ptr< CriticalRegion > CriticalRegionptr
Definition: CriticalRegion.h:78