15 #include <mrpt/containers/yaml.h>
16 #include <mrpt/math/TPoint3D.h>
33 "At least one 'output_layer_between' or "
34 "'output_layer_outside' must be provided.");
38 ASSERT_(c[
"center"].isSequence() && c[
"center"].asSequence().size() == 3);
40 auto cc = c[
"center"].asSequence();
42 for (
int i = 0; i < 3; i++)
53 MRPT_LOG_DEBUG_STREAM(
"Loading these params:\n" << c);
72 const auto& pc = *pcPtr;
78 pcPtr->GetRuntimeClass()->className);
80 if (outBetween) outBetween->reserve(outBetween->size() + pc.size() / 10);
86 pcPtr->GetRuntimeClass()->className);
88 if (outOutside) outOutside->reserve(outOutside->size() + pc.size() / 10);
90 const auto& xs = pc.getPointsBufferRef_x();
91 const auto& ys = pc.getPointsBufferRef_y();
92 const auto& zs = pc.getPointsBufferRef_z();
97 for (
size_t i = 0; i < xs.size(); i++)
100 (mrpt::math::TPoint3Df(xs[i], ys[i], zs[i]) -
params_.
center).sqrNorm();
102 const bool isInside = sqrNorm >= sqrMin && sqrNorm <= sqrMax;
104 auto* targetPc = isInside ? outBetween.get() : outOutside.get();
106 if (targetPc) targetPc->insertPointFrom(pc, i);