SFCGAL  1.3.0
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...
 
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

SFCGAL::Coordinate::Coordinate ( )

Empty Coordinate constructor.

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

XY Constructor with exact coordinates.

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

XYZ Constructor with exact coordinates.

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
SFCGAL::Coordinate::Coordinate ( const double &  x,
const double &  y 
)

XY constructor.

Warning
x,y must not be not be NaN nor inf
SFCGAL::Coordinate::Coordinate ( const Kernel::Point_2 &  other)

Constructor from CGAL::Point_2<K>

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

Constructor from CGAL::Point_3<K>

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

copy constructor

SFCGAL::Coordinate::~Coordinate ( )

destructor

Member Function Documentation

int SFCGAL::Coordinate::coordinateDimension ( ) const

Get the dimension of the coordinates.

bool SFCGAL::Coordinate::is3D ( ) const

Tests if Z is defined.

bool SFCGAL::Coordinate::isEmpty ( ) const

Tests if the coordinates are empty.

template<class Archive >
void SFCGAL::Coordinate::load ( Archive &  ar,
const unsigned  int 
)
inline
bool SFCGAL::Coordinate::operator!= ( const Coordinate other) const

Compares with an other point.

Warning
coordinates must have the same dimension
bool SFCGAL::Coordinate::operator< ( const Coordinate other) const

Compares two points (lexicographic order)

Warning
coordinates must have the same dimension
Coordinate & SFCGAL::Coordinate::operator= ( const Coordinate other)

assign operator

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

Compares with an other point.

Warning
coordinates must have the same dimension
Coordinate & SFCGAL::Coordinate::round ( const long &  scaleFactor = 1)

round coordinates with a scale factor

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

Serialization.

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

Converts to Kernel::Point_2.

Kernel::Point_3 SFCGAL::Coordinate::toPoint_3 ( ) const

Converts to Kernel::Point_3.

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

Converts to Kernel::Vector_2.

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

Converts to Kernel::Vector_3.

Kernel::FT SFCGAL::Coordinate::x ( ) const

Gets the x value.

Warning
Exact, NaN for empty coordinates
Kernel::FT SFCGAL::Coordinate::y ( ) const

Gets the y value.

Warning
Exact, NaN for empty coordinates
Kernel::FT SFCGAL::Coordinate::z ( ) const

Gets the z value.

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