MultiPoint.h
/**********************************************************************
*
* GEOS - Geometry Engine Open Source
* http://geos.osgeo.org
*
* Copyright (C) 2011 Sandro Santilli <strk@kbt.io>
* Copyright (C) 2001-2002 Vivid Solutions Inc.
* Copyright (C) 2005 2006 Refractions Research Inc.
*
* This is free software; you can redistribute and/or modify it under
* the terms of the GNU Lesser General Public Licence as published
* by the Free Software Foundation.
* See the COPYING file for more information.
*
**********************************************************************
*
* Last port: geom/MultiPoint.java r320 (JTS-1.12)
*
**********************************************************************/
#pragma once
#include <geos/export.h>
#include <geos/geom/GeometryCollection.h> // for inheritance
#include <geos/geom/Dimension.h> // for Dimension::DimensionType
#include <geos/geom/Point.h> // for covariant return type
#include <string>
#include <vector>
namespace geos {
namespace geom { // geos::geom
class Coordinate;
}
}
namespace geos {
namespace geom { // geos::geom
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable:4250) // T1 inherits T2 via dominance
#endif
class GEOS_DLL MultiPoint: public GeometryCollection {
public:
friend class GeometryFactory;
~MultiPoint() override = default;
Dimension::DimensionType getDimension() const override;
bool isDimensionStrict(Dimension::DimensionType d) const override {
return d == Dimension::P;
}
bool hasDimension(Dimension::DimensionType d) const override {
return d == Dimension::P;
}
int getBoundaryDimension() const override;
std::unique_ptr<Geometry> getBoundary() const override;
const Point* getGeometryN(std::size_t n) const override;
std::string getGeometryType() const override;
GeometryTypeId getGeometryTypeId() const override;
std::unique_ptr<MultiPoint> clone() const
{
return std::unique_ptr<MultiPoint>(cloneImpl());
}
std::unique_ptr<MultiPoint> reverse() const
{
return std::unique_ptr<MultiPoint>(reverseImpl());
}
protected:
MultiPoint(std::vector<std::unique_ptr<Point>> && newPoints, const GeometryFactory& newFactory);
MultiPoint(std::vector<std::unique_ptr<Geometry>> && newPoints, const GeometryFactory& newFactory);
MultiPoint(const MultiPoint& mp): GeometryCollection(mp) {}
MultiPoint* cloneImpl() const override { return new MultiPoint(*this); }
MultiPoint* reverseImpl() const override { return new MultiPoint(*this); }
const CoordinateXY* getCoordinateN(std::size_t n) const;
int
getSortIndex() const override
{
return SORTINDEX_MULTIPOINT;
};
bool hasCurvedComponents() const override
{
return false;
}
};
#ifdef _MSC_VER
#pragma warning(pop)
#endif
} // namespace geos::geom
} // namespace geos
geos::geom::Coordinate
Coordinate is the lightweight class used to store coordinates.
Definition Coordinate.h:217
geos::geom::Dimension::DimensionType
DimensionType
Definition Dimension.h:29
geos::geom::Dimension::P
@ P
Dimension value of a point (0).
Definition Dimension.h:40
geos::geom::MultiPoint::cloneImpl
MultiPoint * cloneImpl() const override
Make a deep-copy of this Geometry.
Definition MultiPoint.h:125
geos::geom::MultiPoint::hasCurvedComponents
bool hasCurvedComponents() const override
Returns whether the Geometry contains curved components.
Definition MultiPoint.h:137
geos::geom::MultiPoint::getBoundary
std::unique_ptr< Geometry > getBoundary() const override
Gets the boundary of this geometry.
geos::geom::MultiPoint::getGeometryTypeId
GeometryTypeId getGeometryTypeId() const override
Return an integer representation of this Geometry type.
geos::geom::MultiPoint::isDimensionStrict
bool isDimensionStrict(Dimension::DimensionType d) const override
Checks whether this Geometry consists only of components having dimension d.
Definition MultiPoint.h:61
geos::geom::MultiPoint::getGeometryType
std::string getGeometryType() const override
Return a string representation of this Geometry type.
geos::geom::MultiPoint::hasDimension
bool hasDimension(Dimension::DimensionType d) const override
Checks whether any component of this geometry has dimension d.
Definition MultiPoint.h:65
geos::geom::MultiPoint::getDimension
Dimension::DimensionType getDimension() const override
Returns point dimension (0).
geos::geom::MultiPoint::getBoundaryDimension
int getBoundaryDimension() const override
Returns Dimension::False (Point has no boundary).
geos::geom::MultiPoint::MultiPoint
MultiPoint(std::vector< std::unique_ptr< Point > > &&newPoints, const GeometryFactory &newFactory)
Constructs a MultiPoint.
geos::geom::MultiPoint::reverseImpl
MultiPoint * reverseImpl() const override
Make a geometry with coordinates in reverse order.
Definition MultiPoint.h:127
geos::geom::MultiPoint::getGeometryN
const Point * getGeometryN(std::size_t n) const override
Returns a pointer to the nth Geometry in this collection.
geos::geom::Point
Definition Point.h:61
geos::geom
Definition Angle.h:26
geos::geom::GeometryTypeId
GeometryTypeId
Geometry types.
Definition Geometry.h:73
geos
Basic namespace for all GEOS functionalities.
Definition geos.h:38