MySQL 8.0.40
Source Code Documentation
gis::Ring_flip_visitor Class Reference

A visitor that flips polygon rings so that exterior rings are in a counter-clockwise direction and interior rings in a clockwise direction. More...

#include <ring_flip_visitor.h>

Inheritance diagram for gis::Ring_flip_visitor:
[legend]

Public Member Functions

 Ring_flip_visitor (double semi_major, double semi_minor)
 Construct a new ring flip visitor. More...
 
bool invalid () const
 Check if anything wrong has been detected, either an invalid ellipsoid or a ring with an unknown direction. More...
 
bool visit_enter (Polygon *py) override
 
bool visit_enter (Multipolygon *py) override
 
bool visit_enter (Multipoint *) override
 
bool visit_enter (Multilinestring *) override
 
bool visit_enter (Geometry *) override
 Enters a compound geometry. More...
 
bool visit_enter (Curve *c) override
 
bool visit_enter (Linestring *ls) override
 
bool visit_enter (Linearring *lr) override
 
bool visit_enter (Surface *s) override
 
bool visit_enter (Polygon *py) override
 
bool visit_enter (Geometrycollection *gc) override
 
bool visit_enter (Multipoint *mpt) override
 
bool visit_enter (Multicurve *mc) override
 
bool visit_enter (Multilinestring *mls) override
 
bool visit_enter (Multisurface *ms) override
 
bool visit_enter (Multipolygon *mpy) override
 
- Public Member Functions inherited from gis::Nop_visitor
bool visit (Geometry *) override
 Visits a geometry. More...
 
bool visit (Point *pt) override
 
bool visit (Curve *c) override
 
bool visit (Linestring *ls) override
 
bool visit (Linearring *lr) override
 
bool visit (Surface *s) override
 
bool visit (Polygon *py) override
 
bool visit (Geometrycollection *gc) override
 
bool visit (Multipoint *mpt) override
 
bool visit (Multicurve *mc) override
 
bool visit (Multilinestring *mls) override
 
bool visit (Multisurface *ms) override
 
bool visit (Multipolygon *mpy) override
 
bool visit_leave (Geometry *) override
 Leaves a compound geometry. More...
 
bool visit_leave (Curve *c) override
 
bool visit_leave (Linestring *ls) override
 
bool visit_leave (Linearring *lr) override
 
bool visit_leave (Surface *s) override
 
bool visit_leave (Polygon *py) override
 
bool visit_leave (Geometrycollection *gc) override
 
bool visit_leave (Multipoint *mpt) override
 
bool visit_leave (Multicurve *mc) override
 
bool visit_leave (Multilinestring *mls) override
 
bool visit_leave (Multisurface *ms) override
 
bool visit_leave (Multipolygon *mpy) override
 
- Public Member Functions inherited from gis::Geometry_visitor
 Geometry_visitor ()=default
 
virtual ~Geometry_visitor ()=default
 

Private Attributes

std::unique_ptr< boost::geometry::strategy::area::geographic<> > m_geographic_strategy
 Strategy used for geographic SRSs. More...
 
bool m_invalid
 Whether the geometry is invalid. More...
 

Detailed Description

A visitor that flips polygon rings so that exterior rings are in a counter-clockwise direction and interior rings in a clockwise direction.

Invalid polygon rings are not guaranteed to be flipped to the correct direction.

Constructor & Destructor Documentation

◆ Ring_flip_visitor()

gis::Ring_flip_visitor::Ring_flip_visitor ( double  semi_major,
double  semi_minor 
)
inline

Construct a new ring flip visitor.

Parameters
[in]semi_majorThe semi-major axis of the ellipsoid.
[in]semi_minorThe semi-minor axis of the ellipsoid.

Member Function Documentation

◆ invalid()

bool gis::Ring_flip_visitor::invalid ( ) const
inline

Check if anything wrong has been detected, either an invalid ellipsoid or a ring with an unknown direction.

