MySQL 8.3.0
Source Code Documentation
gis::Cartesian_polygon Class Reference

A Cartesian 2d polygon. More...

#include <geometries_cs.h>

Inheritance diagram for gis::Cartesian_polygon:
[legend]

Public Member Functions

 Cartesian_polygon ()
 
Coordinate_system coordinate_system () const override
 Gets the coordinate system. More...
 
bool accept (Geometry_visitor *v) override
 Applies a hierarchical visitor to this geometry. More...
 
void push_back (const Linearring &lr) override
 Adds a linear ring to the polygon. More...
 
void push_back (Linearring &&lr) override
 
bool empty () const override
 Checks if the polygon is empty. More...
 
Cartesian_polygonclone () const override
 
decltype(m_interior_rings) & interior_rings ()
 Get list of interior rings. More...
 
decltype(m_interior_rings) const & const_interior_rings () const
 Get list of interior rings. More...
 
std::size_t size () const override
 Returns the size of the polygon. More...
 
Cartesian_linearringcartesian_exterior_ring () const
 Get the exterior ring. More...
 
Linearringexterior_ring () override
 Returns the exterior ring of the polygon. More...
 
Linearringinterior_ring (std::size_t n) override
 Returns an interior ring of the polygon. More...
 
- Public Member Functions inherited from gis::Polygon
Geometry_type type () const override
 Gets the geometry type of the object. More...
 
bool is_empty () const override
 Check if this is an empty geometry. More...
 
- Public Member Functions inherited from gis::Geometry
 Geometry ()=default
 
virtual ~Geometry ()=default
 
 Geometry (const Geometry &)=default
 
Geometryoperator= (const Geometry &)=default
 

Private Attributes

Cartesian_linearring m_exterior_ring
 Exterior ring. More...
 
std::vector< Cartesian_linearring, Malloc_allocator< Cartesian_linearring > > m_interior_rings
 Interior rings (holes). More...
 

Additional Inherited Members

- Static Public Member Functions inherited from gis::Polygon
static Polygoncreate_polygon (Coordinate_system coordinate_system)
 Creates a subclass of Polygon from a Coordinate_system. More...
 

Detailed Description

A Cartesian 2d polygon.

Constructor & Destructor Documentation

◆ Cartesian_polygon()

gis::Cartesian_polygon::Cartesian_polygon ( )
inline

Member Function Documentation

◆ accept()

bool gis::Cartesian_polygon::accept ( Geometry_visitor v)
overridevirtual

Applies a hierarchical visitor to this geometry.

See also
gis::Geometry_visitor
Parameters
vA hierarchical visitor.
Return values
trueThe execution was aborted by the visitor.
falseThe execution completed.

Implements gis::Polygon.

◆ cartesian_exterior_ring()

Cartesian_linearring & gis::Cartesian_polygon::cartesian_exterior_ring ( ) const

Get the exterior ring.

This function is used by the interface to Boost.Geometry.

Returns
The exterior ring.

◆ clone()

Cartesian_polygon * gis::Cartesian_polygon::clone ( ) const
inlineoverridevirtual

Implements gis::Polygon.

◆ const_interior_rings()

decltype(m_interior_rings) const & gis::Cartesian_polygon::const_interior_rings ( ) const

Get list of interior rings.

This function is used by the interface to Boost.Geometry.

Returns
The list of interior rings

◆ coordinate_system()

Coordinate_system gis::Cartesian_polygon::coordinate_system ( ) const
inlineoverridevirtual

Gets the coordinate system.

Returns
The coordinate system type.

Implements gis::Geometry.

◆ empty()

bool gis::Cartesian_polygon::empty ( ) const
overridevirtual

Checks if the polygon is empty.

The polygon is considered empty if it has no rings.

Return values
trueThe polygon is empty.
falseThe polygon is not empty.

Implements gis::Polygon.

◆ exterior_ring()

Linearring & gis::Cartesian_polygon::exterior_ring ( )
inlineoverridevirtual

Returns the exterior ring of the polygon.

Note
If the polygon currently has no exterior ring, an empty one is added.
Returns
The exterior ring.

Implements gis::Polygon.

◆ interior_ring()

Linearring & gis::Cartesian_polygon::interior_ring ( std::size_t  n)
overridevirtual

Returns an interior ring of the polygon.

Parameters
nRing number, zero indexed.
Returns
The interior ring.

Implements gis::Polygon.

◆ interior_rings()

decltype(m_interior_rings) & gis::Cartesian_polygon::interior_rings ( )

Get list of interior rings.

This function is used by the interface to Boost.Geometry.

Returns
The list of interior rings

◆ push_back() [1/2]

void gis::Cartesian_polygon::push_back ( const Linearring lr)
overridevirtual

Adds a linear ring to the polygon.

The first ring will become the exterior ring. All following rings will be interior rings (holes).

Parameters
lrThe linear ring to add.

Implements gis::Polygon.

◆ push_back() [2/2]

void gis::Cartesian_polygon::push_back ( Linearring &&  lr)
overridevirtual

Implements gis::Polygon.

◆ size()

std::size_t gis::Cartesian_polygon::size ( ) const
overridevirtual

Returns the size of the polygon.

Returns
Number of rings in the polygon (exterior + interior).

Implements gis::Polygon.

Member Data Documentation

◆ m_exterior_ring

Cartesian_linearring gis::Cartesian_polygon::m_exterior_ring
private

Exterior ring.

◆ m_interior_rings

std::vector<Cartesian_linearring, Malloc_allocator<Cartesian_linearring> > gis::Cartesian_polygon::m_interior_rings
private

Interior rings (holes).


The documentation for this class was generated from the following files: