MultiLineString.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/MultiLineString.java r320 (JTS-1.12)
*
**********************************************************************/
#pragma once
#include <geos/export.h>
#include <geos/geom/GeometryCollection.h> // for inheritance
#include <geos/geom/Dimension.h>
#include <geos/geom/LineString.h>
#include <geos/geom/MultiPoint.h>
#include <string>
#include <vector>
// Forward declarations
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 MultiLineString: public GeometryCollection {
public:
friend class GeometryFactory;
~MultiLineString() override = default;
Dimension::DimensionType getDimension() const override;
bool hasDimension(Dimension::DimensionType d) const override {
return d == Dimension::L;
}
bool isDimensionStrict(Dimension::DimensionType d) const override {
return d == Dimension::L;
}
int getBoundaryDimension() const override;
std::unique_ptr<Geometry> getBoundary() const override;
const LineString* getGeometryN(std::size_t n) const override;
std::string getGeometryType() const override;
GeometryTypeId getGeometryTypeId() const override;
bool isClosed() const;
std::unique_ptr<MultiLineString> clone() const
{
return std::unique_ptr<MultiLineString>(cloneImpl());
};
std::unique_ptr<MultiLineString> reverse() const { return std::unique_ptr<MultiLineString>(reverseImpl()); }
protected:
MultiLineString(std::vector<std::unique_ptr<LineString>> && newLines,
const GeometryFactory& newFactory);
MultiLineString(std::vector<std::unique_ptr<Geometry>> && newLines,
const GeometryFactory& newFactory);
MultiLineString(const MultiLineString& mp)
: GeometryCollection(mp)
{};
MultiLineString* cloneImpl() const override { return new MultiLineString(*this); }
MultiLineString* reverseImpl() const override;
int
getSortIndex() const override
{
return SORTINDEX_MULTILINESTRING;
};
bool hasCurvedComponents() const override
{
return false;
}
};
} // namespace geos::geom
} // namespace geos
#ifdef _MSC_VER
#pragma warning(pop)
#endif
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::L
@ L
Dimension value of a curve (1).
Definition Dimension.h:43
geos::geom::LineString
Definition LineString.h:66
geos::geom::MultiLineString::MultiLineString
MultiLineString(std::vector< std::unique_ptr< LineString > > &&newLines, const GeometryFactory &newFactory)
Constructs a MultiLineString.
geos::geom::MultiLineString::hasDimension
bool hasDimension(Dimension::DimensionType d) const override
Checks whether any component of this geometry has dimension d.
Definition MultiLineString.h:60
geos::geom::MultiLineString::isDimensionStrict
bool isDimensionStrict(Dimension::DimensionType d) const override
Checks whether this Geometry consists only of components having dimension d.
Definition MultiLineString.h:64
geos::geom::MultiLineString::getDimension
Dimension::DimensionType getDimension() const override
Returns line dimension (1).
geos::geom::MultiLineString::reverseImpl
MultiLineString * reverseImpl() const override
Make a geometry with coordinates in reverse order.
geos::geom::MultiLineString::getGeometryN
const LineString * getGeometryN(std::size_t n) const override
Returns a pointer to the nth Geometry in this collection.
geos::geom::MultiLineString::cloneImpl
MultiLineString * cloneImpl() const override
Make a deep-copy of this Geometry.
Definition MultiLineString.h:131
geos::geom::MultiLineString::hasCurvedComponents
bool hasCurvedComponents() const override
Returns whether the Geometry contains curved components.
Definition MultiLineString.h:141
geos::geom::MultiLineString::getGeometryTypeId
GeometryTypeId getGeometryTypeId() const override
Return an integer representation of this Geometry type.
geos::geom::MultiLineString::getGeometryType
std::string getGeometryType() const override
Return a string representation of this Geometry type.
geos::geom::MultiLineString::reverse
std::unique_ptr< MultiLineString > reverse() const
Definition MultiLineString.h:100
geos::geom::MultiLineString::getBoundaryDimension
int getBoundaryDimension() const override
Returns Dimension::False if all LineStrings in the collection are closed, 0 otherwise.
geos::geom::MultiLineString::getBoundary
std::unique_ptr< Geometry > getBoundary() const override
Returns a (possibly empty) MultiPoint.
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