Skip to content

Commit

Permalink
Move Bbox_d.h to NewKernel
Browse files Browse the repository at this point in the history
  • Loading branch information
afabri committed Jan 10, 2025
1 parent 44215ad commit 32c481a
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 28 deletions.
28 changes: 0 additions & 28 deletions Kernel_23/test/Kernel_23/test_bbox.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include <CGAL/Simple_cartesian.h>
#include <CGAL/Bbox_2.h>
#include <CGAL/Bbox_3.h>
#include <CGAL/Bbox_d.h>

#include <vector>

Expand Down Expand Up @@ -80,31 +79,4 @@ int main()
assert( span.z_span() == 8);
}

{
//Dimension d
typedef CGAL::Bbox_d<CGAL::Dimension_tag<3>> BBox3;
BBox3 bb3(3), bb3a(3,1.0);
assert(bb3.dimension() == 3);
assert(bb3 != bb3a);
bb3 = bb3a;
assert(bb3 == bb3a);

std::array<std::pair<double,double>,3> coord = { std::make_pair(0.0, 0.0), std::make_pair(1.0, 1.1), std::make_pair(1.0, 20.0)};

BBox3 bb3b(3,coord.begin(), coord.end());

bb3b = bb3b + bb3b;
bb3b += bb3;
bb3b.dilate(15);
assert(CGAL::do_overlap(bb3, bb3b));

std::cout << bb3b << std::endl;

BBox3::Cartesian_const_iterator beg = bb3b.cartesian_begin();
BBox3::Cartesian_const_iterator end = bb3b.cartesian_end();
for(; beg != end; ++beg){
std::cout << *beg << std::endl;
}

}
}
File renamed without changes.
41 changes: 41 additions & 0 deletions NewKernel_d/test/NewKernel_d/test_bbox_d.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#include <CGAL/Bbox_2.h>
#include <CGAL/Bbox_3.h>
#include <CGAL/Bbox_d.h>

#include <array>

int main()
{
//Dimension d
typedef CGAL::Bbox_d<CGAL::Dimension_tag<2>> BBox2;
typedef CGAL::Bbox_d<CGAL::Dimension_tag<3>> BBox3;
BBox3 bb3(3), bb3a(3,1.0);
assert(bb3.dimension() == 3);
assert(bb3 != bb3a);
bb3 = bb3a;
assert(bb3 == bb3a);

std::array<std::pair<double,double>,3> coord = { std::make_pair(0.0, 0.0), std::make_pair(1.0, 1.1), std::make_pair(1.0, 20.0)};

BBox3 bb3b(3,coord.begin(), coord.end());

bb3b = bb3b + bb3b;
bb3b += bb3;
bb3b.dilate(15);
assert(CGAL::do_overlap(bb3, bb3b));

std::cout << bb3b << std::endl;

BBox3::Cartesian_const_iterator beg = bb3b.cartesian_begin();
BBox3::Cartesian_const_iterator end = bb3b.cartesian_end();
for(; beg != end; ++beg){
std::cout << *beg << std::endl;
}

CGAL::Bbox_2 bb_2(0,0, 1, 1);
BBox2 bb_d2(bb_2);

CGAL::Bbox_3 bb_3(0,0, 0, 1, 1,1);
BBox3 bb_d3(bb_3);

}

0 comments on commit 32c481a

Please sign in to comment.