Example use of circulator to collect all cells around an edge?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Example use of circulator to collect all cells around an edge?

Adam Getchell
Hello all,

If I want to collect cells incident to a vertex  in a Triangulation into a container, I use `OutputIterator CGAL::Triangulation_3<Traits, TDS, SLDS>::incident cells`, passing in the Vertex_handle of the vertex and an OutputIterator (e.g., std::back_inserter) to the container of collected cells, e.g.:

tds().incident_cells(Vertex_handle, std::back_inserter(cells)

From looking at the documentation:


I’m not clear how to do the same for the cells around an edge.

It looks like `Cell_circulator CGAL::Triangulation_3<Traits, TDS, SLDS>::incident_cells(Edge e, Cell_handle start) const` would give me a circulator of the cells incident to the edge, but I’m not able to resolve to the correct overload of the incident_cells() function.

I’m passing in for the Edge argument an Edge_handle:

using Edge_handle = std::tuple<Cell_handle, int, int>

Which describes the edge according to a cell and two vertices in the cell which comprise the Edge. On that logic, then, I’m using `incident_cells(Edge_handle e, std::get<0>(Edge_handle)` to pass in the Edge and starting Cell, but this is not resolving.

Is there an example of how to obtain a Cell_circulator of the incident cells to an edge?

Thanks for your attention,

Adam
-- 

Reply | Threaded
Open this post in threaded view
|

Re: Example use of circulator to collect all cells around an edge?

andreas.fabri

Hi Adam,

https://doc.cgal.org/latest/Triangulation_3/classCGAL_1_1Triangulation__3.html#a0f355dbb38cf631f24d4df8abd7a942f

states:  typedef Triangulation_data_structure::Edge Edge

and when you loo at the concept

https://doc.cgal.org/latest/TDS_3/classTriangulationDataStructure__3.html

you find:  typedef Triple< Cell_handle, int, int > Edge

Best,

Andreas


On 2/25/2019 5:58 AM, Adam Getchell wrote:
Hello all,

If I want to collect cells incident to a vertex  in a Triangulation into a container, I use `OutputIterator CGAL::Triangulation_3<Traits, TDS, SLDS>::incident cells`, passing in the Vertex_handle of the vertex and an OutputIterator (e.g., std::back_inserter) to the container of collected cells, e.g.:

tds().incident_cells(Vertex_handle, std::back_inserter(cells)

From looking at the documentation:


I’m not clear how to do the same for the cells around an edge.

It looks like `Cell_circulator CGAL::Triangulation_3<Traits, TDS, SLDS>::incident_cells(Edge e, Cell_handle start) const` would give me a circulator of the cells incident to the edge, but I’m not able to resolve to the correct overload of the incident_cells() function.

I’m passing in for the Edge argument an Edge_handle:

using Edge_handle = std::tuple<Cell_handle, int, int>

Which describes the edge according to a cell and two vertices in the cell which comprise the Edge. On that logic, then, I’m using `incident_cells(Edge_handle e, std::get<0>(Edge_handle)` to pass in the Edge and starting Cell, but this is not resolving.

Is there an example of how to obtain a Cell_circulator of the incident cells to an edge?

Thanks for your attention,

Adam
-- 

-- 
Andreas Fabri, PhD
Chief Officer, GeometryFactory
Editor, The CGAL Project

phone: +33.492.954.912    skype: andreas.fabri
Reply | Threaded
Open this post in threaded view
|

Re: Example use of circulator to collect all cells around an edge?

Adam Getchell
Great, thanks!

I was able to collect the cells around an edge once I used the correct CGAL::Edge type in incident_cells().

On Feb 24, 2019, at 11:50 PM, Andreas Fabri <[hidden email]> wrote:

Hi Adam,

https://doc.cgal.org/latest/Triangulation_3/classCGAL_1_1Triangulation__3.html#a0f355dbb38cf631f24d4df8abd7a942f

states:  typedef Triangulation_data_structure::Edge Edge

and when you loo at the concept

https://doc.cgal.org/latest/TDS_3/classTriangulationDataStructure__3.html

you find:  typedef Triple< Cell_handle, int, int > Edge

Best,

Andreas


On 2/25/2019 5:58 AM, Adam Getchell wrote:
Hello all,

If I want to collect cells incident to a vertex  in a Triangulation into a container, I use `OutputIterator CGAL::Triangulation_3<Traits, TDS, SLDS>::incident cells`, passing in the Vertex_handle of the vertex and an OutputIterator (e.g., std::back_inserter) to the container of collected cells, e.g.:

tds().incident_cells(Vertex_handle, std::back_inserter(cells)

From looking at the documentation:


I’m not clear how to do the same for the cells around an edge.

It looks like `Cell_circulator CGAL::Triangulation_3<Traits, TDS, SLDS>::incident_cells(Edge e, Cell_handle start) const` would give me a circulator of the cells incident to the edge, but I’m not able to resolve to the correct overload of the incident_cells() function.

I’m passing in for the Edge argument an Edge_handle:

using Edge_handle = std::tuple<Cell_handle, int, int>

Which describes the edge according to a cell and two vertices in the cell which comprise the Edge. On that logic, then, I’m using `incident_cells(Edge_handle e, std::get<0>(Edge_handle)` to pass in the Edge and starting Cell, but this is not resolving.

Is there an example of how to obtain a Cell_circulator of the incident cells to an edge?

Thanks for your attention,

Adam
-- 

-- 
Andreas Fabri, PhD
Chief Officer, GeometryFactory
Editor, The CGAL Project

phone: +33.492.954.912    skype: andreas.fabri