SFCGAL
|
OGC/SFA based Geometry abstract class. More...
#include <Geometry.h>
Public Member Functions | |
Geometry () | |
Default constructor. More... | |
Geometry (const Geometry &)=default | |
Copy constructor. More... | |
Geometry & | operator= (const Geometry &other)=default |
Copy assignemnt operator. More... | |
virtual | ~Geometry ()=default |
Destructor. More... | |
virtual Geometry * | clone () const =0 |
Get a deep copy of the geometry. More... | |
virtual std::string | geometryType () const =0 |
[OGC/SFA]returns the geometry type More... | |
virtual GeometryType | geometryTypeId () const =0 |
Returns a code corresponding to the type. More... | |
virtual int | dimension () const =0 |
[OGC/SFA]Dimension of the Geometry ( 0 : punctual, 1 : curve, ...) More... | |
virtual int | coordinateDimension () const =0 |
[OGC/SFA]returns the dimension of the coordinates More... | |
virtual bool | isEmpty () const =0 |
[OGC/SFA]test if geometry is empty More... | |
virtual bool | is3D () const =0 |
[OGC/SFA]test if geometry is 3d More... | |
virtual bool | isMeasured () const =0 |
[OGC/SFA]test if geometry is measured (has an m) More... | |
void | forceValidityFlag (bool validity) |
Force the state of the validity flag. More... | |
bool | hasValidityFlag () const |
Returns the validity flag. More... | |
std::string | asText (const int &numDecimals=-1) const |
[OGC/SFA]returns the WKT string More... | |
Envelope | envelope () const |
[OGC/SFA]Returns a polygon representing the BBOX of the geometry More... | |
virtual std::unique_ptr< Geometry > | boundary () const |
[OGC/SFA]Returns the boundary of the geometry More... | |
double | distance (const Geometry &other) const |
Computes the distance to an other geometry. More... | |
double | distance3D (const Geometry &other) const |
Computes the 3D distance to an other geometry. More... | |
void | round (const long &scale=1) |
round the geometry with a corresponding scale factor More... | |
auto | almostEqual (const Geometry &, const double tolerance) const -> bool |
Equality operator. More... | |
virtual size_t | numGeometries () const |
[OGC/SFA]Gets the number of geometries in a collection of geometries More... | |
virtual const Geometry & | geometryN (size_t const &n) const |
[OGC/SFA]Returns the n-th geometry More... | |
virtual Geometry & | geometryN (size_t const &n) |
[OGC/SFA]Returns the n-th geometry More... | |
template<typename Derived > | |
bool | is () const |
Tests if geometry is of "Derived" type given as template parameter. More... | |
template<typename Derived > | |
const Derived & | as () const |
Downcast to a "Derived" class. More... | |
template<typename Derived > | |
Derived & | as () |
Downcast to a "Derived" class. More... | |
virtual void | accept (GeometryVisitor &visitor)=0 |
[visitor]dispatch visitor More... | |
virtual void | accept (ConstGeometryVisitor &visitor) const =0 |
[visitor]dispatch visitor More... | |
template<class Archive > | |
void | serialize (Archive &, const unsigned int) |
Serializer. More... | |
Protected Attributes | |
bool | validityFlag_ |
OGC/SFA based Geometry abstract class.
SFCGAL::Geometry::Geometry | ( | ) |
Default constructor.
|
default |
Copy constructor.
|
virtualdefault |
Destructor.
auto SFCGAL::Geometry::almostEqual | ( | const Geometry & | other, |
const double | tolerance | ||
) | const -> bool |
|
inline |
Downcast to a "Derived" class.
|
inline |
Downcast to a "Derived" class.
auto SFCGAL::Geometry::asText | ( | const int & | numDecimals = -1 | ) | const |
[OGC/SFA]returns the WKT string
numDecimals | extension specify fix precision output |
|
virtual |
[OGC/SFA]Returns the boundary of the geometry
|
pure virtual |
Get a deep copy of the geometry.
Implemented in SFCGAL::GeometryCollection, SFCGAL::LineString, SFCGAL::MultiLineString, SFCGAL::MultiPoint, SFCGAL::MultiPolygon, SFCGAL::MultiSolid, SFCGAL::Point, SFCGAL::Polygon, SFCGAL::PolyhedralSurface, SFCGAL::Solid, SFCGAL::Triangle, and SFCGAL::TriangulatedSurface.
|
pure virtual |
[OGC/SFA]returns the dimension of the coordinates
Implemented in SFCGAL::GeometryCollection, SFCGAL::LineString, SFCGAL::Point, SFCGAL::Polygon, SFCGAL::PolyhedralSurface, SFCGAL::Solid, SFCGAL::Triangle, and SFCGAL::TriangulatedSurface.
|
pure virtual |
[OGC/SFA]Dimension of the Geometry ( 0 : punctual, 1 : curve, ...)
Implemented in SFCGAL::GeometryCollection, SFCGAL::LineString, SFCGAL::Point, SFCGAL::PolyhedralSurface, SFCGAL::Solid, SFCGAL::Surface, and SFCGAL::TriangulatedSurface.
auto SFCGAL::Geometry::distance | ( | const Geometry & | other | ) | const |
Computes the distance to an other geometry.
auto SFCGAL::Geometry::distance3D | ( | const Geometry & | other | ) | const |
Computes the 3D distance to an other geometry.
auto SFCGAL::Geometry::envelope | ( | ) | const |
[OGC/SFA]Returns a polygon representing the BBOX of the geometry
void SFCGAL::Geometry::forceValidityFlag | ( | bool | validity | ) |
Force the state of the validity flag.
The validity flag allows to bypass validity checks If the flag is true, it means the geometry is considered valid If the flag is false, it means the validity state of the geometry is unknown The flag is only changed for this geometry and not the internal geometries.
|
virtual |
[OGC/SFA]Returns the n-th geometry
Reimplemented in SFCGAL::GeometryCollection, SFCGAL::PolyhedralSurface, and SFCGAL::TriangulatedSurface.
|
virtual |
[OGC/SFA]Returns the n-th geometry
Reimplemented in SFCGAL::GeometryCollection, SFCGAL::PolyhedralSurface, and SFCGAL::TriangulatedSurface.
|
pure virtual |
[OGC/SFA]returns the geometry type
Implemented in SFCGAL::GeometryCollection, SFCGAL::LineString, SFCGAL::MultiLineString, SFCGAL::MultiPoint, SFCGAL::MultiPolygon, SFCGAL::MultiSolid, SFCGAL::Point, SFCGAL::Polygon, SFCGAL::PolyhedralSurface, SFCGAL::Solid, SFCGAL::Triangle, and SFCGAL::TriangulatedSurface.
|
pure virtual |
Returns a code corresponding to the type.
Implemented in SFCGAL::GeometryCollection, SFCGAL::LineString, SFCGAL::MultiLineString, SFCGAL::MultiPoint, SFCGAL::MultiPolygon, SFCGAL::MultiSolid, SFCGAL::Point, SFCGAL::Polygon, SFCGAL::PolyhedralSurface, SFCGAL::Solid, SFCGAL::Triangle, and SFCGAL::TriangulatedSurface.
auto SFCGAL::Geometry::hasValidityFlag | ( | ) | const |
Returns the validity flag.
|
inline |
Tests if geometry is of "Derived" type given as template parameter.
|
pure virtual |
[OGC/SFA]test if geometry is 3d
Implemented in SFCGAL::GeometryCollection, SFCGAL::LineString, SFCGAL::Point, SFCGAL::Polygon, SFCGAL::PolyhedralSurface, SFCGAL::Solid, SFCGAL::Triangle, and SFCGAL::TriangulatedSurface.
|
pure virtual |
[OGC/SFA]test if geometry is empty
Implemented in SFCGAL::GeometryCollection, SFCGAL::LineString, SFCGAL::Point, SFCGAL::Polygon, SFCGAL::PolyhedralSurface, SFCGAL::Solid, SFCGAL::Triangle, and SFCGAL::TriangulatedSurface.
|
pure virtual |
[OGC/SFA]test if geometry is measured (has an m)
Implemented in SFCGAL::GeometryCollection, SFCGAL::LineString, SFCGAL::Point, SFCGAL::Polygon, SFCGAL::PolyhedralSurface, SFCGAL::Solid, SFCGAL::Triangle, and SFCGAL::TriangulatedSurface.
|
virtual |
[OGC/SFA]Gets the number of geometries in a collection of geometries
Reimplemented in SFCGAL::GeometryCollection, SFCGAL::PolyhedralSurface, and SFCGAL::TriangulatedSurface.
void SFCGAL::Geometry::round | ( | const long & | scale = 1 | ) |
round the geometry with a corresponding scale factor
scale | the scale factor (1 corresponds to the nearest integer, 1000 to a 0.001 tolerance) |
|
protected |