\( \newcommand{\E}{\mathrm{E}} \) \( \newcommand{\A}{\mathrm{A}} \) \( \newcommand{\R}{\mathrm{R}} \) \( \newcommand{\N}{\mathrm{N}} \) \( \newcommand{\Q}{\mathrm{Q}} \) \( \newcommand{\Z}{\mathrm{Z}} \) \( \def\ccSum #1#2#3{ \sum_{#1}^{#2}{#3} } \def\ccProd #1#2#3{ \sum_{#1}^{#2}{#3} }\)
CGAL 4.14.3 - 3D Polyhedral Surface

Functions

template<class PolyhedronTraits_3 >
bool read_off (std::istream &in, Polyhedron_3< PolyhedronTraits_3 > &P)
 
template<class PolyhedronTraits_3 >
std::istream & operator>> (std::istream &in, Polyhedron_3< PolyhedronTraits_3 > &P)
 
template<class PolyhedronTraits_3 >
bool write_off (std::ostream &out, Polyhedron_3< PolyhedronTraits_3 > &P)
 
template<class PolyhedronTraits_3 >
std::ostream & operator<< (std::ostream &out, Polyhedron_3< PolyhedronTraits_3 > &P)
 

Function Documentation

◆ operator
template<class PolyhedronTraits_3 >
std::ostream & operator<< ( std::ostream &  out,
Polyhedron_3< PolyhedronTraits_3 > &  P 
)
related

◆ operator>>()

template<class PolyhedronTraits_3 >
std::istream & operator>> ( std::istream &  in,
Polyhedron_3< PolyhedronTraits_3 > &  P 
)
related

◆ read_off()

template<class PolyhedronTraits_3 >
bool read_off ( std::istream &  in,
Polyhedron_3< PolyhedronTraits_3 > &  P 
)
related

This function reads a polyhedral surface in Object File Format, OFF, with file extension .off, which is also understood by Geomview [5], from the input stream in and appends it to the polyhedral surface \( P\). Only the point coordinates and facets from the input stream are used to build the polyhedral surface. Neither normal vectors nor color attributes are evaluated. If the stream in does not contain a permissible polyhedral surface the ios::badbit of the input stream in is set and \( P\) remains unchanged.

For OFF an ASCII and a binary format exist. The stream detects the format automatically and can read both.

See also
CGAL::Polyhedron_3<Traits>
CGAL::Polyhedron_incremental_builder_3<HDS>
operator<<(std::ostream&, Polyhedron_3<PolyhedronTraits_3>&)

This function overloads the generic function read_off(std::istream&,FaceGraph).

Implementation

This operator is implemented using the modifier mechanism for polyhedral surfaces and the Polyhedron_incremental_builder_3 class, which allows the construction in a single, efficient scan pass of the input and handles also all the possible flexibility of the polyhedral surface.

◆ write_off()

template<class PolyhedronTraits_3 >
bool write_off ( std::ostream &  out,
Polyhedron_3< PolyhedronTraits_3 > &  P 
)
related

This function writes the polyhedral surface \(P\) to the output stream out using the Object File Format, OFF, with file extension .off, which is also understood by GeomView [5]. The output is in ASCII format. From the polyhedral surface, only the point coordinates and facets are written. Neither normal vectors nor color attributes are used.

For OFF an ASCII and a binary format exist. The format can be selected with the CGAL modifiers for streams, set_ascii_mode() and set_binary_mode() respectively. The modifier set_pretty_mode() can be used to allow for (a few) structuring comments in the output. Otherwise, the output would be free of comments. The default for writing is ASCII without comments.

This function overloads the generic function write_off(std::istream&,FaceGraph) .

See also
CGAL::Polyhedron_3<Traits>
CGAL::Polyhedron_incremental_builder_3<HDS>
operator>>(std::istream& in, Polyhedron_3<PolyhedronTraits_3>& P)