SFCGAL  2.2.0
Public Member Functions | List of all members
SFCGAL::Point Class Reference

A point in SFA. More...

#include <Point.h>

Inherits SFCGAL::Geometry.

Public Member Functions

 Point ()
 Empty point constructor. More...
 
 Point (const Coordinate &coordinate)
 Constructor with Coordinate. More...
 
 Point (const Kernel::FT &x, const Kernel::FT &y)
 XY Constructor with exact coordinates. More...
 
 Point (const Kernel::FT &x, const Kernel::FT &y, const Kernel::FT &z, const double &m=NaN())
 XY Constructor with exact coordinates. More...
 
 Point (const double &x, const double &y)
 XY constructor. More...
 
 Point (const double &x, const double &y, const double &z)
 XYZ constructor. More...
 
 Point (const double &x, const double &y, const double &z, const double &m)
 XYZM constructor. More...
 
 Point (const double &x, const double &y, const double &z, const double &m, CoordinateType dim)
 Generic XYZM constructor determined by CoordinateType. More...
 
 Point (const Kernel::FT &x, const Kernel::FT &y, const Kernel::FT &z, const double &m, CoordinateType dim)
 Generic XYZM constructor determined by CoordinateType. More...
 
 Point (const Kernel::Point_2 &other)
 Constructor from CGAL::Point_2<K> More...
 
 Point (const Kernel::Point_3 &other)
 Constructor from CGAL::Point_3<K> More...
 
 Point (const Point &other)
 copy constructor More...
 
Pointoperator= (const Point &other)
 assign operator More...
 
 ~Point ()
 destructor More...
 
Pointclone () const override
 
std::string geometryType () const override
 
GeometryType geometryTypeId () const override
 
int dimension () const override
 
int coordinateDimension () const override
 
bool isEmpty () const override
 
bool is3D () const override
 
bool isMeasured () const override
 
auto dropZ () -> bool override
 
auto dropM () -> bool override
 
auto swapXY () -> void override
 
Kernel::RT x () const
 Returns the x value as a double throw for empty Point. More...
 
Kernel::RT y () const
 Returns the y value as a double throw for empty Point. More...
 
Kernel::RT z () const
 Returns the z value (zero for 2D) throw for empty Point. More...
 
double m () const
 Returns the m value (NaN is not defined) More...
 
void setM (const double &m)
 Sets the m value. More...
 
bool operator< (const Point &other) const
 compare two points More...
 
bool operator== (const Point &other) const
 compare with an other point More...
 
bool operator!= (const Point &other) const
 compare with an other point More...
 
bool almostEqual (const Point &other, const double tolerance) const
 absolute comparison with an other point More...
 
void accept (GeometryVisitor &visitor) override
 
void accept (ConstGeometryVisitor &visitor) const override
 
Kernel::Vector_2 toVector_2 () const
 
Kernel::Vector_3 toVector_3 () const
 
Kernel::Point_2 toPoint_2 () const
 
Kernel::Point_3 toPoint_3 () const
 
template<int D>
detail::TypeForDimension< D >::Point toPoint_d () const
 Converts to CGAL::Point_2 or CGAL::Point_3. More...
 
Coordinatecoordinate ()
 
const Coordinatecoordinate () const
 
template<class Archive >
void serialize (Archive &ar, const unsigned int)
 Serializer. More...
 

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?

Constructor & Destructor Documentation

SFCGAL::Point::Point ( )

Empty point constructor.

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

Constructor with Coordinate.

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

XY Constructor with exact coordinates.

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

XY Constructor with exact coordinates.

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

XY constructor.

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

XYZ constructor.

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

XYZM constructor.

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

Generic XYZM constructor determined by CoordinateType.

SFCGAL::Point::Point ( const Kernel::FT &  x,
const Kernel::FT &  y,
const Kernel::FT &  z,
const double &  m,
CoordinateType  dim 
)

Generic XYZM constructor determined by CoordinateType.

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

Constructor from CGAL::Point_2<K>

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

Constructor from CGAL::Point_3<K>

SFCGAL::Point::Point ( const Point other)
default

copy constructor

SFCGAL::Point::~Point ( )
default

destructor

Member Function Documentation

void SFCGAL::Point::accept ( GeometryVisitor visitor)
override
void SFCGAL::Point::accept ( ConstGeometryVisitor visitor) const
override
auto SFCGAL::Point::almostEqual ( const Point other,
const double  tolerance 
) const

absolute comparison with an other point

auto SFCGAL::Point::clone ( ) const
override
Coordinate& SFCGAL::Point::coordinate ( )
inline
const Coordinate& SFCGAL::Point::coordinate ( ) const
inline
auto SFCGAL::Point::coordinateDimension ( ) const
override
auto SFCGAL::Point::dimension ( ) const
override
auto SFCGAL::Point::dropM ( ) -> bool
override
auto SFCGAL::Point::dropZ ( ) -> bool
override
auto SFCGAL::Point::geometryType ( ) const
override
auto SFCGAL::Point::geometryTypeId ( ) const
override
auto SFCGAL::Point::is3D ( ) const
override
auto SFCGAL::Point::isEmpty ( ) const
override
auto SFCGAL::Point::isMeasured ( ) const
override
double SFCGAL::Point::m ( ) const
inline

Returns the m value (NaN is not defined)

auto SFCGAL::Point::operator!= ( const Point other) const

compare with an other point

auto SFCGAL::Point::operator< ( const Point other) const

compare two points

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

assign operator

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

compare with an other point

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

Serializer.

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

Sets the m value.

auto SFCGAL::Point::swapXY ( ) -> void
override
Kernel::Point_2 SFCGAL::Point::toPoint_2 ( ) const
inline
Kernel::Point_3 SFCGAL::Point::toPoint_3 ( ) const
inline
template<int D>
detail::TypeForDimension<D>::Point SFCGAL::Point::toPoint_d ( ) const

Converts to CGAL::Point_2 or CGAL::Point_3.

Kernel::Vector_2 SFCGAL::Point::toVector_2 ( ) const
inline
Kernel::Vector_3 SFCGAL::Point::toVector_3 ( ) const
inline
Kernel::RT SFCGAL::Point::x ( ) const
inline

Returns the x value as a double throw for empty Point.

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

Returns the y value as a double throw for empty Point.

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

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