#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/box_intersection_d.h>
#include <vector>
#include <fstream>
typedef std::vector<Triangle_3> Triangles;
struct Report {
Triangles* triangles;
Report(Triangles& triangles)
: triangles(&triangles)
{}
void operator()(const Box* a, const Box* b) const
{
std::cout << "Box " << (a->handle() - triangles->begin()) << " and "
<< (b->handle() - triangles->begin()) << " intersect";
if ( ! a->handle()->is_degenerate() && ! b->handle()->is_degenerate()
std::cout << ", and the triangles intersect also";
}
std::cout << '.' << std::endl;
}
};
int main(int argc, char*argv[])
{
Triangles triangles;
Triangle_3 t;
while(in >> t){
triangles.push_back(t);
}
std::vector<Box> boxes;
for (
Iterator i = triangles.begin(); i != triangles.end(); ++i)
boxes.push_back( Box( i->bbox(), i));
std::vector<Box *> ptr;
for ( std::vector<Box>::iterator i = boxes.begin(); i != boxes.end(); ++i)
ptr.push_back( &*i);
return 0;
}
Box_with_handle_d is a generic iso-oriented bounding box in dimension that stores additionally a han...
Definition: Box_with_handle_d.h:66
void box_self_intersection_d(RandomAccessIterator begin, RandomAccessIterator end, Callback callback, std::ptrdiff_t cutoff=10, CGAL::Box_intersection_d::Topology topology=CGAL::Box_intersection_d::CLOSED)
Invocation of box intersection with default box traits Box_intersection_d::Box_traits_d<Box_handle>,...
bool do_intersect(Type1< Kernel > obj1, Type2< Kernel > obj2)
std::string data_file_path(const std::string &filename)