Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use nullptr in module surface #3026

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion surface/include/pcl/surface/impl/concave_hull.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ pcl::ConcaveHull<PointInT>::performReconstruction (PointCloud &alpha_shape, std:
// option flags for qhull, see qh_opt.htm
char flags[] = "qhull d QJ";
// output from qh_produce_output(), use NULL to skip qh_produce_output()
FILE *outfile = NULL;
FILE *outfile = nullptr;
// error messages from qhull code
FILE *errfile = stderr;
// 0 if no error from qhull
Expand Down
4 changes: 2 additions & 2 deletions surface/include/pcl/surface/impl/convex_hull.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ pcl::ConvexHull<PointInT>::performReconstruction2D (PointCloud &hull, std::vecto
// True if qhull should free points in qh_freeqhull() or reallocation
boolT ismalloc = True;
// output from qh_produce_output(), use NULL to skip qh_produce_output()
FILE *outfile = NULL;
FILE *outfile = nullptr;

#ifndef HAVE_QHULL_2011
if (compute_area_)
Expand Down Expand Up @@ -297,7 +297,7 @@ pcl::ConvexHull<PointInT>::performReconstruction3D (
// True if qhull should free points in qh_freeqhull() or reallocation
boolT ismalloc = True;
// output from qh_produce_output(), use NULL to skip qh_produce_output()
FILE *outfile = NULL;
FILE *outfile = nullptr;

#ifndef HAVE_QHULL_2011
if (compute_area_)
Expand Down
2 changes: 1 addition & 1 deletion surface/include/pcl/surface/impl/mls.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -777,7 +777,7 @@ pcl::MLSResult::computeMLSSurface (const pcl::PointCloud<PointT> &cloud,
{
// Note: The max_sq_radius parameter is only used if weight_func was not defined
double max_sq_radius = 1;
if (weight_func == 0)
if (weight_func.empty())
{
max_sq_radius = search_radius * search_radius;
weight_func = boost::bind (&pcl::MLSResult::computeMLSWeight, this, _1, max_sq_radius);
Expand Down
2 changes: 1 addition & 1 deletion surface/include/pcl/surface/mls.h
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ namespace pcl
const std::vector<int> &nn_indices,
double search_radius,
int polynomial_order = 2,
boost::function<double(const double)> weight_func = 0);
boost::function<double(const double)> weight_func = {});

Eigen::Vector3d query_point; /**< \brief The query point about which the mls surface was generated */
Eigen::Vector3d mean; /**< \brief The mean point of all the neighbors. */
Expand Down
8 changes: 4 additions & 4 deletions surface/src/on_nurbs/sequential_fitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ SequentialFitter::is_back_facing (const Eigen::Vector3d &v0, const Eigen::Vector
void
SequentialFitter::setInputCloud (pcl::PointCloud<pcl::PointXYZRGB>::Ptr &pcl_cloud)
{
if (pcl_cloud.get () == 0 || pcl_cloud->points.size () == 0)
if (pcl_cloud.get () == nullptr || pcl_cloud->points.size () == 0)
throw std::runtime_error ("[SequentialFitter::setInputCloud] Error: Empty or invalid pcl-point-cloud.\n");

m_cloud = pcl_cloud;
Expand All @@ -206,7 +206,7 @@ SequentialFitter::setInputCloud (pcl::PointCloud<pcl::PointXYZRGB>::Ptr &pcl_clo
void
SequentialFitter::setBoundary (pcl::PointIndices::Ptr &pcl_cloud_indexes)
{
if (m_cloud.get () == 0 || m_cloud->points.size () == 0)
if (m_cloud.get () == nullptr || m_cloud->points.size () == 0)
throw std::runtime_error ("[SequentialFitter::setBoundary] Error: Empty or invalid pcl-point-cloud.\n");

this->m_boundary_indices = pcl_cloud_indexes;
Expand All @@ -217,7 +217,7 @@ SequentialFitter::setBoundary (pcl::PointIndices::Ptr &pcl_cloud_indexes)
void
SequentialFitter::setInterior (pcl::PointIndices::Ptr &pcl_cloud_indexes)
{
if (m_cloud.get () == 0 || m_cloud->points.size () == 0)
if (m_cloud.get () == nullptr || m_cloud->points.size () == 0)
throw std::runtime_error ("[SequentialFitter::setIndices] Error: Empty or invalid pcl-point-cloud.\n");

this->m_interior_indices = pcl_cloud_indexes;
Expand All @@ -228,7 +228,7 @@ SequentialFitter::setInterior (pcl::PointIndices::Ptr &pcl_cloud_indexes)
void
SequentialFitter::setCorners (pcl::PointIndices::Ptr &corners, bool flip_on_demand)
{
if (m_cloud.get () == 0 || m_cloud->points.size () == 0)
if (m_cloud.get () == nullptr || m_cloud->points.size () == 0)
throw std::runtime_error ("[SequentialFitter::setCorners] Error: Empty or invalid pcl-point-cloud.\n");

if (corners->indices.size () < 4)
Expand Down
6 changes: 3 additions & 3 deletions surface/src/vtk_smoothing/vtk_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ pcl::VTKUtils::vtk2mesh (const vtkSmartPointer<vtkPolyData>& poly_data, pcl::Pol
if (nr_points == 0)
return 0;

vtkUnsignedCharArray* poly_colors = NULL;
if (poly_data->GetPointData() != NULL)
vtkUnsignedCharArray* poly_colors = nullptr;
if (poly_data->GetPointData() != nullptr)
poly_colors = vtkUnsignedCharArray::SafeDownCast (poly_data->GetPointData ()->GetScalars ("Colors"));

// Some applications do not save the name of scalars (including PCL's native vtk_io)
Expand Down Expand Up @@ -261,7 +261,7 @@ pcl::VTKUtils::mesh2vtk (const pcl::PolygonMesh& mesh, vtkSmartPointer<vtkPolyDa
poly_data->GetPointData()->SetNormals (normals);
}

if (poly_data->GetPoints() == NULL)
if (poly_data->GetPoints() == nullptr)
return (0);
return (static_cast<int> (poly_data->GetPoints()->GetNumberOfPoints ()));
}
Expand Down