1.6.0
CCC
 
Loading...
Searching...
No Matches
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)
 
PolyLine2D & operator= (const PolyLine2D &m)
 
virtual ~PolyLine2D ()
 
virtual String toString (const AStringFormat *strfmt=nullptr) const override
 Interface of AStringable.
 
int getNPoints () const
 
void init (const VectorDouble &x, const VectorDouble &y)
 
const VectorDouble & getX () const
 
const VectorDouble & getY () 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)
 
AStringable & operator= (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)
 
ASerializable & operator= (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 PolyLine2D * createFromNF (const String &neutralFilename, bool verbose=true)
 
static PolyLine2D * create (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 String & getContainerName ()
 
static const String & getPrefixName ()
 
static bool createDirectory (const String &dir)
 
static String getExecDirectory ()
 
static String getDirectory (const String &path)
 

Constructor & Destructor Documentation

◆ PolyLine2D() [1/2]

PolyLine2D::PolyLine2D ( const VectorDouble &  x = VectorDouble(),
const VectorDouble &  y = VectorDouble() 
)

◆ PolyLine2D() [2/2]

PolyLine2D::PolyLine2D ( const PolyLine2D &  m)

◆ ~PolyLine2D()

PolyLine2D::~PolyLine2D ( )
virtual

Member Function Documentation

◆ addPoint()

void PolyLine2D::addPoint ( double  x,
double  y 
)

◆ angleAtPolyline()

double PolyLine2D::angleAtPolyline ( const PolyPoint2D &  pldist,
int  nb_neigh = 0 
) const

◆ create()

PolyLine2D * PolyLine2D::create ( const VectorDouble &  x = VectorDouble(),
const VectorDouble &  y = VectorDouble() 
)
static

◆ createFromNF()

PolyLine2D * PolyLine2D::createFromNF ( const String &  neutralFilename,
bool  verbose = true 
)
static

◆ distanceAlongPolyline()

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

◆ distanceAtPolyline()

double PolyLine2D::distanceAtPolyline ( const PolyPoint2D &  pldist,
const VectorDouble &  target,
int  nb_neigh 
) const

◆ distanceBetweenPoints()

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

◆ getNPoints()

int PolyLine2D::getNPoints ( ) const
inline

◆ getPLIndex()

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

◆ getPoint()

VectorDouble PolyLine2D::getPoint ( int  i) const

◆ getX() [1/2]

const VectorDouble & PolyLine2D::getX ( ) const
inline

◆ getX() [2/2]

double PolyLine2D::getX ( int  i) const
inline

◆ getXmax()

double PolyLine2D::getXmax ( ) const
inline

◆ getXmin()

double PolyLine2D::getXmin ( ) const
inline

◆ getY() [1/2]

const VectorDouble & PolyLine2D::getY ( ) const
inline

◆ getY() [2/2]

double PolyLine2D::getY ( int  i) const
inline

◆ getYmax()

double PolyLine2D::getYmax ( ) const
inline

◆ getYmin()

double PolyLine2D::getYmin ( ) const
inline

◆ init()

void PolyLine2D::init ( const VectorDouble &  x,
const VectorDouble &  y 
)

◆ operator=()

PolyLine2D & PolyLine2D::operator= ( const PolyLine2D &  m)

◆ setX()

void PolyLine2D::setX ( const VectorDouble &  x)
inline

◆ setY()

void PolyLine2D::setY ( const VectorDouble &  y)
inline

◆ toString()

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: