Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Convex Hull problem

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Convex Hull problem


Chronological Thread 
  • From: Leandro Gazoni <>
  • To:
  • Subject: Re: [cgal-discuss] Convex Hull problem
  • Date: Sat, 22 Aug 2009 18:28:43 -0300
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=XJJBDhqNz4Pneh1d0ndlmuKKqEDs83BulKMzDtSsar3XaCcbhafCcjamFFS0VuBly/ WX+KwPF1as9y/kC+j1Y+xDJi6DnIkU4O80Q70BT3rXotHvtztQ/MNWtHaBrM3z6E/Lnj 7sQEJy1V6sYzu7z/cZkrShzImN8jg9Q8kTbjg=

Dear Friends,

Would like to take this option in my code because I will take these data to include more points in the radius of these coordinates.

Gazoni


2009/8/22 Atul Thakur <>
If you just want to write it to a file for reading...easiest way without changing your code is that you can redirect the output to a file.

Like on windows you can give this command... 

yourapplication.exe >>output.txt

-Atul


On Sat, Aug 22, 2009 at 4:46 PM, Leandro Gazoni <> wrote:
Hello,

I have the problem!!!
I have a procedure that returns a list of vertices of the convex hull, I would like to save this list in a file and then read this list again. How to save this list in a file?

In the terminal I can see the output of the vertices, example:
Pontos do Convex Hull sao:

-965 497 803 1
-909 -199 -201 1
-905 303 -378 1
-455 -738 995 1
-623 -966 -322 1
205 -948 -8 1
-853 -625 -69 1
-986 -59 225 1
925 -738 515 1



/***************************************************************************************/
void List_CH(Polyhedron_3 Poly) {

    /* CRIANDO ARQUIVO DOS PONTOS DO CONVEX HULL */
    string line;
    fstream fgrava;
    fgrava.open("CH_Gerado.txt");

    /* PONTOS DO CONVEX HULL */
    Polyhedron_3::Vertex_iterator vi;
    std::vector<Point_3> ret;

    if (!Poly.empty()) {
        vi = Poly.vertices_begin();
        //fa = Pcvx.facets_begin();

        std::cerr << "Pontos do Convex Hull sao:" << std::endl;
        for (; vi != Poly.vertices_end(); vi++) {

            Polyhedron_3::Vertex v = *vi;
            ret.push_back(v.point());
            std::cout << v.point() << std::endl;

            while (fgrava.eof()) {
                getline(fgrava, line);
                cout << line << endl;
            }
            fgrava.seekg(0, ios::end);
            fgrava << v.point() << "\n";
            fgrava.close();

        }
    }

thanks
--
Leandro Gazoni




--
Leandro Gazoni



Archive powered by MHonArc 2.6.16.

Top of Page