Skip to content

Commit

Permalink
Get rid of local variables with misleading names
Browse files Browse the repository at this point in the history
  • Loading branch information
taketwo committed Feb 8, 2017
1 parent 39901cd commit dbab771
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions filters/include/pcl/filters/impl/crop_box.hpp
Expand Up @@ -90,10 +90,6 @@ pcl::CropBox<PointT>::applyFilter (std::vector<int> &indices)
inverse_transform = transform.inverse ();
}

bool transform_matrix_is_identity = transform_.matrix ().isIdentity ();
bool translation_is_zero = (translation_ != Eigen::Vector3f::Zero ());
bool inverse_transform_matrix_is_identity = inverse_transform.matrix ().isIdentity ();

for (size_t index = 0; index < indices_->size (); ++index)
{
if (!input_->is_dense)
Expand All @@ -105,18 +101,18 @@ pcl::CropBox<PointT>::applyFilter (std::vector<int> &indices)
PointT local_pt = input_->points[(*indices_)[index]];

// Transform point to world space
if (!transform_matrix_is_identity)
if (!transform_.matrix ().isIdentity ())
local_pt = pcl::transformPoint<PointT> (local_pt, transform_);

if (translation_is_zero)
if (translation_ != Eigen::Vector3f::Zero ())
{
local_pt.x -= translation_ (0);
local_pt.y -= translation_ (1);
local_pt.z -= translation_ (2);
}

// Transform point to local space of crop box
if (!inverse_transform_matrix_is_identity)
if (!inverse_transform.matrix ().isIdentity ())
local_pt = pcl::transformPoint<PointT> (local_pt, inverse_transform);

// If outside the cropbox
Expand Down

0 comments on commit dbab771

Please sign in to comment.