GEOS 3.9.1
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
34namespace geos {
35namespace geom { // geos::geom
36class Coordinate;
37class CoordinateArraySequence;
38}
39}
40
41namespace geos {
42namespace 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
54class GEOS_DLL MultiPoint: public GeometryCollection {
55
56public:
57
58 friend class GeometryFactory;
59
60 ~MultiPoint() override = default;
61
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
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
103protected:
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
Coordinate is the lightweight class used to store coordinates.
Definition Coordinate.h:60
DimensionType
Definition Dimension.h:31
Represents a collection of heterogeneous Geometry objects.
Definition GeometryCollection.h:55
Supplies a set of utility methods for building Geometry objects from CoordinateSequence or other Geom...
Definition GeometryFactory.h:68
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition Geometry.h:188
Definition MultiPoint.h:54
std::unique_ptr< Geometry > reverse() const override
Definition MultiPoint.h:98
bool equalsExact(const Geometry *other, double tolerance=0) const override
Returns true iff the two Geometrys are of the same type and their vertices corresponding by index are...
std::unique_ptr< Geometry > clone() const override
Definition MultiPoint.h:92
MultiPoint(std::vector< Geometry * > *newPoints, const GeometryFactory *newFactory)
Constructs a MultiPoint.
std::unique_ptr< Geometry > getBoundary() const override
Gets the boundary of this geometry.
GeometryTypeId getGeometryTypeId() const override
Return an integer representation of this Geometry type.
bool isDimensionStrict(Dimension::DimensionType d) const override
Checks whether this Geometry consists only of components having dimension d.
Definition MultiPoint.h:65
std::string getGeometryType() const override
Return a string representation of this Geometry type.
Dimension::DimensionType getDimension() const override
Returns point dimension (0)
int getBoundaryDimension() const override
Returns Dimension::False (Point has no boundary)
const Point * getGeometryN(std::size_t n) const override
Returns a pointer to the nth Geometry in this collection.
Definition Point.h:66
GeometryTypeId
Geometry types.
Definition Geometry.h:75
Basic namespace for all GEOS functionalities.
Definition IndexedNestedRingTester.h:26