Fade2D Documentation pages v2.07
Delaunay Features
File I/O

Functions

bool GEOM_FADE2D::readPointsBIN (const char *filename, std::vector< Point2 > &vPointsIn, bool bWithHeader=true)
 Read points from a binary file. More...
 
bool GEOM_FADE2D::readSegmentsBIN (const char *filename, std::vector< Segment2 > &vSegmentsOut)
 Read segments from a binary file. More...
 
bool GEOM_FADE2D::readXY (const char *filename, std::vector< Point2 > &vPointsOut)
 Read (x y) points. More...
 
bool GEOM_FADE2D::writePointsASCII (const char *filename, const std::vector< Point2 * > &vPointsIn)
 Write points to an ASCII file. More...
 
bool GEOM_FADE2D::writePointsASCII (const char *filename, const std::vector< Point2 > &vPointsIn)
 Write points to an ASCII file. More...
 
bool GEOM_FADE2D::writePointsBIN (const char *filename, std::vector< Point2 * > &vPointsIn)
 Write points to a binary file. More...
 
bool GEOM_FADE2D::writePointsBIN (const char *filename, std::vector< Point2 > &vPointsIn)
 Write points to a binary file. More...
 
bool GEOM_FADE2D::writeSegmentsBIN (const char *filename, std::vector< Segment2 > &vSegmentsIn)
 Write segments to a binary file. More...
 

Detailed Description

Function Documentation

◆ readPointsBIN()

bool GEOM_FADE2D::readPointsBIN ( const char *  filename,
std::vector< Point2 > &  vPointsIn,
bool  bWithHeader = true 
)

Reads points from a binary file.

Parameters
filenameis the input file
vPointsInis used to return the points
bWithHeaderspecifies if the file contains a header (like the ones written by writePointsBIN()) or if the file contains just a sequence of double precision coordinates - use false in this case.
See also
writePointsBIN()

◆ readSegmentsBIN()

bool GEOM_FADE2D::readSegmentsBIN ( const char *  filename,
std::vector< Segment2 > &  vSegmentsOut 
)

Reads segments from a binary file of type 21 or 31

See also
writeSegmentsBIN()

◆ readXY()

bool GEOM_FADE2D::readXY ( const char *  filename,
std::vector< Point2 > &  vPointsOut 
)

Reads points from an ASCII file. Expected file format: Two coordinates (x y) per line, whitespace separated.

◆ writePointsASCII() [1/2]

bool GEOM_FADE2D::writePointsASCII ( const char *  filename,
const std::vector< Point2 * > &  vPointsIn 
)

Writes points to an ASCII file, two coordinates (x y) per line, whitespace separated.

Note
Data exchange through ASCII files is easy and convenient but floating point coordinates are not necessarily exact when represented as decimal numbers. If the tiny rounding errors can't be accepted in your setting you are advised to write binary files, (use writePointsBIN() )

◆ writePointsASCII() [2/2]

bool GEOM_FADE2D::writePointsASCII ( const char *  filename,
const std::vector< Point2 > &  vPointsIn 
)

Write points to an ASCII file

See also
readPointsASCII()

◆ writePointsBIN() [1/2]

bool GEOM_FADE2D::writePointsBIN ( const char *  filename,
std::vector< Point2 * > &  vPointsIn 
)

Writes points to a binary file

See also
readPointsBIN()

◆ writePointsBIN() [2/2]

bool GEOM_FADE2D::writePointsBIN ( const char *  filename,
std::vector< Point2 > &  vPointsIn 
)

File format:
int filetype (20)
size_t numPoints (vPointsIn.size())
double x0
double y0
double z0
...
double xn
double yn
double zn

Note
Since version 1.64 the binary file format written by 32-bit machines is identical with the file format of x64 machines i.e., the numPoints value is always 8 bytes, not 4. This change affects only 32-bit programs.

◆ writeSegmentsBIN()

bool GEOM_FADE2D::writeSegmentsBIN ( const char *  filename,
std::vector< Segment2 > &  vSegmentsIn 
)

Binary file format:
int filetype (21)
size_t numSegments (vSegmentsIn.size())
double x0_source
double y0_source
double x0_target
double y0_target
...
double xn_source
double yn_source
double xn_target
double yn_target

Note
Since version 1.64 the binary file format written by 32-bit machines is identical with the file format of x64 machines i.e., the numSegments value is always 8 bytes, not 4. This change affects only 32-bit programs.
See also
readSegmentsBIN()