SFCGAL  1.4.1
Public Types | Public Member Functions | Protected Member Functions | List of all members
SFCGAL::GeometryCollection Class Reference

A GeometryCollection in SFA. More...

#include <GeometryCollection.h>

Inheritance diagram for SFCGAL::GeometryCollection:
SFCGAL::Geometry SFCGAL::MultiLineString SFCGAL::MultiPoint SFCGAL::MultiPolygon SFCGAL::MultiSolid

Public Types

typedef boost::ptr_vector< Geometry >::iterator iterator
 
typedef boost::ptr_vector< Geometry >::const_iterator const_iterator
 
typedef boost::ptr_vector< Geometry >::iterator iterator
 
typedef boost::ptr_vector< Geometry >::const_iterator const_iterator
 

Public Member Functions

 GeometryCollection ()
 Empty GeometryCollection constructor. More...
 
 GeometryCollection (const GeometryCollection &other)
 Copy constructor. More...
 
GeometryCollectionoperator= (GeometryCollection other)
 assign operator More...
 
virtual ~GeometryCollection ()
 destructor More...
 
virtual GeometryCollectionclone () const
 Get a deep copy of the geometry. More...
 
virtual std::string geometryType () const
 [OGC/SFA]returns the geometry type More...
 
virtual GeometryType geometryTypeId () const
 Returns a code corresponding to the type. More...
 
virtual int dimension () const
 [OGC/SFA]Dimension of the Geometry ( 0 : punctual, 1 : curve, ...) More...
 
virtual int coordinateDimension () const
 [OGC/SFA]returns the dimension of the coordinates More...
 
virtual bool isEmpty () const
 [OGC/SFA]test if geometry is empty More...
 
virtual bool is3D () const
 [OGC/SFA]test if geometry is 3d More...
 
virtual bool isMeasured () const
 [OGC/SFA]test if geometry is measured (has an m) More...
 
virtual size_t numGeometries () const
 [OGC/SFA]Gets the number of geometries in a collection of geometries More...
 
virtual const GeometrygeometryN (size_t const &n) const
 [OGC/SFA]Returns the n-th geometry More...
 
virtual GeometrygeometryN (size_t const &n)
 [OGC/SFA]Returns the n-th geometry More...
 
void addGeometry (Geometry *geometry)
 [SFA/OGC]add a geometry to the collection (takes ownership) More...
 
void addGeometry (Geometry const &geometry)
 [SFA/OGC]add a geometry to the collection (clone instance) More...
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
virtual void accept (GeometryVisitor &visitor)
 [visitor]dispatch visitor More...
 
virtual void accept (ConstGeometryVisitor &visitor) const
 [visitor]dispatch visitor More...
 
template<class Archive >
void serialize (Archive &ar, const unsigned int)
 Serializer. More...
 
 GeometryCollection ()
 Empty GeometryCollection constructor. More...
 
 GeometryCollection (const GeometryCollection &other)
 Copy constructor. More...
 
GeometryCollectionoperator= (GeometryCollection other)
 assign operator More...
 
virtual ~GeometryCollection ()
 destructor More...
 
virtual GeometryCollectionclone () const
 Get a deep copy of the geometry. More...
 
virtual std::string geometryType () const
 [OGC/SFA]returns the geometry type More...
 
virtual GeometryType geometryTypeId () const
 Returns a code corresponding to the type. More...
 
virtual int dimension () const
 [OGC/SFA]Dimension of the Geometry ( 0 : punctual, 1 : curve, ...) More...
 
virtual int coordinateDimension () const
 [OGC/SFA]returns the dimension of the coordinates More...
 
virtual bool isEmpty () const
 [OGC/SFA]test if geometry is empty More...
 
virtual bool is3D () const
 [OGC/SFA]test if geometry is 3d More...
 
virtual bool isMeasured () const
 [OGC/SFA]test if geometry is measured (has an m) More...
 
virtual size_t numGeometries () const
 [OGC/SFA]Gets the number of geometries in a collection of geometries More...
 
