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
1 parent
110885e
commit b70181c
Showing
2 changed files
with
125 additions
and
1 deletion.
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
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 |
---|---|---|
@@ -1 +1,103 @@ | ||
// TODO | ||
|
||
#define CGAL_TRACE_STREAM std::cerr | ||
|
||
#include <iostream> | ||
#include <CGAL/Octree.h> | ||
#include <CGAL/Octree/IO.h> | ||
#include <CGAL/Simple_cartesian.h> | ||
#include <CGAL/Point_set_3.h> | ||
|
||
#include <cassert> | ||
|
||
typedef CGAL::Simple_cartesian<double> Kernel; | ||
typedef Kernel::Point_3 Point; | ||
typedef Kernel::FT FT; | ||
typedef CGAL::Point_set_3<Point> Point_set; | ||
typedef CGAL::Octree::Octree | ||
<Point_set, typename Point_set::Point_map> | ||
Octree; | ||
|
||
void test_1_point() { | ||
|
||
// Define the dataset | ||
Point_set points; | ||
points.insert({-1, -1, -1}); | ||
|
||
// Create the octree | ||
Octree octree(points, points.point_map()); | ||
octree.refine(10, 1); | ||
|
||
std::cout << octree << std::endl; | ||
|
||
std::cout << "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" << std::endl; | ||
octree.grade(); | ||
|
||
std::cout << octree << std::endl; | ||
|
||
std::cout << "\n\n\n" << std::endl; | ||
} | ||
|
||
void test_8_points() { | ||
|
||
// Define the dataset | ||
Point_set points; | ||
points.insert({-1, -1, -1}); | ||
points.insert({1, -1, -1}); | ||
points.insert({-1, 1, -1}); | ||
points.insert({1, 1, -1}); | ||
points.insert({-1, -1, 1}); | ||
points.insert({1, -1, 1}); | ||
points.insert({-1, 1, 1}); | ||
points.insert({1, 1, 1}); | ||
|
||
// Create the octree | ||
Octree octree(points, points.point_map()); | ||
octree.refine(10, 1); | ||
|
||
std::cout << octree << std::endl; | ||
|
||
std::cout << "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" << std::endl; | ||
octree.grade(); | ||
|
||
std::cout << octree << std::endl; | ||
|
||
std::cout << "\n\n\n" << std::endl; | ||
} | ||
|
||
void test_10_points() { | ||
|
||
// Define the dataset | ||
Point_set points; | ||
points.insert({-1, -1, -1}); | ||
points.insert({1, -1, -1}); | ||
points.insert({-1, 1, -1}); | ||
points.insert({1, 1, -1}); | ||
points.insert({-1, -1, 1}); | ||
points.insert({1, -1, 1}); | ||
points.insert({-1, 1, 1}); | ||
points.insert({1, 1, 1}); | ||
points.insert({0.875, 1, -1}); | ||
points.insert({-1, -0.75, 1}); | ||
|
||
// Create the octree | ||
Octree octree(points, points.point_map()); | ||
octree.refine(10, 1); | ||
|
||
std::cout << octree << std::endl; | ||
|
||
std::cout << "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" << std::endl; | ||
octree.grade(); | ||
|
||
std::cout << octree << std::endl; | ||
|
||
std::cout << "\n\n\n" << std::endl; | ||
} | ||
|
||
int main(void) { | ||
|
||
test_1_point(); | ||
test_8_points(); | ||
test_10_points(); | ||
|
||
return EXIT_SUCCESS; | ||
} |