Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] Triangulation_cell_base_with_info_3 - how to access the info?

Subject: CGAL users discussion list

List archive

[cgal-discuss] Triangulation_cell_base_with_info_3 - how to access the info?


Chronological Thread 
  • From: <>
  • To:
  • Subject: [cgal-discuss] Triangulation_cell_base_with_info_3 - how to access the info?
  • Date: Fri, 13 Mar 2009 19:44:16 +0100 (CET)

Hi, I'm using Triangulation_cell_base_with_info_3 so that I can augment cells
with more information, but reading the manual, it says:
"It provides an easy way to add some user defined information in cells. Note
that input/output operators discard this additional information."

This statement confuses me, as if input/output iterators discard this
additional information, does that mean I cannot access the extra information
when I am using Triangulation_cell_base_with_info_3 with for example a
hierarchical delaunay triangulation (as below)?

Setup:

typedef CGAL::Exact_predicates_inexact_constructions_kernel J;
typedef CGAL::Triangulation_cell_base_with_info_3<TetraInfo, J> Cb;
typedef CGAL::Triangulation_vertex_base_3<J> Vb;
typedef CGAL::Triangulation_hierarchy_vertex_base_3<Vb> Vbh;
typedef CGAL::Triangulation_data_structure_3<Vbh, Cb> Tds_info;
typedef CGAL::Delaunay_triangulation_3<J,Tds_info> Dt_info;
typedef CGAL::Triangulation_hierarchy_3<Dt_info> Dh_info;

typedef Dh_info::Finite_vertices_iterator Finite_vertices_iteratorI;
typedef Dh_info::Finite_cells_iterator Finite_cells_iteratorI;
typedef Dh_info::Vertex_handle Vertex_handleI;
typedef Dh_info::Point PointI;
typedef Dh_info::Cell CellI;

Code:

//create triangulation
Dh_info dti;

//populate with points
for (int i=0; i<vertex_positionsI.size(); ++i)
{
dti.insert(vertex_positionsI[i]);
}

//output in geomview to confirm triangulation is successful
gv<<dti;

for (Finite_cells_iteratorI fit=dti.finite_cells_begin();
fit!=dti.finite_cells_end();++fit)
{
cout<<(*fit).info.in_model<<endl; <------compile error here
}

Compile error:

[something really long] does not have class type

Tetrainfo, my info class, is just a simple class:
class TetraInfo{
public:
TetraInfo();
bool in_model;
};

Can I simply not access my additional information through this method?
If not, how can I access my additional information?

Thanks for your help,
Qi



Archive powered by MHonArc 2.6.16.

Top of Page