ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
ecvFastMarchingForNormsDirection.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 // cloudViewer
11 #include <DgmOctree.h>
12 #include <FastMarching.h>
13 
14 // CV_DB_LIB
15 #include "ecvAdvancedTypes.h"
16 
17 // system
18 #include <vector>
19 
21 class ccPointCloud;
22 class ccOctree;
23 class ecvProgressDialog;
24 
26 
29 public:
31  static int OrientNormals(ccPointCloud* theCloud,
32  unsigned char octreeLevel,
33  ecvProgressDialog* progressCb = nullptr);
36 
38 
48  NormsIndexesTableType* theNorms,
49  ccOctree* theOctree,
50  unsigned char gridLevel);
51 
53 
56  std::vector<unsigned char>& resolved,
57  NormsIndexesTableType* theNorms);
58 
59  // inherited methods (see FastMarchingAlgorithm)
60  int propagate() override;
61 
62 protected:
65  public:
68  : Cell(),
69  N(0, 0, 0),
70  C(0, 0, 0),
71  cellCode(0),
73 #ifdef QT_DEBUG
74  ,
75  scalar(0)
76 #endif
77  {
78  }
79 
81  ~DirectionCell() override = default;
82 
91 #ifdef QT_DEBUG
93  float scalar;
94 #endif
95  };
96 
97  // inherited methods (see FastMarchingAlgorithm)
100  cloudViewer::FastMarching::Cell* neighbourCell) const override;
101  int step() override;
102  void initTrialCells() override;
103  bool instantiateGrid(unsigned size) override {
104  return instantiateGridTpl<DirectionCell*>(size);
105  }
106 
108 
111  DirectionCell* destCell) const;
112 
114  void resolveCellOrientation(unsigned index);
115 };
int size
Array of compressed 3D normals (single index)
A Fast Marching grid cell for normals direction resolution.
~DirectionCell() override=default
! Destructor
cloudViewer::DgmOctree::CellCode cellCode
the code of the equivalent cell in the octree
Fast Marching algorithm for normals direction resolution.
float computePropagationConfidence(DirectionCell *originCell, DirectionCell *destCell) const
Computes relative 'confidence' between two cells (orientations)
int step() override
Propagates the front (one step)
ccFastMarchingForNormsDirection()
Default constructor.
void resolveCellOrientation(unsigned index)
Resolves the direction of a given cell (once and for all)
float computeTCoefApprox(cloudViewer::FastMarching::Cell *currentCell, cloudViewer::FastMarching::Cell *neighbourCell) const override
Computes the front acceleration between two cells.
static int OrientNormals(ccPointCloud *theCloud, unsigned char octreeLevel, ecvProgressDialog *progressCb=nullptr)
Static entry point (helper)
int propagate() override
Propagates the front.
void initTrialCells() override
Initializes the TRIAL cells list.
unsigned updateResolvedTable(ccGenericPointCloud *theCloud, std::vector< unsigned char > &resolved, NormsIndexesTableType *theNorms)
Updates a list of point flags, indicating the points already processed.
bool instantiateGrid(unsigned size) override
Instantiates grid in memory.
int init(ccGenericPointCloud *cloud, NormsIndexesTableType *theNorms, ccOctree *theOctree, unsigned char gridLevel)
Initializes the grid with a point cloud (and ist corresponding octree)
A 3D cloud interface with associated features (color, normals, octree, etc.)
Octree structure.
Definition: ecvOctree.h:27
A 3D cloud and its associated features (color, normals, scalar fields, etc.)
unsigned CellCode
Type of the code of an octree cell.
Definition: DgmOctree.h:78
A generic Fast Marching grid cell.
Definition: FastMarching.h:95
Fast Marching algorithm (front propagation)
Definition: FastMarching.h:41
Graphical progress indicator (thread-safe)
unsigned char octreeLevel