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
Polygon.hpp
1 // Copyright 2015 GEOSYSTEMS SRL
2 // All Rights Reserved.
3 
4 #ifndef FIRE_GEAR_GEOM_POLYGON_HPP_INCLUDED
5 #define FIRE_GEAR_GEOM_POLYGON_HPP_INCLUDED
6 
7 #include <vector>
8 
9 #include "fire/export.hpp"
10 
11 #include "fire/gear/geom/Geometry.hpp"
12 
13 namespace fire {
14 namespace gear {
15 namespace geom {
16 class PrecisionModel;
17 class LinearRing;
18 class CoordinateSequence;
19 } // namespace geom
20 } // namespace gear
21 } // namespace fire
22 
29 namespace fire {
36 namespace gear {
43 namespace geom {
50 class FIRE_ENGINE_DLL Polygon : public Geometry {
51  friend class MultiPolygon; // Per permettere l' accesso al metodo private loadJsonValueCoordinates
52 
53  private:
60  std::auto_ptr< LinearRing > exteriorRing;
67  std::auto_ptr< std::vector< LinearRing* > > interiorRings;
79  void loadJsonValueGeometry(Json::Value& value) const;
91  void loadJsonValueCoordinates(Json::Value& value) const;
103  virtual void setCoordinatesFromJsonValue(Json::Value& value);
111  bool isZ_DoubleNotANumber() const;
112 
113  public:
118  Polygon();
129  Polygon(PrecisionModel* precisionModel, int srid);
143  Polygon(CoordinateSequence* coordinateSequence, std::vector< CoordinateSequence* >* interiorRings, PrecisionModel* precisionModel, int srid);
155  Polygon(const CoordinateSequence& coordinateSequence, const PrecisionModel& precisionModel, int srid);
170  Polygon(LinearRing* exteriorRing, std::vector< LinearRing* >* interiorRings, PrecisionModel* precisionModel, int srid);
184  Polygon(const LinearRing& exteriorRing, const PrecisionModel& precisionModel, int srid);
191  Polygon(const Polygon& polygon);
198  Polygon& operator=(const Polygon& polygon);
203  virtual ~Polygon();
210  LinearRing& getExteriorRing();
211  const LinearRing& getExteriorRing() const;
223  void setExteriorRing(LinearRing* linearRing);
235  void setExteriorRing(CoordinateSequence* coordinateSequence);
247  std::size_t getInteriorRingsCount() const;
256  const LinearRing& getInteriorRingAt(std::size_t index) const;
268  void addInteriorRing(LinearRing* linearRing);
280  void addInteriorRing(CoordinateSequence* coordinateSequence);
297  void setInteriorRingAt(LinearRing* linearRing, std::size_t index);
314  void setInteriorRingAt(CoordinateSequence* coordinateSequence, std::size_t index);
331  void insertInteriorRingAt(LinearRing* lineraRing, std::size_t index);
348  void insertInteriorRingAt(CoordinateSequence* coordinateSequence, std::size_t index);
360  void removeInteriorRingAt(std::size_t index);
366  void clearInteriorRings();
378  double getLength() const;
390  double getArea() const;
402  std::size_t getCoordinatesCount() const;
414  bool normalize();
426  GeometryType::GeometryType getGeometryType() const;
438  bool isEmpty() const;
450  DimensionType::DimensionType getDimensionType() const;
462  Geometry* clone() const;
471  virtual bool isUpdated() const;
472 };
473 } // namespace geom
474 } // namespace gear
475 } // namespace fire
476 
477 #endif
Definition: Polygon.hpp:50
Definition: PrecisionModel.hpp:50
Definition: LinearRing.hpp:47
GeometryType
Definition: GeometryType.hpp:43
Definition: CoordinateSequence.hpp:49
Definition: Geometry.hpp:69
Definition: MultiPolygon.hpp:48
DimensionType
Definition: DimensionType.hpp:41