Jonathan Fu
Jonathan Fu

Reputation: 31

Visualising the CGAL Line_face_circulator

on a project I'm working on we are trying to test out the line_walk() function and work with the Line_face_circulator. Would there be a way to visualise the faces in the Line_face_circulator? The problem that I am having is figuring out how to extract information from the circulator. I've tried some of the methods below which didn't work but the documentation for the LFC is a bit difficult to maneuver around.

Delaunay::Line_face_circulator lfc = dt.line_walk(Point_2(13, 166), Point_2(42, 1761));
std::cout << "linewalk res" << std::endl;
Container container(lfc);
Iterator i = container.begin();
std::cout << typeid(i).name() << std::endl;
//std::cout << (container.begin()->vertex(0)) << std::endl;
std::cout << lfc.is_empty() << std::endl;
//std::cout << lfc->vertex(0) << std::endl;
//std::cout << *i->vertex(0)->point() << std::endl;
while (i != container.end()){
  std::cout << *i << std::endl;
  i++;
}

May I ask if there are particular methods to extract the faces or the vertices of the faces from the line_face_circulator?

Thank you!

Upvotes: 0

Views: 48

Answers (1)

sloriot
sloriot

Reputation: 6263

Something like the following should work:

Delaunay::Line_face_circulator lfc = dt.line_walk(Point_2(13, 166), Point_2(42, 1761)), start=lfc;

std::vector<Delaunay::Face_handle> visited_faces;
if (lfc!=nullptr)
{
  do{
    visited_face.push_back(lfc);
  } while(++lfc!=start);
}

Circulator doc is here.

Upvotes: 2

Related Questions