GEOS 3.8.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
28#include <geos/inline.h>
29
30#include <string>
31#include <vector>
32
33namespace geos {
34namespace geom { // geos::geom
35class Coordinate;
36class CoordinateArraySequence;
37}
38}
39
40namespace geos {
41namespace geom { // geos::geom
42
43#ifdef _MSC_VER
44#pragma warning(push)
45#pragma warning(disable:4250) // T1 inherits T2 via dominance
46#endif
47
53class GEOS_DLL MultiPoint: public GeometryCollection {
54
55public:
56
57 friend class GeometryFactory;
58
59 ~MultiPoint() override = default;
60
63
65 return d == Dimension::P;
66 }
67
69 int getBoundaryDimension() const override;
70
80 std::unique_ptr<Geometry> getBoundary() const override;
81
82 std::string getGeometryType() const override;
83
85
86 bool equalsExact(const Geometry* other, double tolerance = 0) const override;
87
88 std::unique_ptr<Geometry>
89 clone() const override
90 {
91 return std::unique_ptr<Geometry>(new MultiPoint(*this));
92 }
93
94 std::unique_ptr<Geometry>
95 reverse() const override
96 {
97 return clone();
98 }
99
100protected:
101
120 MultiPoint(std::vector<Geometry*>* newPoints, const GeometryFactory* newFactory);
121
122 MultiPoint(std::vector<std::unique_ptr<Point>> && newPoints, const GeometryFactory& newFactory);
123
124 MultiPoint(std::vector<std::unique_ptr<Geometry>> && newPoints, const GeometryFactory& newFactory);
125
126 MultiPoint(const MultiPoint& mp): GeometryCollection(mp) {}
127
128 const Coordinate* getCoordinateN(size_t n) const;
129
130 int
131 getSortIndex() const override
132 {
133 return SORTINDEX_MULTIPOINT;
134 };
135
136};
137
138#ifdef _MSC_VER
139#pragma warning(pop)
140#endif
141
142} // namespace geos::geom
143} // namespace geos
144
145#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:53
std::unique_ptr< Geometry > reverse() const override
Definition: MultiPoint.h:95
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:89
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:64
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)
GeometryTypeId
Geometry types.
Definition: Geometry.h:75
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:25