Skip to content

Class SFCGAL::GeometryCollection

ClassList > SFCGAL > GeometryCollection

More...

  • #include <GeometryCollection.h>

Inherits the following classes: SFCGAL::Geometry

Inherited by the following classes: SFCGAL::MultiLineString, SFCGAL::MultiPoint, SFCGAL::MultiPolygon, SFCGAL::MultiSolid

Public Types

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

Public Functions

Type Name
GeometryCollection ()
GeometryCollection (const GeometryCollection & other)
virtual void accept (GeometryVisitor & visitor)
[visitor]dispatch visitor
virtual void accept (ConstGeometryVisitor & visitor) const
[visitor]dispatch visitor
void addGeometry (Geometry * geometry)
void addGeometry (Geometry const & geometry)
iterator begin ()
const_iterator begin () const
virtual GeometryCollection * clone () const
Get a deep copy of the geometry.
virtual int coordinateDimension () const
virtual int dimension () const
iterator end ()
const_iterator end () const
virtual const Geometry & geometryN (size_t const & n) const
[OGC/SFA]Returns the n-th geometry
virtual Geometry & geometryN (size_t const & n)
[OGC/SFA]Returns the n-th geometry
virtual std::string geometryType () const
[OGC/SFA]returns the geometry type
virtual GeometryType geometryTypeId () const
Returns a code corresponding to the type.
virtual bool is3D () const
virtual bool isEmpty () const
virtual bool isMeasured () const
virtual size_t numGeometries () const
[OGC/SFA]Gets the number of geometries in a collection of geometries
GeometryCollection & operator= (GeometryCollection other)
void serialize (Archive & ar, const unsigned int)
virtual ~GeometryCollection ()

Public Functions inherited from SFCGAL::Geometry

See SFCGAL::Geometry

Type Name
Geometry ()
Default constructor.
Geometry (const Geometry &) = default
Copy constructor.
virtual void accept (GeometryVisitor & visitor) = 0
[visitor]dispatch visitor
virtual void accept (ConstGeometryVisitor & visitor) const = 0
[visitor]dispatch visitor
auto almostEqual (const Geometry & other, const double tolerance) const
const Derived & as () const
Downcast to a "Derived" class.
Derived & as ()
Downcast to a "Derived" class.
std::string asText (const int & numDecimals=-1) const
std::string asWkb (boost::endian::order wkbOrder=boost::endian::order::native, bool asHex=false) const
virtual std::unique_ptr< Geometry > boundary () const
[OGC/SFA]Returns the boundary of the geometry
virtual Geometry * clone () const = 0
Get a deep copy of the geometry.
virtual int coordinateDimension () const = 0
virtual int dimension () const = 0
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.
Envelope envelope () const
void forceValidityFlag (bool validity)
virtual const Geometry & geometryN (size_t const & n) const
[OGC/SFA]Returns the n-th geometry
virtual Geometry & geometryN (size_t const & n)
[OGC/SFA]Returns the n-th 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.
bool hasValidityFlag () const
bool is () const
Tests if geometry is of "Derived" type given as template parameter.
virtual bool is3D () const = 0
virtual bool isEmpty () const = 0
virtual bool isMeasured () const = 0
virtual size_t numGeometries () const
[OGC/SFA]Gets the number of geometries in a collection of geometries
Geometry & operator= (const Geometry & other) = default
Copy assignemnt operator.
void round (const long & scale=1)
round the geometry with a corresponding scale factor
void serialize (Archive &, const unsigned int)
virtual ~Geometry () = default
Destructor.

Protected Attributes inherited from SFCGAL::Geometry

See SFCGAL::Geometry

Type Name
bool validityFlag_ = = false

Protected Functions

Type Name
virtual bool isAllowed (Geometry const & g)
void swap (GeometryCollection & other)

Detailed Description

A GeometryCollection in SFA.

Public Types Documentation

typedef const_iterator

typedef boost::ptr_vector<Geometry>::const_iterator SFCGAL::GeometryCollection::const_iterator;

typedef iterator

typedef boost::ptr_vector<Geometry>::iterator SFCGAL::GeometryCollection::iterator;

Public Functions Documentation

function GeometryCollection [1/2]

SFCGAL::GeometryCollection::GeometryCollection () 

Empty GeometryCollection constructor


function GeometryCollection [2/2]

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

Copy constructor


function accept [1/2]

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

Implements SFCGAL::Geometry::accept


function accept [2/2]

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

Implements SFCGAL::Geometry::accept


function addGeometry [1/2]

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

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


function addGeometry [2/2]

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

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


function begin [1/2]

inline iterator SFCGAL::GeometryCollection::begin () 

function begin [2/2]

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

function clone

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

Implements SFCGAL::Geometry::clone


function coordinateDimension

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

[OGC/SFA]returns the dimension of the coordinates

Precondition:

suppose no mix of 2D/3D coordinates

Implements SFCGAL::Geometry::coordinateDimension


function dimension

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

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

Warning:

empty geometries provide the dimension corresponding to the object

Implements SFCGAL::Geometry::dimension


function end [1/2]

inline iterator SFCGAL::GeometryCollection::end () 

function end [2/2]

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

function geometryN [1/2]

[OGC/SFA]Returns the n-th geometry

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

Warning:

*this for Point, LineString, Polygon, Triangle

Implements SFCGAL::Geometry::geometryN


function geometryN [2/2]

[OGC/SFA]Returns the n-th geometry

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

Warning:

*this for Point, LineString, Polygon, Triangle

Implements SFCGAL::Geometry::geometryN


function geometryType

[OGC/SFA]returns the geometry type

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

Warning:

use CamelCase (LineString, not LINESTRING)

Implements SFCGAL::Geometry::geometryType


function geometryTypeId

Returns a code corresponding to the type.

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

Warning:

not standard

Implements SFCGAL::Geometry::geometryTypeId


function is3D

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

[OGC/SFA]test if geometry is 3d

Precondition:

suppose no mix of 2D/3D coordinates

Implements SFCGAL::Geometry::is3D


function isEmpty

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

[OGC/SFA]test if geometry is empty

Implements SFCGAL::Geometry::isEmpty


function isMeasured

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

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

Precondition:

suppose no mix of M/!M points

Implements SFCGAL::Geometry::isMeasured


function numGeometries

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

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

Warning:

1 for Point, LineString, Polygon, Triangle

Implements SFCGAL::Geometry::numGeometries


function operator=

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

assign operator


function serialize

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

Serializer


function ~GeometryCollection

virtual SFCGAL::GeometryCollection::~GeometryCollection () 

destructor


Protected Functions Documentation

function isAllowed

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

Test if a geometry in the collection


function swap

inline void SFCGAL::GeometryCollection::swap (
    GeometryCollection & other
) 

Swap



The documentation for this class was generated from the following file /builds/sfcgal/SFCGAL/src/GeometryCollection.h