SFCGAL
SFCGAL::Surface Class Reference

Abstract Surface class. More...

#include <Surface.h>

Inheritance diagram for SFCGAL::Surface:
SFCGAL::Geometry SFCGAL::Polygon SFCGAL::PolyhedralSurface SFCGAL::Triangle SFCGAL::TriangulatedSurface

Public Member Functions

virtual ~Surface ()
 destructor
 
virtual int dimension () const
 [OGC/SFA]Dimension of the Geometry ( 0 : punctual, 1 : curve, ...)
 
- Public Member Functions inherited from SFCGAL::Geometry
 Geometry ()
 Default constructor.
 
 Geometry (const Geometry &)=default
 Copy constructor.
 
Geometryoperator= (const Geometry &other)=default
 Copy assignemnt operator.
 
virtual ~Geometry ()=default
 Destructor.
 
virtual Geometryclone () const =0
 Get a deep copy of the geometry.
 
virtual std::string geometryType () const =0
 [OGC/SFA]returns the geometry type
 
virtual GeometryType geometryTypeId () const =0
 Returns a code corresponding to the type.
 
virtual int coordinateDimension () const =0
 [OGC/SFA]returns the dimension of the coordinates
 
virtual bool isEmpty () const =0
 [OGC/SFA]test if geometry is empty
 
virtual bool is3D () const =0
 [OGC/SFA]test if geometry is 3d
 
virtual bool isMeasured () const =0
 [OGC/SFA]test if geometry is measured (has an m)
 
void forceValidityFlag (bool validity)
 Force the state of the validity flag.
 
bool hasValidityFlag () const
 Returns the validity flag.
 
std::string asText (const int &numDecimals=-1) const
 [OGC/SFA]returns the WKT string
 
std::string asWkb (boost::endian::order wkbOrder=boost::endian::order::native, bool asHex=false) const
 [OGC/SFA]returns the WKB string
 
Envelope envelope () const
 [OGC/SFA]Returns a polygon representing the BBOX of the geometry
 
virtual std::unique_ptr< Geometryboundary () const
 [OGC/SFA]Returns the boundary of the geometry
 
double distance (const Geometry &other) const
 Computes the distance to an other geometry.
 
double distance3D (const Geometry &other) const
 Computes the 3D distance to an other geometry.
 
void round (const long &scale=1)
 round the geometry with a corresponding scale factor
 
auto almostEqual (const Geometry &, const double tolerance) const -> bool
 Equality operator.
 
virtual size_t numGeometries () const
 [OGC/SFA]Gets the number of geometries in a collection of geometries
 
virtual const GeometrygeometryN (size_t const &n) const
 [OGC/SFA]Returns the n-th geometry
 
virtual GeometrygeometryN (size_t const &n)
 [OGC/SFA]Returns the n-th geometry
 
template<typename Derived >
bool is () const
 Tests if geometry is of "Derived" type given as template parameter.
 
template<typename Derived >
const Derived & as () const
 Downcast to a "Derived" class.
 
template<typename Derived >
Derived & as ()
 Downcast to a "Derived" class.
 
virtual void accept (GeometryVisitor &visitor)=0
 [visitor]dispatch visitor
 
virtual void accept (ConstGeometryVisitor &visitor) const =0
 [visitor]dispatch visitor
 
template<class Archive >
void serialize (Archive &, const unsigned int)
 Serializer.
 

Protected Member Functions

 Surface ()
 [OGC/SFS]"The area of this Surface, as measured in the spatial reference system of this Surface"
 
 Surface (Surface const &other)
 no copy constructor
 

Additional Inherited Members

- Protected Attributes inherited from SFCGAL::Geometry
bool validityFlag_
 

Detailed Description

Abstract Surface class.

Constructor & Destructor Documentation

◆ ~Surface()

SFCGAL::Surface::~Surface ( )
virtualdefault

destructor

◆ Surface() [1/2]

SFCGAL::Surface::Surface ( )
protecteddefault

[OGC/SFS]"The area of this Surface, as measured in the spatial reference system of this Surface"

[OGC/SFS]"The mathematical centroid for this Surface as a Point. The result in not guaranteed to be on this Surface" [OGC/SFS]"A Point guaranteed to be on this Surface"

Warning
empty point is isEmpty() no default constructor

◆ Surface() [2/2]

SFCGAL::Surface::Surface ( Surface const & other)
protecteddefault

no copy constructor

Member Function Documentation

◆ dimension()

auto SFCGAL::Surface::dimension ( ) const
virtual

[OGC/SFA]Dimension of the Geometry ( 0 : punctual, 1 : curve, ...)

Warning
empty geometries provide the dimension corresponding to the object

Implements SFCGAL::Geometry.

Reimplemented in SFCGAL::PolyhedralSurface, and SFCGAL::TriangulatedSurface.