GEOS  3.8.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 
28 #include <geos/inline.h>
29 
30 #include <string>
31 #include <vector>
32 
33 namespace geos {
34 namespace geom { // geos::geom
35 class Coordinate;
36 class CoordinateArraySequence;
37 }
38 }
39 
40 namespace geos {
41 namespace 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 
53 class GEOS_DLL MultiPoint: public GeometryCollection {
54 
55 public:
56 
57  friend class GeometryFactory;
58 
59  ~MultiPoint() override;
60 
62  Dimension::DimensionType getDimension() const override;
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 
84  GeometryTypeId getGeometryTypeId() const override;
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 
100 protected:
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
std::unique_ptr< Geometry > clone() const override
Definition: MultiPoint.h:89
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:64
Supplies a set of utility methods for building Geometry objects from CoordinateSequence or other Geom...
Definition: GeometryFactory.h:66
Represents a collection of heterogeneous Geometry objects.
Definition: GeometryCollection.h:55
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:25
Definition: MultiPoint.h:53
Dimension value of a point (0).
Definition: Dimension.h:42
std::unique_ptr< Geometry > reverse() const override
Definition: MultiPoint.h:95
DimensionType
Definition: Dimension.h:31