GEOS  3.9.0dev
MultiPoint.h
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
54 class GEOS_DLL MultiPoint: public GeometryCollection {
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
129  MultiPoint(const MultiPoint& mp): GeometryCollection(mp) {}
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
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
Supplies a set of utility methods for building Geometry objects from CoordinateSequence or other Geom...
Definition: GeometryFactory.h:68
Represents a collection of heterogeneous Geometry objects.
Definition: GeometryCollection.h:55
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:26
Definition: MultiPoint.h:54
Dimension value of a point (0).
Definition: Dimension.h:42
Definition: Point.h:66
std::unique_ptr< Geometry > reverse() const override
Definition: MultiPoint.h:98
DimensionType
Definition: Dimension.h:31