Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Triangulation: "global" Cell's order , and Cell_handle comparation

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Triangulation: "global" Cell's order , and Cell_handle comparation


Chronological Thread 
  • From: Philipp Moeller <>
  • To:
  • Subject: Re: [cgal-discuss] Triangulation: "global" Cell's order , and Cell_handle comparation
  • Date: Fri, 11 May 2012 15:16:03 +0200
  • Organization: GeometryFactory

horstmann
<>
writes:

> Hi everyone!
>
> If I had a triangulation as follows:
>
> std::vector<Point> P;
>
> for(i=0;i<*nsphere;i++)
> // Add point to triangulation
> P.push_back(Point(coord[pos],coord[pos+1],coord[pos+2]));
>
> Delaunay dt(P.begin(), P.end());
>
> 1. Then, is there a "global" order of the Finite_Cells respect to the whole
> triangulation¿?
> i.e., a global index of each Finite_Cell between the range [0 ,
> dt.number_of_finite_cells()-1 ]
> Is it possible to get that index?¿

Well, the index would be std::distance(cell_begin, cell_iter). You
shouldn't use that though, as the complexity depends on the storage and
can be linear. You might want to add an id field to the cell base used
in your triangulation to get the same functionality. And initialize all
cells once you have built the triangulation. (You are not talking about
gloabl ids here, but local ids, if I get you correctly).

>
> 2. Is it possible to compare two Cell_handle's as pointers, in order to know
> if they point to the same cell¿?
>
> typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
> typedef CGAL::Delaunay_triangulation_3<K, CGAL::Fast_location>
> Delaunay;
> typedef Delaunay::Cell_handle Cell_handle;
>
> Cell_handle ch1,ch2;
> ... assign someything
> * if (ch1 == ch2) ....... *
>
> Does it make sense??
> If not, is it possible to compare to cell's ?¿

Yes. All handles are equivalent to their respective iterators which
requires them to have equality.

--
Philipp Moeller
GeometryFactory



Archive powered by MHonArc 2.6.16.

Top of Page