 |
MySQL
8.0.23
Source Code Documentation
|
Go to the documentation of this file. 1 #ifndef SQL_GIS_GEOMETRIES_H_INCLUDED
2 #define SQL_GIS_GEOMETRIES_H_INCLUDED
90 class Geometry_visitor;
152 return (std::isnan(
m_x) || std::isnan(
m_y));
161 template <std::
size_t K>
184 template <std::
size_t K>
227 return (lhs.
x() < rhs.
x()) || (lhs.
x() == rhs.
x() && lhs.
y() < rhs.
y());
271 virtual std::size_t
size()
const = 0;
277 virtual const
Point &operator[](
std::
size_t i) const = 0;
335 virtual std::size_t
size()
const = 0;
382 virtual std::size_t
size()
const = 0;
456 #endif // SQL_GIS_GEOMETRIES_H_INCLUDED
bool accept(Geometry_visitor *v) override=0
Applies a hierarchical visitor to this geometry.
virtual std::size_t size() const =0
Returns the size of (number of points in) the linestring.
const char * type_to_name(Geometry_type type)
Get the type name string corresponding to a geometry type.
Definition: geometries.cc:629
virtual Linearring & exterior_ring()=0
Returns the exterior ring of the polygon.
A colletion of linestrings.
Definition: geometries.h:421
bool operator<(const Point &lhs, const Point &rhs)
Compares two points.
Definition: geometries.h:226
A ring-shaped linestring.
Definition: geometries.h:287
Geometry_type type() const override
Gets the geometry type of the object.
Definition: geometries.h:443
Ring_direction
Direction of a ring.
Definition: geometries.h:77
virtual void push_back(const Linearring &lr)=0
Adds a linear ring to the polygon.
double get() const
Gets a coordinate value.
Geometry_type
Types of geometry objects.
Definition: geometries.h:52
bool accept(Geometry_visitor *v) override=0
Applies a hierarchical visitor to this geometry.
bool accept(Geometry_visitor *v) override=0
Applies a hierarchical visitor to this geometry.
Geometry_type type() const override
Gets the geometry type of the object.
Definition: geometries.h:423
double m_x
First coordinate (X or longitude).
Definition: geometries.h:206
bool accept(Geometry_visitor *v) override=0
Applies a hierarchical visitor to this geometry.
virtual bool empty() const =0
Checks if the linestring is empty.
double y() const
Gets the second coordinate value.
Definition: geometries.cc:47
Point(double x, double y)
Definition: geometries.h:148
Geometry_type type() const override=0
Gets the geometry type of the object.
double x() const
Gets the first coordinate value.
Definition: geometries.cc:45
bool is_empty() const override
Check if this is an empty geometry.
Definition: geometries.h:151
virtual void push_back(Geometry &&g)=0
Abstract superclass for all geometric objects.
Definition: geometries.h:99
virtual bool empty() const =0
Checks if the collection is empty.
int n
Definition: xcom_base.cc:445
A string of connected line segments.
Definition: geometries.h:247
An abstract 2d curve.
Definition: geometries.h:233
Coordinate_system
Types of coordinate systems.
Definition: geometries.h:68
A collection of polygons.
Definition: geometries.h:441
virtual bool is_empty() const =0
Check if this is an empty geometry.
@ kCartesian
A Cartesian plane with the same unit in both directions.
bool is_empty() const override
Check if this is an empty geometry.
Definition: geometries.h:313
virtual Geometry_type type() const =0
Gets the geometry type of the object.
Geometry_type type() const override
Gets the geometry type of the object.
Definition: geometries.h:311
virtual void push_back(Point &&pt)=0
bool accept(Geometry_visitor *v) override=0
Applies a hierarchical visitor to this geometry.
void set(double d)
Sets a coordinate.
bool accept(Geometry_visitor *v) override=0
Applies a hierarchical visitor to this geometry.
An abstract collection of surfaces.
Definition: geometries.h:432
virtual void push_back(Linearring &&lr)=0
Geometry_type type() const override
Gets the geometry type of the object.
Definition: geometries.h:249
virtual ~Geometry()=default
Geometry_type type() const override
Gets the geometry type of the object.
Definition: geometries.h:149
virtual std::size_t size() const =0
Returns the size of the polygon.
Abstract visitor class to be used on class Geometry and descendants.
Definition: geometry_visitor.h:45
bool accept(Geometry_visitor *v) override=0
Applies a hierarchical visitor to this geometry.
bool accept(Geometry_visitor *v) override=0
Applies a hierarchical visitor to this geometry.
An abstract 2d surface.
Definition: geometries.h:295
Geometry_type type() const override=0
Gets the geometry type of the object.
double m_y
Second coordinate (Y or latitude).
Definition: geometries.h:212
Geometry_type type() const override
Gets the geometry type of the object.
Definition: geometries.h:362
A collection of geometries.
Definition: geometries.h:360
Geometry(const Geometry &)=default
Geometry & operator=(const Geometry &)=default
virtual Linearring & interior_ring(std::size_t n)=0
Returns an interior ring of the polygon.
A 2d point.
Definition: geometries.h:145
A collection of points.
Definition: geometries.h:402
Geometry_type type() const override
Gets the geometry type of the object.
Definition: geometries.h:404
Point()
Definition: geometries.h:147
virtual bool empty() const =0
Checks if the polygon is empty.
Definition: varlen_sort.h:182
virtual void push_back(const Geometry &g)=0
Adds a geometry to the collection.
ssize_t count
Definition: memcached.c:386
bool accept(Geometry_visitor *v) override
Applies a hierarchical visitor to this geometry.
Definition: geometries.cc:33
Geometry_type type() const override=0
Gets the geometry type of the object.
bool accept(Geometry_visitor *v) override=0
Applies a hierarchical visitor to this geometry.
bool is_empty() const override
Check if this is an empty geometry.
Definition: geometries.h:251
Geometry_type type() const override=0
Gets the geometry type of the object.
virtual void clear() noexcept=0
Removes all geometries from the geometrycollection.
bool accept(Geometry_visitor *v) override=0
Applies a hierarchical visitor to this geometry.
virtual bool accept(Geometry_visitor *v)=0
Applies a hierarchical visitor to this geometry.
@ kGeographic
An ellipsoidal system with longitude and latitude coordinates, both in the same unit.
A polygon consisting of an outer ring and zero or more interior rings defining holes in the polygon.
Definition: geometries.h:309
An abstract collection of curves.
Definition: geometries.h:412
virtual std::size_t size() const =0
Returns the size of the geometrycollection.
bool accept(Geometry_visitor *v) override=0
Applies a hierarchical visitor to this geometry.
virtual void resize(std::size_t count)=0
Resizes the geometrycollection to contain a given number of elements.
virtual void clear() noexcept=0
Removes all points from the linestring.
virtual Coordinate_system coordinate_system() const =0
Gets the coordinate system.
virtual void push_back(const Point &pt)=0
Adds a point to the end of the linestring.