ddt 1.4.0
 
Loading...
Searching...
No Matches
ddtFileBasedOverlay.hpp
Go to the documentation of this file.
1
11
12#ifndef DDT_DATAVISUALISATION_DDTGRAPHCIS_FILEBASEDOVERLAY_HPP
13#define DDT_DATAVISUALISATION_DDTGRAPHCIS_FILEBASEDOVERLAY_HPP
14
15#define BOOST_BIND_GLOBAL_PLACEHOLDERS
16
17#include <QtMath>
18#include <boost/property_tree/json_parser.hpp>
19#include <boost/property_tree/ptree.hpp>
20
23
24namespace pt = boost::property_tree;
25
30 public:
35
40
45 void AddGraphicalElement(DdtGraphicalElement* const element);
46
51
56 QList<DdtGraphicalElement*>* GetListOfGraphicalElements();
57
65 bool LoadOverlayFile(const QString overlay_file,
66 const std::string image_widget_name, QString& error_msg);
67
71 void ShowOverlay() const;
72
76 void HideOverlay() const;
77
82 void ShowOverlayByObject(const QString object_name) const;
83
88 void HideOverlayByObject(const QString object_name) const;
89
94 void ShowOverlayByElement(const QString element_name) const;
95
100 void HideOverlayByElement(const QString element_name) const;
101
107 std::string ParseElementType(pt::ptree& elem_type);
108
109 private:
110 bool ParseImageWidget(pt::ptree& image_widget);
111 bool ParseObjectElements(pt::ptree& object);
112 bool GetShow(pt::ptree const& node) const;
113 bool HandleRectangle(pt::ptree const& element, const QString object_name);
114 bool HandleEllipse(pt::ptree const& element, const QString object_name);
115 bool HandleCross(pt::ptree const& element, const QString object_name);
116 bool HandleLine(pt::ptree const& element, const QString object_name);
117 bool HandleText(pt::ptree const& element, const QString object_name);
118 void ReadProperties(pt::ptree const& properties_tree,
119 DdtGraphicalElementProperties& element_properties) const;
120 Qt::GlobalColor CheckColour(const std::string colour) const;
121 QFont::Weight CheckWeight(const std::string weight) const;
122 Qt::PenStyle CheckLineStyle(const std::string line_style) const;
123
124 QString error_txt;
125 QList<DdtGraphicalElement*> graphical_elements;
126};
127
128#endif // DDT_DATAVISUALISATION_DDTGRAPHCIS_FILEBASEDOVERLAY_HPP
void RemoveGraphicalElements()
Definition ddtFileBasedOverlay.cpp:24
void AddGraphicalElement(DdtGraphicalElement *const element)
Definition ddtFileBasedOverlay.cpp:18
QList< DdtGraphicalElement * > * GetListOfGraphicalElements()
Definition ddtFileBasedOverlay.cpp:29
std::string ParseElementType(pt::ptree &elem_type)
Definition ddtFileBasedOverlay.cpp:129
virtual ~DdtFileBasedOverlay()
void ShowOverlayByObject(const QString object_name) const
Definition ddtFileBasedOverlay.cpp:610
void ShowOverlayByElement(const QString element_name) const
Definition ddtFileBasedOverlay.cpp:630
void HideOverlay() const
Definition ddtFileBasedOverlay.cpp:603
void ShowOverlay() const
Definition ddtFileBasedOverlay.cpp:596
void HideOverlayByElement(const QString element_name) const
Definition ddtFileBasedOverlay.cpp:641
void HideOverlayByObject(const QString object_name) const
Definition ddtFileBasedOverlay.cpp:620
bool LoadOverlayFile(const QString overlay_file, const std::string image_widget_name, QString &error_msg)
Definition ddtFileBasedOverlay.cpp:33
Definition ddtGraphicalElementProperties.hpp:20
Definition ddtGraphicalElement.hpp:80
DDT Graphics. Base Class for the DDT Graphical Elements. Elements can be lines, ovals,...
DDT Graphics. Include file to include all supported graphical element types. Include list for the Gra...