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

A Polygon in SFA with holes. More...

#include <Polygon.h>

Inheritance diagram for SFCGAL::Polygon:
SFCGAL::Surface

Public Types

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

Public Member Functions

 Polygon ()
 Empty Polygon constructor. More...
 
 Polygon (const std::vector< LineString > &rings)
 Constructor with an exterior ring. More...
 
 Polygon (const LineString &exteriorRing)
 Constructor with an exterior ring. More...
 
 Polygon (LineString *exteriorRing)
 Constructor with an exterior ring (takes ownership) More...
 
 Polygon (const Triangle &triangle)
 Constructor with a Triangle. More...
 
 Polygon (const Polygon &other)
 Copy constructor. More...
 
 Polygon (const CGAL::Polygon_2< Kernel > &other)
 Constructor from CGAL::Polygon_with_holes_2<K> More...
 
 Polygon (const CGAL::Polygon_with_holes_2< Kernel > &other)
 Constructor from CGAL::Polygon_with_holes_2<K> More...
 
Polygonoperator= (Polygon other)
 assign operator More...
 
 ~Polygon ()
 destructor More...
 
Polygonclone () const override
 
std::string geometryType () const override
 
GeometryType geometryTypeId () const override
 
int coordinateDimension () const override
 
bool isEmpty () const override
 
bool is3D () const override
 
bool isMeasured () const override
 
auto dropZ () -> bool override
 
auto dropM () -> bool override
 
auto swapXY () -> void override
 
bool isCounterClockWiseOriented () const
 Check whether the 2D polygon is pointing up. More...
 
void reverse ()
 reverse Polygon orientation More...
 
const LineStringexteriorRing () const
 [OGC/SFA]returns the exterior ring More...
 
LineStringexteriorRing ()
 [OGC/SFA]returns the exterior ring More...
 
void setExteriorRing (const LineString &ring)
 Sets the exterior ring. More...
 
void setExteriorRing (LineString *ring)
 Sets the exterior ring (takes ownership) More...
 
bool hasInteriorRings () const
 Test if the polygon has interior rings. More...
 
size_t numInteriorRings () const
 [OGC/SFA]returns the exterior ring More...
 
const LineStringinteriorRingN (const size_t &n) const
 [OGC/SFA]returns the exterior ring More...
 
LineStringinteriorRingN (const size_t &n)
 [OGC/SFA]returns the exterior ring More...
 
size_t numRings () const
 Returns the number of rings. More...
 
const LineStringringN (const size_t &n) const
 Returns the n-th ring, 0 is exteriorRing. More...
 
LineStringringN (const size_t &n)
 Returns the n-th ring, 0 is exteriorRing. More...
 
void addInteriorRing (const LineString &ls)
 append a ring to the Polygon More...
 
void addInteriorRing (LineString *ls)
 append a ring to the Polygon (take ownership) More...
 
void addRing (const LineString &ls)
 append a ring to the Polygon More...
 
void addRing (LineString *ls)
 append a ring to the Polygon (take ownership) More...
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
CGAL::Polygon_2< KerneltoPolygon_2 (bool fixOrientation=true) const
 
CGAL::Polygon_with_holes_2< KerneltoPolygon_with_holes_2 (bool fixOrientation=true) const
 
void accept (GeometryVisitor &visitor) override
 
void accept (ConstGeometryVisitor &visitor) const override
 
template<class Archive >
void serialize (Archive &ar, const unsigned int)
 Serializer. More...
 
- Public Member Functions inherited from SFCGAL::Surface
virtual ~Surface ()
 destructor More...
 
int dimension () const override
 

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...
 

Detailed Description

A Polygon in SFA with holes.

Member Typedef Documentation

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

Constructor & Destructor Documentation

SFCGAL::Polygon::Polygon ( )

Empty Polygon constructor.

SFCGAL::Polygon::Polygon ( const std::vector< LineString > &  rings)

Constructor with an exterior ring.

SFCGAL::Polygon::Polygon ( const LineString exteriorRing)

Constructor with an exterior ring.

SFCGAL::Polygon::Polygon ( LineString exteriorRing)

Constructor with an exterior ring (takes ownership)

SFCGAL::Polygon::Polygon ( const Triangle triangle)

