Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] The class Triangulation

Subject: CGAL users discussion list

List archive

[cgal-discuss] The class Triangulation


Chronological Thread 
  • From: sara_mahdavi <>
  • To:
  • Subject: [cgal-discuss] The class Triangulation
  • Date: Sun, 18 Oct 2009 16:16:35 -0700 (PDT)


hi
I need visit face in Triangulation, I read manual cgal ,but output example
is ambiguous ,and I need for visit all face by iterator but error Occurs,
line error in program is: std::cout << *vit1<std::endl;//error is
#include "stdafx.h"
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Delaunay_triangulation_3.h>
#include <CGAL/Triangulation_vertex_base_with_info_3.h>
#include <CGAL/IO/Color.h>
#include <fstream>
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef CGAL::Triangulation_vertex_base_with_info_3<CGAL::Color, K> Vb;
typedef CGAL::Triangulation_data_structure_3<Vb> Tds;
typedef CGAL::Delaunay_triangulation_3<K, Tds> Delaunay;
typedef Delaunay::Point Point;
//typedef TriangulationDataStructure 3::Facet Facet;
int main()
{
Delaunay T;
char ch;
T.insert(Point(0,0,0));
T.insert(Point(1,0,0));
T.insert(Point(0,1,0));
T.insert(Point(0,0,1));
T.insert(Point(2,2,2));
T.insert(Point(-1,0,1));
// Set the color of finite vertices of degree 6 to red.
Delaunay::Finite_vertices_iterator vit;
std::ofstream oFileT("output_tds.txt",std::ios::out);
oFileT<<T;
std::ifstream oFileT1("output_tds.txt",std::ios::in);
oFileT1>>T;
std::cout<<T;
for (vit = T.finite_vertices_begin(); vit != T.finite_vertices_end(); ++vit)
{
if (T.degree(vit) == 6)
vit->info() = CGAL::RED;
std::cout << *vit<<std::endl;
}
Delaunay::Finite_facets_iterator vit1;
for (vit1= T.finite_facets_begin(); vit1 != T.finite_facets_end(); ++vit1)
std::cout << *vit1<std::endl;//error is
std::cin>>ch;
return 0;
}
please help me in structure triangulation and output.thanks.
3
6
0 0 0
1 0 0
0 1 0
0 0 1
2 2 2
-1 0 1
12
1 2 3 4
0 1 3 6
2 1 0 4
1 3 2 0
2 0 3 5
2 5 3 4
2 0 5 4
6 1 3 4
5 6 3 4
5 0 6 4
0 1 6 4
5 0 3 6
5 7 2 3
7 11 10 3
10 6 0 3
4 2 1 0
11 5 6 3
8 0 6 4
9 5 2 4
0 8 10 1
7 5 9 11
10 8 6 11
7 9 2 1
1 8 9 4
what is numbers next 12?(1 2 3 4) ?


--
View this message in context:
http://www.nabble.com/The-class-Triangulation-tp25951474p25951474.html
Sent from the cgal-discuss mailing list archive at Nabble.com.




Archive powered by MHonArc 2.6.16.

Top of Page