MCPcopy Create free account
hub / github.com/LimHyungTae/patchwork / initialize

Method initialize

include/patchwork/patchwork.hpp:354–382  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

352
353template <typename PointT>
354inline void PatchWork<PointT>::initialize(RegionwisePatches &patches,
355 const ConcentricZoneModel &zone_model) {
356 patches.clear();
357 patch_indices_.clear();
358 Patch<PointT> patch;
359
360 // Reserve memory in advance to boost speed
361 patch.cloud_.reserve(1000);
362 patch.ground_.reserve(1000);
363 patch.non_ground_.reserve(1000);
364
365 // In polar coordinates, `num_columns` are `num_sectors`
366 // and `num_rows` are `num_rings`, respectively
367 int num_rows = zone_model_.num_total_rings_;
368 const auto &num_sectors_per_ring = zone_model.num_sectors_per_ring_;
369
370 for (int j = 0; j < num_rows; j++) {
371 Ring ring;
372 patch.ring_idx_ = j;
373 patch.is_close_to_origin_ = j < zone_model.max_ring_index_in_first_zone;
374 for (int i = 0; i < num_sectors_per_ring[j]; i++) {
375 patch.sector_idx_ = i;
376 ring.emplace_back(patch);
377
378 patch_indices_.emplace_back(j, i);
379 }
380 patches.emplace_back(ring);
381 }
382}
383
384template <typename PointT>
385inline void PatchWork<PointT>::flush_patches(RegionwisePatches &patches) {

Callers

nothing calls this directly

Calls 1

clearMethod · 0.45

Tested by

no test coverage detected