Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Binary Polyhedron_3 I/O questions

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Binary Polyhedron_3 I/O questions


Chronological Thread 
  • From: "Rui Guo" <>
  • To:
  • Subject: Re: [cgal-discuss] Binary Polyhedron_3 I/O questions
  • Date: Tue, 18 Nov 2008 10:16:13 +0800
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:references; b=H6wzCw9dupTsCPQ/nI6VYvWfnaf5Sj8LnfUFEYgYgwgPTr8RGHiY/uOaHOc/NVKH8n wUX5/K7TQAwyi6X0KzQlvQth0nOXUqdKSOpc0Afc3HG6aZxszFkNiUS6R4uKxr3qDzX3 +c4btVdWpAn7gQOu9tVY/IUzZUZUYSohOoJRk=

Chapter 63 IO Streams in manul may help.
You need to set stream mode to binary.


2008/11/18 Joe C <>
Hi,

I got some issue with Polyhedron_3 I/O stuff. I have two polyhedron .off files in ascii mode (poly_ascii.off) and binary mode (poly_binary.off) respectively. They are the same polyhedron, the only difference is that one is in ascii mode and the other is in binary mode. I use the following code snipet to read in the files

typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel;
typedef CGAL::Polyhedron_3<Kernel>         Polyhedron;

// Read in ascii file
Polyhedron poly_ascii;
std::ifstream OpenFile("poly_ascii.off");
OpenFile >> poly_ascii;
OpenFile.close();

std::cout<< "poly is valid ? " << poly_ascii.is_valid() << std::endl; // true
std::cout<< "size of facets ? " << poly_ascii.size_of_facets() << std::endl; // This is O.K, size of polyhedron is correct.

/////////////////////////////////
// Read in binary file, replacing the above code
Polyhedron poly_binary;
std::ifstream OpenFile("poly_binary.off");
OpenFile >> poly_binary;
OpenFile.close();

std::cout<< "poly is valid ? " << poly_binary.is_valid() << std::endl; // true
std::cout<< "size of facets ? " << poly_binary.size_of_facets() << std::endl; // This is NOT O.K, size of polyhedron is zero.


It seems that CGAL does not handle the binary case correctly. Is this a bug or am I missing something to read the binary file right?

Thanks.

Joe





Archive powered by MHonArc 2.6.16.

Top of Page