Skip to content

Class SFCGAL::Point

ClassList > SFCGAL > Point

More...

  • #include <Point.h>

Inherits the following classes: SFCGAL::Geometry

Public Functions

Type Name
Point ()
Point (const Coordinate & coordinate)
Point (const Kernel::FT & x, const Kernel::FT & y)
Point (const Kernel::FT & x, const Kernel::FT & y, const Kernel::FT & z, const double & m=NaN())
Point (const double & x, const double & y)
Point (const double & x, const double & y, const double & z)
Point (const double & x, const double & y, const double & z, const double & m)
Point (const Kernel::Point_2 & other)
Point (const Kernel::Point_3 & other)
Point (const Point & other)
virtual void accept (GeometryVisitor & visitor)
[visitor]dispatch visitor
virtual void accept (ConstGeometryVisitor & visitor) const
[visitor]dispatch visitor
bool almostEqual (const Point & other, const double tolerance) const
virtual Point * clone () const
Get a deep copy of the geometry.
Coordinate & coordinate ()
const Coordinate & coordinate () const
virtual int coordinateDimension () const
virtual int dimension () const
virtual std::string geometryType () const
[OGC/SFA]returns the geometry type
virtual GeometryType geometryTypeId () const
Returns a code corresponding to the type.
virtual bool is3D () const
virtual bool isEmpty () const
virtual bool isMeasured () const
double m () const
bool operator!= (const Point & other) const
bool operator< (const Point & other) const
Point & operator= (const Point & other)
bool operator== (const Point & other) const
void serialize (Archive & ar, const unsigned int)
void setM (const double & m)
Kernel::Point_2 toPoint_2 () const
Kernel::Point_3 toPoint_3 () const
detail::TypeForDimension< D >::Point toPoint_d () const
Converts to CGAL::Point_2 or CGAL::Point_3.
auto toPoint_d () const
Kernel::Vector_2 toVector_2 () const
Kernel::Vector_3 toVector_3 () const
Kernel::RT x () const
Kernel::RT y () const
Kernel::RT z () const
~Point ()

Public Functions inherited from SFCGAL::Geometry

See SFCGAL::Geometry

Type Name
Geometry ()
Default constructor.
Geometry (const Geometry &) = default
Copy constructor.
virtual void accept (GeometryVisitor & visitor) = 0
[visitor]dispatch visitor
virtual void accept (ConstGeometryVisitor & visitor) const = 0
[visitor]dispatch visitor
auto almostEqual (const Geometry & other, const double tolerance) const
const Derived & as () const
Downcast to a "Derived" class.
Derived & as ()
Downcast to a "Derived" class.
std::string asText (const int & numDecimals=-1) const
std::string asWkb (boost::endian::order wkbOrder=boost::endian::order::native, bool asHex=false) const
virtual std::unique_ptr< Geometry > boundary () const
[OGC/SFA]Returns the boundary of the geometry
virtual Geometry * clone () const = 0
Get a deep copy of the geometry.
virtual int coordinateDimension () const = 0
virtual int dimension () const = 0
double distance (const Geometry & other) const
Computes the distance to an other geometry.
double distance3D (const Geometry & other) const
Computes the 3D distance to an other geometry.
Envelope envelope () const
void forceValidityFlag (bool validity)
virtual const Geometry & geometryN (size_t const & n) const
[OGC/SFA]Returns the n-th geometry
virtual Geometry & geometryN (size_t const & n)
[OGC/SFA]Returns the n-th geometry
virtual std::string geometryType () const = 0
[OGC/SFA]returns the geometry type
virtual GeometryType geometryTypeId () const = 0
Returns a code corresponding to the type.
bool hasValidityFlag () const
bool is () const
Tests if geometry is of "Derived" type given as template parameter.
virtual bool is3D () const = 0
virtual bool isEmpty () const = 0
virtual bool isMeasured () const = 0
virtual size_t numGeometries () const
[OGC/SFA]Gets the number of geometries in a collection of geometries
Geometry & operator= (const Geometry & other) = default
Copy assignemnt operator.
void round (const long & scale=1)
round the geometry with a corresponding scale factor
void serialize (Archive &, const unsigned int)
virtual ~Geometry () = default
Destructor.

Protected Attributes inherited from SFCGAL::Geometry

See SFCGAL::Geometry

Type Name
bool validityFlag_ = = false

Detailed Description

A point in SFA.

The x(),y(),z() interface is based on CGAL kernel requirements, taken from examples/Kernel_23/MyPointC2.h

Todo

strong typing on coordinate dimension?

Public Functions Documentation

function Point [1/10]

SFCGAL::Point::Point () 

Empty point constructor


function Point [2/10]

SFCGAL::Point::Point (
    const Coordinate & coordinate
) 

Constructor with Coordinate


function Point [3/10]

SFCGAL::Point::Point (
    const Kernel::FT & x,
    const Kernel::FT & y
) 

XY Constructor with exact coordinates


function Point [4/10]

SFCGAL::Point::Point (
    const Kernel::FT & x,
    const Kernel::FT & y,
    const Kernel::FT & z,
    const double & m=NaN ()
) 

XY Constructor with exact coordinates


