15 #include <mrpt/containers/yaml.h>
16 #include <mrpt/math/ops_containers.h>
31 "At least one 'inside_pointcloud_layer' or "
32 "'outside_pointcloud_layer' must be provided.");
35 c.has(
"bounding_box_min") && c[
"bounding_box_min"].isSequence() &&
36 c[
"bounding_box_min"].asSequence().size() == 3);
38 c.has(
"bounding_box_max") && c[
"bounding_box_max"].isSequence() &&
39 c[
"bounding_box_max"].asSequence().size() == 3);
41 const auto bboxMin = c[
"bounding_box_min"].asSequence();
42 const auto bboxMax = c[
"bounding_box_max"].asSequence();
44 for (
int i = 0; i < 3; i++)
53 mrpt::system::COutputLogger::setLoggerName(
"FilterBoundingBox");
60 MRPT_LOG_DEBUG_STREAM(
"Loading these params:\n" << c);
77 const auto& pc = *pcPtr;
83 pcPtr->GetRuntimeClass()->className);
85 if (insidePc) insidePc->reserve(insidePc->size() + pc.size() / 10);
90 pcPtr->GetRuntimeClass()->className);
92 if (outsidePc) outsidePc->reserve(outsidePc->size() + pc.size() / 10);
94 const auto& xs = pc.getPointsBufferRef_x();
95 const auto& ys = pc.getPointsBufferRef_y();
96 const auto& zs = pc.getPointsBufferRef_z();
98 for (
size_t i = 0; i < xs.size(); i++)
102 auto* targetPc = isInside ? insidePc.get() : outsidePc.get();
104 if (targetPc) targetPc->insertPointFrom(pc, i);