Constructor with a Triangle.

SFCGAL::Polygon::Polygon ( const Polygon other)

Copy constructor.

SFCGAL::Polygon::Polygon ( const CGAL::Polygon_2< Kernel > &  other)

Constructor from CGAL::Polygon_with_holes_2<K>

SFCGAL::Polygon::Polygon ( const CGAL::Polygon_with_holes_2< Kernel > &  other)

Constructor from CGAL::Polygon_with_holes_2<K>

SFCGAL::Polygon::~Polygon ( )
default

destructor

Member Function Documentation

void SFCGAL::Polygon::accept ( GeometryVisitor visitor)
override
void SFCGAL::Polygon::accept ( ConstGeometryVisitor visitor) const
override
void SFCGAL::Polygon::addInteriorRing ( const LineString ls)
inline

append a ring to the Polygon

void SFCGAL::Polygon::addInteriorRing ( LineString ls)
inline

append a ring to the Polygon (take ownership)

void SFCGAL::Polygon::addRing ( const LineString ls)
inline

append a ring to the Polygon

Deprecated:
addInteriorRing
void SFCGAL::Polygon::addRing ( LineString ls)
inline

append a ring to the Polygon (take ownership)

Deprecated:
addInteriorRing
iterator SFCGAL::Polygon::begin ( )
inline
const_iterator SFCGAL::Polygon::begin ( ) const
inline
auto SFCGAL::Polygon::clone ( ) const
override
auto SFCGAL::Polygon::coordinateDimension ( ) const
override
auto SFCGAL::Polygon::dropM ( ) -> bool
override
auto SFCGAL::Polygon::dropZ ( ) -> bool
override
iterator SFCGAL::Polygon::end ( )
inline
const_iterator SFCGAL::Polygon::end ( ) const
inline
const LineString& SFCGAL::Polygon::exteriorRing ( ) const
inline

[OGC/SFA]returns the exterior ring

LineString& SFCGAL::Polygon::exteriorRing ( )
inline

[OGC/SFA]returns the exterior ring

auto SFCGAL::Polygon::geometryType ( ) const
override
auto SFCGAL::Polygon::geometryTypeId ( ) const
override
bool SFCGAL::Polygon::hasInteriorRings ( ) const
inline

Test if the polygon has interior rings.

const LineString& SFCGAL::Polygon::interiorRingN ( const size_t &  n) const
inline

[OGC/SFA]returns the exterior ring

LineString& SFCGAL::Polygon::interiorRingN ( const size_t &  n)
inline

[OGC/SFA]returns the exterior ring

auto SFCGAL::Polygon::is3D ( ) const
override
auto SFCGAL::Polygon::isCounterClockWiseOriented ( ) const

Check whether the 2D polygon is pointing up.

auto SFCGAL::Polygon::isEmpty ( ) const
override
auto SFCGAL::Polygon::isMeasured ( ) const
override
size_t SFCGAL::Polygon::numInteriorRings ( ) const
inline

[OGC/SFA]returns the exterior ring

size_t SFCGAL::Polygon::numRings ( ) const
inline

Returns the number of rings.

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

assign operator

void SFCGAL::Polygon::reverse ( )

reverse Polygon orientation

const LineString& SFCGAL::Polygon::ringN ( const size_t &  n) const
inline

Returns the n-th ring, 0 is exteriorRing.

Warning
not standard, avoid conditionnal to access rings
LineString& SFCGAL::Polygon::ringN ( const size_t &  n)
inline

Returns the n-th ring, 0 is exteriorRing.

Warning
not standard, avoid conditionnal to access rings
template<class Archive >
void SFCGAL::Polygon::serialize ( Archive &  ar,
const unsigned  int 
)
inline

Serializer.

void SFCGAL::Polygon::setExteriorRing ( const LineString ring)
inline

Sets the exterior ring.

void SFCGAL::Polygon::setExteriorRing ( LineString ring)
inline

Sets the exterior ring (takes ownership)

auto SFCGAL::Polygon::swapXY ( ) -> void
override
auto SFCGAL::Polygon::toPolygon_2 ( bool  fixOrientation = true) const
auto SFCGAL::Polygon::toPolygon_with_holes_2 ( bool  fixOrientation = true) const