ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
FastMarchingForPropagation.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 // local
11 #include "DgmOctree.h"
12 #include "FastMarching.h"
13 
14 namespace cloudViewer {
15 
16 class ReferenceCloud;
17 class GenericCloud;
18 
20 
23 public:
26 
28 
39  int init(GenericCloud* theCloud,
40  DgmOctree* theOctree,
41  unsigned char gridLevel,
42  bool constantAcceleration = false);
43 
46 
51 
53 
56 
58 
63  void setDetectionThreshold(float value) { m_detectionThreshold = value; }
64 
66 
72  void setJumpCoef(float value) { m_jumpCoef = value; }
73 
75 
79  void findPeaks();
80 
81  // inherited methods (see FastMarching)
82  int propagate() override;
83 
84 protected:
86  class PropagationCell : public Cell {
87  public:
89  PropagationCell() : Cell(), f(0), cellCode(0) {}
90 
92  ~PropagationCell() override = default;
93 
95  float f;
98  };
99 
100  // inherited methods (see FastMarching)
101  float computeTCoefApprox(Cell* currentCell,
102  Cell* neighbourCell) const override;
103  int step() override;
104  bool instantiateGrid(unsigned size) override {
105  return instantiateGridTpl<PropagationCell>(size);
106  }
107 
109  float m_jumpCoef;
112 };
113 
114 } // namespace cloudViewer
int size
The octree structure used throughout the library.
Definition: DgmOctree.h:39
unsigned CellCode
Type of the code of an octree cell.
Definition: DgmOctree.h:78
A Fast Marching grid cell for surfacical propagation.
DgmOctree::CellCode cellCode
Equivalent cell code in the octree.
Fast Marching algorithm for surface front propagation.
void setDetectionThreshold(float value)
Sets the threshold for propagation stop.
float m_jumpCoef
Accceleration exageration factor.
float computeTCoefApprox(Cell *currentCell, Cell *neighbourCell) const override
Computes the front acceleration between two cells.
int propagate() override
Propagates the front.
void setJumpCoef(float value)
Sets the accceleration exageration factor.
int init(GenericCloud *theCloud, DgmOctree *theOctree, unsigned char gridLevel, bool constantAcceleration=false)
Initializes the grid with a point cloud (and ist corresponding octree)
int step() override
Propagates the front (one step)
bool setPropagationTimingsAsDistances()
Sets the propagation timings as distances for each point.
void findPeaks()
Find peaks of local acceleration values.
bool instantiateGrid(unsigned size) override
Instantiates grid in memory.
float m_detectionThreshold
Threshold for propagation stop.
A generic Fast Marching grid cell.
Definition: FastMarching.h:95
Fast Marching algorithm (front propagation)
Definition: FastMarching.h:41
A very simple point cloud (no point duplication)
Generic file read and write utility for python interface.