Skip to content

Class SFCGAL::Polygon

ClassList > SFCGAL > Polygon

More...

  • #include <Polygon.h>

Inherits the following classes: SFCGAL::Surface

Public Types

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

Public Functions

Type Name
Polygon ()
Polygon (const std::vector< LineString > & rings)
Polygon (const LineString & exteriorRing)
Polygon (LineString * exteriorRing)
Polygon (const Triangle & triangle)
Polygon (const Polygon & other)
Polygon (const CGAL::Polygon_2< Kernel > & other)
Polygon (const CGAL::Polygon_with_holes_2< Kernel > & other)
virtual void accept (GeometryVisitor & visitor)
[visitor]dispatch visitor
virtual void accept (ConstGeometryVisitor & visitor) const
[visitor]dispatch visitor
void addInteriorRing (const LineString & ls)
void addInteriorRing (LineString * ls)
void addRing (const LineString & ls)
void addRing (LineString * ls)
iterator begin ()
const_iterator begin () const
virtual Polygon * clone () const
Get a deep copy of the geometry.
virtual int coordinateDimension () const
iterator end ()
const_iterator end () const
const LineString & exteriorRing () const
LineString & exteriorRing ()
virtual std::string geometryType () const
[OGC/SFA]returns the geometry type
virtual GeometryType geometryTypeId () const
Returns a code corresponding to the type.
bool hasInteriorRings () const
const LineString & interiorRingN (const size_t & n) const
LineString & interiorRingN (const size_t & n)
virtual bool is3D () const
bool isCounterClockWiseOriented () const
virtual bool isEmpty () const
virtual bool isMeasured () const
size_t numInteriorRings () const
size_t numRings () const
Polygon & operator= (Polygon other)
void reverse ()
const LineString & ringN (const size_t & n) const
LineString & ringN (const size_t & n)
void serialize (Archive & ar, const unsigned int)
void setExteriorRing (const LineString & ring)
void setExteriorRing (LineString * ring)
CGAL::Polygon_2< Kernel > toPolygon_2 (bool fixOrientation=true) const
CGAL::Polygon_with_holes_2< Kernel > toPolygon_with_holes_2 (bool fixOrientation=true) const
~Polygon ()

Public Functions inherited from SFCGAL::Surface

See SFCGAL::Surface

Type Name
virtual int dimension () const
virtual ~Surface ()

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 inherited from SFCGAL::Surface

See SFCGAL::Surface

Type Name
Surface ()
Surface (Surface const & other)

Detailed Description

A Polygon in SFA with holes

Public Types Documentation

typedef const_iterator

typedef boost::ptr_vector<LineString>::const_iterator SFCGAL::Polygon::const_iterator;

typedef iterator

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

Public Functions Documentation

function Polygon [1/8]

SFCGAL::Polygon::Polygon () 

Empty Polygon constructor


function Polygon [2/8]

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

Constructor with an exterior ring


function Polygon [3/8]

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

Constructor with an exterior ring


function Polygon [4/8]

SFCGAL::Polygon::Polygon (
    LineString * exteriorRing
) 

Constructor with an exterior ring (takes ownership)


function Polygon [5/8]

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

Constructor with a Triangle


function Polygon [6/8]

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

Copy constructor


function Polygon [7/8]

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

Constructor from CGAL::Polygon_with_holes_2<K>


function Polygon [8/8]

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

Constructor from CGAL::Polygon_with_holes_2<K>


function accept [1/2]

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

Implements SFCGAL::Geometry::accept


function accept [2/2]

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

Implements SFCGAL::Geometry::accept


function addInteriorRing [1/2]

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

append a ring to the Polygon


function addInteriorRing [2/2]

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

append a ring to the Polygon (take ownership)


function addRing [1/2]

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

append a ring to the Polygon

Deprecated

addInteriorRing


function addRing [2/2]

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

append a ring to the Polygon (take ownership)

Deprecated

addInteriorRing


function begin [1/2]

inline iterator SFCGAL::Polygon::begin () 

function begin [2/2]

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

function clone

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

Implements SFCGAL::Geometry::clone


function coordinateDimension

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

[OGC/SFA]returns the dimension of the coordinates

Precondition:

suppose no mix of 2D/3D coordinates

Implements SFCGAL::Geometry::coordinateDimension


function end [1/2]

inline iterator SFCGAL::Polygon::end () 

function end [2/2]

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

function exteriorRing [1/2]

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

[OGC/SFA]returns the exterior ring


function exteriorRing [2/2]

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

[OGC/SFA]returns the exterior ring


function geometryType

[OGC/SFA]returns the geometry type

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

Warning:

use CamelCase (LineString, not LINESTRING)

Implements SFCGAL::Geometry::geometryType


function geometryTypeId

Returns a code corresponding to the type.

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

Warning:

not standard

Implements SFCGAL::Geometry::geometryTypeId


function hasInteriorRings

inline bool SFCGAL::Polygon::hasInteriorRings () const

Test if the polygon has interior rings


function interiorRingN [1/2]

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

[OGC/SFA]returns the exterior ring


function interiorRingN [2/2]

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

[OGC/SFA]returns the exterior ring


function is3D

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

[OGC/SFA]test if geometry is 3d

Precondition:

suppose no mix of 2D/3D coordinates

Implements SFCGAL::Geometry::is3D


function isCounterClockWiseOriented

bool SFCGAL::Polygon::isCounterClockWiseOriented () const

Check whether the 2D polygon is pointing up


function isEmpty

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

[OGC/SFA]test if geometry is empty

Implements SFCGAL::Geometry::isEmpty


function isMeasured

virtual bool SFCGAL::Polygon::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 numInteriorRings

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

[OGC/SFA]returns the exterior ring


function numRings

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

Returns the number of rings


function operator=

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

assign operator


function reverse

void SFCGAL::Polygon::reverse () 

reverse Polygon orientation


function ringN [1/2]

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

Returns the n-th ring, 0 is exteriorRing

Warning:

not standard, avoid conditionnal to access rings


function ringN [2/2]

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

Returns the n-th ring, 0 is exteriorRing

Warning:

not standard, avoid conditionnal to access rings


function serialize

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

Serializer


function setExteriorRing [1/2]

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

Sets the exterior ring


function setExteriorRing [2/2]

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

Sets the exterior ring (takes ownership)


function toPolygon_2

CGAL::Polygon_2< Kernel > SFCGAL::Polygon::toPolygon_2 (
    bool fixOrientation=true
) const

function toPolygon_with_holes_2

CGAL::Polygon_with_holes_2< Kernel > SFCGAL::Polygon::toPolygon_with_holes_2 (
    bool fixOrientation=true
) const

function ~Polygon

SFCGAL::Polygon::~Polygon () 

destructor



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