|
SFCGAL 2.3.0
|
A Polygon in SFA with holes. More...
#include <Polygon.h>
Public Types | |
| using | iterator |
| Iterator type for polygon rings. | |
| using | const_iterator |
| Const iterator type for polygon rings. | |
Public Member Functions | |
| Polygon () | |
| Empty Polygon constructor. | |
| Polygon (const std::vector< LineString > &rings) | |
| Constructor with an exterior ring. | |
| Polygon (const LineString &exteriorRing) | |
| Constructor with an exterior ring. | |
| Polygon (LineString *exteriorRing) | |
| Constructor with an exterior ring (takes ownership). | |
| Polygon (std::unique_ptr< LineString > exteriorRing) | |
| Constructor with an exterior ring (takes ownership). | |
| Polygon (const Triangle &triangle) | |
| Constructor with a Triangle. | |
| Polygon (const Polygon &other) | |
| Copy constructor. | |
| Polygon (const CGAL::Polygon_2< Kernel > &other) | |
| Constructor from CGAL::Polygon_2<K>. | |
| Polygon (const CGAL::Polygon_with_holes_2< Kernel > &poly) | |
| Constructor from CGAL::Polygon_with_holes_2<K>. | |
| auto | operator= (Polygon other) -> Polygon & |
| assign operator | |
| ~Polygon () override | |
| destructor | |
| auto | geometryType () const -> std::string override |
| Get the geometry type as string. | |
| auto | geometryTypeId () const -> GeometryType override |
| Get the geometry type identifier. | |
| auto | coordinateDimension () const -> int override |
| Get the coordinate dimension. | |
| auto | isEmpty () const -> bool override |
| Check if the polygon is empty. | |
| auto | is3D () const -> bool override |
| Check if the polygon has 3D coordinates. | |
| auto | isMeasured () const -> bool override |
| Check if the polygon has measured coordinates. | |
| auto | dropZ () -> bool override |
| Drop Z coordinate from all points. | |
| auto | dropM () -> bool override |
| Drop M coordinate from all points. | |
| auto | swapXY () -> void override |
| Swap X and Y coordinates of all points. | |
| auto | isCounterClockWiseOriented () const -> bool |
| Check whether the 2D polygon is pointing up. | |
| void | reverse () |
| reverse Polygon orientation | |
| auto | exteriorRing () const -> const LineString & |
| [OGC/SFA]returns the exterior ring | |
| auto | exteriorRing () -> LineString & |
| [OGC/SFA]returns the exterior ring | |
| void | setExteriorRing (const LineString &ring) |
| Sets the exterior ring. | |
| void | setExteriorRing (LineString *ring) |
| Sets the exterior ring (takes ownership). | |
| void | setExteriorRing (std::unique_ptr< LineString > ring) |
| Sets the exterior ring. | |
| auto | hasInteriorRings () const -> bool |
| Test if the polygon has interior rings. | |
| auto | numInteriorRings () const -> size_t |
| [OGC/SFA]returns the number of interior rings | |
| auto | interiorRingN (const size_t &n) const -> const LineString & |
| [OGC/SFA]returns the nth interior ring | |
| auto | interiorRingN (const size_t &n) -> LineString & |
| [OGC/SFA]returns the nth interior ring | |
| auto | numRings () const -> size_t |
| Returns the number of rings. | |
| auto | ringN (const size_t &n) const -> const LineString & |
| Returns the n-th ring, 0 is exteriorRing. | |
| auto | ringN (const size_t &n) -> LineString & |
| Returns the n-th ring, 0 is exteriorRing. | |
| void | addInteriorRing (const LineString &ls) |
| append a ring to the Polygon | |
| void | addInteriorRing (LineString *ls) |
| append a ring to the Polygon (take ownership) | |
| void | addInteriorRing (std::unique_ptr< LineString > ring) |
| Adds a ring to the Polygon. | |
| void | addRing (const LineString &ls) |
| append a ring to the Polygon | |
| void | addRing (LineString *ls) |
| append a ring to the Polygon (take ownership) | |
| auto | begin () -> iterator |
| Get iterator to beginning of rings. | |
| auto | begin () const -> const_iterator |
| Get const iterator to beginning of rings. | |
| auto | end () -> iterator |
| Get iterator to end of rings. | |
| auto | end () const -> const_iterator |
| Get const iterator to end of rings. | |
| auto | toPolygon_2 (bool fixOrientation=true) const -> CGAL::Polygon_2< Kernel > |
| Convert to CGAL::Polygon_2. | |
| auto | toPolygon_with_holes_2 (bool fixOrientation=true) const -> CGAL::Polygon_with_holes_2< Kernel > |
| Convert to CGAL::Polygon_with_holes_2. | |
| void | accept (GeometryVisitor &visitor) override |
| Accept a geometry visitor. | |
| void | accept (ConstGeometryVisitor &visitor) const override |
| Accept a const geometry visitor. | |
| template<class Archive> | |
| void | serialize (Archive &ar, const unsigned int) |
| Serializer. | |
A Polygon in SFA with holes.
Const iterator type for polygon rings.
Iterator type for polygon rings.
| SFCGAL::Polygon::Polygon | ( | ) |
Empty Polygon constructor.
| SFCGAL::Polygon::Polygon | ( | const std::vector< LineString > & | rings | ) |
Constructor with an exterior ring.
| rings | Vector of rings (first is exterior, rest are holes) |
| SFCGAL::Polygon::Polygon | ( | const LineString & | exteriorRing | ) |
Constructor with an exterior ring.
| exteriorRing | The exterior ring of the polygon |
| SFCGAL::Polygon::Polygon | ( | LineString * | exteriorRing | ) |
Constructor with an exterior ring (takes ownership).
| exteriorRing | The exterior ring of the polygon |
| SFCGAL::Polygon::Polygon | ( | std::unique_ptr< LineString > | exteriorRing | ) |
Constructor with an exterior ring (takes ownership).
| exteriorRing | A unique pointer to the exterior ring of the exterior ring |
| SFCGAL::Polygon::Polygon | ( | const Triangle & | triangle | ) |
Constructor with a Triangle.
| triangle | The triangle to convert to a polygon |
| SFCGAL::Polygon::Polygon | ( | const Polygon & | other | ) |
Copy constructor.
| other | The polygon to copy from |
| SFCGAL::Polygon::Polygon | ( | const CGAL::Polygon_2< Kernel > & | other | ) |
Constructor from CGAL::Polygon_2<K>.
| other | The CGAL polygon to convert |
| SFCGAL::Polygon::Polygon | ( | const CGAL::Polygon_with_holes_2< Kernel > & | poly | ) |
Constructor from CGAL::Polygon_with_holes_2<K>.
| poly | The CGAL polygon with holes to convert |
|
overridedefault |
destructor
|
override |
Accept a const geometry visitor.
| visitor | Const visitor to accept |
|
override |
Accept a geometry visitor.
| visitor | Visitor to accept |
|
inline |
append a ring to the Polygon
| ls | The line string to add as interior ring |
|
inline |
append a ring to the Polygon (take ownership)
| ls | The line string to add as interior ring |
|
inline |
Adds a ring to the Polygon.
| ring | A unique pointer to the LineString object representing the new ring to add. Ownership of this ring is moved into the Polygon. |
|
inline |
|
inline |
append a ring to the Polygon (take ownership)
| ls | Pointer to LineString to add as ring |
|
inline |
Get iterator to beginning of rings.
|
inlinenodiscard |
Get const iterator to beginning of rings.
|
nodiscardoverride |
Get the coordinate dimension.
|
override |
Drop M coordinate from all points.
|
override |
Drop Z coordinate from all points.
|
inline |
Get iterator to end of rings.
|
inlinenodiscard |
Get const iterator to end of rings.
|
inline |
[OGC/SFA]returns the exterior ring
|
inlinenodiscard |
[OGC/SFA]returns the exterior ring
|
nodiscardoverride |
Get the geometry type as string.
|
nodiscardoverride |
Get the geometry type identifier.
|
inlinenodiscard |
Test if the polygon has interior rings.
|
inline |
[OGC/SFA]returns the nth interior ring
| n | The index of the interior ring to get |
|
inlinenodiscard |
[OGC/SFA]returns the nth interior ring
| n | The index of the interior ring to get |
|
nodiscardoverride |
Check if the polygon has 3D coordinates.
|
nodiscard |
Check whether the 2D polygon is pointing up.
|
nodiscardoverride |
Check if the polygon is empty.
|
nodiscardoverride |
Check if the polygon has measured coordinates.
|
inlinenodiscard |
[OGC/SFA]returns the number of interior rings
|
inlinenodiscard |
Returns the number of rings.
assign operator
| other | The polygon to assign from |
| void SFCGAL::Polygon::reverse | ( | ) |
reverse Polygon orientation
|
inline |
Returns the n-th ring, 0 is exteriorRing.
| n | The ring index (0 for exterior ring) |
|
inlinenodiscard |
Returns the n-th ring, 0 is exteriorRing.
| n | The ring index (0 for exterior ring) |
|
inline |
Serializer.
| ar | Archive for serialization |
|
inline |
Sets the exterior ring.
| ring | The new exterior ring |
|
inline |
Sets the exterior ring (takes ownership).
| ring | The new exterior ring |
|
inline |
Sets the exterior ring.
Replaces the exterior ring with the provided one.
| ring | A unique pointer to the ring object to set. Ownership is transferred to this class. |
|
override |
Swap X and Y coordinates of all points.
|
nodiscard |
Convert to CGAL::Polygon_2.
Does not consider holes, if any
| fixOrientation | force exterior ring orientation to counter clockwise |
|
nodiscard |
Convert to CGAL::Polygon_with_holes_2.
| fixOrientation | force exterior ring orientation to counter clockwise and interior ring to clockwise. |