- Added print_polyhedron_ functions that match everything instead of

just Polyhedron_3 with its potential template template parameter.
- Different names for the two versions: print_polyhedron_OFF and
  print_polyhedron_header_OFF
- Added const declarations in test_polyhedron_io[_old].C to
  the char * string constants.
This commit is contained in:
Lutz Kettner 2002-04-26 13:30:03 +00:00
parent 00abbd9604
commit c4a143d350
12 changed files with 108 additions and 42 deletions

View File

@ -1,5 +1,15 @@
Polyhedron_IO Package: Release changes:
---------------------------------------------------------------------
3.11 (26 Apr 2002)
- Added print_polyhedron_ functions that match everything instead of
just Polyhedron_3 with its potential template template parameter.
- Different names for the two versions: print_polyhedron_OFF and
print_polyhedron_header_OFF
- Added const declarations in test_polyhedron_io[_old].C to
the char * string constants.
3.10 (17 Dec 2001)
- Fixed some warnings about double to float and int to bool conversions.

View File

@ -61,7 +61,7 @@ public:
typedef File_header_OFF Self;
typedef File_header_extended_OFF Base;
File_header_OFF( bool verbose = false);
explicit File_header_OFF( bool verbose = false);
File_header_OFF( bool binary, bool noc, bool skel,
bool verbose = false);
//File_header_OFF( int v, int h, int f, bool verbose = false);

View File

@ -52,7 +52,7 @@ operator<<( std::ostream& out, const Polyhedron_3<Traits,Items,HDS,Alloc>& P) {
// writes P to `out' in PRETTY, ASCII or BINARY format
// as the stream indicates.
File_header_OFF header( is_binary( out), ! is_pretty( out), false);
CGAL::print_OFF( out, P, header);
CGAL::print_polyhedron_with_header_OFF( out, P, header);
return out;
}

View File

@ -36,6 +36,30 @@
CGAL_BEGIN_NAMESPACE
template <class Polyhedron>
void print_polyhedron_with_header_OFF( std::ostream& out,
const Polyhedron& P,
const File_header_OFF& header) {
File_writer_OFF writer( header);
writer.header().set_polyhedral_surface( true);
writer.header().set_halfedges( P.size_of_halfedges());
generic_print_polyhedron( out, P, writer);
}
template <class Polyhedron>
void print_polyhedron_OFF( std::ostream& out,
const Polyhedron& P,
bool verbose = false) {
File_header_OFF header( verbose);
header.set_binary( is_binary( out));
header.set_no_comments( ! is_pretty( out));
print_polyhedron_with_header_OFF( out, P, header);
}
// Deprecated global functions, replaced with functions above
#ifdef CGAL_USE_POLYHEDRON_DESIGN_ONE
template <class Traits, class HDS>
void

View File

@ -32,6 +32,14 @@
CGAL_BEGIN_NAMESPACE
template <class Polyhedron>
void print_polyhedron_VRML_1( std::ostream& out, const Polyhedron& P) {
VRML_1_ostream os( out);
os << P;
}
// Deprecated global functions, replaced with functions above
#ifdef CGAL_USE_POLYHEDRON_DESIGN_ONE
template <class Traits, class HDS>
void

View File

@ -32,6 +32,14 @@
CGAL_BEGIN_NAMESPACE
template <class Polyhedron>
void print_polyhedron_VRML_2( std::ostream& out, const Polyhedron& P) {
VRML_2_ostream os( out);
os << P;
}
// Deprecated global functions, replaced with functions above
#ifdef CGAL_USE_POLYHEDRON_DESIGN_ONE
template <class Traits, class HDS>
void

View File

@ -33,6 +33,14 @@
CGAL_BEGIN_NAMESPACE
template <class Polyhedron>
void print_polyhedron_inventor( std::ostream& out, const Polyhedron& P) {
Inventor_ostream os( out);
os << P;
}
// Deprecated global functions, replaced with functions above
#ifdef CGAL_USE_POLYHEDRON_DESIGN_ONE
template <class Traits, class HDS>
void

View File

@ -35,6 +35,14 @@
CGAL_BEGIN_NAMESPACE
template <class Polyhedron>
void print_polyhedron_wavefront( std::ostream& out, const Polyhedron& P) {
File_writer_wavefront writer;
generic_print_polyhedron( out, P, writer);
}
// Deprecated global functions, replaced with functions above
#ifdef CGAL_USE_POLYHEDRON_DESIGN_ONE
template <class Traits, class HDS>
void

View File