virtual const GeometrygeometryN (size_t const &n) const
 [OGC/SFA]Returns the n-th geometry More...
 
virtual GeometrygeometryN (size_t const &n)
 [OGC/SFA]Returns the n-th geometry More...
 
void addGeometry (Geometry *geometry)
 [SFA/OGC]add a geometry to the collection (takes ownership) More...
 
void addGeometry (Geometry const &geometry)
 [SFA/OGC]add a geometry to the collection (clone instance) More...
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
virtual void accept (GeometryVisitor &visitor)
 [visitor]dispatch visitor More...
 
virtual void accept (ConstGeometryVisitor &visitor) const
 [visitor]dispatch visitor More...
 
template<class Archive >
void serialize (Archive &ar, const unsigned int)
 Serializer. More...
 
- Public Member Functions inherited from SFCGAL::Geometry
 Geometry ()
 Default constructor. More...
 
 Geometry (const Geometry &)=default
 Copy constructor. More...
 
Geometryoperator= (const Geometry &other)=default
 Copy assignemnt operator. More...
 
virtual ~Geometry ()=default
 Destructor. 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< Geometryboundary () 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...
 
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...
 
template<class Archive >
void serialize (Archive &, const unsigned int)
 Serializer. More...
 
 Geometry ()
 Default constructor. More...
 
 Geometry (const Geometry &)=default
 Copy constructor. More...
 
Geometryoperator= (const Geometry &other)=default
 Copy assignemnt operator. More...
 
virtual ~Geometry ()=default
 Destructor. 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< Geometryboundary () 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...
 
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...
 
template<class Archive >
void serialize (Archive &, const unsigned int)
 Serializer. More...
 

Protected Member Functions

virtual bool isAllowed (Geometry const &g)
 Test if a geometry in the collection. More...
 
void swap (GeometryCollection &other)
 Swap. More...
 
virtual bool isAllowed (Geometry const &g)
 Test if a geometry in the collection. More...
 
void swap (GeometryCollection &other)
 Swap. More...
 

Additional Inherited Members

- Protected Attributes inherited from SFCGAL::Geometry
bool validityFlag_
 

Detailed Description

A GeometryCollection in SFA.

Member Typedef Documentation

◆ const_iterator [1/2]

◆ const_iterator [2/2]

◆ iterator [1/2]

◆ iterator [2/2]

Constructor & Destructor Documentation

◆ GeometryCollection() [1/4]

SFCGAL::GeometryCollection::GeometryCollection ( )

Empty GeometryCollection constructor.

◆ GeometryCollection() [2/4]

SFCGAL::GeometryCollection::GeometryCollection ( const GeometryCollection other)

Copy constructor.

◆ ~GeometryCollection() [1/2]

SFCGAL::GeometryCollection::~GeometryCollection ( )
virtualdefault

destructor

◆ GeometryCollection() [3/4]

SFCGAL::GeometryCollection::GeometryCollection ( )

Empty GeometryCollection constructor.

◆ GeometryCollection() [4/4]

SFCGAL::GeometryCollection::GeometryCollection ( const GeometryCollection other)

Copy constructor.

◆ ~GeometryCollection() [2/2]

virtual SFCGAL::GeometryCollection::~GeometryCollection ( )
virtual

destructor

Member Function Documentation

◆ accept() [1/4]

void SFCGAL::GeometryCollection::accept ( ConstGeometryVisitor visitor) const
virtual

◆ accept() [2/4]

virtual void SFCGAL::GeometryCollection::accept ( ConstGeometryVisitor visitor) const
virtual

◆ accept() [3/4]

void SFCGAL::GeometryCollection::accept ( GeometryVisitor visitor)
virtual

◆ accept() [4/4]

virtual void SFCGAL::GeometryCollection::accept ( GeometryVisitor visitor)
virtual

◆ addGeometry() [1/4]

void SFCGAL::GeometryCollection::addGeometry ( Geometry geometry)

[SFA/OGC]add a geometry to the collection (takes ownership)

◆ addGeometry() [2/4]

void SFCGAL::GeometryCollection::addGeometry ( Geometry geometry)

