SFCGAL  1.3.0
Classes | Public Types | Public Member Functions | List of all members
SFCGAL::LineString Class Reference

A LineString in SFA. More...

#include <LineString.h>

Inheritance diagram for SFCGAL::LineString:
SFCGAL::Geometry

Classes

class  Point_2_const_iterator
 Const iterator to 2D points TODO: replace by boost::tranform_iterator ? More...
 
class  Point_3_const_iterator
 Const iterator to 3D points TODO: replace by boost::tranform_iterator ? More...
 

Public Types

typedef boost::ptr_vector< Point >::iterator iterator
 
typedef boost::ptr_vector< Point >::const_iterator const_iterator
 

Public Member Functions

 LineString ()
 Empty LineString constructor. More...
 
 LineString (const std::vector< Point > &points)
 Constructor with a point vector. More...
 
 LineString (const Point &startPoint, const Point &endPoint)
 LineString constructor. More...
 
 LineString (LineString const &other)
 Copy constructor. More...
 
LineStringoperator= (LineString other)
 assign operator More...
 
 ~LineString ()
 destructor More...
 
virtual LineStringclone () 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...
 
void clear ()
 remove all points from the LineString More...
 
void reverse ()
 reverse LineString orientation More...
 
size_t numPoints () const
 [SFA/OGC]Returns the number of points More...
 
size_t numSegments () const
 Returns the number of segments. More...
 
const PointpointN (size_t const &n) const
 [SFA/OGC]Returns the n-th point More...
 
PointpointN (size_t const &n)
 [SFA/OGC]Returns the n-th point More...
 
const PointstartPoint () const
 [SFA/OGC]Returns the first point More...
 
PointstartPoint ()
 [SFA/OGC]Returns the first point More...
 
const PointendPoint () const
 [SFA/OGC]Returns the first point More...
 
PointendPoint ()
 [SFA/OGC]Returns the first point More...
 
void addPoint (const Point &p)
 append a Point to the LineString More...
 
void addPoint (Point *p)
 append a Point to the LineString and takes ownership More...
 
bool isClosed () const
 test if the LineString is closed More...
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
void reserve (const size_t &n)
 
Point_2_const_iterator points_2_begin () const
 
Point_2_const_iterator points_2_end () const
 
std::pair< Point_2_const_iterator, Point_2_const_iteratorpoints_2 () const
 
Point_3_const_iterator points_3_begin () const
 
Point_3_const_iterator points_3_end () const
 
std::pair< Point_3_const_iterator, Point_3_const_iteratorpoints_3 () const
 
CGAL::Polygon_2< KerneltoPolygon_2 (bool fixOrientation=true) const
 
virtual void accept (GeometryVisitor &visitor)
 [visitor]dispatch visitor

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

  More...
 
template<class Archive >
void serialize (Archive &ar, const unsigned int)
 Serializer. More...
 
- 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 LineString in SFA.

Member Typedef Documentation

typedef boost::ptr_vector< Point >::iterator SFCGAL::LineString::iterator

Constructor & Destructor Documentation

SFCGAL::LineString::LineString ( )

Empty LineString constructor.

SFCGAL::LineString::LineString ( const std::vector< Point > &  points)

Constructor with a point vector.

SFCGAL::LineString::LineString ( const Point startPoint,
const Point endPoint 
)

LineString constructor.

SFCGAL::LineString::LineString ( LineString const &  other)

Copy constructor.

SFCGAL::LineString::~LineString ( )

destructor

Member Function Documentation

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

[visitor]dispatch visitor

 

Implements SFCGAL::Geometry.

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

[visitor]dispatch visitor

 

Implements SFCGAL::Geometry.

void SFCGAL::LineString::addPoint ( const Point p)
inline

append a Point to the LineString

void SFCGAL::LineString::addPoint ( Point p)
inline

append a Point to the LineString and takes ownership

iterator SFCGAL::LineString::begin ( )
inline
const_iterator SFCGAL::LineString::begin ( ) const
inline
void SFCGAL::LineString::clear ( )

remove all points from the LineString

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

Get a deep copy of the geometry.

Implements SFCGAL::Geometry.

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

[OGC/SFA]returns the dimension of the coordinates

Precondition
suppose no mix of 2D/3D coordinates

Implements SFCGAL::Geometry.

int SFCGAL::LineString::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.

iterator SFCGAL::LineString::end ( )
inline
const_iterator SFCGAL::LineString::end ( ) const
inline
const Point& SFCGAL::LineString::endPoint ( ) const
inline

[SFA/OGC]Returns the first point

Point& SFCGAL::LineString::endPoint ( )
inline

[SFA/OGC]Returns the first point

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

[OGC/SFA]returns the geometry type

Warning
use CamelCase (LineString, not LINESTRING)

Implements SFCGAL::Geometry.

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

Returns a code corresponding to the type.

Warning
not standard

Implements SFCGAL::Geometry.

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

[OGC/SFA]test if geometry is 3d

Precondition
suppose no mix of 2D/3D coordinates

Implements SFCGAL::Geometry.

bool SFCGAL::LineString::isClosed ( ) const

test if the LineString is closed

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

[OGC/SFA]test if geometry is empty

Implements SFCGAL::Geometry.

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

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

Precondition
suppose no mix of M/!M points

Implements SFCGAL::Geometry.

size_t SFCGAL::LineString::numPoints ( ) const
inline

[SFA/OGC]Returns the number of points

size_t SFCGAL::LineString::numSegments ( ) const

Returns the number of segments.

Warning
not standard, returns zero if LineString contains only one point
LineString & SFCGAL::LineString::operator= ( LineString  other)

assign operator

const Point& SFCGAL::LineString::pointN ( size_t const &  n) const
inline

[SFA/OGC]Returns the n-th point

Point& SFCGAL::LineString::pointN ( size_t const &  n)
inline

[SFA/OGC]Returns the n-th point

std::pair< Point_2_const_iterator, Point_2_const_iterator > SFCGAL::LineString::points_2 ( ) const
inline
Point_2_const_iterator SFCGAL::LineString::points_2_begin ( ) const
inline
Point_2_const_iterator SFCGAL::LineString::points_2_end ( ) const
inline
std::pair< Point_3_const_iterator, Point_3_const_iterator > SFCGAL::LineString::points_3 ( ) const
inline
Point_3_const_iterator SFCGAL::LineString::points_3_begin ( ) const
inline
Point_3_const_iterator SFCGAL::LineString::points_3_end ( ) const
inline
void SFCGAL::LineString::reserve ( const size_t &  n)
void SFCGAL::LineString::reverse ( )

reverse LineString orientation

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

Serializer.

const Point& SFCGAL::LineString::startPoint ( ) const
inline

[SFA/OGC]Returns the first point

Point& SFCGAL::LineString::startPoint ( )
inline

[SFA/OGC]Returns the first point

CGAL::Polygon_2< Kernel > SFCGAL::LineString::toPolygon_2 ( bool  fixOrientation = true) const