SFCGAL
Classes | Public Member Functions | List of all members
SFCGAL::Coordinate Class Reference

Represents the Coordinate of a Point (wraps either an empty structure, or a Kernel::Point_2, or a Kernel::Point_3) More...

#include <Coordinate.h>

Classes

class  Empty
 

Public Member Functions

 Coordinate ()
 Empty Coordinate constructor. More...
 
 Coordinate (const Kernel::FT &x, const Kernel::FT &y)
 XY Constructor with exact coordinates. More...
 
 Coordinate (const Kernel::FT &x, const Kernel::FT &y, const Kernel::FT &z)
 XYZ Constructor with exact coordinates. More...
 
 Coordinate (const double &x, const double &y, const double &z)
 XYZ constructor. More...
 
 Coordinate (const double &x, const double &y)
 XY constructor. More...
 
 Coordinate (const Kernel::Point_2 &other)
 Constructor from CGAL::Point_2<K> More...
 
 Coordinate (const Kernel::Point_3 &other)
 Constructor from CGAL::Point_3<K> More...
 
 Coordinate (const Coordinate &other)
 copy constructor More...
 
Coordinateoperator= (const Coordinate &other)
 assign operator More...
 
 ~Coordinate ()
 destructor More...
 
int coordinateDimension () const
 Get the dimension of the coordinates. More...
 
bool isEmpty () const
 Tests if the coordinates are empty. More...
 
bool is3D () const
 Tests if Z is defined. More...
 
Kernel::FT x () const
 Gets the x value. More...
 
Kernel::FT y () const
 Gets the y value. More...
 
Kernel::FT z () const
 Gets the z value. More...
 
Coordinateround (const long &scaleFactor=1)
 round coordinates with a scale factor More...
 
bool operator< (const Coordinate &other) const
 Compares two points (lexicographic order) More...
 
bool operator== (const Coordinate &other) const
 Compares with an other point. More...
 
bool operator!= (const Coordinate &other) const
 Compares with an other point. More...
 
bool almostEqual (const Coordinate &other, const double tolerance) const
 absolute comparison with an other coordinate More...
 
Kernel::Vector_2 toVector_2 () const
 Converts to Kernel::Vector_2. More...
 
Kernel::Vector_3 toVector_3 () const
 Converts to Kernel::Vector_3. More...
 
Kernel::Point_2 toPoint_2 () const
 Converts to Kernel::Point_2. More...
 
Kernel::Point_3 toPoint_3 () const
 Converts to Kernel::Point_3. More...
 
template<class Archive >
void save (Archive &ar, const unsigned int) const
 Serialization. More...
 
template<class Archive >
void load (Archive &ar, const unsigned int)
 
template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Detailed Description

Represents the Coordinate of a Point (wraps either an empty structure, or a Kernel::Point_2, or a Kernel::Point_3)

Constructor & Destructor Documentation

◆ Coordinate() [1/8]

SFCGAL::Coordinate::Coordinate ( )

Empty Coordinate constructor.

◆ Coordinate() [2/8]

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

XY Constructor with exact coordinates.

◆ Coordinate() [3/8]

SFCGAL::Coordinate::Coordinate ( const Kernel::FT &  x,
const Kernel::FT &  y,
const Kernel::FT &  z 
)

XYZ Constructor with exact coordinates.

◆ Coordinate() [4/8]

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

XYZ constructor.

Warning
x,y,z must not be not be NaN nor inf

◆ Coordinate() [5/8]

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

XY constructor.

Warning
x,y must not be not be NaN nor inf

◆ Coordinate() [6/8]

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

Constructor from CGAL::Point_2<K>

◆ Coordinate() [7/8]

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

Constructor from CGAL::Point_3<K>

◆ Coordinate() [8/8]

SFCGAL::Coordinate::Coordinate ( const Coordinate other)
default

copy constructor

◆ ~Coordinate()

SFCGAL::Coordinate::~Coordinate ( )
default

destructor

Member Function Documentation

◆ almostEqual()

auto SFCGAL::Coordinate::almostEqual ( const Coordinate other,
const double  tolerance 
) const

absolute comparison with an other coordinate

◆ coordinateDimension()

auto SFCGAL::Coordinate::coordinateDimension ( ) const

Get the dimension of the coordinates.

◆ is3D()

auto SFCGAL::Coordinate::is3D ( ) const

Tests if Z is defined.

◆ isEmpty()

auto SFCGAL::Coordinate::isEmpty ( ) const

Tests if the coordinates are empty.

◆ load()

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

◆ operator!=()

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

Compares with an other point.

Warning
coordinates must have the same dimension

◆ operator<()

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

Compares two points (lexicographic order)

Warning
coordinates must have the same dimension

◆ operator=()

auto SFCGAL::Coordinate::operator= ( const Coordinate other)
default

assign operator

◆ operator==()

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

Compares with an other point.

Warning
coordinates must have the same dimension

◆ round()

auto SFCGAL::Coordinate::round ( const long &  scaleFactor = 1)

round coordinates with a scale factor

Returns
*this

◆ save()

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

Serialization.

◆ serialize()

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

◆ toPoint_2()

auto SFCGAL::Coordinate::toPoint_2 ( ) const

Converts to Kernel::Point_2.

◆ toPoint_3()

auto SFCGAL::Coordinate::toPoint_3 ( ) const

Converts to Kernel::Point_3.

◆ toVector_2()

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

Converts to Kernel::Vector_2.

◆ toVector_3()

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

Converts to Kernel::Vector_3.

◆ x()

auto SFCGAL::Coordinate::x ( ) const

Gets the x value.

Warning
Exact, NaN for empty coordinates

◆ y()

auto SFCGAL::Coordinate::y ( ) const

Gets the y value.

Warning
Exact, NaN for empty coordinates

◆ z()

auto SFCGAL::Coordinate::z ( ) const

Gets the z value.

Warning
Exact, NaN for empty or 0 for 2D coordinates