polygon_intersection.h
Go to the documentation of this file.
1 /**************************************************************************************************
2  Software License Agreement (BSD License)
3 
4  Copyright (c) 2011-2013, LAR toolkit developers - University of Aveiro - http://lars.mec.ua.pt
5  All rights reserved.
6 
7  Redistribution and use in source and binary forms, with or without modification, are permitted
8  provided that the following conditions are met:
9 
10  *Redistributions of source code must retain the above copyright notice, this list of
11  conditions and the following disclaimer.
12  *Redistributions in binary form must reproduce the above copyright notice, this list of
13  conditions and the following disclaimer in the documentation and/or other materials provided
14  with the distribution.
15  *Neither the name of the University of Aveiro nor the names of its contributors may be used to
16  endorse or promote products derived from this software without specific prior written permission.
17 
18  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
19  IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
20  FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
21  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
24  IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
25  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 ***************************************************************************************************/
37 #ifndef _POLYGON_INTERSECTION_H_
38 #define _POLYGON_INTERSECTION_H_
39 
40 #define PFLN {printf("DEBUG PRINT FILE %s LINE %d\n",__FILE__,__LINE__);}
41 
42 //####################################################################
45 #include <ros/ros.h>
46 
47 #include <pcl/point_cloud.h>
48 #include <pcl/point_types.h>
49 #include <pcl_ros/transforms.h>
50 #include <tf/tf.h>
51 
52 //CGAL
53 #include <CGAL/basic.h>
54 #include <CGAL/Polygon_2.h>
55 #include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
56 #include <CGAL/Partition_traits_2.h>
57 #include <CGAL/Partition_is_valid_traits_2.h>
58 #include <CGAL/polygon_function_objects.h>
59 #include <CGAL/partition_2.h>
60 #include <CGAL/point_generators_2.h>
61 #include <CGAL/Polygon_set_2.h>
62 
63 #include <CGAL/random_polygon_2.h>
64 //#include <cassert>
65 //#include <list>
66 
67 #include <CGAL/Cartesian.h>
68 #include <CGAL/Boolean_set_operations_2.h>
69 //#include <list>
70 
71 #include <bo_polygon2d/polygon_simplification.h>
72 #include <bo_polygon2d/transform_wrapper.h>
73 
74 typedef CGAL::Exact_predicates_inexact_constructions_kernel CGALKernel;
76 typedef CGAL::Polygon_2<CGALKernel> CGALPolygon_2;
77 typedef CGAL::Polygon_with_holes_2<CGALKernel> CGALPolygon_with_holes_2;
78 typedef std::list<CGALPolygon_with_holes_2> CGALPwh_list_2;
79 
80 
81 class class_polygon_intersection: public class_polygon_simplification, public class_transform_wrapper
82 {
83  public:
86 
87  int clear_all_polygons(void);
88  int add_polygon_to_list(pcl::PointCloud<pcl::PointXYZ>::Ptr p_pc);
89  int add_polygon_to_list(pcl::PointCloud<pcl::PointXYZ>* pc);
90  int compute_polygon_intersection(pcl::PointCloud<pcl::PointXYZ>* pc_out);
91  int compute_polygon_union(std::vector<pcl::PointCloud<pcl::PointXYZ> > *pc_list);
92 
93  protected:
94  std::vector<CGALPolygon_2> polygons;
95 
96 
97 };
98 
99 
100 #endif
101 
CGAL::Polygon_2< CGALKernel > CGALPolygon_2
CGALKernel::Point_2 CGALPoint_2
int add_polygon_to_list(pcl::PointCloud< pcl::PointXYZ >::Ptr p_pc)
CGAL::Polygon_with_holes_2< CGALKernel > CGALPolygon_with_holes_2
CGAL::Exact_predicates_inexact_constructions_kernel CGALKernel
std::vector< CGALPolygon_2 > polygons
std::list< CGALPolygon_with_holes_2 > CGALPwh_list_2
int compute_polygon_union(std::vector< pcl::PointCloud< pcl::PointXYZ > > *pc_list)
int compute_polygon_intersection(pcl::PointCloud< pcl::PointXYZ > *pc_out)


polygon_primitives_extraction
Author(s): Miguel Oliveira
autogenerated on Mon Mar 2 2015 01:32:42