27 #include "../../../maptools/Utils.h"
28 #include "../../../se.h"
29 #include "../../../xlink/SimpleLink.h"
37 #include <QGridLayout>
41 #include <QtPropertyBrowser/QtTreePropertyBrowser>
42 #include <QtPropertyBrowser/QtVariantPropertyManager>
49 m_setLocalGraphic(false), m_graphic(new te::se::Graphic)
51 QGridLayout* layout =
new QGridLayout(
this);
52 this->setLayout(layout);
54 QToolBox* tb =
new QToolBox(
this);
55 layout->addWidget(tb);
57 QtTreePropertyBrowser* graphBrowser =
new QtTreePropertyBrowser(
this);
58 graphBrowser->setIndentation(10);
59 graphBrowser->setPropertiesWithoutValueMarked(
true);
60 graphBrowser->setRootIsDecorated(
false);
61 graphBrowser->setResizeMode(QtTreePropertyBrowser::ResizeToContents);
64 tb->addItem(graphBrowser,
"Graphic Properties");
66 QtTreePropertyBrowser* wkBrowser =
new QtTreePropertyBrowser(
this);
67 wkBrowser->setIndentation(10);
68 wkBrowser->setPropertiesWithoutValueMarked(
true);
69 wkBrowser->setRootIsDecorated(
false);
70 wkBrowser->setResizeMode(QtTreePropertyBrowser::ResizeToContents);
73 tb->addItem(wkBrowser,
"Well Known Mark");
75 QtTreePropertyBrowser* gpBrowser =
new QtTreePropertyBrowser(
this);
76 gpBrowser->setIndentation(10);
77 gpBrowser->setPropertiesWithoutValueMarked(
true);
78 gpBrowser->setRootIsDecorated(
false);
79 gpBrowser->setResizeMode(QtTreePropertyBrowser::ResizeToContents);
82 tb->addItem(gpBrowser,
"Glyph Mark");
84 QtTreePropertyBrowser* liBrowser =
new QtTreePropertyBrowser(
this);
85 liBrowser->setIndentation(10);
86 liBrowser->setPropertiesWithoutValueMarked(
true);
87 liBrowser->setRootIsDecorated(
false);
88 liBrowser->setResizeMode(QtTreePropertyBrowser::ResizeToContents);
91 tb->addItem(liBrowser,
"Local Image");
112 m_setLocalGraphic =
true;
114 m_graphic = graphic->
clone();
116 m_graphp->setGraphic(m_graphic);
119 const std::vector<te::se::Mark*> marks = m_graphic->
getMarks();
120 if(marks.empty() ==
false)
126 std::size_t found = name->find(
"ttf://");
127 if(found != std::string::npos)
128 m_gp->setMark(marks[0]);
130 found = name->find(
"://");
131 if(found == std::string::npos)
132 m_mp->setMark(marks[0]);
136 const std::vector<te::se::ExternalGraphic*> extGraphics = m_graphic->getExternalGraphics();
137 if(extGraphics.empty() ==
false)
144 const std::string href = link->
getHref();
149 if(!img.load(href.c_str()))
153 m_li->setExternalGraphic(g);
156 m_setLocalGraphic =
false;
163 return m_graphic->
clone();
179 if(!m_setLocalGraphic)
180 emit graphicChanged();
190 m_graphic->add(mark);
193 if(!m_setLocalGraphic)
194 emit graphicChanged();
204 m_graphic->add(mark);
207 if(!m_setLocalGraphic)
208 emit graphicChanged();
220 if(!m_setLocalGraphic)
221 emit graphicChanged();
const ParameterValue * getRotation() const
A Mark specifies a geometric shape and applies coloring to it.
const std::string & getHref() const
A widget used to define a local image graphic for a se symbolizer.
void setSize(ParameterValue *value)
The Size element gives the absolute size of the graphic in uoms encoded as a floating-point number...
A Graphic is a graphic symbol with an inherent shape, color(s), and possibly size.
void add(ExternalGraphic *g)
Graphics can either be referenced from an external URL in a common format (such as GIF or SVG)...
A widget used to define a glyph object.
const te::xl::SimpleLink * getOnlineResource() const
A widget used to define the general properties of a se object.
The ExternalGraphic allows a reference to be made to an external graphic file with a Web URL or to in...
Graphic * clone() const
It creates a new copy of this object.
A widget used to define the mark se properties.
const std::string * getWellKnownName() const
ParameterValue * clone() const
It creates a new copy of this object.
const std::vector< Mark * > getMarks() const
const ParameterValue * getSize() const
const ParameterValue * getOpacity() const