GEOS  3.9.1dev
MultiPoint.h
Go to the documentation of this file.
1 /**********************************************************************
2  *
3  * GEOS - Geometry Engine Open Source
4  * http://geos.osgeo.org
5  *
6  * Copyright (C) 2011 Sandro Santilli <strk@kbt.io>
7  * Copyright (C) 2001-2002 Vivid Solutions Inc.
8  * Copyright (C) 2005 2006 Refractions Research Inc.
9  *
10  * This is free software; you can redistribute and/or modify it under
11  * the terms of the GNU Lesser General Public Licence as published
12  * by the Free Software Foundation.
13  * See the COPYING file for more information.
14  *
15  **********************************************************************
16  *
17  * Last port: geom/MultiPoint.java r320 (JTS-1.12)
18  *
19  **********************************************************************/
20 
21 #ifndef GEOS_GEOS_MULTIPOINT_H
22 #define GEOS_GEOS_MULTIPOINT_H
23 
24 #include <geos/export.h>
25 #include <geos/geom/GeometryCollection.h> // for inheritance
26 #include <geos/geom/Dimension.h> // for Dimension::DimensionType
27 #include <geos/geom/Point.h> // for covariant return type
28 
29 #include <geos/inline.h>
30 
31 #include <string>
32 #include <vector>
33 
34 namespace geos {
35 namespace geom { // geos::geom
36 class Coordinate;
37 class CoordinateArraySequence;
38 }
39 }
40 
41 namespace geos {
42 namespace geom { // geos::geom
43 
44 #ifdef _MSC_VER
45 #pragma warning(push)
46 #pragma warning(disable:4250) // T1 inherits T2 via dominance
47 #endif
48 
55 
56 public:
57 
58  friend class GeometryFactory;
59 
60  ~MultiPoint() override = default;
61 
63  Dimension::DimensionType getDimension() const override;
64 
66  return d == Dimension::P;
67  }
68 
70  int getBoundaryDimension() const override;
71 
81  std::unique_ptr<Geometry> getBoundary() const override;
82 
83  const Point* getGeometryN(std::size_t n) const override;
84 
85  std::string getGeometryType() const override;
86 
87  GeometryTypeId getGeometryTypeId() const override;
88 
89  bool equalsExact(const Geometry* other, double tolerance = 0) const override;
90 
91  std::unique_ptr<Geometry>
92  clone() const override
93  {
94  return std::unique_ptr<Geometry>(new MultiPoint(*this));
95  }
96 
97  std::unique_ptr<Geometry>
98  reverse() const override
99  {
100  return clone();
101  }
102 
103 protected:
104 
123  MultiPoint(std::vector<Geometry*>* newPoints, const GeometryFactory* newFactory);
124 
125  MultiPoint(std::vector<std::unique_ptr<Point>> && newPoints, const GeometryFactory& newFactory);
126 
127  MultiPoint(std::vector<std::unique_ptr<Geometry>> && newPoints, const GeometryFactory& newFactory);
128 
130 
131  const Coordinate* getCoordinateN(size_t n) const;
132 
133  int
134  getSortIndex() const override
135  {
136  return SORTINDEX_MULTIPOINT;
137  };
138 
139 };
140 
141 #ifdef _MSC_VER
142 #pragma warning(pop)
143 #endif
144 
145 } // namespace geos::geom
146 } // namespace geos
147 
148 #endif // ndef GEOS_GEOS_MULTIPOINT_H
int getSortIndex() const override
Definition: MultiPoint.h:134
#define GEOS_DLL
Definition: export.h:28
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:60
std::unique_ptr< Geometry > clone() const override
Definition: MultiPoint.h:92
GeometryTypeId
Geometry types.
Definition: Geometry.h:75
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition: Geometry.h:188
bool isDimensionStrict(Dimension::DimensionType d) const override
Checks whether this Geometry consists only of components having dimension d.
Definition: MultiPoint.h:65
MultiPoint(const MultiPoint &mp)
Definition: MultiPoint.h:129
Supplies a set of utility methods for building Geometry objects from CoordinateSequence or other Geom...
Represents a collection of heterogeneous Geometry objects.
Basic namespace for all GEOS functionalities.
Dimension value of a point (0).
Definition: Dimension.h:42
std::unique_ptr< Geometry > reverse() const override
Definition: MultiPoint.h:98