Euclid
Geometry Processing and Shape Analysis in C++
Off I/O

Off I/O. More...

Functions

template<int N, typename FT , typename IT , typename CT , typename Interface >
void Euclid::read_off (const std::string &filename, std::vector< FT > &positions, std::vector< CT > *vcolors, std::vector< IT > *findices, std::vector< CT > *fcolors)
 Read off file. More...
 
template<int N, typename FT , typename IT , typename CT , typename Interface >
void Euclid::write_off (const std::string &filename, const std::vector< FT > &positions, const std::vector< CT > *vcolors, const std::vector< IT > *findices, const std::vector< CT > *fcolors)
 Write off file. More...
 

Detailed Description

Off is a simple geometry file format storing positions, indices, and optionally colors.

Function Documentation

template<int N, typename FT , typename IT , typename CT , typename Interface >
void Euclid::read_off ( const std::string &  filename,
std::vector< FT > &  positions,
std::vector< CT > *  vcolors,
std::vector< IT > *  findices,
std::vector< CT > *  fcolors 
)

Off file can store positions, indices, vertex colors and face colors. Note that index count can vary per face, but it's asumed to be fixed for all faces by this reader. Also note that off file format can store edge indices, which is often 0, thus omitted by this reader.

Template Parameters
NNumber of vertices per face.
FTType of floating point value.
ITType of index value.
CTType of color value.
InterfaceUser should never specify the type for it.
Parameters
filenameInput file name.
positionsVertex positions.
vcolorsVertex colors, including r, g, b, a. Use nullptr if you don't want to read them.
findicesFace indices. Use nullptr if you don't want to read them.
fcolorsFace colors, including r, g, b, a. Use nullptr if you don't want to read them.

Note

Proper overloading functions are implemented so that it's not necessary to provide template parameters even if nullptr is used.

template<int N, typename FT , typename IT , typename CT , typename Interface >
void Euclid::write_off ( const std::string &  filename,
const std::vector< FT > &  positions,
const std::vector< CT > *  vcolors,
const std::vector< IT > *  findices,
const std::vector< CT > *  fcolors 
)

Off file can store positions, indices, vertex colors and face colors. Note that index count can vary per face, but it's asumed to be fixed for all faces by this reader. Also note that off file format can store edge indices, which is often 0, thus omitted by this reader.

Template Parameters
NNumber of vertices per face.
FTType of floating point value.
ITType of index value.
CTType of color value.
InterfaceUser should never specify the type for it.
Parameters
filenameInput file name.
positionsVertex positions.
vcolorsVertex colors, including r, g, b, a. Use nullptr if you don't want to write them.
findicesFace indices. Use nullptr if you don't want to write them.
fcolorsFace colors, including r, g, b, a. Use nullptr if you don't want to write them.

Note

Proper overloading functions are implemented so that it's not necessary to provide template parameters even if nullptr is used.