@ -1 +1 @@
Lutz Kettner <kettner@inf.ethz.ch>
Lutz Kettner <kettner@mpi-sb.mpg.de>

View File

@ -47,22 +47,22 @@
using namespace CGAL;
char* triangle = "OFF\n"
"3 1 0\n"
"0 0 0\n"
"1 0 0\n"
"0 1 0\n"
"3 0 1 2\n";
char* tetra = "OFF\n"
"4 4 0\n"
"0 0 0.707107\n"
"1 1 0.707107\n"
"0 1 0\n"
"1 0 0\n"
"3 1 3 0\n"
"3 2 1 0\n"
"3 3 2 0\n"
"3 2 3 1\n";
const char* triangle = "OFF\n"
"3 1 0\n"
"0 0 0\n"
"1 0 0\n"
"0 1 0\n"
"3 0 1 2\n";
const char* tetra = "OFF\n"
"4 4 0\n"
"0 0 0.707107\n"
"1 1 0.707107\n"
"0 1 0\n"
"1 0 0\n"
"3 1 3 0\n"
"3 2 1 0\n"
"3 3 2 0\n"
"3 2 3 1\n";
void test_file_IO_OFF() {
@ -86,7 +86,7 @@ void test_file_IO_OFF() {
CGAL_assertion( P.is_triangle( P.halfedges_begin()));
std::ostrstream out_new( buffer, 100000);
print_OFF( out_new, P, true);
print_polyhedron_OFF( out_new, P, true);
out_new << '\0';
std::istrstream bufin_new( buffer, 100000);
P = Polyhedron();
@ -95,7 +95,7 @@ void test_file_IO_OFF() {
CGAL_assertion( P.is_triangle( P.halfedges_begin()));
{
std::ofstream out2( "triangle_binary.off");
print_OFF( out2, P, true);
print_polyhedron_OFF( out2, P, true);
}
std::ifstream filein( "triangle_binary.off");
P = Polyhedron();
@ -117,7 +117,7 @@ void test_file_IO_OFF() {
CGAL_assertion( P.is_tetrahedron( P.halfedges_begin()));
{
std::ofstream out2( "tetra_binary.off");
print_OFF( out2, P, true);
print_polyhedron_OFF( out2, P, true);
}
std::ifstream filein( "tetra_binary.off");
P = Polyhedron();

View File

@ -45,22 +45,22 @@
using namespace CGAL;
char* triangle = "OFF\n"
"3 1 0\n"
"0 0 0\n"
"1 0 0\n"
"0 1 0\n"
"3 0 1 2\n";
char* tetra = "OFF\n"
"4 4 0\n"
"0 0 0.707107\n"
"1 1 0.707107\n"
"0 1 0\n"
"1 0 0\n"
"3 1 3 0\n"
"3 2 1 0\n"
"3 3 2 0\n"
"3 2 3 1\n";
const char* triangle = "OFF\n"
"3 1 0\n"
"0 0 0\n"
"1 0 0\n"
"0 1 0\n"
"3 0 1 2\n";
const char* tetra = "OFF\n"
"4 4 0\n"
"0 0 0.707107\n"
"1 1 0.707107\n"
"0 1 0\n"
"1 0 0\n"
"3 1 3 0\n"
"3 2 1 0\n"
"3 3 2 0\n"
"3 2 3 1\n";
void test_file_IO_OFF() {
@ -87,7 +87,7 @@ void test_file_IO_OFF() {
CGAL_assertion( P.is_triangle( P.halfedges_begin()));
std::ostrstream out_new( buffer, 100000);
print_OFF( out_new, P, true);
print_polyhedron_OFF( out_new, P, true);
out_new << '\0';
std::istrstream bufin_new( buffer, 100000);
P = Polyhedron();
@ -96,7 +96,7 @@ void test_file_IO_OFF() {
CGAL_assertion( P.is_triangle( P.halfedges_begin()));
{
std::ofstream out2( "triangle_binary.off");
print_OFF( out2, P, true);
print_polyhedron_OFF( out2, P, true);
}
std::ifstream filein( "triangle_binary.off");
P = Polyhedron();
@ -118,7 +118,7 @@ void test_file_IO_OFF() {
CGAL_assertion( P.is_tetrahedron( P.halfedges_begin()));
{
std::ofstream out2( "tetra_binary.off");
print_OFF( out2, P, true);
print_polyhedron_OFF( out2, P, true);
}
std::ifstream filein( "tetra_binary.off");
P = Polyhedron();

View File

@ -1 +1 @@
3.10 (17 Dec 2001)
3.11 (26 Apr 2002)