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
LineString.hpp
1 // Copyright 2015 GEOSYSTEMS SRL
2 // All Rights Reserved.
3 
4 #ifndef FIRE_GEAR_GEOM_LINESTRING_HPP_INCLUDED
5 #define FIRE_GEAR_GEOM_LINESTRING_HPP_INCLUDED
6 
7 #include "fire/export.hpp"
8 
9 #include "fire/gear/geom/Geometry.hpp"
10 
11 namespace fire {
12 namespace gear {
13 namespace geom {
14 class CoordinateSequence;
15 class PrecisionModel;
16 class Coordinate;
17 } // namespace geom
18 } // namespace gear
19 } // namespace fire
20 
27 namespace fire {
34 namespace gear {
41 namespace geom {
48 class FIRE_ENGINE_DLL LineString : public Geometry {
49  friend class Polygon; // Per permettere l' accesso all' attributo private coordinates
50  friend class MultiLineString; // Per permettere l' accesso al metodo private loadJsonValueCoordinates
51 
52  protected:
59  std::auto_ptr< CoordinateSequence > coordinates;
78  void loadJsonValueGeometry(Json::Value& value) const;
90  void loadJsonValueCoordinates(Json::Value& value) const;
102  virtual void setCoordinatesFromJsonValue(Json::Value& value);
110  bool isZ_DoubleNotANumber() const;
111 
112  public:
118  LineString();
129  LineString(PrecisionModel* precisionModel, int srid);
141  LineString(CoordinateSequence* coordinateSequence, PrecisionModel* precisionModel, int srid);
152  explicit LineString(CoordinateSequence* coordinateSequence);
159  LineString(const LineString& lineString);
166  LineString& operator=(const LineString& lineString);
171  virtual ~LineString();
183  const CoordinateSequence& getCoordinates() const;
195  void setCoordinates(CoordinateSequence* coordinates);
207  bool isClosed() const;
219  bool isRing() const;
236  const Coordinate& getCoordinateAt(std::size_t index) const;
248  const Coordinate& getFirstCoordinate() const;
260  const Coordinate& getLastCoordinate() const;
272  void addCoordinate(Coordinate* coordinate);
289  void setCoordinateAt(Coordinate* coordinate, std::size_t index);
306  void insertCoordinateAt(Coordinate* coordinate, std::size_t index);
323  void removeCoordinateAt(std::size_t index);
335  double getLength() const;
347  double getArea() const;
354  void reverse();
361  bool normalize();
373  std::size_t getCoordinatesCount() const;
385  GeometryType::GeometryType getGeometryType() const;
397  bool isEmpty() const;
409  DimensionType::DimensionType getDimensionType() const;
421  Geometry* clone() const;
422 };
423 } // namespace geom
424 } // namespace gear
425 } // namespace fire
426 
427 #endif
Definition: Coordinate.hpp:48
Definition: Polygon.hpp:50
Definition: PrecisionModel.hpp:50
std::auto_ptr< CoordinateSequence > coordinates
Definition: LineString.hpp:59
Definition: MultiLineString.hpp:48
GeometryType
Definition: GeometryType.hpp:43
Definition: CoordinateSequence.hpp:49
Definition: Geometry.hpp:69
Definition: LineString.hpp:48
DimensionType
Definition: DimensionType.hpp:41
bool allowedRepeated
Definition: LineString.hpp:66