#include <Polygons.hpp>
|
| | Polygons () |
| |
| | Polygons (const Polygons &r) |
| |
| Polygons & | operator= (const Polygons &r) |
| |
| virtual | ~Polygons () |
| |
| virtual String | toString (const AStringFormat *strfmt=nullptr) const override |
| | Interface to AStringable. More...
|
| |
| int | resetFromDb (const Db *db, double dilate=0., bool verbose=false) |
| |
| int | resetFromCSV (const String &filename, const CSVformat &csv, int verbose=false, int ncol_max=-1, int nrow_max=-1) |
| |
| int | getPolyElemNumber () const |
| |
| void | addPolyElem (const PolyElem &polyelem) |
| |
| const std::vector< PolyElem > & | getPolyElems () const |
| |
| const PolyElem | getPolyElem (int ipol) const |
| |
| PolyElem | getClosedPolyElem (int ipol) const |
| |
| const VectorDouble | getX (int ipol) const |
| |
| const VectorDouble | getY (int ipol) const |
| |
| void | setX (int ipol, const VectorDouble &x) |
| |
| void | setY (int ipol, const VectorDouble &y) |
| |
| void | getExtension (double *xmin, double *xmax, double *ymin, double *ymax) const |
| |
| double | getSurface () const |
| |
| bool | inside (const VectorDouble &coor, bool flag_nested=false) |
| |
| Polygons | reduceComplexity (double distmin) const |
| |
| | 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 |
| |
| | 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 Polygons * | create () |
| |
| static Polygons * | createFromNF (const String &neutralFilename, bool verbose=false) |
| |
| static Polygons * | createFromCSV (const String &filename, const CSVformat &csv=CSVformat(), int verbose=false, int ncol_max=-1, int nrow_max=-1) |
| |
| static Polygons * | createFromDb (const Db *db, double dilate=0., bool verbose=false) |
| |
| 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=String(), 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) |
| |
|
| PolyElem | _extractFromTab (int ideb, int ifin, int ncol, const VectorDouble &tab) |
| |
| bool | _isValidPolyElemIndex (int ipol) const |
| |
| VectorInt | _getHullIndices (const VectorDouble &x, const VectorDouble &y) const |
| |
| void | _getExtend (double ext, VectorDouble &x, VectorDouble &y, int nsect=16) |
| |
| int | _buildHull (const Db *db, double dilate, bool verbose) |
| |
| void | _polygonHullPrint (const VectorInt &index, const VectorDouble &x, const VectorDouble &y) const |
| |
|
| 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) |
| |
◆ Polygons() [1/2]
◆ Polygons() [2/2]
| Polygons::Polygons |
( |
const Polygons & |
r | ) |
|
◆ ~Polygons()
◆ _buildHull()
| int Polygons::_buildHull |
( |
const Db * |
db, |
|
|
double |
dilate, |
|
|
bool |
verbose |
|
) |
| |
|
private |
Create a polygon from the convex hull of active samples
- Returns
- Error returned code
- Parameters
-
| [in] | db | descriptor of the Db serving for convex hull calculation |
| [in] | dilate | Radius of the dilation |
| [in] | verbose | Verbose flag |
◆ _deserialize()
| bool Polygons::_deserialize |
( |
std::istream & |
is, |
|
|
bool |
verbose = false |
|
) |
| |
|
overrideprotectedvirtual |
◆ _extractFromTab()
◆ _getExtend()
Create a set of fictitious samples obtained by dilating the initial ones
- Parameters
-
| ext | Dilation distance |
| x | Vector of X-coordinates or initial samples |
| y | Vector of Y-coordinates of initial samples |
| nsect | Number of discretization points for dilation |
◆ _getHullIndices()
Create a polygon from the convex hull of active samples
- Returns
- Error returned code
- Parameters
-
| [in] | x | Vector of X coordinates |
| [in] | y | Vector of Y coordinates |
◆ _getNFName()
| String Polygons::_getNFName |
( |
| ) |
const |
|
inlineoverrideprotectedvirtual |
◆ _isValidPolyElemIndex()
| bool Polygons::_isValidPolyElemIndex |
( |
int |
ipol | ) |
const |
|
private |
◆ _polygonHullPrint()
◆ _serialize()
| bool Polygons::_serialize |
( |
std::ostream & |
os, |
|
|
bool |
verbose = false |
|
) |
| const |
|
overrideprotectedvirtual |
◆ addPolyElem()
| void Polygons::addPolyElem |
( |
const PolyElem & |
polyelem | ) |
|
Add the PolyElem to the list of polygons. This is performed only if the current PolyElem contains at least 3 vertices.
- Parameters
-
◆ create()
◆ createFromCSV()
◆ createFromDb()
| Polygons * Polygons::createFromDb |
( |
const Db * |
db, |
|
|
double |
dilate = 0., |
|
|
bool |
verbose = false |
|
) |
| |
|
static |
◆ createFromNF()
| Polygons * Polygons::createFromNF |
( |
const String & |
neutralFilename, |
|
|
bool |
verbose = false |
|
) |
| |
|
static |
Create a Polygon by loading the contents of a Neutral File
- Parameters
-
| neutralFilename | Name of the Neutral File |
| verbose | Verbose flag |
- Returns
◆ getClosedPolyElem()
| PolyElem Polygons::getClosedPolyElem |
( |
int |
ipol | ) |
const |
◆ getExtension()
| void Polygons::getExtension |
( |
double * |
xmin, |
|
|
double * |
xmax, |
|
|
double * |
ymin, |
|
|
double * |
ymax |
|
) |
| const |
◆ getPolyElem()
| const PolyElem Polygons::getPolyElem |
( |
int |
ipol | ) |
const |
◆ getPolyElemNumber()
| int Polygons::getPolyElemNumber |
( |
| ) |
const |
|
inline |
◆ getPolyElems()
| const std::vector<PolyElem>& Polygons::getPolyElems |
( |
| ) |
const |
|
inline |
◆ getSurface()
| double Polygons::getSurface |
( |
| ) |
const |
◆ getX()
◆ getY()
◆ inside()
| bool Polygons::inside |
( |
const VectorDouble & |
coor, |
|
|
bool |
flag_nested = false |
|
) |
| |
Check if one point belongs to a Polygons
- Returns
- 1 if the point belongs to the Polygons; 0 otherwise
- Parameters
-
| [in] | coor | Vector of coordinates |
| [in] | flag_nested | Option for nested polyelems (see details) |
◆ operator=()
◆ reduceComplexity()
| Polygons Polygons::reduceComplexity |
( |
double |
distmin | ) |
const |
◆ resetFromCSV()
| int Polygons::resetFromCSV |
( |
const String & |
filename, |
|
|
const CSVformat & |
csv, |
|
|
int |
verbose = false, |
|
|
int |
ncol_max = -1, |
|
|
int |
nrow_max = -1 |
|
) |
| |
Reset the Polygon from a CSV file
- Parameters
-
| filename | Filename |
| csv | CSV characteristics |
| verbose | Verbose flag |
| ncol_max | Maximum number of columns |
| nrow_max | Maximum number of rows |
- Returns
◆ resetFromDb()
| int Polygons::resetFromDb |
( |
const Db * |
db, |
|
|
double |
dilate = 0., |
|
|
bool |
verbose = false |
|
) |
| |
◆ setX()
◆ setY()
◆ toString()
◆ _polyelems
| std::vector<PolyElem> Polygons::_polyelems |
|
private |
The documentation for this class was generated from the following files: