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
GeometryCollection.hpp
1 // Copyright 2015 GEOSYSTEMS SRL
2 // All Rights Reserved.
3 
4 #ifndef FIRE_GEAR_GEOM_GEOMETRYCOLLECTION_HPP_INCLUDED
5 #define FIRE_GEAR_GEOM_GEOMETRYCOLLECTION_HPP_INCLUDED
6 
7 #include <vector>
8 #include <string>
9 
10 #include "fire/export.hpp"
11 
12 #include "fire/gear/geom/Geometry.hpp"
13 
14 namespace fire {
15 namespace gear {
16 namespace geom {
17 class LineString;
18 class Polygon;
19 } // namespace geom
20 } // namespace gear
21 } // namespace fire
22 
29 namespace fire {
36 namespace gear {
43 namespace geom {
51 class FIRE_ENGINE_DLL GeometryCollection : public Geometry {
52  private:
64  void addClone(std::vector< Geometry* >* geometries);
76  void addClonePoint(std::vector< Point* >* points);
88  void addCloneLineString(std::vector< LineString* >* lineStrings);
100  void addClonePolygon(std::vector< Polygon* >* polygons);
112  void deleteGeometry(Geometry* geometry);
124  virtual void loadJsonValueGeometry(Json::Value& value) const;
125 
126  virtual void setCoordinatesFromJsonValue(Json::Value& value){};
127 
128  protected:
135  std::auto_ptr< std::vector< Geometry* > > _geometries;
154  void setGeometryTypeId(GeometryType::GeometryType geometryType);
166  explicit GeometryCollection(std::vector< Point* >* points);
178  GeometryCollection(std::vector< Point* >* points, PrecisionModel* precisionModel, int srid);
190  explicit GeometryCollection(std::vector< LineString* >* lineStrings);
202  GeometryCollection(std::vector< LineString* >* lineStrings, PrecisionModel* precisionModel, int srid);
214  explicit GeometryCollection(std::vector< Polygon* >* polygons);
226  GeometryCollection(std::vector< Polygon* >* polygons, PrecisionModel* precisionModel, int srid);
227 
228  public:
244  explicit GeometryCollection(std::vector< Geometry* >* geometries);
255  GeometryCollection(PrecisionModel* precisionModel, int srid);
269  GeometryCollection(std::vector< Geometry* >* geometries, PrecisionModel* precisionModel, int srid);
276  GeometryCollection(const GeometryCollection& geometryCollection);
283  GeometryCollection& operator=(const GeometryCollection& geometryCollection);
288  virtual ~GeometryCollection();
300  GeometryType::GeometryType getGeometryType() const;
312  bool isEmpty() const;
324  DimensionType::DimensionType getDimensionType() const;
336  double getLength() const;
348  double getArea() const;
360  std::size_t getGeometriesCount() const;
377  Geometry& getGeometryAt(std::size_t index);
378  const Geometry& getGeometryAt(std::size_t index) const;
390  std::vector< Geometry* >::const_iterator begin() const;
402  std::vector< Geometry* >::const_iterator end() const;
409  bool normalize();
421  GeometryCollection* clone() const;
433  std::string toString() const;
460  std::string toWkt(bool oldStyle = false, int dimension = 3, int decimalPrecision = -1) const;
482  std::string toJson(bool onlyGeom = true, bool pretty = false) const;
509  void toWkb(std::ostream& outputStream, const int dimension = 3, const int newByteOrder = getMachineByteOrder(), const bool includeSRID = false) const;
521  std::size_t getCoordinatesCount() const;
533  void addGeometry(Geometry* geometry);
550  void setGeometryAt(Geometry* geometry, std::size_t index);
567  void removeGeometryAt(std::size_t index);
584  void insertGeometryAt(Geometry* geometry, std::size_t index);
590  void clearGeometries();
598  virtual bool isUpdated() const;
606  bool isZ_DoubleNotANumber() const;
607 };
608 } // namespace geom
609 } // namespace gear
610 } // namespace fire
611 
612 #endif
Definition: PrecisionModel.hpp:50
Definition: GeometryCollection.hpp:51
GeometryType
Definition: GeometryType.hpp:43
GeometryType::GeometryType _idGeometryType
Definition: GeometryCollection.hpp:142
Definition: Geometry.hpp:69
DimensionType
Definition: DimensionType.hpp:41