Skip to Content.
Sympa Menu

cgal-discuss - Is it a bug of Polyhedron_3? (integration with boost graph)

Subject: CGAL users discussion list

List archive

Is it a bug of Polyhedron_3? (integration with boost graph)


Chronological Thread 
  • From: Tux Han <>
  • To:
  • Subject: Is it a bug of Polyhedron_3? (integration with boost graph)
  • Date: Sat, 17 Nov 2007 09:34:31 -0800 (PST)
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type:Message-ID; b=HpWH4wPWtVuXcknPfw3YeSF9Wug9xwbdYqPSNB5h9pT/9L/AtxDXCN1A6s0T3A0SzyLUobPlNHZ76c1UssthTXbo54vrX6moRswRAZEuk/r8KJ7AFKOWnpiYmDCd8ICsQShzokwdI+fK1wHGmDQWw3cFKk+3kUF+TsXEU6Ju+0k=;

Dear CGAL users,

I have a problem of integration of boost graph (BGL) and CGAL::Polyhedron_3. If I use dijkstra algorithm with Polyhedron_3, it will report some errors. I simplified the code and write a toy project. Can you point out the problem?

Is it a bug of CGAL?

Here is the code, and I compiled it on WinXP64 + Visual Studio 2005 sp1:

-----------------------------------------------------------------
#include <CGAL/Cartesian.h>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/Polyhedron_items_with_id_3.h>
#include <CGAL/boost/graph/graph_traits_Polyhedron_3.h>
#include <CGAL/boost/graph/properties_Polyhedron_3.h>

typedef CGAL::Cartesian<double>                                      Kernel;
typedef Kernel::Point_3                                              Point;
typedef CGAL::Polyhedron_3<Kernel,CGAL::Polyhedron_items_with_id_3>  Polyhedron;

typedef boost::graph_traits<Polyhedron>::vertex_descriptor vertex_descriptor;
typedef boost::graph_traits<Polyhedron>::vertex_iterator   vertex_iterator;

template <typename VertexListGraph>
void test(const VertexListGraph& g)
{
    typename boost::graph_traits<VertexListGraph>::vertex_iterator ui, ui_end;
    boost::tie(ui, ui_end) = boost::vertices(g);
}


int main() {

    Polyhedron P;

    Point a(1,0,0);
    Point b(0,1,0);
    Point c(0,0,1);
    Point d(0,0,0);

    P.make_tetrahedron(a,b,c,d);

    test(P);

    return 0;
}
-----------------------------------------------------------------


And here is the output of my compiler:

-----------------------------------------------------------------
1>------ Build started: Project: cons, Configuration: Release Win32 ------
1>Compiling...
1>cons.cpp
1>D:\Lib\boost\boost/tuple/detail/tuple_basic.hpp(637) : error C2679: binary '=' : no operator found which takes a right-hand operand of type 'const CGAL::HDS_all_vertices_const_iterator<HDS>' (or there is no acceptable conversion)
1>        with
1>        [
1>            HDS=CGAL::Polyhedron_3<Kernel,CGAL::Polyhedron_items_with_id_3>
1>        ]
1>        D:\Lib\CGAL-3.3.1\include\CGAL/boost/graph/graph_traits_HalfedgeDS.h(158): could be 'CGAL::HDS_all_vertices_iterator<HDS> &CGAL::HDS_all_vertices_iterator<HDS>::operator =(const CGAL::HDS_all_vertices_iterator<HDS> &)'
1>        with
1>        [
1>            HDS=CGAL::Polyhedron_3<Kernel,CGAL::Polyhedron_items_with_id_3>
1>        ]
1>        while trying to match the argument list '(CGAL::HDS_all_vertices_iterator<HDS>, const CGAL::HDS_all_vertices_const_iterator<HDS>)'
1>        with
1>        [
1>            HDS=CGAL::Polyhedron_3<Kernel,CGAL::Polyhedron_items_with_id_3>
1>        ]
1>        .\cons.cpp(20) : see reference to function template instantiation 'boost::tuples::tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9> &boost::tuples::tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9>::operator =<CGAL::HDS_all_vertices_const_iterator<HDS>,CGAL::HDS_all_vertices_const_iterator<HDS>>(const std::pair<_Ty1,_Ty2> &)' being compiled
1>        with
1>        [
1>            T0=CGAL::HDS_all_vertices_iterator<CGAL::Polyhedron_3<Kernel,CGAL::Polyhedron_items_with_id_3>> &,
1>            T1=CGAL::HDS_all_vertices_iterator<CGAL::Polyhedron_3<Kernel,CGAL::Polyhedron_items_with_id_3>> &,
1>            T2=boost::tuples::null_type,
1>            T3=boost::tuples::null_type,
1>            T4=boost::tuples::null_type,
1>            T5=boost::tuples::null_type,
1>            T6=boost::tuples::null_type,
1>            T7=boost::tuples::null_type,
1>            T8=boost::tuples::null_type,
1>            T9=boost::tuples::null_type,
1>            HDS=CGAL::Polyhedron_3<Kernel,CGAL::Polyhedron_items_with_id_3>,
1>            _Ty1=CGAL::HDS_all_vertices_const_iterator<CGAL::Polyhedron_3<Kernel,CGAL::Polyhedron_items_with_id_3>>,
1>            _Ty2=CGAL::HDS_all_vertices_const_iterator<CGAL::Polyhedron_3<Kernel,CGAL::Polyhedron_items_with_id_3>>
1>        ]
1>        .\cons.cpp(35) : see reference to function template instantiation 'void test<Polyhedron>(const VertexListGraph &)' being compiled
1>        with
1>        [
1>            VertexListGraph=Polyhedron
1>        ]
1>D:\Lib\boost\boost/tuple/detail/tuple_basic.hpp(638) : error C2679: binary '=' : no operator found which takes a right-hand operand of type 'const CGAL::HDS_all_vertices_const_iterator<HDS>' (or there is no acceptable conversion)
1>        with
1>        [
1>            HDS=CGAL::Polyhedron_3<Kernel,CGAL::Polyhedron_items_with_id_3>
1>        ]
1>        D:\Lib\CGAL-3.3.1\include\CGAL/boost/graph/graph_traits_HalfedgeDS.h(158): could be 'CGAL::HDS_all_vertices_iterator<HDS> &CGAL::HDS_all_vertices_iterator<HDS>::operator =(const CGAL::HDS_all_vertices_iterator<HDS> &)'
1>        with
1>        [
1>            HDS=CGAL::Polyhedron_3<Kernel,CGAL::Polyhedron_items_with_id_3>
1>        ]
1>        while trying to match the argument list '(CGAL::HDS_all_vertices_iterator<HDS>, const CGAL::HDS_all_vertices_const_iterator<HDS>)'
1>        with
1>        [
1>            HDS=CGAL::Polyhedron_3<Kernel,CGAL::Polyhedron_items_with_id_3>
1>        ]
1>Build Time 0:04
1>Build log was saved at "file://d:\misc\cons\Release\BuildLog.htm"
1>cons - 2 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

-----------------------------------------------------------------


Thanks a lot


Be a better pen pal. Text or chat with friends inside Yahoo! Mail. See how.

  • Is it a bug of Polyhedron_3? (integration with boost graph), Tux Han, 11/17/2007

Archive powered by MHonArc 2.6.16.

Top of Page