Fade2D Documentation pages v2.15
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::readPointsPLY (const char *filename, bool bUniquePoints, std::vector< Point2 > &vPoints, std::vector< VtxColor > *pVertexColors=NULL)
 Read points from a *.PLY file. More...
 
bool GEOM_FADE2D::readPointsPLY (std::istream &is, bool bUniquePoints, std::vector< Point2 > &vPoints, std::vector< VtxColor > *pVertexColors=NULL)
 Read points from a *.PLY 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 * > &vPoints)
 Write points to a binary file. More...
 
bool GEOM_FADE2D::writePointsBIN (const char *filename, std::vector< Point2 > &vPoints)
 Write points to a binary file. More...
 
bool GEOM_FADE2D::writePointsPLY (const char *filename, std::vector< Point2 * > &vPoints, bool bASCII)
 Write points to a *.PLY file. More...
 
bool GEOM_FADE2D::writePointsPLY (std::ostream &os, std::vector< Point2 * > &vPoints, bool bASCII)
 Write points to a *.PLY 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 
)

Read points from a binary file.

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()

◆ readPointsPLY() [1/2]

bool GEOM_FADE2D::readPointsPLY ( const char *  filename,
bool  bUniquePoints,
std::vector< Point2 > &  vPoints,
std::vector< VtxColor > *  pVertexColors = NULL 
)

Read points from a *.PLY file.

Parameters
vPoints[out] returns the read points
filenameis the input filename
bUniquePointsspecifies whether to read a unique point set OR point triples (3 points per triangle)
pVertexColorspoints to an optional color output vector. Default: NULL
Note
: If pVertexColors!=NULL, then colors from the *.PLY file are stored in *pVertexColors. Additionally, indices to these colors are then stored in the points. These indices can be retrieved with Point2::getCustomIndex() Function available for platforms with C++11.

◆ readPointsPLY() [2/2]

bool GEOM_FADE2D::readPointsPLY ( std::istream &  is,
bool  bUniquePoints,
std::vector< Point2 > &  vPoints,
std::vector< VtxColor > *  pVertexColors = NULL 
)

Read points from a *.PLY file.

Parameters
vPoints[out] returns the read points
isis the input stream
bUniquePointsspecifies whether to read a unique point set OR point triples (3 points per triangle)
pVertexColorspoints to an optional color output vector. Default: NULL
Note
: If pVertexColors!=NULL, then colors from the *.PLY file are stored in *pVertexColors. Additionally, indices to these colors are then stored in the points. These indices can be retrieved with Point2::getCustomIndex() Function available for platforms with C++11.

◆ readSegmentsBIN()

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

Read segments from a binary file.

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 
)

Read (x y) points.

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 
)

Write points to an ASCII file.

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.

Write points to an ASCII file

See also
readPointsASCII()

◆ writePointsBIN() [1/2]

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

Write points to a binary file.

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

◆ writePointsBIN() [2/2]

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

Write points to a binary file.

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

◆ writePointsPLY() [1/2]

bool GEOM_FADE2D::writePointsPLY ( const char *  filename,
std::vector< Point2 * > &  vPoints,
bool  bASCII 
)

Write points to a *.PLY file.

Parameters
vPoints[in] are the points to be written
bASCIIspecifies whether to write an ASCII- (true) or binary (false) *.ply file
filenameis the output filename
Note
Coordinates are rounded to 32-bit floating point numbers. Function available for platforms with C++11.

◆ writePointsPLY() [2/2]

bool GEOM_FADE2D::writePointsPLY ( std::ostream &  os,
std::vector< Point2 * > &  vPoints,
bool  bASCII 
)

Write points to a *.PLY file.

Parameters
vPoints[in] are the points to be written
bASCIIspecifies whether to write an ASCII- (true) or binary (false) *.ply file
osis the output stream
Note
Coordinates are rounded to 32-bit floating point numbers. Function available for platforms with C++11.

◆ writeSegmentsBIN()

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

Write segments to a binary file.

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()