MySQL  8.0.22
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:
gis::Nop_visitor gis::Geometry_visitor

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
 
- Public Member Functions inherited from gis::Nop_visitor
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 (Geometrycollection *gc) override
 
bool visit_enter (Multicurve *mc) override
 
bool visit_enter (Multisurface *ms) override
 
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 ()
 
virtual ~Geometry_visitor ()
 

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/4]

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

Reimplemented from gis::Nop_visitor.

◆ visit_enter() [2/4]

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

Reimplemented from gis::Nop_visitor.

◆ visit_enter() [3/4]

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

Reimplemented from gis::Nop_visitor.

◆ visit_enter() [4/4]

bool gis::Ring_flip_visitor::visit_enter ( Multilinestring )
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: