27 #include "../../../common/STLUtils.h"
28 #include "../../../maptools/MarkRendererManager.h"
29 #include "../../../maptools/Utils.h"
30 #include "../../../se/AnchorPoint.h"
31 #include "../../../se/Displacement.h"
32 #include "../../../se/Graphic.h"
33 #include "../../../se/Mark.h"
37 #include "ui_WellKnownGraphicWidgetForm.h"
40 #include <QtGui/QGridLayout>
47 m_ui(new Ui::WellKnownGraphicWidgetForm)
55 QGridLayout* layout =
new QGridLayout(
m_ui->m_markGroupBox);
62 connect(
m_ui->m_graphicSizeDoubleSpinBox, SIGNAL(valueChanged(
const QString&)), SLOT(
setGraphicSize(
const QString&)));
63 connect(
m_ui->m_graphicAngleDoubleSpinBox, SIGNAL(valueChanged(
const QString&)), SLOT(
setGraphicAngle(
const QString&)));
82 m_graphic = graphic->
clone();
85 const std::vector<te::se::Mark*> marks = m_graphic->
getMarks();
97 std::size_t found = name->find(
"://");
98 if(found != std::string::npos)
102 m_markWidget->setMark(marks[0]);
111 return tr(
"Well Known Marker");
118 int dimension = size.width();
122 QIcon icon = QIcon(QPixmap::fromImage(img->scaled(size, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)));
133 m_graphic->setMark(0, m_markWidget->getMark());
134 emit graphicChanged();
139 setGraphicDisplacement(m_ui->m_displacementXDoubleSpinBox->text(), m_ui->m_displacementXDoubleSpinBox->text());
144 setGraphicAnchorPoint(m_ui->m_anchorPointXDoubleSpinBox->text(), m_ui->m_anchorPointYDoubleSpinBox->text());
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)
QIcon getGraphicIcon(const QSize &size) const
Pure virtual method that should return a QIcon that represents the graphic. i.e. a simple preview...
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.
const std::string * getWellKnownName() const
const ParameterValue * getDisplacementX() const
TEMAPEXPORT double GetDouble(const te::se::ParameterValue *param)
Gets the parameter value as double.
const ParameterValue * getDisplacementY() const
void updateUi()
Updates the widget form based on internal graphic element.
te::se::Mark * getMark() const
Gets the configured mark element.
A widget used to build a well known mark element.
void onGraphicAnchorPointChanged(const QString &text)
te::qt::widgets::WellKnownMarkWidget * m_markWidget
Well known mark Widget used to configure the mark element.
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.
A widget used to build a well known mark element.
A helper class for 32-bit RGBA (Red-Green-Blue-Alpha channel) color.
bool setGraphic(const te::se::Graphic *graphic)
Sets a graphic element to this widget.
std::auto_ptr< Ui::WellKnownGraphicWidgetForm > m_ui
Widget form.
~WellKnownGraphicWidget()
Destructor.
Abstract class that represents a widget that can be used to build a graphic element.
void onGraphicDisplacementChanged(const QString &text)
void Free(std::vector< T * > *v)
This function can be applied to a pointer to a vector of pointers.
const ParameterValue * getAnchorPointX() const
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)
A widget used to build a graphic associate with a well-known mark element.
static MarkRendererManager & getInstance()
It returns a reference to the singleton instance.
A Graphic is a graphic symbol with an inherent shape, color(s), and possibly size.
void setGraphicSize(const QString &size)
WellKnownGraphicWidget(QWidget *parent=0, Qt::WindowFlags f=0)
Constructs a well known graphic widget which is a child of parent, with widget flags set to f...
The "ParameterValueType" uses WFS-Filter expressions to give values for SE graphic parameters...
const std::vector< Mark * > getMarks() const
TEQTWIDGETSEXPORT QImage * GetImage(te::color::RGBAColor **img, int width, int height)
It creates a QImage from an RGBA color array.
A Mark specifies a geometric shape and applies coloring to it.