2525#include < mrpt/math/ops_containers.h> // dotProduct
2626#include < mrpt/random/RandomGenerators.h>
2727
28- //
29- #include < mrpt/maps/CPointsMapXYZI.h>
30- #include < mrpt/maps/CPointsMapXYZIRT.h>
31- #include < mrpt/version.h>
32-
3328IMPLEMENTS_MRPT_OBJECT (FilterDecimateVoxels, mp2p_icp_filters::FilterBase, mp2p_icp_filters)
3429
3530using namespace mp2p_icp_filters;
@@ -174,11 +169,9 @@ void FilterDecimateVoxels::filter(mp2p_icp::metric_map_t& inOut) const
174169 const auto & xs = pcPtrs[mapIdx]->getPointsBufferRef_x ();
175170 const auto & ys = pcPtrs[mapIdx]->getPointsBufferRef_y ();
176171
177- #if MRPT_VERSION >= 0x020f00 // 2.15.0
178172 outPc->registerPointFieldsFrom (*pcPtrs[mapIdx]);
179173 mrpt::maps::CPointsMap::InsertCtx ctxOut =
180174 outPc->prepareForInsertPointsFrom (*pcPtrs[mapIdx]);
181- #endif
182175
183176 for (size_t i = 0 ; i < xs.size (); i++)
184177 {
@@ -188,13 +181,7 @@ void FilterDecimateVoxels::filter(mp2p_icp::metric_map_t& inOut) const
188181 }
189182 else
190183 {
191- #if MRPT_VERSION >= 0x020f03 // 2.15.3
192184 outPc->insertPointFrom (i, ctxOut);
193- #elif MRPT_VERSION >= 0x020f00 // 2.15.0
194- outPc->insertPointFrom (*pcPtrs[mapIdx], i, ctxOut);
195- #else
196- outPc->insertPointFrom (*pcPtrs[mapIdx], i);
197- #endif
198185 }
199186 }
200187 }
@@ -233,9 +220,7 @@ void FilterDecimateVoxels::filter(mp2p_icp::metric_map_t& inOut) const
233220 std::set<PointCloudToVoxelGridSingle::indices_t , PointCloudToVoxelGridSingle::IndicesHash>
234221 flattenUsedBins;
235222
236- #if MRPT_VERSION >= 0x020f00 // 2.15.0
237223 std::map<const mrpt::maps::CPointsMap*, mrpt::maps::CPointsMap::InsertCtx> ctxs;
238- #endif
239224
240225 grid.visit_voxels (
241226 [&](const PointCloudToVoxelGridSingle::indices_t & idx,
@@ -269,11 +254,7 @@ void FilterDecimateVoxels::filter(mp2p_icp::metric_map_t& inOut) const
269254 outPc->registerPointFieldsFrom (*pc);
270255 ctx = outPc->prepareForInsertPointsFrom (*pc);
271256 }
272- #if MRPT_VERSION >= 0x020f03 // 2.15.3
273257 outPc->insertPointFrom (*vxl.pointIdx , ctx);
274- #else
275- outPc->insertPointFrom (*pc, *vxl.pointIdx , ctx);
276- #endif
277258 // Actual flatten in "z":
278259 outPc->getPointsBufferRef_float_field (" z" )->back () =
279260 static_cast <float >(*params.flatten_to );
@@ -288,11 +269,7 @@ void FilterDecimateVoxels::filter(mp2p_icp::metric_map_t& inOut) const
288269 outPc->registerPointFieldsFrom (*pc);
289270 ctx = outPc->prepareForInsertPointsFrom (*pc);
290271 }
291- #if MRPT_VERSION >= 0x020f03 // 2.15.3
292272 outPc->insertPointFrom (*vxl.pointIdx , ctx);
293- #else
294- outPc->insertPointFrom (*pc, *vxl.pointIdx , ctx);
295- #endif
296273 }
297274 });
298275 }
@@ -326,10 +303,8 @@ void FilterDecimateVoxels::filter(mp2p_icp::metric_map_t& inOut) const
326303 std::set<PointCloudToVoxelGrid::indices_t , PointCloudToVoxelGrid::IndicesHash>
327304 flattenUsedBins;
328305
329- #if MRPT_VERSION >= 0x020f00 // 2.15.0
330306 outPc->registerPointFieldsFrom (pc);
331307 auto ctx = outPc->prepareForInsertPointsFrom (pc);
332- #endif
333308
334309 grid.visit_voxels (
335310 [&](const PointCloudToVoxelGrid::indices_t & idx,
@@ -440,13 +415,7 @@ void FilterDecimateVoxels::filter(mp2p_icp::metric_map_t& inOut) const
440415 }
441416 else
442417 {
443- #if MRPT_VERSION >= 0x020f03 // 2.15.3
444418 outPc->insertPointFrom (insertPtIdx, ctx);
445- #elif MRPT_VERSION >= 0x020f00 // 2.15.0
446- outPc->insertPointFrom (pc, insertPtIdx, ctx);
447- #else
448- outPc->insertPointFrom (pc, insertPtIdx);
449- #endif
450419 }
451420 }
452421 });
0 commit comments