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

A point in SFA. More...

#include <Point.h>

Inheritance diagram for SFCGAL::Point:
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 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...
 
virtual Pointclone () const
 Get a deep copy of the geometry. More...
 
virtual std::string geometryType () const
 [OGC/SFA]returns the geometry type More...
 
virtual GeometryType geometryTypeId () const
 Returns a code corresponding to the type. More...
 
virtual int dimension () const
 [OGC/SFA]Dimension of the Geometry ( 0 : punctual, 1 : curve, ...) More...
 
virtual int coordinateDimension () const
 [OGC/SFA]returns the dimension of the coordinates More...
 
virtual bool isEmpty () const
 [OGC/SFA]test if geometry is empty More...
 
virtual bool is3D () const
 [OGC/SFA]test if geometry is 3d More...
 
virtual bool isMeasured () const
 [OGC/SFA]test if geometry is measured (has an m) More...
 
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...
 
virtual void accept (GeometryVisitor &visitor)
 [visitor]dispatch visitor

  More...
 
virtual void accept (ConstGeometryVisitor &visitor) const
 [visitor]dispatch visitor

  More...
 
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...
 
template<int Dim>
TypeForDimension< Dim >::Point toPoint_d () const
 
- Public Member Functions inherited from SFCGAL::Geometry
virtual ~Geometry ()
 
void forceValidityFlag (bool validity)
 Force the state of the validity flag. More...
 
bool hasValidityFlag () const
 Returns the validity flag. More...
 
std::string asText (const int &numDecimals=-1) const
 [OGC/SFA]returns the WKT string More...
 
Envelope envelope () const
 [OGC/SFA]Returns a polygon representing the BBOX of the geometry More...
 
virtual std::auto_ptr< Geometryboundary () const
 [OGC/SFA]Returns the boundary of the geometry More...
 
double distance (const Geometry &other) const
 Computes the distance to an other geometry. More...
 
double distance3D (const Geometry &other) const
 Computes the 3D distance to an other geometry. More...
 
void round (const long &scale=1)
 round the geometry with a corresponding scale factor More...
 
virtual size_t numGeometries () const
 [OGC/SFA]Gets the number of geometries in a collection of geometries More...
 
virtual const GeometrygeometryN (size_t const &n) const
 [OGC/SFA]Returns the n-th geometry More...
 
virtual GeometrygeometryN (size_t const &n)
 [OGC/SFA]Returns the n-th geometry More...
 
template<typename Derived >
bool is () const
 Tests if geometry is of "Derived" type given as template parameter. More...
 
template<typename Derived >
const Derived & as () const
 Downcast to a "Derived" class. More...
 
template<typename Derived >
Derived & as ()
 Downcast to a "Derived" class. More...
 
template<class Archive >
void serialize (Archive &, const unsigned int)
 Serializer

. More...

 

Additional Inherited Members

- Protected Member Functions inherited from SFCGAL::Geometry
 Geometry ()
 
 Geometry (const Geometry &)
 
const Geometryoperator= (const Geometry &)
 
- Protected Attributes inherited from SFCGAL::Geometry
bool validityFlag_
 

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 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)

copy constructor

SFCGAL::Point::~Point ( )

destructor

Member Function Documentation

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

[visitor]dispatch visitor

 

Implements SFCGAL::Geometry.

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

[visitor]dispatch visitor

 

Implements SFCGAL::Geometry.

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

Get a deep copy of the geometry.

Implements SFCGAL::Geometry.

Coordinate& SFCGAL::Point::coordinate ( )
inline
const Coordinate& SFCGAL::Point::coordinate ( ) const
inline
int SFCGAL::Point::coordinateDimension ( ) const
virtual

[OGC/SFA]returns the dimension of the coordinates

Precondition
suppose no mix of 2D/3D coordinates

Implements SFCGAL::Geometry.

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

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

Warning
empty geometries provide the dimension corresponding to the object

Implements SFCGAL::Geometry.

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

[OGC/SFA]returns the geometry type

Warning
use CamelCase (LineString, not LINESTRING)

Implements SFCGAL::Geometry.

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

Returns a code corresponding to the type.

Warning
not standard

Implements SFCGAL::Geometry.

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

[OGC/SFA]test if geometry is 3d

Precondition
suppose no mix of 2D/3D coordinates

Implements SFCGAL::Geometry.

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

[OGC/SFA]test if geometry is empty

Implements SFCGAL::Geometry.

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

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

Precondition
suppose no mix of M/!M points

Implements SFCGAL::Geometry.

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

Returns the m value (NaN is not defined)

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

compare with an other point

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

compare two points

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

assign operator

bool 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.

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.

template<int Dim>
TypeForDimension<Dim>::Point SFCGAL::Point::toPoint_d ( ) const
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.