Skip to Content.
Sympa Menu

cgal-discuss - Re:Re: [cgal-discuss] Reading and writing Point_3 values to file

Subject: CGAL users discussion list

List archive

Re:Re: [cgal-discuss] Reading and writing Point_3 values to file


Chronological Thread 
  • From: 卢建杰 <>
  • To: naresh <>
  • Cc: cgal-discuss <>
  • Subject: Re:Re: [cgal-discuss] Reading and writing Point_3 values to file
  • Date: Thu, 26 Mar 2009 22:14:46 +0800 (CST)

is a good idea


在2009-03-26,naresh <> 写道:
Hi
 
You can easily read or write points. You can user  Point_3 from kernel and using ofstream and ifstream you can read and write.
 
 
Here is example :
 
typedef kernel::Point_3 Point_3;
 
Reading :
 
int pointsize;
Point p;

std::ifstream outfile;

outfile.open ("test.pts");
outfile >> pointsize;
 
for(int i=0; i<pointsize; ++i)
{
    outfile >> p;
    // now you have point p that you can do what you want
}
 
Writing :
 

std::ofstream outfile;

outfile.open ("test.pts");

outfile << Points.size() << "\n";

for (int i=0; i< Points.size(); ++i)

{

outfile << Points[i] << "\n";

}

 
All this is only sample psuecode. You have to implement your self
 
 
----- Original Message -----
From:
To:
Sent: Thursday, March 26, 2009 3:04 PM
Subject: [cgal-discuss] Reading and writing Point_3 values to file

Hello,

 

Is there a convenient way to write Point_3 values to a file stream (using a cout operator), and then reading them, using a cin in the same order? I am using a gmpq kernel.

 

Amir.




网易邮箱,中国第一大电子邮件服务商



Archive powered by MHonArc 2.6.16.

Top of Page