CADToPointCloud.h
Go to the documentation of this file.
1 
18 #pragma once
19 #ifndef _CAD_TO_POINTCLOUD_H
20 #define _CAD_TO_POINTCLOUD_H
21 
22 #include <Utils.h>
23 
24 #include <pcl/io/vtk_lib_io.h>
25 
26 
33 {
34  typedef pcl::PointCloud<pcl::PointXYZ> PointCloudXYZ;
35  typedef pcl::PointCloud<pcl::PointXYZRGB> PointCloudRGB;
36 
37 public:
43  CADToPointCloud(const std::string& cad_file_path, int sample_points);
44 
50 
56  void convertCloud(PointCloudRGB::Ptr cloud);
57 
58 private:
59 
61  std::string extension_;
62 
64  std::string cad_file_path_;
65 
68 
69  // Following methods are extracted from Point Cloud Library (PCL)
70  // --> pcl/tools/mesh_sampling.cpp
71  //
72  // Software License Agreement (BSD License)
73  //
74  // Point Cloud Library (PCL) - www.pointclouds.org
75  // Copyright (c) 2010-2011, Willow Garage, Inc.
76  // All rights reserved.
77  //
78  // Redistribution and use in source and binary forms, with or without
79  // modification, are permitted provided that the following conditions
80  // are met:
81  //
82  // * Redistributions of source code must retain the above copyright
83  // notice, this list of conditions and the following disclaimer.
84  // * Redistributions in binary form must reproduce the above
85  // copyright notice, this list of conditions and the following
86  // disclaimer in the documentation and/or other materials provided
87  // with the distribution.
88  // * Neither the name of the copyright holder(s) nor the names of its
89  // contributors may be used to endorse or promote products derived
90  // from this software without specific prior written permission.
91  //
92  // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
93  // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
94  // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
95  // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
96  // COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
97  // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
98  // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
99  // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
100  // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
101  // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
102  // ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
103  // POSSIBILITY OF SUCH DAMAGE.
104  //
105 
108  void uniformSampling(vtkSmartPointer<vtkPolyData> polydata, size_t n_samples, PointCloudRGB& cloud_out);
109 
112  void randPSurface(vtkPolyData* polydata, std::vector<double>* cumulativeAreas, double totalArea, Eigen::Vector4f& p);
113 
116  void randomPointTriangle(float a1, float a2, float a3, float b1, float b2, float b3, float c1, float c2, float c3,
117  Eigen::Vector4f& p);
118 
121  double uniformDeviate(int seed);
122 };
123 
124 #endif
int SAMPLE_POINTS_
number of points to sample CAD mesh.
~CADToPointCloud()
Destroy the CADToPointCloud object.
std::string extension_
cad file path extension to check formats.
void randPSurface(vtkPolyData *polydata, std::vector< double > *cumulativeAreas, double totalArea, Eigen::Vector4f &p)
Extracted from Point Cloud Library (PCL) –> pcl/tools/mesh_sampling.cpp Copyright (c) 2010-2011...
std::string cad_file_path_
path to CAD file to be converted.
This class is used to obtain pcl::PointCloud from CAD file. Supported formats: .OBJ.
void convertCloud(PointCloudRGB::Ptr cloud)
convert cloud defined by path in construstor into cloud
double uniformDeviate(int seed)
Extracted from Point Cloud Library (PCL) –> pcl/tools/mesh_sampling.cpp Copyright (c) 2010-2011...
CADToPointCloud(const std::string &cad_file_path, int sample_points)
Construct a new CADToPointCloud object.
void uniformSampling(vtkSmartPointer< vtkPolyData > polydata, size_t n_samples, PointCloudRGB &cloud_out)
Extracted from Point Cloud Library (PCL) –> pcl/tools/mesh_sampling.cpp Copyright (c) 2010-2011...
pcl::PointCloud< pcl::PointXYZRGB > PointCloudRGB
pcl::PointCloud< pcl::PointXYZ > PointCloudXYZ
void randomPointTriangle(float a1, float a2, float a3, float b1, float b2, float b3, float c1, float c2, float c3, Eigen::Vector4f &p)
Extracted from Point Cloud Library (PCL) –> pcl/tools/mesh_sampling.cpp Copyright (c) 2010-2011...


leica_point_cloud_processing
Author(s): Ines Lara Sicilia
autogenerated on Fri Feb 5 2021 03:20:30