Point Cloud Library (PCL)  1.6.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
shapes.h
Go to the documentation of this file.
1 /*
2  * Software License Agreement (BSD License)
3  *
4  * Point Cloud Library (PCL) - www.pointclouds.org
5  * Copyright (c) 2009-2012, Willow Garage, Inc.
6  *
7  * All rights reserved.
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions
11  * are met:
12  *
13  * * Redistributions of source code must retain the above copyright
14  * notice, this list of conditions and the following disclaimer.
15  * * Redistributions in binary form must reproduce the above
16  * copyright notice, this list of conditions and the following
17  * disclaimer in the documentation and/or other materials provided
18  * with the distribution.
19  * * Neither the name of Willow Garage, Inc. nor the names of its
20  * contributors may be used to endorse or promote products derived
21  * from this software without specific prior written permission.
22  *
23  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
29  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34  * POSSIBILITY OF SUCH DAMAGE.
35  *
36  * $Id: shapes.h 5501 2012-04-04 07:08:51Z rusu $
37  *
38  */
39 #ifndef PCL_PCL_VISUALIZER_SHAPES_H_
40 #define PCL_PCL_VISUALIZER_SHAPES_H_
41 
42 #include <Eigen/Geometry>
43 #include <pcl/ModelCoefficients.h>
44 #include <pcl/point_cloud.h>
45 #include <pcl/visualization/vtk.h>
47 
55 namespace pcl
56 {
57  namespace visualization
58  {
63  template <typename PointT> vtkSmartPointer<vtkDataSet> inline
64  createPolygon (const typename pcl::PointCloud<PointT>::ConstPtr &cloud);
65 
70  template <typename PointT> vtkSmartPointer<vtkDataSet> inline
71  createPolygon (const pcl::PlanarPolygon<PointT> &planar_polygon);
72 
78  PCL_EXPORTS vtkSmartPointer<vtkDataSet>
79  createLine (const Eigen::Vector4f &pt1, const Eigen::Vector4f &pt2);
80 
87  PCL_EXPORTS vtkSmartPointer<vtkDataSet>
88  createSphere (const Eigen::Vector4f &center, double radius, int res = 10);
89 
116  PCL_EXPORTS vtkSmartPointer<vtkDataSet>
117  createCylinder (const pcl::ModelCoefficients &coefficients, int numsides = 30);
118 
141  PCL_EXPORTS vtkSmartPointer<vtkDataSet>
142  createSphere (const pcl::ModelCoefficients &coefficients, int res = 10);
143 
166  PCL_EXPORTS vtkSmartPointer<vtkDataSet>
167  createLine (const pcl::ModelCoefficients &coefficients);
168 
188  PCL_EXPORTS vtkSmartPointer<vtkDataSet>
189  createPlane (const pcl::ModelCoefficients &coefficients);
190 
210  PCL_EXPORTS vtkSmartPointer<vtkDataSet>
211  create2DCircle (const pcl::ModelCoefficients &coefficients, double z = 0.0);
212 
217  PCL_EXPORTS vtkSmartPointer<vtkDataSet>
218  createCone (const pcl::ModelCoefficients &coefficients);
219 
224  PCL_EXPORTS vtkSmartPointer<vtkDataSet>
225  createCube (const pcl::ModelCoefficients &coefficients);
226 
236  PCL_EXPORTS vtkSmartPointer<vtkDataSet>
237  createCube (const Eigen::Vector3f &translation, const Eigen::Quaternionf &rotation,
238  double width, double height, double depth);
239 
250  PCL_EXPORTS vtkSmartPointer<vtkDataSet>
251  createCube (double x_min, double x_max,
252  double y_min, double y_max,
253  double z_min, double z_max);
254 
258  PCL_EXPORTS void
259  allocVtkUnstructuredGrid (vtkSmartPointer<vtkUnstructuredGrid> &polydata);
260  }
261 }
265 
266 #endif