Skip to content

Compilation problem using AABB trees in CGAL 6.0.1 #8895

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ImperatorS79 opened this issue May 19, 2025 · 1 comment
Open

Compilation problem using AABB trees in CGAL 6.0.1 #8895

ImperatorS79 opened this issue May 19, 2025 · 1 comment

Comments

@ImperatorS79
Copy link

ImperatorS79 commented May 19, 2025

Issue Details

When Compiling the following example using CGAL 6.0.1, I get the following compiler error, while everything works with CGAL 5.6:

error.txt

Source Code

#include <vector>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/AABB_tree.h>
#if CGAL_VERSION_NR >= CGAL_VERSION_NUMBER(6,0,0)
#include <CGAL/AABB_traits_2.h>
#include <CGAL/AABB_segment_primitive_2.h>
#else
#include <CGAL/AABB_traits.h>
#include <CGAL/AABB_segment_primitive.h>
#endif

typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
//typedef CGAL::Simple_cartesian<double> K;
#if CGAL_VERSION_NR >= CGAL_VERSION_NUMBER(6,0,0)
typedef std::vector<K::Segment_2>::const_iterator Iterator;
typedef CGAL::AABB_segment_primitive_2<K, Iterator> Primitive;
typedef CGAL::AABB_traits_2<K, Primitive> Traits;
#else
typedef std::vector<K::Segment_3>::const_iterator Iterator;
typedef CGAL::AABB_segment_primitive<K, Iterator> Primitive;
typedef CGAL::AABB_traits<K, Primitive> Traits;
#endif
typedef CGAL::AABB_tree<Traits> Tree;
#if CGAL_VERSION_NR >= CGAL_VERSION_NUMBER(6,0,0)
typedef std::optional<Tree::Intersection_and_primitive_id<K::Ray_2>::Type> Ray_intersection;
typedef std::optional<Tree::Intersection_and_primitive_id<K::Segment_2>::Type> Segment_intersection;
#else
typedef boost::optional<Tree::Intersection_and_primitive_id<K::Ray_3>::Type> Ray_intersection;
typedef boost::optional<Tree::Intersection_and_primitive_id<K::Segment_3>::Type> Segment_intersection;
#endif

int main()
{
    Tree tree;

#if CGAL_VERSION_NR >= CGAL_VERSION_NUMBER(6,0,0)
    std::vector<K::Segment_2> segmentsList;
    segmentsList.push_back({K::Point_2(0,0), K::Point_2(1.0,0)});
    K::Point_2 pointQuery = K::Point_2(0.5, 0.5);
#else
    std::vector<K::Segment_3> segmentsList;
    segmentsList.push_back({K::Point_3(0,0,0), K::Point_3(1.0,0,0)});
    K::Point_3 pointQuery = K::Point_3(0.5, 0.5, 0.0);
#endif

    tree.rebuild(segmentsList.begin(), segmentsList.end());

    Tree::Point_and_primitive_id res = tree.closest_point_and_primitive(pointQuery);
    
    return 0;
}

Environment

  • Operating system : Kubuntu 24.04
  • Compiler: gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
  • Release or debug mode: both
  • Specific flags used (if any): N.A.
  • CGAL version: 6.0.1
  • Boost version: 1.83.0
  • Other libraries versions if used (Eigen, TBB, etc.): N.A.
@soesau soesau self-assigned this May 21, 2025
@MaelRL MaelRL added this to the 6.0.2 milestone May 26, 2025
@soesau
Copy link
Member

soesau commented May 26, 2025

#8891 should fix this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants