-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add method for an octree node to determine what its index is.
- Loading branch information
1 parent
2e1adcb
commit dcfeb0a
Showing
4 changed files
with
59 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
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,46 @@ | ||
#define CGAL_TRACE_STREAM std::cerr | ||
|
||
#include <CGAL/Octree.h> | ||
#include <CGAL/Octree/IO.h> | ||
|
||
#include <CGAL/Simple_cartesian.h> | ||
#include <CGAL/Point_set_3.h> | ||
|
||
typedef CGAL::Simple_cartesian<double> Kernel; | ||
typedef Kernel::Point_3 Point; | ||
typedef CGAL::Point_set_3<Point> Point_set; | ||
typedef CGAL::Octree | ||
<Point_set, typename Point_set::Point_map> | ||
Octree; | ||
|
||
int main(void) { | ||
|
||
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({-1, -1, -1.1}); | ||
points.insert({-1, -1, -1.2}); | ||
points.insert({-1, -1, -1.3}); | ||
points.insert({-1, -1, -1.4}); | ||
points.insert({-1, -1, -1.5}); | ||
points.insert({-1, -1, -1.6}); | ||
points.insert({-1, -1, -1.7}); | ||
points.insert({-1, -1, -1.8}); | ||
points.insert({-1, -1, -1.9}); | ||
|
||
auto point_map = points.point_map(); | ||
|
||
Octree octree(points, point_map); | ||
octree.refine(10, 1); | ||
|
||
std::cout << octree.root()[4].index(); | ||
|
||
return 0; | ||
} |
File renamed without changes.