Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] can't create stl containers of type AABB tree in CGAL

Subject: CGAL users discussion list

List archive

[cgal-discuss] can't create stl containers of type AABB tree in CGAL


Chronological Thread 
  • From: dontcarebear <>
  • To:
  • Subject: [cgal-discuss] can't create stl containers of type AABB tree in CGAL
  • Date: Mon, 17 Mar 2014 05:33:02 -0700 (PDT)

I am trying to create a STL map of type map<int,CGAL::AABB_tree&lt;Traits>>
(map of AABB tree's) when I try to assign a value to the map, for example
(this code is only for demonstration purposes):

//CGAL includes begin
#include <CGAL/Simple_cartesian.h>
#include <CGAL/Polyhedron_incremental_builder_3.h>
#include <CGAL/AABB_tree.h>
#include <CGAL/AABB_traits.h>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/AABB_face_graph_triangle_primitive.h>
//CGAL includes end
/*
* CGAL typedef's for initialization
*/
typedef CGAL::Simple_cartesian<double> K;
typedef K::FT FT;
typedef K::Point_3 Point_3;
typedef K::Segment_3 Segment;
typedef CGAL::Polyhedron_3<K> Polyhedron;
typedef Polyhedron::HalfedgeDS HalfedgeDS;
typedef Polyhedron::Vertex_const_iterator
Vertex_const_iterator;
typedef Polyhedron::Facet_const_iterator
Facet_const_iterator;
typedef Polyhedron::Halfedge_around_facet_const_circulator
Halfedge_around_facet_const_circulator;
typedef CGAL::AABB_face_graph_triangle_primitive<Polyhedron> Primitive;
typedef CGAL::AABB_traits<K, Primitive> Traits;
typedef CGAL::AABB_tree<Traits> Tree;
typedef Tree::Point_and_primitive_id
Point_and_primitive_id;
//end of typedef's

BuildMesh<HalfedgeDS> mesh(V, F);
polyhedron.delegate( mesh);
myMap[someInt] =
Tree(polyhedron.facets_begin(),polyhedron.facets_end(),polyhedron);
I get the following error:

error C2248: 'CGAL::AABB_tree< AABBTraits >::operator =' : cannot access
private member declared in class 'CGAL::AABB_tree< AABBTraits>'

I tried looking in the source code of CGAL and found in CGAL\AABB_tree.h the
following lines:

private:
// Disabled copy constructor & assignment operator
typedef AABB_tree<AABBTraits> Self;
AABB_tree(const Self& src);
Self& operator=(const Self& src);
this means that the copy and assignment constructors are private, thus it's
not possible to create stl containers of type Tree.

I tried to use pointers instead I changed my map to map<int,CGAL::AABB_tree
&lt; Traits > * > and tried:

BuildMesh<HalfedgeDS> mesh(V, F);
polyhedron.delegate( mesh);
myMap[someInt] = new
Tree(polyhedron.facets_begin(),polyhedron.facets_end(),polyhedron);
but then it crashed my code.

Is there any way around it so it will be possible to create an STL container
of this type?



--
View this message in context:
http://cgal-discuss.949826.n4.nabble.com/can-t-create-stl-containers-of-type-AABB-tree-in-CGAL-tp4658973.html
Sent from the cgal-discuss mailing list archive at Nabble.com.



Archive powered by MHonArc 2.6.18.

Top of Page