Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] A problem with iso oriented box intersection package

Subject: CGAL users discussion list

List archive

[cgal-discuss] A problem with iso oriented box intersection package


Chronological Thread 
  • From: BBB HHH <>
  • To:
  • Subject: [cgal-discuss] A problem with iso oriented box intersection package
  • Date: Wed, 10 Dec 2008 11:08:09 +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=S9SSboWnOiy2kcCcICzE1tRlNm+dnIRvaNewcnKyXMKnUibkM4Gk3KJ/yS/o4GHMjq+puWQBvCbPlDdI0jl16N0UW7f7qfLW4jgYjkvifzVJ3wFzFU1MK2Jmt1xb5GoFQGGYFgbi7zSbibXz9C0MjfS11BgyvCEdiYyd0vlFaEs=;

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);
    }
   
   
};






Archive powered by MHonArc 2.6.16.

Top of Page