|
SFCGAL
2.3.0
|
A Polygon in SFA with holes. More...
#include <Polygon.h>
Inherits SFCGAL::GeometryImpl< Derived, Base >.
Public Types | |
| using | iterator = DereferenceIterator< std::vector< std::unique_ptr< LineString >>::iterator > |
| Iterator type for polygon rings. More... | |
| using | const_iterator = DereferenceIterator< std::vector< std::unique_ptr< LineString >>::const_iterator > |
| Const iterator type for polygon rings. More... | |
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 (std::unique_ptr< 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_2<K> More... | |
| Polygon (const CGAL::Polygon_with_holes_2< Kernel > &poly) | |
| Constructor from CGAL::Polygon_with_holes_2<K> More... | |
| auto | operator= (Polygon other) -> Polygon & |
| assign operator More... | |
| ~Polygon () override | |
| destructor More... | |
| auto | geometryType () const -> std::string override |
| Get the geometry type as string. More... | |
| auto | geometryTypeId () const -> GeometryType override |
| Get the geometry type identifier. More... | |
| auto | coordinateDimension () const -> int override |
| Get the coordinate dimension. More... | |
| auto | isEmpty () const -> bool override |
| Check if the polygon is empty. More... | |
| auto | is3D () const -> bool override |
| Check if the polygon has 3D coordinates. More... | |
| auto | isMeasured () const -> bool override |
| Check if the polygon has measured coordinates. More... | |
| auto | dropZ () -> bool override |
| Drop Z coordinate from all points. More... | |
| auto | dropM () -> bool override |
| Drop M coordinate from all points. More... | |
| auto | swapXY () -> void override |
| Swap X and Y coordinates of all points. More... | |
| auto | isCounterClockWiseOriented () const -> bool |
| Check whether the 2D polygon is pointing up. More... | |
| void | reverse () |
| reverse Polygon orientation More... | |
| auto | exteriorRing () const -> const LineString & |
| [OGC/SFA]returns the exterior ring More... | |
| auto | exteriorRing () -> LineString & |
| [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... | |
| void | setExteriorRing (std::unique_ptr< LineString > ring) |
| Sets the exterior ring. More... | |
| auto | hasInteriorRings () const -> bool |
| Test if the polygon has interior rings. More... | |
| auto | numInteriorRings () const -> size_t |
| [OGC/SFA]returns the number of interior rings More... | |
| auto | interiorRingN (const size_t &n) const -> const LineString & |
| [OGC/SFA]returns the nth interior ring More... | |
| auto | interiorRingN (const size_t &n) -> LineString & |
| [OGC/SFA]returns the nth interior ring More... | |
| auto | numRings () const -> size_t |
| Returns the number of rings. More... | |
| auto | ringN (const size_t &n) const -> const LineString & |
| Returns the n-th ring, 0 is exteriorRing. More... | |
| auto | ringN (const size_t &n) -> LineString & |
| 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 | addInteriorRing (std::unique_ptr< LineString > ring) |
| Adds a ring to the Polygon. 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... | |
| auto | begin () -> iterator |
| Get iterator to beginning of rings. More... | |
| auto | begin () const -> const_iterator |
| Get const iterator to beginning of rings. More... | |
| auto | end () -> iterator |
| Get iterator to end of rings. More... | |
| auto | end () const -> const_iterator |
| Get const iterator to end of rings. More... | |
| auto | toPolygon_2 (bool fixOrientation=true) const -> CGAL::Polygon_2< Kernel > |
| Convert to CGAL::Polygon_2. More... | |
| auto | toPolygon_with_holes_2 (bool fixOrientation=true) const -> CGAL::Polygon_with_holes_2< Kernel > |
| Convert to CGAL::Polygon_with_holes_2. More... | |
| void | accept (GeometryVisitor &visitor) override |
| Accept a geometry visitor. More... | |
| void | accept (ConstGeometryVisitor &visitor) const override |
| Accept a const geometry visitor. More... | |
| template<class Archive > | |
| void | serialize (Archive &ar, const unsigned int) |
| Serializer. More... | |
A Polygon in SFA with holes.
| using SFCGAL::Polygon::const_iterator = DereferenceIterator< std::vector<std::unique_ptr<LineString>>::const_iterator> |
Const iterator type for polygon rings.
| using SFCGAL::Polygon::iterator = DereferenceIterator<std::vector<std::unique_ptr<LineString>>::iterator> |
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 geometry visitor.
| visitor | Visitor to accept |
|
override |
Accept a const geometry visitor.
| visitor | Const 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.
|
inline |
Get const iterator to beginning of rings.
|
override |
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.
|
inline |
Get const iterator to end of rings.
|
inline |
[OGC/SFA]returns the exterior ring
|
inline |
[OGC/SFA]returns the exterior ring
|
override |
Get the geometry type as string.
|
override |
Get the geometry type identifier.
|
inline |
Test if the polygon has interior rings.
|
inline |
[OGC/SFA]returns the nth interior ring
| n | The index of the interior ring to get |
|
inline |
[OGC/SFA]returns the nth interior ring
| n | The index of the interior ring to get |
|
override |
Check if the polygon has 3D coordinates.
| auto SFCGAL::Polygon::isCounterClockWiseOriented | ( | ) | const -> bool |
Check whether the 2D polygon is pointing up.
|
override |
Check if the polygon is empty.
|
override |
Check if the polygon has measured coordinates.
|
inline |
[OGC/SFA]returns the number of interior rings
|
inline |
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) |
|
inline |
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.
| auto SFCGAL::Polygon::toPolygon_2 | ( | bool | fixOrientation = true | ) | const -> CGAL::Polygon_2<Kernel> |
Convert to CGAL::Polygon_2.
Does not consider holes, if any
| fixOrientation | force exterior ring orientation to counter clockwise |
| auto SFCGAL::Polygon::toPolygon_with_holes_2 | ( | bool | fixOrientation = true | ) | const -> CGAL::Polygon_with_holes_2<Kernel> |
Convert to CGAL::Polygon_with_holes_2.
| fixOrientation | force exterior ring orientation to counter clockwise and interior ring to clockwise. |
1.8.10