Skip to content

Commit

Permalink
Replace pcl_isfinite with std::isfinite
Browse files Browse the repository at this point in the history
  • Loading branch information
Thorsten Harter committed Jan 24, 2019
1 parent 1afcb2f commit bd2b2eb
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions surface/include/pcl/surface/impl/mls.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ pcl::MovingLeastSquares<PointInT, PointOutT>::performUpsampling (PointCloudOut &
for (size_t dp_i = 0; dp_i < distinct_cloud_->size (); ++dp_i) // dp_i = distinct_point_i
{
// Distinct cloud may have nan points, skip them
if (!pcl_isfinite (distinct_cloud_->points[dp_i].x))
if (!std::isfinite (distinct_cloud_->points[dp_i].x))
continue;

// Get 3D position of point
Expand Down Expand Up @@ -537,7 +537,7 @@ pcl::MLSResult::calculatePrincipleCurvatures (const double u, const double v) co
// Then:
// k1 = H + sqrt(H^2 - K)
// k1 = H - sqrt(H^2 - K)
if (order > 1 && c_vec.size () >= (order + 1) * (order + 2) / 2 && pcl_isfinite (c_vec[0]))
if (order > 1 && c_vec.size () >= (order + 1) * (order + 2) / 2 && std::isfinite (c_vec[0]))
{
const PolynomialPartialDerivative d = getPolynomialPartialDerivative (u, v);
const double Z = 1 + d.z_u * d.z_u + d.z_v * d.z_v;
Expand Down Expand Up @@ -569,7 +569,7 @@ pcl::MLSResult::projectPointOrthogonalToPolynomialSurface (const double u, const

MLSProjectionResults result;
result.normal = plane_normal;
if (order > 1 && c_vec.size () >= (order + 1) * (order + 2) / 2 && pcl_isfinite (c_vec[0]))
if (order > 1 && c_vec.size () >= (order + 1) * (order + 2) / 2 && std::isfinite (c_vec[0]))
{
PolynomialPartialDerivative d = getPolynomialPartialDerivative (gu, gv);
gw = d.z;
Expand Down Expand Up @@ -647,7 +647,7 @@ pcl::MLSResult::projectPointSimpleToPolynomialSurface (const double u, const dou
result.v = v;
result.normal = plane_normal;

if (order > 1 && c_vec.size () >= (order + 1) * (order + 2) / 2 && pcl_isfinite (c_vec[0]))
if (order > 1 && c_vec.size () >= (order + 1) * (order + 2) / 2 && std::isfinite (c_vec[0]))
{
const PolynomialPartialDerivative d = getPolynomialPartialDerivative (u, v);
w = d.z;
Expand All @@ -667,7 +667,7 @@ pcl::MLSResult::projectPoint (const Eigen::Vector3d &pt, ProjectionMethod method
getMLSCoordinates (pt, u, v, w);

MLSResult::MLSProjectionResults proj;
if (order > 1 && num_neighbors >= required_neighbors && pcl_isfinite (c_vec[0]) && method != NONE)
if (order > 1 && num_neighbors >= required_neighbors && std::isfinite (c_vec[0]) && method != NONE)
{
if (method == ORTHOGONAL)
proj = projectPointOrthogonalToPolynomialSurface (u, v, w);
Expand All @@ -686,7 +686,7 @@ pcl::MLSResult::MLSProjectionResults
pcl::MLSResult::projectQueryPoint (ProjectionMethod method, int required_neighbors) const
{
MLSResult::MLSProjectionResults proj;
if (order > 1 && num_neighbors >= required_neighbors && pcl_isfinite (c_vec[0]) && method != NONE)
if (order > 1 && num_neighbors >= required_neighbors && std::isfinite (c_vec[0]) && method != NONE)
{
if (method == ORTHOGONAL)
{
Expand Down Expand Up @@ -739,7 +739,7 @@ pcl::MLSResult::computeMLSSurface (const pcl::PointCloud<PointT> &cloud,

query_point = cloud.points[index].getVector3fMap ().template cast<double> ();

if (!pcl_isfinite (eigen_vector[0]) || !pcl_isfinite (eigen_vector[1]) || !pcl_isfinite (eigen_vector[2]))
if (!std::isfinite(eigen_vector[0]) || !std::isfinite(eigen_vector[1]) || !std::isfinite(eigen_vector[2]))
{
// Invalid plane coefficients, this may happen if the input cloud is non-dense (it contains invalid points)
// or if the points in the neighborhood are linearly dependent (e.g. on a line).
Expand Down Expand Up @@ -848,7 +848,7 @@ pcl::MovingLeastSquares<PointInT, PointOutT>::MLSVoxelGrid::MLSVoxelGrid (PointC
// Put initial cloud in voxel grid
data_size_ = static_cast<uint64_t> (1.5 * max_size / voxel_size_);
for (unsigned int i = 0; i < indices->size (); ++i)
if (pcl_isfinite (cloud->points[(*indices)[i]].x))
if (std::isfinite (cloud->points[(*indices)[i]].x))
{
Eigen::Vector3i pos;
getCellIndex (cloud->points[(*indices)[i]].getVector3fMap (), pos);
Expand Down

0 comments on commit bd2b2eb

Please sign in to comment.