-
Notifications
You must be signed in to change notification settings - Fork 4
/
testcase.cpp
36 lines (34 loc) · 1.5 KB
/
testcase.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
#include <CGAL/Nef_polyhedron_3.h>
#include <CGAL/IO/Nef_polyhedron_iostream_3.h>
#include <boost/multi_array.hpp>
#include <iostream>
#include <sstream>
#include <cutcell.hpp>
typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel;
typedef CGAL::Nef_polyhedron_3<Kernel> Nef_polyhedron;
int main(int argc, char **argv) {
std::istringstream in(cutcell::cube);
Nef_polyhedron N1;
in >> N1;
Nef_polyhedron::Halffacet_const_iterator fi;
int i = 0;
CGAL_forall_facets(fi, N1) {
std::cout << "Halffacet " << i++ << " plane: " << fi->plane().a()
<< " " << fi->plane().b()
<< " " << fi->plane().c()
<< " " << fi->plane().d()
<< std::endl;
Nef_polyhedron::Halffacet_cycle_const_iterator fc;
fc = fi->facet_cycles_begin();
int j = 0;
CGAL_For_all(fc, fi->facet_cycles_end()) {
Nef_polyhedron::SHalfedge_const_handle se = Nef_polyhedron::SHalfedge_const_handle(fc);
Nef_polyhedron::SHalfedge_around_facet_const_circulator hc_start(se);
Nef_polyhedron::SHalfedge_around_facet_const_circulator hc_end(hc_start);
CGAL_For_all(hc_start, hc_end)
std::cout << "Point " << j++ << ": " << hc_start->source()->center_vertex()->point() << std::endl;
}
}
return 0;
}