Fire Core  8.0.0.alpha
GIS framework per tutti gli usi
 Tutto Classi Namespace Funzioni Variabili Ridefinizioni di tipo (typedef) Tipi enumerati (enum) Valori del tipo enumerato Friend
Envelope.hpp
1 // Copyright 2015 GEOSYSTEMS SRL
2 // All Rights Reserved.
3 
4 #ifndef FIRE_GEAR_GEOM_ENVELOPE_HPP_INCLUDED
5 #define FIRE_GEAR_GEOM_ENVELOPE_HPP_INCLUDED
6 
7 #include <geos/geom/Envelope.h>
8 
9 #include <boost/smart_ptr/shared_ptr.hpp>
10 
11 #include <exception>
12 #include <string>
13 
14 #include "fire/export.hpp"
15 
16 #include "fire/gear/projection/Projector.hpp"
17 #include "fire/gear/geom/Coordinate.hpp"
18 #include "fire/gear/Entity.hpp"
19 
20 namespace fire {
21 namespace gear {
22 namespace geom {
23 
24 namespace shared {
25 class EnvelopeSh;
26 } // namespace shared
27 
31 class FIRE_ENGINE_DLL Envelope : public fire::gear::Entity {
32  public:
34 
35  private:
39  std::auto_ptr< geos::geom::Envelope > envelope;
43  int srid;
47  std::auto_ptr< fire::gear::projection::Projector > _projector;
48 
49  public:
54  explicit Envelope(int srid = 0);
63  Envelope(double x1, double x2, double y1, double y2, int srid = 0);
70  Envelope(const fire::gear::geom::Coordinate& coordinate1, const fire::gear::geom::Coordinate& coordinate2, int srid = 0);
76  explicit Envelope(const fire::gear::geom::Coordinate& coordinate, int srid = 0);
88  Envelope(const Envelope& envelope);
100  Envelope& operator=(const Envelope& envelope);
105  void init(int srid = 0);
114  void init(double x1, double x2, double y1, double y2, int srid = 0);
121  void init(const fire::gear::geom::Coordinate& coordinate1, const fire::gear::geom::Coordinate& coordinate2, int srid = 0);
127  void init(const fire::gear::geom::Coordinate& coordinate, int srid = 0);
131  void setToNull();
136  void setDestinationProjection(int destSrid);
141  bool isNull() const;
146  double getWidth() const;
151  double getHeight() const;
156  double getArea() const;
161  double getMaxX() const;
166  double getMaxY() const;
171  double getMinX() const;
176  double getMinY() const;
181  int getSrid() const;
187  bool centre(fire::gear::geom::Coordinate& centre) const;
193  void translate(double deltaX, double deltaY);
199  void expandBy(double deltaX, double deltaY);
204  void expandBy(double distance);
210  void expandToInclude(double x, double y);
215  void expandToInclude(const fire::gear::geom::Coordinate& coordinate);
220  void expandToInclude(const fire::gear::geom::Envelope& envelope);
225  void setSrid(int srid);
232  bool contains(double x, double y) const;
238  bool contains(const fire::gear::geom::Coordinate& coordinate) const;
244  bool contains(const fire::gear::geom::Envelope& envelope) const;
251  bool intersects(double x, double y) const;
257  bool intersects(const fire::gear::geom::Coordinate& coordinate) const;
263  bool intersects(const fire::gear::geom::Envelope& envelope) const;
270  bool intersection(const fire::gear::geom::Envelope& envelope, Envelope &result) const;
275  fire::gear::geom::Geometry* toGeometry() const;
280  bool isPoint() const;
285  bool isLine() const;
292  bool covers(double x, double y) const;
298  bool covers(const fire::gear::geom::Coordinate& coordinate) const;
304  bool covers(const fire::gear::geom::Envelope& envelope) const;
310  bool equals(const fire::gear::geom::Envelope& envelope) const;
317  bool equals(const fire::gear::geom::Envelope& envelope, bool strict) const;
322  std::string toString() const;
328  double distance(const Envelope& envelope) const;
329 
330  void project(const int& srid);
331 
332 private:
337  void _init(int srid);
343  boost::shared_ptr< fire::gear::geom::Envelope > _project(const fire::gear::geom::Envelope& envelope) const;
344 };
345 } // namespace geom
346 } // namespace gear
347 } // namespace fire
348 
349 #endif
Definition: Coordinate.hpp:48
Definition: EnvelopeSh.hpp:18
Definition: Entity.hpp:44
Definition: Envelope.hpp:31
Definition: Geometry.hpp:69