-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
41 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
|
||
} |