SFCGAL
Public Types | Public Member Functions | List of all members
SFCGAL::PolyhedralSurface Class Reference

A PolyhedralSurface in SFA modeled as a Polygon soup. More...

#include <PolyhedralSurface.h>

Inheritance diagram for SFCGAL::PolyhedralSurface:
SFCGAL::Surface SFCGAL::Geometry

Public Types

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

Public Member Functions

 PolyhedralSurface ()
 Empty PolyhedralSurface constructor. More...
 
 PolyhedralSurface (const std::vector< Polygon > &polygons)
 Constructor with a vector of polygons. More...
 
 PolyhedralSurface (const detail::MarkedPolyhedron &poly)
 Constructor from a CGAL::Polyhedron_3. More...
 
 PolyhedralSurface (const PolyhedralSurface &other)
 Copy constructor. More...
 
PolyhedralSurfaceoperator= (PolyhedralSurface other)
 assign operator More...
 
 ~PolyhedralSurface ()
 destructor More...
 
virtual PolyhedralSurfaceclone () 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...
 
TriangulatedSurface toTriangulatedSurface () const
 Convert PolyhedralSurface to TriangulatedSurface. More...
 
size_t numPolygons () const
 [SFA/OGC]Returns the number of points More...
 
const PolygonpolygonN (size_t const &n) const
 [SFA/OGC]Returns the n-th point More...
 
PolygonpolygonN (size_t const &n)
 [SFA/OGC]Returns the n-th point More...
 
void addPolygon (const Polygon &polygon)
 add a polygon to the PolyhedralSurface More...
 
void addPolygon (Polygon *polygon)
 add a polygon to the PolyhedralSurface More...
 
void addPolygons (const PolyhedralSurface &polyhedralSurface)
 add polygons from an other PolyhedralSurface More...
 
virtual size_t numGeometries () const
 [OGC/SFA]Gets the number of geometries in a collection of geometries More...
 
virtual const PolygongeometryN (size_t const &n) const
 [OGC/SFA]Returns the n-th geometry More...
 
virtual PolygongeometryN (size_t const &n)
 [OGC/SFA]Returns the n-th geometry More...
 
template<typename K , typename Polyhedron >
std::unique_ptr< Polyhedron > toPolyhedron_3 () const
 Convert to CGAL::Polyhedron_3. 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::Surface
virtual ~Surface ()
 destructor 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...
 
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...
 

Additional Inherited Members

- Protected Member Functions inherited from SFCGAL::Surface
 Surface ()
 [OGC/SFS]"The area of this Surface, as measured in the spatial reference system of this Surface" More...
 
 Surface (Surface const &other)
 no copy constructor More...
 
- Protected Attributes inherited from SFCGAL::Geometry
bool validityFlag_
 

Detailed Description

A PolyhedralSurface in SFA modeled as a Polygon soup.

Todo:
do better than a "polygon soup" or add topological view?

Member Typedef Documentation

◆ const_iterator

◆ iterator

typedef boost::ptr_vector< Polygon >::iterator SFCGAL::PolyhedralSurface::iterator

Constructor & Destructor Documentation

◆ PolyhedralSurface() [1/4]

SFCGAL::PolyhedralSurface::PolyhedralSurface ( )

Empty PolyhedralSurface constructor.

◆ PolyhedralSurface() [2/4]

SFCGAL::PolyhedralSurface::PolyhedralSurface ( const std::vector< Polygon > &  polygons)

Constructor with a vector of polygons.

◆ PolyhedralSurface() [3/4]

SFCGAL::PolyhedralSurface::PolyhedralSurface ( const detail::MarkedPolyhedron poly)

Constructor from a CGAL::Polyhedron_3.

◆ PolyhedralSurface() [4/4]

SFCGAL::PolyhedralSurface::PolyhedralSurface ( const PolyhedralSurface other)

Copy constructor.

◆ ~PolyhedralSurface()

SFCGAL::PolyhedralSurface::~PolyhedralSurface ( )

destructor

Member Function Documentation

◆ accept() [1/2]

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

[visitor]dispatch visitor

Implements SFCGAL::Geometry.

◆ accept() [2/2]

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

[visitor]dispatch visitor

Implements SFCGAL::Geometry.

◆ addPolygon() [1/2]

void SFCGAL::PolyhedralSurface::addPolygon ( const Polygon polygon)

add a polygon to the PolyhedralSurface

◆ addPolygon() [2/2]

void SFCGAL::PolyhedralSurface::addPolygon ( Polygon polygon)

add a polygon to the PolyhedralSurface

◆ addPolygons()

void SFCGAL::PolyhedralSurface::addPolygons ( const PolyhedralSurface polyhedralSurface)

add polygons from an other PolyhedralSurface

◆ begin() [1/2]

iterator SFCGAL::PolyhedralSurface::begin ( )
inline

◆ begin() [2/2]

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

◆ clone()

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

Get a deep copy of the geometry.

Implements SFCGAL::Geometry.

◆ coordinateDimension()

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

[OGC/SFA]returns the dimension of the coordinates

Precondition
suppose no mix of 2D/3D coordinates

Implements SFCGAL::Geometry.

◆ dimension()

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

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

Warning
empty geometries provide the dimension corresponding to the object

Reimplemented from SFCGAL::Surface.

◆ end() [1/2]

iterator SFCGAL::PolyhedralSurface::end ( )
inline

◆ end() [2/2]

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

◆ geometryN() [1/2]

Polygon & SFCGAL::PolyhedralSurface::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/2]

const Polygon & SFCGAL::PolyhedralSurface::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()

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

[OGC/SFA]returns the geometry type

Warning
use CamelCase (LineString, not LINESTRING)

Implements SFCGAL::Geometry.

◆ geometryTypeId()

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

Returns a code corresponding to the type.

Warning
not standard

Implements SFCGAL::Geometry.

◆ is3D()

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

[OGC/SFA]test if geometry is 3d

Precondition
suppose no mix of 2D/3D coordinates

Implements SFCGAL::Geometry.

◆ isEmpty()

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

[OGC/SFA]test if geometry is empty

Implements SFCGAL::Geometry.

◆ isMeasured()

bool SFCGAL::PolyhedralSurface::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()

size_t SFCGAL::PolyhedralSurface::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.

◆ numPolygons()

size_t SFCGAL::PolyhedralSurface::numPolygons ( ) const
inline

[SFA/OGC]Returns the number of points

Deprecated:
see numGeometries

◆ operator=()

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

assign operator

◆ polygonN() [1/2]

Polygon& SFCGAL::PolyhedralSurface::polygonN ( size_t const &  n)
inline

[SFA/OGC]Returns the n-th point

Deprecated:
see geometryN()

◆ polygonN() [2/2]

const Polygon& SFCGAL::PolyhedralSurface::polygonN ( size_t const &  n) const
inline

[SFA/OGC]Returns the n-th point

Deprecated:
see geometryN()

◆ serialize()

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

Serializer.

◆ toPolyhedron_3()

template<typename K , typename Polyhedron >
std::unique_ptr<Polyhedron> SFCGAL::PolyhedralSurface::toPolyhedron_3 ( ) const
inline

Convert to CGAL::Polyhedron_3.

◆ toTriangulatedSurface()

TriangulatedSurface SFCGAL::PolyhedralSurface::toTriangulatedSurface ( ) const