gstlearn  1.0.0
CCC
PolyElem Class Reference

#include <PolyElem.hpp>

Inheritance diagram for PolyElem:
PolyLine2D AStringable ASerializable

Public Member Functions

 PolyElem (const VectorDouble &x=VectorDouble(), const VectorDouble &y=VectorDouble(), double zmin=TEST, double zmax=TEST)
 
 PolyElem (const PolyElem &r)
 
PolyElemoperator= (const PolyElem &r)
 
virtual ~PolyElem ()
 
virtual String toString (const AStringFormat *strfmt=nullptr) const override
 Interface of AStringable. More...
 
const VectorDoublegetX () const
 
const VectorDoublegetY () const
 
double getX (int i) const
 
double getY (int i) const
 
double getZmax () const
 
double getZmin () const
 
void init (const VectorDouble &x, const VectorDouble &y, double zmin=TEST, double zmax=TEST)
 
void getExtension (double *xmin, double *xmax, double *ymin, double *ymax) const
 
double getSurface () const
 
void closePolyElem ()
 
bool inside (const VectorDouble &coor)
 
bool inside3D (double zz)
 
PolyElem reduceComplexity (double distmin) const
 
- Public Member Functions inherited from PolyLine2D
 PolyLine2D (const VectorDouble &x=VectorDouble(), const VectorDouble &y=VectorDouble())
 
 PolyLine2D (const PolyLine2D &m)
 
PolyLine2Doperator= (const PolyLine2D &m)
 
virtual ~PolyLine2D ()
 
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 PolyElemcreate ()
 
static PolyElemcreateFromNF (const String &neutralFilename, bool verbose=true)
 
- Static Public Member Functions inherited from PolyLine2D
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)
 

Protected Member Functions

virtual bool _deserialize (std::istream &is, bool verbose=false) override
 Interface for ASerializable. More...
 
virtual bool _serialize (std::ostream &os, bool verbose=false) const override
 
String _getNFName () const override
 
- Protected Member Functions inherited from ASerializable
bool _fileOpenWrite (const String &filename, std::ofstream &os, bool verbose=false) const
 
bool _fileOpenRead (const String &filename, std::ifstream &is, bool verbose=false) const
 

Private Member Functions

bool _isClosed () const
 

Private Attributes

double _zmin
 
double _zmax
 

Friends

class Polygons
 

Additional Inherited Members

- Static Protected Member Functions inherited from ASerializable
static bool _commentWrite (std::ostream &os, const String &comment)
 
template<typename T >
static bool _recordWrite (std::ostream &os, const String &title, const T &val)
 
template<typename T >
static bool _recordWriteVec (std::ostream &os, const String &title, const VectorT< T > &vec)
 
template<typename T >
static bool _recordRead (std::istream &is, const String &title, T &val)
 
template<typename T >
static bool _recordReadVec (std::istream &is, const String &title, VectorT< T > &vec, int nvalues)
 
static bool _onlyBlanks (char *string)
 
static bool _tableRead (std::istream &is, const String &string, int ntab, double *tab)
 
static bool _tableWrite (std::ostream &os, const String &string, int ntab, const VectorDouble &tab)
 

Constructor & Destructor Documentation

◆ PolyElem() [1/2]

PolyElem::PolyElem ( const VectorDouble x = VectorDouble(),
const VectorDouble y = VectorDouble(),
double  zmin = TEST,
double  zmax = TEST 
)

◆ PolyElem() [2/2]

PolyElem::PolyElem ( const PolyElem r)

◆ ~PolyElem()

PolyElem::~PolyElem ( )
virtual

Member Function Documentation

◆ _deserialize()

bool PolyElem::_deserialize ( std::istream &  is,
bool  verbose = false 
)
overrideprotectedvirtual

Interface for ASerializable.

Reimplemented from PolyLine2D.

◆ _getNFName()

String PolyElem::_getNFName ( ) const
inlineoverrideprotectedvirtual

Reimplemented from PolyLine2D.

◆ _isClosed()

bool PolyElem::_isClosed ( ) const
private

◆ _serialize()

bool PolyElem::_serialize ( std::ostream &  os,
bool  verbose = false 
) const
overrideprotectedvirtual

Serialization (by Point rather than by Coordinate) This is maintained for all classes using this interface for serialization

Parameters
osOutput Stream
verboseVerbose flag
Returns

Reimplemented from PolyLine2D.

◆ closePolyElem()

void PolyElem::closePolyElem ( )

Close the PolyElem if necessary

◆ create()

PolyElem * PolyElem::create ( )
static

◆ createFromNF()

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

◆ getExtension()

void PolyElem::getExtension ( double *  xmin,
double *  xmax,
double *  ymin,
double *  ymax 
) const

◆ getSurface()

double PolyElem::getSurface ( ) const

◆ getX() [1/2]

const VectorDouble& PolyElem::getX ( ) const
inline

◆ getX() [2/2]

double PolyElem::getX ( int  i) const
inline

◆ getY() [1/2]

const VectorDouble& PolyElem::getY ( ) const
inline

◆ getY() [2/2]

double PolyElem::getY ( int  i) const
inline

◆ getZmax()

double PolyElem::getZmax ( ) const
inline

◆ getZmin()

double PolyElem::getZmin ( ) const
inline

◆ init()

void PolyElem::init ( const VectorDouble x,
const VectorDouble y,
double  zmin = TEST,
double  zmax = TEST 
)

◆ inside()

bool PolyElem::inside ( const VectorDouble coor)

Check if one point belongs to a 2-D polyelem

Returns
True if the point belongs to the polygon; False otherwise
Parameters
[in]coorVector giving the coordinates of the target point

◆ inside3D()

bool PolyElem::inside3D ( double  zz)

Check if one point belongs to a vertical interval of a (limited) polyelem

Returns
True if the point belongs to the polygon; False otherwise
Parameters
[in]zzarray of point coordinates of the point along Z or TEST

◆ operator=()

PolyElem & PolyElem::operator= ( const PolyElem r)

◆ reduceComplexity()

PolyElem PolyElem::reduceComplexity ( double  distmin) const

◆ toString()

String PolyElem::toString ( const AStringFormat strfmt = nullptr) const
overridevirtual

Interface of AStringable.

Reimplemented from PolyLine2D.

Friends And Related Function Documentation

◆ Polygons

friend class Polygons
friend

Member Data Documentation

◆ _zmax

double PolyElem::_zmax
private

◆ _zmin

double PolyElem::_zmin
private

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