[SFA/OGC]add a geometry to the collection (takes ownership)

◆ addGeometry() [3/4]

void SFCGAL::GeometryCollection::addGeometry ( Geometry const &  geometry)

[SFA/OGC]add a geometry to the collection (clone instance)

◆ addGeometry() [4/4]

void SFCGAL::GeometryCollection::addGeometry ( Geometry const &  geometry)

[SFA/OGC]add a geometry to the collection (clone instance)

◆ begin() [1/4]

iterator SFCGAL::GeometryCollection::begin ( )
inline

◆ begin() [2/4]

iterator SFCGAL::GeometryCollection::begin ( )
inline

◆ begin() [3/4]

const_iterator SFCGAL::GeometryCollection::begin ( ) const
inline

◆ begin() [4/4]

const_iterator SFCGAL::GeometryCollection::begin ( ) const
inline

◆ clone() [1/2]

auto SFCGAL::GeometryCollection::clone ( ) const
virtual

◆ clone() [2/2]

virtual GeometryCollection* SFCGAL::GeometryCollection::clone ( ) const
virtual

◆ coordinateDimension() [1/2]

auto SFCGAL::GeometryCollection::coordinateDimension ( ) const
virtual

[OGC/SFA]returns the dimension of the coordinates

Precondition
suppose no mix of 2D/3D coordinates

Implements SFCGAL::Geometry.

◆ coordinateDimension() [2/2]

virtual int SFCGAL::GeometryCollection::coordinateDimension ( ) const
virtual

[OGC/SFA]returns the dimension of the coordinates

Precondition
suppose no mix of 2D/3D coordinates

Implements SFCGAL::Geometry.

◆ dimension() [1/2]

auto SFCGAL::GeometryCollection::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.

◆ dimension() [2/2]

virtual int SFCGAL::GeometryCollection::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.

◆ end() [1/4]

iterator SFCGAL::GeometryCollection::end ( )
inline

◆ end() [2/4]

iterator SFCGAL::GeometryCollection::end ( )
inline

◆ end() [3/4]

const_iterator SFCGAL::GeometryCollection::end ( ) const
inline

◆ end() [4/4]

const_iterator SFCGAL::GeometryCollection::end ( ) const
inline

◆ geometryN() [1/4]

auto SFCGAL::GeometryCollection::geometryN ( size_t const &  n)
virtual

[OGC/SFA]Returns the n-th geometry

Warning
*this for Point, LineString, Polygon, Triangle

Reimplemented from SFCGAL::Geometry.

◆ geometryN() [2/4]

virtual Geometry& SFCGAL::GeometryCollection::geometryN ( size_t const &  n)
virtual

[OGC/SFA]Returns the n-th geometry

Warning
*this for Point, LineString, Polygon, Triangle

Reimplemented from SFCGAL::Geometry.

◆ geometryN() [3/4]

auto SFCGAL::GeometryCollection::geometryN ( size_t const &  n) const
virtual

[OGC/SFA]Returns the n-th geometry

Warning
*this for Point, LineString, Polygon, Triangle

Reimplemented from SFCGAL::Geometry.

◆ geometryN() [4/4]

virtual const Geometry& SFCGAL::GeometryCollection::geometryN ( size_t const &  n) const
virtual

[OGC/SFA]Returns the n-th geometry

Warning
*this for Point, LineString, Polygon, Triangle

Reimplemented from SFCGAL::Geometry.

◆ geometryType() [1/2]

auto SFCGAL::GeometryCollection::geometryType ( ) const
virtual

[OGC/SFA]returns the geometry type

Warning
use CamelCase (LineString, not LINESTRING)

Implements SFCGAL::Geometry.

Reimplemented in SFCGAL::MultiSolid, SFCGAL::MultiPolygon, SFCGAL::MultiPoint, SFCGAL::MultiLineString, SFCGAL::MultiSolid, SFCGAL::MultiPolygon, SFCGAL::MultiPoint, and SFCGAL::MultiLineString.

◆ geometryType() [2/2]

