GlobeEngine
PolygonFeatureObject.h
Go to the documentation of this file.
1 
8 #ifndef GlobeEngine_PolygonFeatureObject_h
9 #define GlobeEngine_PolygonFeatureObject_h
10 
11 #include <string>
12 #include <vector>
13 #include <memory>
14 #include "OpenGL_Includes.h"
15 #include "PolyLine.h"
16 #include "FeatureObject.h"
17 #include "ReferenceSystem.h"
18 #include "ColorisationTable.h"
19 #include "MultiPolygonObject.h"
20 
21 namespace geGIS {
22 
24  {
25  // this array does not contain indexed triangles, but contains points
26  // of several polygons.
27  std::vector< vmml::Vector3d > points;
28  std::vector<int> polygonStartIdx;
29  };
30 
32  {
33 
34  public:
37  void clear();
38  void destroy();
39  void create();
40  void create(std::shared_ptr<ge::Shader> _shader, std::string _name, vmml::Vector3f _color);
41  void create(std::shared_ptr<ge::Shader> _shader, std::string _name, const GLuint _uid, const GLuint _guid, vmml::Vector3f _color, vmml::Vector3d _position, vmml::Vector3d _scale, vmml::Vector3d _rotations);
42  void update();
43  void draw(std::shared_ptr<ge::Camera> _cam);
44  void loadData(std::string filename);
45 
46  void load2DLines(geGIS::FeatureRange _range);
47  void load3DLines(geGIS::FeatureRange _range);
49 
50  void addPolygon(std::shared_ptr<geData::PolyLine> _polyline);
51  virtual void createVAO(enum FeatureObject::GEOMETRYDRAWMODE _in);
52 
53  // wheight information
54  //void setWeightInformationPerPolygon();
55  void setMinMaxWeightInformationToColumn(int _column);
56 
57  bool isTriangulated() {
58  return this->multipolygonGeometry->isTriangulated();
59  };
60 
61  void saveTriangulatedMesh(std::string _path);
62 
63  // polygon generation
64  void copyColorInformationToGPU(vmml::Vector3d _pickcolor = vmml::Vector3d(0.0, 0.0, 0.0), int _picked = -1, const std::shared_ptr<geData::ColorisationTable>& _colorTable = NULL);
65  void updateColorBuffer(vmml::Vector3f _color);
66 
67  // handle polygon names
68  std::string getPolygonName(int _idx);
69 
70  // overrides
71  void resetColor();
72 
73  protected:
74  shpio::SHPFileExportContainer* getExportContainer(std::shared_ptr<ReferenceSystem> _referenceSystem);
75 
76  void clearInitial();
77 
78  protected:
79 
80  std::shared_ptr<geData::MultiLineObject> multilineGeometry;
81  std::shared_ptr<geData::MultiPolygonObject> multipolygonGeometry;
82 
83  // Entities
84  std::vector<int> entityStartIndex;
85  std::vector<int> entityAssociation;
86 
87  // Weight information
88  std::vector< std::vector<double> > entityWeightInfo;
89  //std::vector<float> weights; // per polygon
90 
91  // polygon info
92  std::vector<std::string> polygonNames;
93 
94  std::string nameurl;
95  };
96 }
97 #endif
std::vector< int > entityAssociation
Definition: PolygonFeatureObject.h:85
GEOMETRYDRAWMODE
Definition: FeatureObject.h:37
bool isTriangulated()
Definition: PolygonFeatureObject.h:57
void load3DLines(geGIS::FeatureRange _range)
Definition: PolygonFeatureObject.cpp:105
void addPolygon(std::shared_ptr< geData::PolyLine > _polyline)
Definition: PolygonFeatureObject.cpp:152
std::vector< int > entityStartIndex
Definition: PolygonFeatureObject.h:84
Definition: ClusterGrid.h:17
void create()
Definition: PolygonFeatureObject.cpp:32
void load2DPolygonsWithLimitedLines(geGIS::FeatureRange _entityRange, geGIS::FeatureRange _lineRange)
Definition: PolygonFeatureObject.cpp:114
void resetColor()
Definition: PolygonFeatureObject.cpp:82
void updateColorBuffer(vmml::Vector3f _color)
Definition: PolygonFeatureObject.cpp:168
Definition: FeatureObject.h:28
void clear()
Definition: PolygonFeatureObject.cpp:17
Definition: PolygonFeatureObject.h:23
Definition: PolygonFeatureObject.h:31
void load2DLines(geGIS::FeatureRange _range)
Definition: PolygonFeatureObject.cpp:96
std::shared_ptr< geData::MultiPolygonObject > multipolygonGeometry
Definition: PolygonFeatureObject.h:81
std::shared_ptr< geData::MultiLineObject > multilineGeometry
Definition: PolygonFeatureObject.h:80
virtual void createVAO(enum FeatureObject::GEOMETRYDRAWMODE _in)
Definition: PolygonFeatureObject.cpp:182
std::vector< std::vector< double > > entityWeightInfo
Definition: PolygonFeatureObject.h:88
std::vector< std::string > polygonNames
Definition: PolygonFeatureObject.h:92
std::string getPolygonName(int _idx)
Definition: PolygonFeatureObject.cpp:86
PolygonFeatureObject()
Definition: PolygonFeatureObject.cpp:8
void saveTriangulatedMesh(std::string _path)
Definition: PolygonFeatureObject.cpp:158
void loadData(std::string filename)
std::string nameurl
Definition: PolygonFeatureObject.h:94
std::vector< int > polygonStartIdx
Definition: PolygonFeatureObject.h:28
shpio::SHPFileExportContainer * getExportContainer(std::shared_ptr< ReferenceSystem > _referenceSystem)
Definition: PolygonFeatureObject.cpp:260
void setMinMaxWeightInformationToColumn(int _column)
Definition: PolygonFeatureObject.cpp:216
void update()
Definition: PolygonFeatureObject.cpp:77
void copyColorInformationToGPU(vmml::Vector3d _pickcolor=vmml::Vector3d(0.0, 0.0, 0.0), int _picked=-1, const std::shared_ptr< geData::ColorisationTable > &_colorTable=NULL)
Definition: PolygonFeatureObject.cpp:175
~PolygonFeatureObject()
Definition: PolygonFeatureObject.cpp:13
void draw(std::shared_ptr< ge::Camera > _cam)
Definition: PolygonFeatureObject.cpp:203
void clearInitial()
Definition: PolygonFeatureObject.cpp:22
std::vector< vmml::Vector3d > points
Definition: PolygonFeatureObject.h:27