4 #ifndef FIRE_GEAR_GEOM_SHARED_ENVELOPESH_HPP_INCLUDED
5 #define FIRE_GEAR_GEOM_SHARED_ENVELOPESH_HPP_INCLUDED
10 #include "fire/shared/Shared.hpp"
11 #include "fire/gear/geom/Envelope.hpp"
43 EnvelopeSh(
const double& x1,
const double& x2,
const double& y1,
const double& y2,
int const & srid = 0) {
63 inline bool operator!=(
EnvelopeSh const & r)
const {
64 return !(this->operator ==(r));
67 inline bool operator==(
EnvelopeSh const & r)
const {
71 if (Shared::operator ==(r))
79 void init(
int const & srid = 0) {
83 void init(
const double& x1,
const double& x2,
const double& y1,
const double& y2,
int const & srid = 0) {
84 _ptr->init(x1, x2, y1, y2, srid);
88 _ptr->init(c1, c2, srid);
91 void init(
const Coordinate& c,
int const & srid = 0) {
100 return _ptr->isNull();
103 double getWidth()
const {
104 return _ptr->getWidth();
107 double getHeight()
const {
108 return _ptr->getHeight();
111 double getArea()
const {
112 return _ptr->getArea();
115 double getMaxX()
const {
116 return _ptr->getMaxX();
119 double getMaxY()
const {
120 return _ptr->getMaxY();
123 double getMinX()
const {
124 return _ptr->getMinX();
127 double getMinY()
const {
128 return _ptr->getMinY();
131 int getSrid()
const {
132 return _ptr->getSrid();
136 return _ptr->centre(c);
139 void translate(
const double& dx,
const double& dy) {
140 return _ptr->translate(dx, dy);
143 void expandBy(
const double& dx,
const double& dy) {
144 _ptr->expandBy(dx, dy);
147 void expandBy(
const double& distance) {
148 _ptr->expandBy(distance);
151 void expandToInclude(
const double& x,
const double& y) {
152 _ptr->expandToInclude(x, y);
156 _ptr->expandToInclude(c);
159 void expandToInclude(
const Envelope& e) {
160 _ptr->expandToInclude(e);
163 void setSrid(
int const & srid) {
167 bool contains(
const double& x,
const double& y)
const {
168 return _ptr->contains(x, y);
172 return _ptr->contains(c);
175 bool contains(
const Envelope& e)
const {
176 return _ptr->contains(e);
179 bool intersects(
const double& x,
const double& y)
const {
180 return _ptr->intersects(x, y);
184 return _ptr->intersects(c);
187 bool intersects(
const Envelope& e)
const {
188 return _ptr->intersects(e);
192 return _ptr->intersection(e, r);
196 return _ptr->toGeometry();
199 bool isPoint()
const {
200 return _ptr->isPoint();
203 bool isLine()
const {
204 return _ptr->isLine();
207 bool covers(
const double& x,
const double& y)
const {
208 return _ptr->covers(x, y);
212 return _ptr->covers(c);
215 bool covers(
const Envelope& e)
const {
216 return _ptr->covers(e);
220 return _ptr->equals(e);
223 std::string toString()
const {
224 return _ptr->toString();
227 double distance(
const Envelope& e)
const {
228 return _ptr->distance(e);
Definition: Coordinate.hpp:48
Definition: EnvelopeSh.hpp:18
Definition: Envelope.hpp:31
Definition: Geometry.hpp:69
Definition: Shared.hpp:17
bool equals(const fire::gear::geom::Envelope &envelope) const