virtual std::string SFCGAL::GeometryCollection::geometryType ( ) const
virtual

[OGC/SFA]returns the geometry type

Warning
use CamelCase (LineString, not LINESTRING)

Implements SFCGAL::Geometry.

Reimplemented in SFCGAL::MultiSolid, SFCGAL::MultiPolygon, SFCGAL::MultiPoint, SFCGAL::MultiLineString, SFCGAL::MultiSolid, SFCGAL::MultiPolygon, SFCGAL::MultiPoint, and SFCGAL::MultiLineString.

◆ geometryTypeId() [1/2]

auto SFCGAL::GeometryCollection::geometryTypeId ( ) const
virtual

◆ geometryTypeId() [2/2]

virtual GeometryType SFCGAL::GeometryCollection::geometryTypeId ( ) const
virtual

◆ is3D() [1/2]

auto SFCGAL::GeometryCollection::is3D ( ) const
virtual

[OGC/SFA]test if geometry is 3d

Precondition
suppose no mix of 2D/3D coordinates

Implements SFCGAL::Geometry.

◆ is3D() [2/2]

virtual bool SFCGAL::GeometryCollection::is3D ( ) const
virtual

[OGC/SFA]test if geometry is 3d

Precondition
suppose no mix of 2D/3D coordinates

Implements SFCGAL::Geometry.

◆ isAllowed() [1/2]

auto SFCGAL::GeometryCollection::isAllowed ( Geometry const &  g)
protectedvirtual

◆ isAllowed() [2/2]

virtual bool SFCGAL::GeometryCollection::isAllowed ( Geometry const &  g)
protectedvirtual

◆ isEmpty() [1/2]

auto SFCGAL::GeometryCollection::isEmpty ( ) const
virtual

[OGC/SFA]test if geometry is empty

Implements SFCGAL::Geometry.

◆ isEmpty() [2/2]

virtual bool SFCGAL::GeometryCollection::isEmpty ( ) const
virtual

[OGC/SFA]test if geometry is empty

Implements SFCGAL::Geometry.

◆ isMeasured() [1/2]

auto SFCGAL::GeometryCollection::isMeasured ( ) const
virtual

[OGC/SFA]test if geometry is measured (has an m)

Precondition
suppose no mix of M/!M points

Implements SFCGAL::Geometry.

◆ isMeasured() [2/2]

virtual bool SFCGAL::GeometryCollection::isMeasured ( ) const
virtual

[OGC/SFA]test if geometry is measured (has an m)

Precondition
suppose no mix of M/!M points

Implements SFCGAL::Geometry.

◆ numGeometries() [1/2]

auto SFCGAL::GeometryCollection::numGeometries ( ) const
virtual

[OGC/SFA]Gets the number of geometries in a collection of geometries

Warning
1 for Point, LineString, Polygon, Triangle

Reimplemented from SFCGAL::Geometry.

◆ numGeometries() [2/2]

virtual size_t SFCGAL::GeometryCollection::numGeometries ( ) const
virtual

[OGC/SFA]Gets the number of geometries in a collection of geometries

Warning
1 for Point, LineString, Polygon, Triangle

Reimplemented from SFCGAL::Geometry.

◆ operator=() [1/2]

auto SFCGAL::GeometryCollection::operator= ( GeometryCollection  other)

assign operator

◆ operator=() [2/2]

GeometryCollection& SFCGAL::GeometryCollection::operator= ( GeometryCollection  other)

assign operator

◆ serialize() [1/2]

template<class Archive >
void SFCGAL::GeometryCollection::serialize ( Archive &  ar,
const unsigned int   
)
inline

Serializer.

◆ serialize() [2/2]

template<class Archive >
void SFCGAL::GeometryCollection::serialize ( Archive &  ar,
const unsigned int   
)
inline

Serializer.

◆ swap() [1/2]

void SFCGAL::GeometryCollection::swap ( GeometryCollection other)
inlineprotected

Swap.

◆ swap() [2/2]

void SFCGAL::GeometryCollection::swap ( GeometryCollection other)
inlineprotected

Swap.