In a given point cloud, I want to remove all the points which are less than min and greater than max for all x, y and
You have found what the documentation makes clear.
PassThrough passes points in a cloud based on constraints for one particular field of the point type.
For multiple fields a different filter should be used, such as ConditionalRemoval
The following is untested, but it'll be something like this.
pcl::ConditionOr::Ptr range_cond (new pcl::ConditionOr ());
range_cond->addComparison (pcl::FieldComparison::Ptr (new pcl::FieldComparison("x", pcl::ComparisonOps::GT, minX)));
range_cond->addComparison (pcl::FieldComparison::Ptr (new pcl::FieldComparison("x", pcl::ComparisonOps::LT, maxX)));
range_cond->addComparison (pcl::FieldComparison::Ptr (new pcl::FieldComparison("y", pcl::ComparisonOps::GT, minY)));
range_cond->addComparison (pcl::FieldComparison::Ptr (new pcl::FieldComparison("y", pcl::ComparisonOps::LT, maxY)));
range_cond->addComparison (pcl::FieldComparison::Ptr (new pcl::FieldComparison("z", pcl::ComparisonOps::GT, minZ)));
range_cond->addComparison (pcl::FieldComparison::Ptr (new pcl::FieldComparison("z", pcl::ComparisonOps::LT, maxZ)));
pcl::ConditionalRemoval range_filt;
range_filt.setInputCloud(body);
range_filt.setCondition (range_cond);
range_filt.filter(*bodyFiltered);