27 #include "../../../maptools/Utils.h"
28 #include "../../../se/ExternalGraphic.h"
29 #include "../../../se/AnchorPoint.h"
30 #include "../../../se/Displacement.h"
31 #include "../../../se/Graphic.h"
32 #include "../../../xlink/SimpleLink.h"
35 #include "ui_LocalGraphicWidgetForm.h"
42 m_ui(new Ui::LocalGraphicWidgetForm)
50 QGridLayout* layout =
new QGridLayout(
m_ui->m_imageGroupBox);
57 connect(
m_ui->m_graphicSizeDoubleSpinBox, SIGNAL(valueChanged(
const QString&)), SLOT(
setGraphicSize(
const QString&)));
58 connect(
m_ui->m_graphicAngleDoubleSpinBox, SIGNAL(valueChanged(
const QString&)), SLOT(
setGraphicAngle(
const QString&)));
77 m_graphic = graphic->
clone();
81 if(extGraphics.empty())
89 const std::string href = link->
getHref();
94 if(!img.load(href.c_str()))
98 m_localImageWidget->setExternalGraphic(g);
107 return tr(
"Local Image");
112 const std::vector<te::se::ExternalGraphic*> extGraphics = m_graphic->getExternalGraphics();
113 if(extGraphics.empty())
121 const std::string href = link->
getHref();
126 if(!img.load(href.c_str()))
129 return QIcon(QPixmap::fromImage(img.scaledToWidth(size.width(), Qt::SmoothTransformation)));
134 m_graphic->setExternalGraphic(0, m_localImageWidget->getExternalGraphic());
136 m_ui->m_graphicSizeDoubleSpinBox->setValue(size.height());
141 setGraphicDisplacement(m_ui->m_displacementXDoubleSpinBox->text(), m_ui->m_displacementXDoubleSpinBox->text());
146 setGraphicAnchorPoint(m_ui->m_anchorPointXDoubleSpinBox->text(), m_ui->m_anchorPointYDoubleSpinBox->text());
const te::xl::SimpleLink * getOnlineResource() const
~LocalGraphicWidget()
Destructor.
void add(ExternalGraphic *g)
Graphics can either be referenced from an external URL in a common format (such as GIF or SVG)...
void setGraphicAngle(const QString &angle)
A widget used to build an external graphic element that references a local image. e...
const ParameterValue * getAnchorPointY() const
A Displacement gives X and Y offset displacements to use for rendering a text label, graphic or other Symbolizer near a point.
void onGraphicDisplacementChanged(const QString &text)
te::se::ExternalGraphic * getExternalGraphic() const
Gets the configured external graphic element.
const std::string & getHref() const
void onGraphicAnchorPointChanged(const QString &text)
The ExternalGraphic allows a reference to be made to an external graphic file with a Web URL or to in...
const ParameterValue * getDisplacementX() const
TEMAPEXPORT double GetDouble(const te::se::ParameterValue *param)
Gets the parameter value as double.
void updateUi()
Updates the widget form based on internal graphic element.
const ParameterValue * getDisplacementY() const
QString getGraphicType() const
Pure virtual method that should return a "user friendly" string that informs the graphic type that ca...
Graphic * clone() const
It creates a new copy of this object.
bool setGraphic(const te::se::Graphic *graphic)
Sets a graphic element to this widget.
std::auto_ptr< Ui::LocalGraphicWidgetForm > m_ui
Widget form.
te::qt::widgets::LocalImageWidget * m_localImageWidget
Local image widget used to configure the external graphic element.
LocalGraphicWidget(QWidget *parent=0, Qt::WindowFlags f=0)
Constructs a local graphic widget which is a child of parent, with widget flags set to f...
A widget used to build an external graphic element that references a local image. e...
Abstract class that represents a widget that can be used to build a graphic element.
void onExternalGraphicChanged(const QSize &size)
const ParameterValue * getAnchorPointX() const
QIcon getGraphicIcon(const QSize &size) const
Pure virtual method that should return a QIcon that represents the graphic. i.e. a simple preview...
te::se::Graphic * m_graphic
Graphic element that will be configured by this widget.
An AnchorPoint identifies the location inside of a text label to use an 'anchor' for positioning it r...
void setGraphicOpacity(int value)
const std::vector< ExternalGraphic * > getExternalGraphics() const
A Graphic is a graphic symbol with an inherent shape, color(s), and possibly size.
void setGraphicSize(const QString &size)
A widget used to build a graphic associated with an external graphic element that references a local ...
The "ParameterValueType" uses WFS-Filter expressions to give values for SE graphic parameters...