![]() |
1.2.0
Geostatistics & Machine Learning toolbox | https://gstlearn.org
|
![]() |
#include <Polygons.hpp>
Public Member Functions | |
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 | resetFromWKT (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 Public Member Functions | |
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 * | createFromWKT (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="", 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) |
Polygons::Polygons | ( | ) |
Polygons::Polygons | ( | const Polygons & | r | ) |
|
virtual |
void Polygons::addPolyElem | ( | const PolyElem & | polyelem | ) |
|
static |
|
static |
|
static |
|
static |
PolyElem Polygons::getClosedPolyElem | ( | int | ipol | ) | const |
void Polygons::getExtension | ( | double * | xmin, |
double * | xmax, | ||
double * | ymin, | ||
double * | ymax | ||
) | const |
const PolyElem & Polygons::getPolyElem | ( | int | ipol | ) | const |
|
inline |
|
inline |
double Polygons::getSurface | ( | ) | const |
const VectorDouble & Polygons::getX | ( | int | ipol | ) | const |
const VectorDouble & Polygons::getY | ( | int | ipol | ) | const |
bool Polygons::inside | ( | const VectorDouble & | coor, |
bool | flag_nested = false |
||
) |
Check if one point belongs to a Polygons
[in] | coor | Vector of coordinates |
[in] | flag_nested | Option for nested polyelems (see details) |
Polygons Polygons::reduceComplexity | ( | double | distmin | ) | const |
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
filename | Filename |
csv | CSV characteristics |
verbose | Verbose flag |
ncol_max | Maximum number of columns |
nrow_max | Maximum number of rows |
int Polygons::resetFromDb | ( | const Db * | db, |
double | dilate = 0. , |
||
bool | verbose = false |
||
) |
int Polygons::resetFromWKT | ( | const String & | filename, |
const CSVformat & | csv, | ||
int | verbose = false , |
||
int | ncol_max = -1 , |
||
int | nrow_max = -1 |
||
) |
Reset the Polygon from a CSV file using WKT format (first column) exported by QGIS
filename | Filename |
csv | CSV characteristics |
verbose | Verbose flag |
ncol_max | Maximum number of columns |
nrow_max | Maximum number of rows |
void Polygons::setX | ( | int | ipol, |
const VectorDouble & | x | ||
) |
void Polygons::setY | ( | int | ipol, |
const VectorDouble & | y | ||
) |
|
overridevirtual |
Interface to AStringable.
Reimplemented from AStringable.