Polygon rings which direction can't be determined are invalid. This is the only way this visitor detects invalid rings. Other invalid rings, e.g., rings crossing themselves, are not necessarily detected.

Return values
trueInvalid SRS ellipsoid or invalid polygon ring.
falseNo invalid rings detected, but the geometry may still be invalid.

◆ visit_enter() [1/16]

bool gis::Nop_visitor::visit_enter ( Curve c)
inlineoverridevirtual

Reimplemented from gis::Nop_visitor.

◆ visit_enter() [2/16]

bool gis::Nop_visitor::visit_enter ( Geometry g)
inlineoverridevirtual

Enters a compound geometry.

This is called on entry to a compound geometry, i.e., all geometries except points.

Parameters
gThe geometry to visit.
Return values
trueDon't descend into children.
falseDescend into children.

Reimplemented from gis::Nop_visitor.

◆ visit_enter() [3/16]

bool gis::Nop_visitor::visit_enter ( Geometrycollection gc)
inlineoverridevirtual

Reimplemented from gis::Nop_visitor.

◆ visit_enter() [4/16]

bool gis::Nop_visitor::visit_enter ( Linearring lr)
inlineoverridevirtual

Reimplemented from gis::Nop_visitor.

◆ visit_enter() [5/16]

bool gis::Nop_visitor::visit_enter ( Linestring ls)
inlineoverridevirtual

Reimplemented from gis::Nop_visitor.

◆ visit_enter() [6/16]

bool gis::Nop_visitor::visit_enter ( Multicurve mc)
inlineoverridevirtual

Reimplemented from gis::Nop_visitor.

◆ visit_enter() [7/16]

bool gis::Ring_flip_visitor::visit_enter ( Multilinestring )
inlineoverridevirtual

Reimplemented from gis::Nop_visitor.

◆ visit_enter() [8/16]

bool gis::Nop_visitor::visit_enter ( Multilinestring mls)
inlineoverridevirtual

Reimplemented from gis::Nop_visitor.

◆ visit_enter() [9/16]

bool gis::Ring_flip_visitor::visit_enter ( Multipoint )
inlineoverridevirtual

Reimplemented from gis::Nop_visitor.

◆ visit_enter() [10/16]

bool gis::Nop_visitor::visit_enter ( Multipoint mpt)
inlineoverridevirtual

Reimplemented from gis::Nop_visitor.

◆ visit_enter() [11/16]

bool gis::Nop_visitor::visit_enter ( Multipolygon mpy)
inlineoverridevirtual

Reimplemented from gis::Nop_visitor.

◆ visit_enter() [12/16]

bool gis::Ring_flip_visitor::visit_enter ( Multipolygon py)
overridevirtual

Reimplemented from gis::Nop_visitor.

◆ visit_enter() [13/16]

bool gis::Nop_visitor::visit_enter ( Multisurface ms)
inlineoverridevirtual

Reimplemented from gis::Nop_visitor.

◆ visit_enter() [14/16]

bool gis::Nop_visitor::visit_enter ( Polygon py)
inlineoverridevirtual

Reimplemented from gis::Nop_visitor.

◆ visit_enter() [15/16]

bool gis::Ring_flip_visitor::visit_enter ( Polygon py)
overridevirtual

Reimplemented from gis::Nop_visitor.

◆ visit_enter() [16/16]

bool gis::Nop_visitor::visit_enter ( Surface s)
inlineoverridevirtual

Reimplemented from gis::Nop_visitor.

Member Data Documentation

◆ m_geographic_strategy

std::unique_ptr<boost::geometry::strategy::area::geographic<> > gis::Ring_flip_visitor::m_geographic_strategy
private

Strategy used for geographic SRSs.

◆ m_invalid

bool gis::Ring_flip_visitor::m_invalid
private

Whether the geometry is invalid.

That happens either if the ellipsoid of a geographic SRS is invalid or if we encounter a ring with unknown direction.


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