function Point [5/10]

SFCGAL::Point::Point (
    const double & x,
    const double & y
) 

XY constructor


function Point [6/10]

SFCGAL::Point::Point (
    const double & x,
    const double & y,
    const double & z
) 

XYZ constructor


function Point [7/10]

SFCGAL::Point::Point (
    const double & x,
    const double & y,
    const double & z,
    const double & m
) 

XYZM constructor


function Point [8/10]

SFCGAL::Point::Point (
    const Kernel::Point_2 & other
) 

Constructor from CGAL::Point_2<K>


function Point [9/10]

SFCGAL::Point::Point (
    const Kernel::Point_3 & other
) 

Constructor from CGAL::Point_3<K>


function Point [10/10]

SFCGAL::Point::Point (
    const Point & other
) 

copy constructor


function accept [1/2]

virtual void SFCGAL::Point::accept (
    GeometryVisitor & visitor
) 

Implements SFCGAL::Geometry::accept


function accept [2/2]

virtual void SFCGAL::Point::accept (
    ConstGeometryVisitor & visitor
) const

Implements SFCGAL::Geometry::accept


function almostEqual

bool SFCGAL::Point::almostEqual (
    const Point & other,
    const double tolerance
) const

absolute comparison with an other point


function clone

virtual Point * SFCGAL::Point::clone () const

Implements SFCGAL::Geometry::clone


function coordinate [1/2]

inline Coordinate & SFCGAL::Point::coordinate () 

function coordinate [2/2]

inline const Coordinate & SFCGAL::Point::coordinate () const

function coordinateDimension

virtual int SFCGAL::Point::coordinateDimension () const

[OGC/SFA]returns the dimension of the coordinates

Precondition:

suppose no mix of 2D/3D coordinates

Implements SFCGAL::Geometry::coordinateDimension


function dimension

virtual int SFCGAL::Point::dimension () const

[OGC/SFA]Dimension of the Geometry ( 0 : punctual, 1 : curve, ...)

Warning:

empty geometries provide the dimension corresponding to the object

Implements SFCGAL::Geometry::dimension


function geometryType

[OGC/SFA]returns the geometry type

virtual std::string SFCGAL::Point::geometryType () const

Warning:

use CamelCase (LineString, not LINESTRING)

Implements SFCGAL::Geometry::geometryType


function geometryTypeId

Returns a code corresponding to the type.

virtual GeometryType SFCGAL::Point::geometryTypeId () const

Warning:

not standard

Implements SFCGAL::Geometry::geometryTypeId


function is3D

virtual bool SFCGAL::Point::is3D () const

[OGC/SFA]test if geometry is 3d

Precondition:

suppose no mix of 2D/3D coordinates

Implements SFCGAL::Geometry::is3D


function isEmpty

virtual bool SFCGAL::Point::isEmpty () const

[OGC/SFA]test if geometry is empty

Implements SFCGAL::Geometry::isEmpty


function isMeasured

virtual bool SFCGAL::Point::isMeasured () const

[OGC/SFA]test if geometry is measured (has an m)

Precondition:

suppose no mix of M/!M points

Implements SFCGAL::Geometry::isMeasured


function m

inline double SFCGAL::Point::m () const

Returns the m value (NaN is not defined)


function operator!=

bool SFCGAL::Point::operator!= (
    const Point & other
) const

compare with an other point


function operator<

bool SFCGAL::Point::operator< (
    const Point & other
) const

compare two points


function operator=

Point & SFCGAL::Point::operator= (
    const Point & other
) 

assign operator


function operator==

bool SFCGAL::Point::operator== (
    const Point & other
) const

compare with an other point


function serialize

template<class Archive>
inline void SFCGAL::Point::serialize (
    Archive & ar,
    const unsigned int
) 

Serializer


function setM

inline void SFCGAL::Point::setM (
    const double & m
) 

Sets the m value


function toPoint_2

inline Kernel::Point_2 SFCGAL::Point::toPoint_2 () const

See also: Coordinate::toPoint_2()


function toPoint_3

inline Kernel::Point_3 SFCGAL::Point::toPoint_3 () const

See also: Coordinate::toPoint_3()


function toPoint_d [1/2]

template<int D>
detail::TypeForDimension < D > ::Point SFCGAL::Point::toPoint_d () const

function toPoint_d [2/2]

template<int Dim>
auto SFCGAL::Point::toPoint_d () const

function toVector_2

inline Kernel::Vector_2 SFCGAL::Point::toVector_2 () const

See also: Coordinate::toVector_2()


function toVector_3

inline Kernel::Vector_3 SFCGAL::Point::toVector_3 () const

See also: Coordinate::toVector_3()


function x

inline Kernel::RT SFCGAL::Point::x () const

Returns the x value as a double throw for empty Point


function y

inline Kernel::RT SFCGAL::Point::y () const

Returns the y value as a double throw for empty Point


function z

inline Kernel::RT SFCGAL::Point::z () const

Returns the z value (zero for 2D) throw for empty Point


function ~Point

SFCGAL::Point::~Point () 

destructor



The documentation for this class was generated from the following file /builds/sfcgal/SFCGAL/src/Point.h