27 #include "../../../maptools/Utils.h"
28 #include "../../../se.h"
29 #include "../../../xlink/SimpleLink.h"
37 #include "../../../../../third-party/qt/propertybrowser/qtpropertybrowser.h"
38 #include <QtGui/QGridLayout>
39 #include <QtGui/QToolBox>
46 m_setLocalGraphic(false), m_graphic(new te::se::Graphic)
48 QGridLayout* layout =
new QGridLayout(
this);
49 this->setLayout(layout);
51 QToolBox* tb =
new QToolBox(
this);
52 layout->addWidget(tb);
54 QtTreePropertyBrowser* graphBrowser =
new QtTreePropertyBrowser(
this);
55 graphBrowser->setIndentation(10);
56 graphBrowser->setPropertiesWithoutValueMarked(
true);
57 graphBrowser->setRootIsDecorated(
false);
58 graphBrowser->setResizeMode(QtTreePropertyBrowser::ResizeToContents);
61 tb->addItem(graphBrowser,
"Graphic Properties");
63 QtTreePropertyBrowser* wkBrowser =
new QtTreePropertyBrowser(
this);
64 wkBrowser->setIndentation(10);
65 wkBrowser->setPropertiesWithoutValueMarked(
true);
66 wkBrowser->setRootIsDecorated(
false);
67 wkBrowser->setResizeMode(QtTreePropertyBrowser::ResizeToContents);
70 tb->addItem(wkBrowser,
"Well Known Mark");
72 QtTreePropertyBrowser* gpBrowser =
new QtTreePropertyBrowser(
this);
73 gpBrowser->setIndentation(10);
74 gpBrowser->setPropertiesWithoutValueMarked(
true);
75 gpBrowser->setRootIsDecorated(
false);
76 gpBrowser->setResizeMode(QtTreePropertyBrowser::ResizeToContents);
79 tb->addItem(gpBrowser,
"Glyph Mark");
81 QtTreePropertyBrowser* liBrowser =
new QtTreePropertyBrowser(
this);
82 liBrowser->setIndentation(10);
83 liBrowser->setPropertiesWithoutValueMarked(
true);
84 liBrowser->setRootIsDecorated(
false);
85 liBrowser->setResizeMode(QtTreePropertyBrowser::ResizeToContents);
88 tb->addItem(liBrowser,
"Local Image");
109 m_setLocalGraphic =
true;
111 m_graphic = graphic->
clone();
113 m_graphp->setGraphic(m_graphic);
116 const std::vector<te::se::Mark*> marks = m_graphic->
getMarks();
117 if(marks.empty() ==
false)
123 std::size_t found = name->find(
"ttf://");
124 if(found != std::string::npos)
125 m_gp->setMark(marks[0]);
127 found = name->find(
"://");
128 if(found == std::string::npos)
129 m_mp->setMark(marks[0]);
133 const std::vector<te::se::ExternalGraphic*> extGraphics = m_graphic->getExternalGraphics();
134 if(extGraphics.empty() ==
false)
141 const std::string href = link->
getHref();
146 if(!img.load(href.c_str()))
150 m_li->setExternalGraphic(g);
153 m_setLocalGraphic =
false;
160 return m_graphic->
clone();
176 if(!m_setLocalGraphic)
177 emit graphicChanged();
187 m_graphic->add(mark);
190 if(!m_setLocalGraphic)
191 emit graphicChanged();
201 m_graphic->add(mark);
204 if(!m_setLocalGraphic)
205 emit graphicChanged();
217 if(!m_setLocalGraphic)
218 emit graphicChanged();
const te::xl::SimpleLink * getOnlineResource() const
ParameterValue * clone() const
It creates a new copy of this object.
void add(ExternalGraphic *g)
Graphics can either be referenced from an external URL in a common format (such as GIF or SVG)...
te::se::Mark * getMark() const
Gets the configured mark element.
A widget used to define the general properties of a se object.
A widget used to define a glyph object.
te::se::Graphic * getGraphic() const
const std::string & getHref() const
A widget used to define the mark se properties.
GraphicProperty(QWidget *parent)
Constructor.
void onWellKnownMarkChanged()
const std::string * getWellKnownName() const
The ExternalGraphic allows a reference to be made to an external graphic file with a Web URL or to in...
te::qt::widgets::LocalImagePropertyItem * m_li
bool setGraphic(const te::se::Graphic *graphic)
A widget used to define a local image graphic for a se symbolizer.
Graphic * clone() const
It creates a new copy of this object.
te::qt::widgets::GlyphMarkPropertyItem * m_gp
void onLocalImageChanged()
void onGlyphMarkChanged()
te::se::Graphic * m_graphic
~GraphicProperty()
Destructor.
void onGraphicPropertyChanged()
const ParameterValue * getOpacity() const
A widget used to define a glyph object.
const ParameterValue * getSize() const
A widget used to define a local image graphic for a se symbolizer.
const ParameterValue * getRotation() const
te::qt::widgets::WellKnownMarkPropertyItem * m_mp
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.
te::qt::widgets::GraphicPropertyItem * m_graphp
A widget used to define the general properties of a se object.
A widget used to define the mark se properties.
const std::vector< Mark * > getMarks() const
A Mark specifies a geometric shape and applies coloring to it.