1.1.0
CCC
 
PolyLine2D Class Reference

#include <PolyLine2D.hpp>

Inheritance diagram for PolyLine2D:
AStringable ASerializable PolyElem

Public Member Functions

 PolyLine2D (const VectorDouble &x=VectorDouble(), const VectorDouble &y=VectorDouble())
 
 PolyLine2D (const PolyLine2D &m)
 
PolyLine2Doperator= (const PolyLine2D &m)
 
virtual ~PolyLine2D ()
 
virtual String toString (const AStringFormat *strfmt=nullptr) const override
 Interface of AStringable. More...
 
int getNPoints () const
 
void init (const VectorDouble &x, const VectorDouble &y)
 
const VectorDoublegetX () const
 
const VectorDoublegetY () const
 
double getX (int i) const
 
double getY (int i) const
 
VectorDouble getPoint (int i) const
 
double getXmin () const
 
double getYmin () const
 
double getXmax () const
 
double getYmax () const
 
void addPoint (double x, double y)
 
void setX (const VectorDouble &x)
 
void setY (const VectorDouble &y)
 
PolyPoint2D getPLIndex (const VectorDouble &xy0) const
 
double distanceBetweenPoints (double ap, double al, const VectorDouble &xy1, const VectorDouble &xy2) const
 
double distanceAlongPolyline (const PolyPoint2D &pldist1, const PolyPoint2D &pldist2) const
 
double angleAtPolyline (const PolyPoint2D &pldist, int nb_neigh=0) const
 
double distanceAtPolyline (const PolyPoint2D &pldist, const VectorDouble &target, int nb_neigh) const
 
- Public Member Functions inherited from AStringable
 AStringable ()
 
 AStringable (const AStringable &r)
 
AStringableoperator= (const AStringable &r)
 
virtual ~AStringable ()
 
virtual void display (const AStringFormat *strfmt=nullptr) const final
 
virtual void display (int level) const final
 
- Public Member Functions inherited from ASerializable
 ASerializable ()
 
 ASerializable (const ASerializable &r)
 
ASerializableoperator= (const ASerializable &r)
 
virtual ~ASerializable ()
 
bool deserialize (std::istream &is, bool verbose=true)
 
bool serialize (std::ostream &os, bool verbose=true) const
 
bool dumpToNF (const String &neutralFilename, bool verbose=false) const
 

Static Public Member Functions

static PolyLine2DcreateFromNF (const String &neutralFilename, bool verbose=true)
 
static PolyLine2Dcreate (const VectorDouble &x=VectorDouble(), const VectorDouble &y=VectorDouble())
 
- Static Public Member Functions inherited from ASerializable
static String buildFileName (int status, const String &filename, bool ensureDirExist=false)
 
static String getHomeDirectory (const String &sub="")
 
static String getWorkingDirectory ()
 
static String getTestData (const String &subdir, const String &filename)
 
static String getFileIdentity (const String &filename, bool verbose=false)
 
static void setContainerName (bool useDefault, const String &containerName="", bool verbose=false)
 
static void unsetContainerName ()
 
static void setPrefixName (const String &prefixName)
 
static void unsetPrefixName ()
 
static const StringgetContainerName ()
 
static const StringgetPrefixName ()
 
static bool createDirectory (const String &dir)
 
static String getExecDirectory ()
 
static String getDirectory (const String &path)
 

Constructor & Destructor Documentation

PolyLine2D::PolyLine2D ( const VectorDouble x = VectorDouble(),
const VectorDouble y = VectorDouble() 
)
PolyLine2D::PolyLine2D ( const PolyLine2D m)
PolyLine2D::~PolyLine2D ( )
virtual

Member Function Documentation

void PolyLine2D::addPoint ( double  x,
double  y 
)
double PolyLine2D::angleAtPolyline ( const PolyPoint2D pldist,
int  nb_neigh = 0 
) const
PolyLine2D * PolyLine2D::create ( const VectorDouble x = VectorDouble(),
const VectorDouble y = VectorDouble() 
)
static
PolyLine2D * PolyLine2D::createFromNF ( const String neutralFilename,
bool  verbose = true 
)
static
double PolyLine2D::distanceAlongPolyline ( const PolyPoint2D pldist1,
const PolyPoint2D pldist2 
) const

Find the shortest distance between two points (x1,y1) and (x2,y2) which belong to the current polyline

Returns
Minimum distance
Parameters
[in]pldist1First PolyPoint2D structure
[in]pldist2Second PolyPoint2D structure
double PolyLine2D::distanceAtPolyline ( const PolyPoint2D pldist,
const VectorDouble target,
int  nb_neigh 
) const
double PolyLine2D::distanceBetweenPoints ( double  ap,
double  al,
const VectorDouble xy1,
const VectorDouble xy2 
) const

Find the shortest distance between two points (x1,y1) and (x2,y2) passing through a polyline

Returns
Minimum distance
Parameters
[in]apCoefficient applied to the projected distances
[in]alCoefficient applied to the distance along line
[in]xy1Coordinates of the first point
[in]xy2Coordinates of the second point
int PolyLine2D::getNPoints ( ) const
inline
PolyPoint2D PolyLine2D::getPLIndex ( const VectorDouble xy0) const

Returns the point of the PolyLine located at shortest distance from Target

Returns
PolyPoint2D structure
Parameters
[in]xy0Coordinates of the target point
VectorDouble PolyLine2D::getPoint ( int  i) const
const VectorDouble& PolyLine2D::getX ( ) const
inline
double PolyLine2D::getX ( int  i) const
inline
double PolyLine2D::getXmax ( ) const
inline
double PolyLine2D::getXmin ( ) const
inline
const VectorDouble& PolyLine2D::getY ( ) const
inline
double PolyLine2D::getY ( int  i) const
inline
double PolyLine2D::getYmax ( ) const
inline
double PolyLine2D::getYmin ( ) const
inline
void PolyLine2D::init ( const VectorDouble x,
const VectorDouble y 
)
PolyLine2D & PolyLine2D::operator= ( const PolyLine2D m)
void PolyLine2D::setX ( const VectorDouble x)
inline
void PolyLine2D::setY ( const VectorDouble y)
inline
String PolyLine2D::toString ( const AStringFormat strfmt = nullptr) const
overridevirtual

Interface of AStringable.

Reimplemented from AStringable.

Reimplemented in PolyElem.


The documentation for this class was generated from the following files: