Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040 #ifndef PCL_SURFACE_RECONSTRUCTION_IMPL_H_
00041 #define PCL_SURFACE_RECONSTRUCTION_IMPL_H_
00042 #include <pcl/search/pcl_search.h>
00043
00045 template <typename PointInT> void
00046 pcl::SurfaceReconstruction<PointInT>::reconstruct (pcl::PolygonMesh &output)
00047 {
00048
00049 output.header = input_->header;
00050
00051 if (!initCompute ())
00052 {
00053 output.cloud.width = output.cloud.height = 0;
00054 output.cloud.data.clear ();
00055 output.polygons.clear ();
00056 return;
00057 }
00058
00059
00060 if (check_tree_)
00061 {
00062 if (!tree_)
00063 {
00064 if (input_->isOrganized ())
00065 tree_.reset (new pcl::search::OrganizedNeighbor<PointInT> ());
00066 else
00067 tree_.reset (new pcl::search::KdTree<PointInT> (false));
00068 }
00069
00070
00071 tree_->setInputCloud (input_, indices_);
00072 }
00073
00074
00075 pcl::toROSMsg (*input_, output.cloud);
00076 output.polygons.clear ();
00077 output.polygons.reserve (2*indices_->size ());
00078
00079 performReconstruction (output);
00080
00081 deinitCompute ();
00082 }
00083
00085 template <typename PointInT> void
00086 pcl::SurfaceReconstruction<PointInT>::reconstruct (pcl::PointCloud<PointInT> &points,
00087 std::vector<pcl::Vertices> &polygons)
00088 {
00089
00090 points.header = input_->header;
00091
00092 if (!initCompute ())
00093 {
00094 points.width = points.height = 0;
00095 points.clear ();
00096 polygons.clear ();
00097 return;
00098 }
00099
00100
00101 if (check_tree_)
00102 {
00103 if (!tree_)
00104 {
00105 if (input_->isOrganized ())
00106 tree_.reset (new pcl::search::OrganizedNeighbor<PointInT> ());
00107 else
00108 tree_.reset (new pcl::search::KdTree<PointInT> (false));
00109 }
00110
00111
00112 tree_->setInputCloud (input_, indices_);
00113 }
00114
00115
00116 polygons.clear ();
00117 polygons.reserve (2 * indices_->size ());
00118
00119 performReconstruction (points, polygons);
00120
00121 deinitCompute ();
00122 }
00123
00125 template <typename PointInT> void
00126 pcl::MeshConstruction<PointInT>::reconstruct (pcl::PolygonMesh &output)
00127 {
00128
00129 output.header = input_->header;
00130
00131 if (!initCompute ())
00132 {
00133 output.cloud.width = output.cloud.height = 1;
00134 output.cloud.data.clear ();
00135 output.polygons.clear ();
00136 return;
00137 }
00138
00139
00140 if (check_tree_)
00141 {
00142 if (!tree_)
00143 {
00144 if (input_->isOrganized ())
00145 tree_.reset (new pcl::search::OrganizedNeighbor<PointInT> ());
00146 else
00147 tree_.reset (new pcl::search::KdTree<PointInT> (false));
00148 }
00149
00150
00151 tree_->setInputCloud (input_, indices_);
00152 }
00153
00154
00155 pcl::toROSMsg (*input_, output.cloud);
00156
00157
00158
00159 performReconstruction (output);
00160
00161 deinitCompute ();
00162 }
00163
00165 template <typename PointInT> void
00166 pcl::MeshConstruction<PointInT>::reconstruct (std::vector<pcl::Vertices> &polygons)
00167 {
00168 if (!initCompute ())
00169 {
00170 polygons.clear ();
00171 return;
00172 }
00173
00174
00175 if (check_tree_)
00176 {
00177 if (!tree_)
00178 {
00179 if (input_->isOrganized ())
00180 tree_.reset (new pcl::search::OrganizedNeighbor<PointInT> ());
00181 else
00182 tree_.reset (new pcl::search::KdTree<PointInT> (false));
00183 }
00184
00185
00186 tree_->setInputCloud (input_, indices_);
00187 }
00188
00189
00190
00191
00192
00193 performReconstruction (polygons);
00194
00195 deinitCompute ();
00196 }
00197
00198
00199 #endif // PCL_SURFACE_RECONSTRUCTION_IMPL_H_
00200