GlobeEngine
StyleCollection.h
Go to the documentation of this file.
1 
9 #ifndef GlobeEngine_StyleCollection_h
10 #define GlobeEngine_StyleCollection_h
11 
12 #include <vmmlib/vmmlib.hpp>
13 #include "OpenGL_Includes.h"
14 #include "Shader.h"
15 #include "BufferArray.h"
16 
17 namespace geGIS {
18 
19  /*
20  * This can be a stroke,pie piece, bar or a barchart
21  */
22  struct StylePiece
23  {
24  vmml::Vector4f color;
25 
27  StylePiece(vmml::Vector4f _color) : color(_color){}
28  };
29 
30  struct Style
31  {
32  std::string name;
33  std::string value;
34  std::string type;
35  std::string iconurl;
36  double strokeWidth;
37  double borderWidth;
39  std::vector< std::shared_ptr<StylePiece> > strokes;
40  Style(){}
41  Style(std::string _name, std::string _value, double _strokeWidth) :
42  name(_name), value(_value), strokeWidth(_strokeWidth){}
43  };
44 
46  {
52  };
53 
55  {
56  public:
58  StyleCollection(std::string _attribute);
60 
61  int getStyleCount();
62  std::shared_ptr<Style> getStyleAt(int _idx);
63  void addStyle(std::shared_ptr<Style> _style);
64  std::string getAttributeName();
65  std::string getAttributeType();
66  void setAttributeName(std::string _name);
67  void setAttributeType(std::string _type);
68 
69  void copyStyleCollectionToUniformBuffers(std::shared_ptr<ge::Shader> _shader);
71 
72  int getTypeIDForStyleType(std::string _type);
73 
74  int getStyleIndexForChar(unsigned char _in);
75  int getStyleIndexForInt(int _in);
76  int getStyleIndexForString(std::string _in);
77 
78  void setLineConfigRadius(double _radius);
79  void setLineConfigMaxRadius(double _radius);
80  double getLineConfigRadius() const;
81  double getLineConfigMaxRadius() const;
82 
83  private:
84  std::string attribute;
85  std::string attributeType;
86  std::vector< std::shared_ptr<Style> > styles;
87 
88  double lineConfigRadius;
89  double lineConfigMaxRadius;
90 
91  ge::UniformBufferArray styleBuffer;
92  StyleCollectionUniformHandles uniformHandles;
93  };
94 
95 }
96 #endif
std::vector< std::shared_ptr< StylePiece > > strokes
Definition: StyleCollection.h:39
int getStyleCount()
Definition: StyleCollection.cpp:45
~StyleCollection()
Definition: StyleCollection.cpp:16
void setLineConfigRadius(double _radius)
Definition: StyleCollection.cpp:342
Style(std::string _name, std::string _value, double _strokeWidth)
Definition: StyleCollection.h:41
StylePiece()
Definition: StyleCollection.h:26
std::string getAttributeName()
Definition: StyleCollection.cpp:33
std::string iconurl
Definition: StyleCollection.h:35
Definition: ClusterGrid.h:17
double borderWidth
Definition: StyleCollection.h:37
Definition: StyleCollection.h:45
int getTypeIDForStyleType(std::string _type)
Definition: StyleCollection.cpp:289
std::string type
Definition: StyleCollection.h:34
double strokeWidth
Definition: StyleCollection.h:36
Definition: StyleCollection.h:30
int getStyleIndexForString(std::string _in)
Definition: StyleCollection.cpp:324
GLuint colorBufferHandle
Definition: StyleCollection.h:47
int getStyleIndexForInt(int _in)
Definition: StyleCollection.cpp:314
Definition: BufferArray.h:18
void addStyle(std::shared_ptr< Style > _style)
Definition: StyleCollection.cpp:29
std::string getAttributeType()
Definition: StyleCollection.cpp:20
Definition: StyleCollection.h:22
void setAttributeType(std::string _type)
Definition: StyleCollection.cpp:41
void setLineConfigMaxRadius(double _radius)
Definition: StyleCollection.cpp:346
void copyStyleCollectionToUniformBuffers(std::shared_ptr< ge::Shader > _shader)
Definition: StyleCollection.cpp:56
StylePiece(vmml::Vector4f _color)
Definition: StyleCollection.h:27
GLuint styleTypeHandle
Definition: StyleCollection.h:49
double getLineConfigRadius() const
Definition: StyleCollection.cpp:334
GLuint maxOffsetHandle
Definition: StyleCollection.h:51
std::string name
Definition: StyleCollection.h:32
Style()
Definition: StyleCollection.h:40
StyleCollectionUniformHandles getUniformBufferHandles()
Definition: StyleCollection.cpp:274
GLuint minOffsetHandle
Definition: StyleCollection.h:50
vmml::Vector4f color
Definition: StyleCollection.h:24
int getStyleIndexForChar(unsigned char _in)
Definition: StyleCollection.cpp:304
double midBorderWidth
Definition: StyleCollection.h:38
std::shared_ptr< Style > getStyleAt(int _idx)
Definition: StyleCollection.cpp:25
GLuint bgcolorBufferHandle
Definition: StyleCollection.h:48
StyleCollection()
Definition: StyleCollection.cpp:7
double getLineConfigMaxRadius() const
Definition: StyleCollection.cpp:338
void setAttributeName(std::string _name)
Definition: StyleCollection.cpp:37
std::string value
Definition: StyleCollection.h:33
Definition: StyleCollection.h:54