Subject: CGAL users discussion list
List archive
- From: BBB HHH <>
- To:
- Subject: Re : [cgal-discuss] A problem with iso oriented box intersection package
- Date: Wed, 10 Dec 2008 12:49:08 +0000 (GMT)
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.fr; h=X-YMail-OSG:Received:X-Mailer:References:Date:From:Subject:To:MIME-Version:Content-Type:Message-ID; b=hB/eX+ff8PS6Y/uCdB68+M6+OWp4XcrEc4Wgr28RiSffBEuP2D4H/qTBoDOn7q1+/ovlGKluIMFvffIin3KeGyrWzZBPyNRA6IKZJLiggSHvYnCng3Kg6S4h6D7rB8M23PSxjhkmTmpxzZ1WJWfyiTl6bjDxwOHcvTLf1Wjekgo=;
Hi Andreas and Pierre,
Thanks for your help. Things are working fine now.
Hichem
Thanks for your help. Things are working fine now.
Hichem
De : Andreas Fabri <>
À :
Envoyé le : Mercredi, 10 Décembre 2008, 12h14mn 39s
Objet : Re: [cgal-discuss] A problem with iso oriented box intersection package
Hi Hichem,
You can replace callback by operator()
and then you write
CGAL::box_self_intersection_d(boxes.begin(), boxes.end(),
*this, 10, CGAL::Box_intersection_d::HALF_OPEN);
Alternatively you can use std::mem_fun or std::mem_fun_ref
andreas
BBB HHH wrote:
> Hello,
>
> I am working with the CGAL::box_self_intersection_d to detect interrsections in a list of bboxes of triangles. I want to do this in an object oriented manner (inside a class). Some parts of my code are listed below. I can not compile my program since there are several errors in the line using box_self_intersection_d.
> I think the error is the use of the callback of box_self_intersection_d. In my program this callback is a class member function. In the examples provided by CGAL. The callback is a global function and the box_self_intersection_d function is called inside main(). Can someone help me to detect the problem (how to put a function object inside a class template and how to use it correctly). I tried a global function as a callback, the compile succeds but i can not acces the member data of my class.
>
> Thanks in advance
> Hichem BARKI
>
>
> #include <iostream>
> #include <vector>
> #include <list>
> #include <CGAL/intersections.h>
> #include <CGAL/Bbox_3.h>
> #include <CGAL/box_intersection_d.h>
> #include <CGAL/function_objects.h>
>
>
> using std::cout;
> using std::cin;
> using std::endl;
>
> template <class Kernel>
> class My_class
> {
> public:
> typedef typename Kernel::FT Number_type;
> typedef typename Kernel::Point_2 Point_2;
> typedef typename Kernel::Point_3 Point_3;
> typedef typename std::list< Triangle_3> Triangles;
> typedef typename Triangles::iterator tri_it;
> typedef CGAL::Box_intersection_d::Box_with_handle_d<double,3,tri_it> Box;
>
>
>
> // Member data
> Triangles triangles; // List of the superset triangles
> // Constructors
> My_class(....)
> {
> // Fill the list of Triangles
> .....
>
> }
> void callback(const& Box a, const Box& b)
> {
> // DO some processing with the member data of My_class
> }
> void get_inters_bboxes()
> {
> // Create the corresponding vector of bounding boxes
> std::vector<Box> boxes;
> for (tri_it iter = triangles.begin(); iter != triangles.end(); ++iter)
> boxes.push_back( Box( iter->bbox(), iter));
>
> // Run the self intersection algorithm with all defaults
> CGAL::box_self_intersection_d(boxes.begin(), boxes.end(), callback, 10, CGAL::Box_intersection_d::HALF_OPEN);
> }
> };
>
>
>
-- You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://lists-sop.inria.fr/wws/info/cgal-discuss
- [cgal-discuss] Nef Polyhedron no simple to OFF, jona_100, 12/09/2008
- RE: [cgal-discuss] Nef Polyhedron no simple to OFF, Fred Dorosh, 12/09/2008
- Re: [cgal-discuss] Nef Polyhedron no simple to OFF, Pierre Alliez, 12/09/2008
- Re: [cgal-discuss] Nef Polyhedron no simple to OFF, Peter Hachenberger, 12/10/2008
- [cgal-discuss] A problem with iso oriented box intersection package, BBB HHH, 12/10/2008
- Re: [cgal-discuss] A problem with iso oriented box intersection package, Pierre Alliez, 12/10/2008
- Re : [cgal-discuss] A problem with iso oriented box intersection package, BBB HHH, 12/11/2008
- Re: [cgal-discuss] A problem with iso oriented box intersection package, Andreas Fabri, 12/10/2008
- Re : [cgal-discuss] A problem with iso oriented box intersection package, BBB HHH, 12/10/2008
- Re: [cgal-discuss] A problem with iso oriented box intersection package, Pierre Alliez, 12/10/2008
- Re: Re: [cgal-discuss] Nef Polyhedron no simple to OFF, jona_100, 12/10/2008
- RE: Re: [cgal-discuss] Nef Polyhedron no simple to OFF, Fred Dorosh, 12/10/2008
- Re: RE: Re: [cgal-discuss] Nef Polyhedron no simple to OFF, jona_100, 12/11/2008
- Re: RE: Re: [cgal-discuss] Nef Polyhedron no simple to OFF, dekosser, 12/11/2008
- Re: Re: RE: Re: [cgal-discuss] Nef Polyhedron no simple to OFF, jona_100, 12/17/2008
- Re: Re: Re: RE: Re: [cgal-discuss] Nef Polyhedron no simple to OFF, jona_100, 12/18/2008
- Re: Re: Re: RE: Re: [cgal-discuss] Nef Polyhedron no simple to OFF, dekosser, 12/18/2008
- Re: [cgal-discuss] Nef Polyhedron no simple to OFF, Laurent Rineau (GeometryFactory), 12/18/2008
- Re: [cgal-discuss] Nef Polyhedron no simple to OFF, Pierre Alliez, 12/18/2008
- Re: Re: [cgal-discuss] Nef Polyhedron no simple to OFF, jona_100, 12/19/2008
- Re: Re: RE: Re: [cgal-discuss] Nef Polyhedron no simple to OFF, jona_100, 12/17/2008
- Re: RE: Re: [cgal-discuss] Nef Polyhedron no simple to OFF, dekosser, 12/11/2008
- Re: RE: Re: [cgal-discuss] Nef Polyhedron no simple to OFF, jona_100, 12/11/2008
- RE: Re: [cgal-discuss] Nef Polyhedron no simple to OFF, Fred Dorosh, 12/10/2008
- [cgal-discuss] A problem with iso oriented box intersection package, BBB HHH, 12/10/2008
- RE: [cgal-discuss] Nef Polyhedron no simple to OFF, Fred Dorosh, 12/09/2008
Archive powered by MHonArc 2.6.16.