34 #ifndef _polygon_boolean_operations_H_
35 #define _polygon_boolean_operations_H_
45 #define PFLN {printf("DEBUG PRINT FILE %s LINE %d\n",__FILE__,__LINE__);}
52 #include <pcl/point_cloud.h>
53 #include <pcl/point_types.h>
54 #include <pcl_ros/transforms.h>
58 #include <CGAL/basic.h>
59 #include <CGAL/Polygon_2.h>
60 #include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
61 #include <CGAL/Partition_traits_2.h>
62 #include <CGAL/Partition_is_valid_traits_2.h>
63 #include <CGAL/polygon_function_objects.h>
64 #include <CGAL/partition_2.h>
65 #include <CGAL/point_generators_2.h>
66 #include <CGAL/Polygon_set_2.h>
68 #include <CGAL/random_polygon_2.h>
70 #include <CGAL/Cartesian.h>
71 #include <CGAL/Boolean_set_operations_2.h>
76 typedef CGAL::Exact_predicates_exact_constructions_kernel
PBO_Kernel;
89 int insert(pcl::PointCloud<pcl::PointXYZ>::Ptr p_pc);
90 int insert(pcl::PointCloud<pcl::PointXYZ>* pc);
94 int join(pcl::PointCloud<pcl::PointXYZ>* pc);
100 int get_all_pcls(std::vector<pcl::PointCloud<pcl::PointXYZ> >* pc_out_vector);
109 template<
class Kernel,
class Container>
112 typename CGAL::Polygon_2<Kernel, Container>::Vertex_const_iterator vit;
114 std::cout <<
"[ " << P.size() <<
" vertices:" << std::endl;
116 for (vit = P.vertices_begin(); vit != P.vertices_end(); ++vit)
118 std::cout <<
"x(" << k <<
")=" << (*vit).x() <<
"; y(" << k <<
")=" << (*vit).y()<<
"; ";
121 std::cout << std::endl;
124 template<
class Kernel,
class Container>
127 if (! pwh.is_unbounded()) {
128 std::cout <<
"{ is_simple=" << pwh.outer_boundary().is_simple() <<
"Outer boundary = ";
132 std::cout <<
"{ Unbounded polygon." << std::endl;
134 typename CGAL::Polygon_with_holes_2<Kernel,Container>::Hole_const_iterator hit;
137 std::cout <<
" " << pwh.number_of_holes() <<
" holes:" << std::endl;
138 for (hit = pwh.holes_begin(); hit != pwh.holes_end(); ++hit, ++k) {
139 std::cout <<
"is_simple=" << (*hit).is_simple() <<
" Hole #" << k <<
" = ";
142 std::cout <<
" }" << std::endl;
Defines the class polygon simplification.
int get_all_pcls(std::vector< pcl::PointCloud< pcl::PointXYZ > > *pc_out_vector)
CGAL::Polygon_with_holes_2< PBO_Kernel > PBO_Polygon_with_holes_2
class_polygon_boolean_operations(void)
int insert(pcl::PointCloud< pcl::PointXYZ >::Ptr p_pc)
PBO_Kernel::Point_2 PBO_Point_2
PBO_Polygon_2 from_pcl_to_cgalpolygon(pcl::PointCloud< pcl::PointXYZ > *pc)
int get_largest_pcl(pcl::PointCloud< pcl::PointXYZ > *pc_out)
int join(pcl::PointCloud< pcl::PointXYZ > *pc)
CGAL::Polygon_set_2< PBO_Kernel > PBO_Polygon_set_2
int intersection(pcl::PointCloud< pcl::PointXYZ > *pc)
~class_polygon_boolean_operations(void)
int get_first_pcl(pcl::PointCloud< pcl::PointXYZ > *pc_out)
CGAL::Polygon_2< PBO_Kernel > PBO_Polygon_2
std::list< PBO_Polygon_with_holes_2 > PBO_Pwh_list_2
void print_polygon_with_holes(const CGAL::Polygon_with_holes_2< Kernel, Container > &pwh)
CGAL::Exact_predicates_exact_constructions_kernel PBO_Kernel
void print_polygon(const CGAL::Polygon_2< Kernel, Container > &P)