27 #include "../../../common/STLUtils.h"
28 #include "../../../geometry/Coord2D.h"
29 #include "../../../geometry/Envelope.h"
30 #include "../../../geometry/Point.h"
31 #include "../../../maptools/MarkRendererManager.h"
32 #include "../../../maptools/Utils.h"
33 #include "../../../se/Fill.h"
34 #include "../../../se/Mark.h"
35 #include "../../../se/Stroke.h"
36 #include "../../../se/Utils.h"
37 #include "../../widgets/tools/AbstractTool.h"
38 #include "../../widgets/tools/Pan.h"
39 #include "../canvas/Canvas.h"
40 #include "../canvas/MultiThreadMapDisplay.h"
44 #include <QGridLayout>
46 #define PATTERN_SIZE 14
49 : QWidget(parent, f), m_parentMapDisplay(mapParent), m_itsMe(false), m_isEnabled(true)
53 QGridLayout* displayLayout =
new QGridLayout(
this);
67 displayLayout->setContentsMargins(0,0,0,0);
98 m_mapDisplay->setMouseTracking(
true);
99 m_mapDisplay->setLayerList(layerList);
100 m_mapDisplay->setSRID(srid,
false);
103 m_mapDisplay->setExtent(ext,
false);
109 return m_mapDisplay->getExtent();
117 m_mapDisplay->getDraftPixmap()->fill(QColor(0, 0, 0, 0));
126 canvasInstance.draw(&point);
128 m_mapDisplay->repaint();
133 m_isEnabled = status;
135 onParentMapDisplayExtentChanged();
148 double w = m_parentMapDisplay->getExtent().getWidth() * 0.5;
149 double h = m_parentMapDisplay->getExtent().getHeight() * 0.5;
153 auxExt.
m_llx = center.
x - w;
154 auxExt.
m_lly = center.
y - h;
155 auxExt.
m_urx = center.
x + w;
156 auxExt.
m_ury = center.
y + h;
159 m_parentMapDisplay->setExtent(auxExt);
179 m_mapDisplay->setExtent(ext,
true);
190 m_mapDisplay->setExtent(ext,
true);
196 double value = (double)m_sliderZoomFactor->value() / 100.;
197 double hScale = (double)m_mapDisplay->
getHeight() / (double)m_parentMapDisplay->getHeight();
198 double wScale = (double)m_mapDisplay->getWidth() / (double)m_parentMapDisplay->getWidth();
199 double scale = (hScale + wScale) / 2.;
204 double w = e.
getWidth() * scale * value;
205 double h = e.
getHeight() * scale * value;
double m_urx
Upper right corner x-coordinate.
double getWidth() const
It returns the envelope width.
An utility struct for representing 2D coordinates.
Coord2D getCenter() const
It returns the rectangle's center coordinate.
void Free(std::vector< T * > *v)
This function can be applied to a pointer to a vector of pointers.
double m_llx
Lower left corner x-coordinate.
static MarkRendererManager & getInstance()
It returns a reference to the singleton instance.
A point with x and y coordinate values.
An Envelope defines a 2D rectangular region.
A Fill specifies the pattern for filling an area geometry.
TESEEXPORT Mark * CreateMark(const std::string &wellKnownName, Stroke *stroke, Fill *fill)
Creates a mark.
double m_lly
Lower left corner y-coordinate.
TESEEXPORT Stroke * CreateStroke(const std::string &color, const std::string &width)
Creates a stroke.
double m_ury
Upper right corner y-coordinate.
#define TE_TRANSPARENT
For an RGBA color this is the value of the alpha-channel for totally transparent. ...
A Stroke specifies the appearance of a linear geometry.
A helper class for 32-bit RGBA (Red-Green-Blue-Alpha channel) color.
double getHeight() const
It returns the envelope height.
bool isValid() const
It tells if the rectangle is valid or not.
TESEEXPORT Fill * CreateFill(const std::string &color, const std::string &opacity)
Creates a fill.