Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] convex hull for points

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] convex hull for points


Chronological Thread 
  • From: Stephane Tayeb <>
  • To:
  • Subject: Re: [cgal-discuss] convex hull for points
  • Date: Thu, 27 Aug 2009 16:18:39 +0200

Hi,


wrote:
I came up with this piece of code which compiles fine, but I get an exception
when I try to do a "facet->second". Could anybody please give a hint on how to
fix it?

std::list<CGAL::Object> facets;
as.filtration(std::back_inserter(facets));

std::list<CGAL::Object>::iterator fit;
for(fit = facets.begin(); fit != facets.end(); fit++)
{
const CGAL::Facet* facet = CGAL::object_cast<Facet>(&(*fit));

Using your pointer without checking if the cast is a success (facet != NULL) is not a good idea I think.
I don't know if it can help.

for(int i = 0; i < 4; i++)
{
if(i != facet->second) // **** Exception here
{
std::cout << " " <<
Point_map[facet->first->vertex(i)->point()];
}
}
std::cout << std::endl;
}

Regards,

--
Stephane Tayeb
Software engineer - INRIA Sophia Antipolis
Geometrica Project-Team




Archive powered by MHonArc 2.6.16.

Top of Page