27 #include "../../../geometry/Coord2D.h" 28 #include "../../../geometry/Envelope.h" 29 #include "../canvas/MapDisplay.h" 33 #include <QMouseEvent> 37 m_zoomFactor(zoomFactor),
63 if(point.isNull() ==
true)
69 double w = currentExtent.
getWidth() * factor * 0.5;
70 double h = currentExtent.
getHeight() * factor * 0.5;
72 extent.
init(center.
x - w, center.
y - h, center.
x + w, center.
y + h);
82 double w = currentExtent.
getWidth() * factor;
83 double h = currentExtent.
getHeight() * factor;
85 double leftWidth = w * dxPercentage;
86 double rightWidth = w * (1. - dxPercentage);
88 double lowerHeight = h * dyPercentage;
89 double upperHeight = h * (1. - dyPercentage);
91 extent.
init(reference.
x - leftWidth, reference.
y - lowerHeight, reference.
x + rightWidth, reference.
y + upperHeight);
void init(const double &llx, const double &lly, const double &urx, const double &ury)
It initializes (sets) the envelope bounds.
This is a utility class to geographic zoom operation.
const double & getLowerLeftY() const
It returns a constant refernce to the y coordinate of the lower left corner.
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.
An Envelope defines a 2D rectangular region.
virtual const te::gm::Envelope & getExtent() const
It returns the world extent showned by the MapDisplay.
const double & getLowerLeftX() const
It returns a constant reference to the x coordinate of the lower left corner.
double getHeight() const
It returns the envelope height.
bool isValid() const
It tells if the rectangle is valid or not.