ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
cellsFusionDlg.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 #include "ui_cellsFusionDlg.h"
11 
14 class CellsFusionDlg : public QDialog, public Ui::CellsFusionDlg {
15 public:
18 
20  CellsFusionDlg(Algorithm algo, QWidget* parent = 0)
21  : QDialog(parent, Qt::Tool), Ui::CellsFusionDlg() {
22  setupUi(this);
23 
24  switch (algo) {
25  case ALGO_KD_TREE:
26  algoComboBox->setCurrentIndex(0);
27  octreeLevelSpinBox->setEnabled(false);
28  kdTreeCellFusionGroupBox->setVisible(true);
29  fmCellFusionGroupBox->setVisible(false);
30  break;
31  case ALGO_FAST_MARCHING:
32  algoComboBox->setCurrentIndex(1);
33  octreeLevelSpinBox->setEnabled(true);
34  kdTreeCellFusionGroupBox->setVisible(false);
35  fmCellFusionGroupBox->setVisible(true);
36  break;
37  }
38  }
39 };
cloudViewer::DgmOctree::NearestNeighboursSearchStruct::cellCenter
CCVector3 cellCenter
Coordinates of the center of the cell including the query point.
Definition: DgmOctree.h:189
qCSF::getActions
virtual QList< QAction * > getActions() override
Get a list of actions for this plugin.
Definition: qCSF.cpp:52
CSF::readPointsFromFile
bool readPointsFromFile(std::string filename)
Definition: CSF.cpp:42
wl::Point::y
float y
Definition: wlPointCloud.h:19
Particle::offsetPos
void offsetPos(const Vec3 v)
Definition: Particle.h:94
QtCompat::endl
QTextStream & endl(QTextStream &stream)
Definition: QtCompat.h:718
Cloth::getParticle
Particle & getParticle(int x, int y)
Definition: Cloth.h:77
ccDefaultPluginInterface::getDescription
virtual QString getDescription() const override
Returns long name/description (for tooltip, etc.)
Definition: ecvDefaultPluginInterface.cpp:104
filename
std::string filename
Definition: PointCloudIO.cpp:47
ccGenericMesh::showNormals
void showNormals(bool state) override
Sets normals visibility.
Definition: ecvGenericMesh.cpp:44
CSF.h
cloudViewer::ReferenceCloud::reserve
virtual bool reserve(unsigned n)
Reserves some memory for hosting the point references.
Definition: ReferenceCloud.cpp:51
DAMPING
#define DAMPING
Definition: Particle.h:14
ecvMainAppInterface::haveOneSelection
bool haveOneSelection() const
Checks if we have exactly one selection.
Definition: ecvMainAppInterface.h:113
Vec3::x
double x
Definition: Vec3.h:18
ccMesh::computePerVertexNormals
bool computePerVertexNormals()
Computes per-vertex normals.
Definition: ecvMesh.cpp:246
ecvMainAppInterface::STD_CONSOLE_MESSAGE
@ STD_CONSOLE_MESSAGE
Definition: ecvMainAppInterface.h:117
octreeLevel
unsigned char octreeLevel
Definition: qCanupoTools.cpp:38
ccDefaultPluginInterface::getName
virtual QString getName() const override
Returns (short) name (for menu entry, etc.)
Definition: ecvDefaultPluginInterface.cpp:100
cloudViewer::DgmOctree::computeCellCenter
void computeCellCenter(CellCode code, unsigned char level, CCVector3 &center, bool isCodeTruncated=false) const
Definition: DgmOctree.h:862
x
normal_z x
Definition: my_point_types.h:165
Particle::nearestPointHeight
double nearestPointHeight
Definition: Particle.h:52
CSF::saveOffGroundPoints
void saveOffGroundPoints(const std::vector< int > &grp, std::string path="")
Definition: CSF.cpp:228
ecvMainAppInterface::dispToConsole
virtual void dispToConsole(QString message, ConsoleMessageLevel level=STD_CONSOLE_MESSAGE)=0
Tuple3Tpl::x
Type x
Definition: CVGeom.h:137
Cloth::Cloth
Cloth(const Vec3 &origin_pos, int num_particles_width, int num_particles_height, double step_x, double step_y, double smoothThreshold, double heightThreshold, int rigidness, double time_step)
Definition: Cloth.cpp:24
cloudViewer::ReferenceCloud::size
unsigned size() const override
Returns the number of points.
Definition: ReferenceCloud.h:41
SQUARE_DIST
#define SQUARE_DIST(x1, y1, x2, y2)
Definition: Rasterization.h:13
cloudViewer::DgmOctree::NearestNeighboursSearchStruct::cellPos
Tuple3i cellPos
Position in the octree of the cell including the query point.
Definition: DgmOctree.h:184
Cloth::saveMovableToFile
void saveMovableToFile(std::string path="")
Definition: Cloth.cpp:453
Particle
Definition: Particle.h:19
cloudViewer::DgmOctree::NearestNeighboursSearchStruct::level
unsigned char level
Level of subdivision of the octree at which to start the search.
Definition: DgmOctree.h:171
qCSF::doAction
void doAction()
Slot called when associated ation is triggered.
Definition: qCSF.cpp:64
nProgress
cloudViewer::NormalizedProgress * nProgress
Definition: qCanupoTools.cpp:42
cloudViewer::DistanceComputationTools::synchronizeOctrees
static SOReturnCode synchronizeOctrees(GenericIndexedCloudPersist *comparedCloud, GenericIndexedCloudPersist *referenceCloud, DgmOctree *&comparedOctree, DgmOctree *&referenceOctree, PointCoordinateType maxSearchDist=0, GenericProgressCallback *progressCb=nullptr)
Synchronizes (and re-build if necessary) two octrees.
Definition: DistanceComputationTools.cpp:242
ecvMainAppInterface::getMainWindow
virtual QMainWindow * getMainWindow()=0
Returns main window.
ccObject::setName
virtual void setName(const QString &name)
Sets object name.
Definition: ecvObject.h:75
ccObject::isA
bool isA(CV_CLASS_ENUM type) const
Definition: ecvObject.h:131
CV_TYPES::POINT_CLOUD
@ POINT_CLOUD
Definition: CVTypes.h:104
Cloth::step_y
double step_y
Definition: Cloth.h:91
cloth_resolution
static double cloth_resolution
Definition: ccCSFDlg.cpp:14
ecvMainAppInterface::WRN_CONSOLE_MESSAGE
@ WRN_CONSOLE_MESSAGE
Definition: ecvMainAppInterface.h:118
cloudViewer::PointCloudTpl::getPoint
const CCVector3 * getPoint(unsigned index) const override
Definition: PointCloudTpl.h:143
cloudViewer::ReferenceCloud::getPoint
const CCVector3 * getPoint(unsigned index) const override
Returns the ith point.
Definition: ReferenceCloud.h:79
CSF::Parameters::cloth_resolution
double cloth_resolution
Definition: CSF.h:56
CSF::Parameters::rigidness
int rigidness
Definition: CSF.h:58
cloudViewer::PointCloudTpl::size
unsigned size() const override
Definition: PointCloudTpl.h:38
ccPointCloud
A 3D cloud and its associated features (color, normals, scalar fields, etc.)
Definition: ecvPointCloud.h:146
Particle::pos
Vec3 pos
Definition: Particle.h:38
qCSF::registerCommands
virtual void registerCommands(ccCommandLineInterface *cmd) override
Optional: registers commands (for the command line mode)
Definition: qCSF.cpp:256
ecvMainAppInterface.h
wl::Point::z
float z
Definition: wlPointCloud.h:20
cloudViewer::ReferenceCloud::getPointGlobalIndex
virtual unsigned getPointGlobalIndex(unsigned localIndex) const
Definition: ReferenceCloud.h:103
cloudViewer::DgmOctree::executeFunctionForAllCellsAtLevel
unsigned executeFunctionForAllCellsAtLevel(unsigned char level, octreeCellFunc func, void **additionalParameters, bool multiThread=false, GenericProgressCallback *progressCb=nullptr, const char *functionTitle=nullptr, int maxThreadCount=0)
Definition: DgmOctree.cpp:3573
DgmOctree.h
cloudViewer::DgmOctree::findBestLevelForAGivenPopulationPerCell
unsigned char findBestLevelForAGivenPopulationPerCell(unsigned indicativeNumberOfPointsPerCell) const
Definition: DgmOctree.cpp:2737
ccMesh::reserve
bool reserve(std::size_t n)
Reserves the memory to store the vertex indexes (3 per triangle)
Definition: ecvMesh.cpp:2475
ccHObject::Container
std::vector< ccHObject * > Container
Standard instances container (for children, etc.)
Definition: ecvHObject.h:337
CSF::Parameters::class_threshold
double class_threshold
Definition: CSF.h:54
CCVector3
Vector3Tpl< PointCoordinateType > CCVector3
Default 3D Vector.
Definition: CVGeom.h:798
Cloth::saveToFile
void saveToFile(std::string path="")
Definition: Cloth.cpp:434
wl::Point::x
float x
Definition: wlPointCloud.h:18
result
core::Tensor result
Definition: VtkUtils.cpp:76
cloudViewer::DgmOctree::octreeCell
Octree cell descriptor.
Definition: DgmOctree.h:354
Particle::pos_y
int pos_y
Definition: Particle.h:36
MaxIteration
static int MaxIteration
Definition: ccCSFDlg.cpp:13
CommandCSF
Definition: qCSFCommands.h:29
cloudViewer::ReferenceCloud::addPointIndex
virtual bool addPointIndex(unsigned globalIndex)
Point global index insertion mechanism.
Definition: ReferenceCloud.cpp:84
CSF::~CSF
virtual ~CSF()
Definition: CSF.cpp:40
ccCSFDlg.h
Particle::c_pos
int c_pos
Definition: Particle.h:37
CSF::Parameters::k_nearest_points
int k_nearest_points
Definition: CSF.h:48
ccMesh::addTriangle
void addTriangle(unsigned i1, unsigned i2, unsigned i3)
Adds a triangle to the mesh.
Definition: ecvMesh.cpp:2428
y
normal_z y
Definition: my_point_types.h:168
doubleMove1
const double doubleMove1[15]
Definition: Particle.cpp:35
CellsFusionDlg::CellsFusionDlg
CellsFusionDlg(Algorithm algo, QWidget *parent=0)
Default constructor.
Definition: cellsFusionDlg.h:20
ecvMainAppInterface
Main application interface (for plugins)
Definition: ecvMainAppInterface.h:24
Particle::makeUnmovable
void makeUnmovable()
Definition: Particle.h:98
singleMove1
const double singleMove1[15]
Definition: Particle.cpp:29
Particle::satisfyConstraintSelf
void satisfyConstraintSelf(int constraintTimes)
Definition: Particle.cpp:39
Vector3Tpl< PointCoordinateType >
qCSFCommands.h
Vec3.h
Rasterization::findHeightValByNeighbor
static double findHeightValByNeighbor(Particle *p, Cloth &cloth)
Definition: Rasterization.cpp:49
wl::Point
Point type.
Definition: wlPointCloud.h:15
cloudViewer::t::geometry::path
static const std::string path
Definition: PointCloud.cpp:59
cloudViewer::DgmOctree::findNearestNeighborsStartingFromCell
unsigned findNearestNeighborsStartingFromCell(NearestNeighboursSearchStruct &nNSS, bool getOnlyPointsWithValidScalar=false) const
Definition: DgmOctree.cpp:1655
ccCommandLineInterface::Command::Shared
QSharedPointer< Command > Shared
Shared type.
Definition: ecvCommandLineInterface.h:132
Vec3::y
double y
Definition: Vec3.h:18
ecvGenericPointCloud.h
ccCSFDlg::saveSettings
void saveSettings()
Saves (temporarily) the dialog parameters on acceptation.
Definition: ccCSFDlg.cpp:29
ecvMainAppInterface::ERR_CONSOLE_MESSAGE
@ ERR_CONSOLE_MESSAGE
Definition: ecvMainAppInterface.h:119
ccPointCloud::partialClone
ccPointCloud * partialClone(const cloudViewer::ReferenceCloud *selection, int *warnings=nullptr, bool withChildEntities=true) const
Creates a new point cloud object from a ReferenceCloud (selection)
Definition: ecvPointCloud.cpp:290
Cloud2CloudDist::Compute
static bool Compute(const Cloth &cloth, const wl::PointCloud &pc, double class_threshold, std::vector< int > &groundIndexes, std::vector< int > &offGroundIndexes, unsigned N=3)
Definition: Cloud2CloudDist.cpp:18
cloudViewer::DgmOctree::NearestNeighboursSearchStruct::pointsInNeighbourhood
NeighboursSet pointsInNeighbourhood
Definition: DgmOctree.h:215
Ui
Definition: sfEditDlg.h:16
CellsFusionDlg::ALGO_FAST_MARCHING
@ ALGO_FAST_MARCHING
Definition: cellsFusionDlg.h:17
CSF
Definition: CSF.h:21
Cloth::terrainCollision
void terrainCollision()
Definition: Cloth.cpp:198
ccPointCloud::reserve
bool reserve(unsigned numberOfPoints) override
Reserves memory for all the active features.
Definition: ecvPointCloud.cpp:1452
ccStdPluginInterface::m_app
ecvMainAppInterface * m_app
Main application interface.
Definition: ecvStdPluginInterface.h:85
cloudViewer::DistanceComputationTools::SYNCHRONIZED
@ SYNCHRONIZED
Definition: DistanceComputationTools.h:563
cloudViewer::DistanceComputationTools::SOReturnCode
SOReturnCode
Return codes for DistanceComputationTools::synchronizeOctrees.
Definition: DistanceComputationTools.h:563
ecvMesh.h
cloudViewer::ReferenceCloud::setPointScalarValue
void setPointScalarValue(unsigned pointIndex, ScalarType value) override
Sets the ith point associated scalar value.
Definition: ReferenceCloud.h:66
ecvProgressDialog.h
cloudViewer::DgmOctree::octreeCell::truncatedCode
CellCode truncatedCode
Truncated cell code.
Definition: DgmOctree.h:361
Particle::correspondingLidarPointList
std::vector< int > correspondingLidarPointList
Definition: Particle.h:48
Cloth::timeStep
double timeStep()
Definition: Cloth.cpp:146
cloudViewer::DgmOctree::NearestNeighboursSearchStruct::queryPoint
CCVector3 queryPoint
Query point.
Definition: DgmOctree.h:167
cloudViewer::DgmOctree
The octree structure used throughout the library.
Definition: DgmOctree.h:39
cloudViewer::DgmOctree::NearestNeighboursSearchStruct
Container of in/out parameters for nearest neighbour(s) search.
Definition: DgmOctree.h:161
Cloud2CloudDist.h
CellsFusionDlg::Algorithm
Algorithm
Cell fusion algorithm.
Definition: cellsFusionDlg.h:17
LasTilingDimensions::XY
@ XY
cloudViewer::utility::floor
MiniVec< float, N > floor(const MiniVec< float, N > &a)
Definition: MiniVec.h:75
Particle::old_pos
Vec3 old_pos
Definition: Particle.h:39
Particle::nearestPointIndex
std::size_t nearestPointIndex
Definition: Particle.h:50
class_threshold
static double class_threshold
Definition: ccCSFDlg.cpp:15
CSF::do_filtering
bool do_filtering(std::vector< int > &groundIndexes, std::vector< int > &offGroundIndexes, bool exportClothMesh, ccMesh *&clothMesh, ecvMainAppInterface *app=0, QWidget *parent=0)
Definition: CSF.cpp:73
ccDrawableObject::setVisible
virtual void setVisible(bool state)
Sets entity visibility.
Definition: ecvDrawableObject.h:40
CSF::Parameters::time_step
double time_step
Definition: CSF.h:52
Tuple3Tpl::z
Type z
Definition: CVGeom.h:137
Cloth::num_particles_width
int num_particles_width
Definition: Cloth.h:88
cloudViewer::DgmOctree::NearestNeighboursSearchStruct::minNumberOfNeighbors
unsigned minNumberOfNeighbors
Minimal number of neighbours to find.
Definition: DgmOctree.h:177
wl::PointCloud
Definition: wlPointCloud.h:28
cloudViewer::DgmOctree::octreeCell::points
ReferenceCloud * points
Set of points lying inside this cell.
Definition: DgmOctree.h:365
Cloth::findUnmovablePoint
void findUnmovablePoint(const std::vector< XY > &connected, const std::vector< double > &heightvals, std::vector< int > &edgePoints)
Definition: Cloth.cpp:318
ecvMainAppInterface::addToDB
virtual void addToDB(ccHObject *obj, bool updateZoom=false, bool autoExpandDBTree=true, bool checkDimensions=false, bool autoRedraw=true)=0
ccCommandLineInterface
Command line interface.
Definition: ecvCommandLineInterface.h:112
wl::PointCloud::computeBoundingBox
void computeBoundingBox(Point &bbMin, Point &bbMax)
Definition: wlPointCloud.h:30
Rasterization::findHeightValByScanline
static double findHeightValByScanline(Particle *p, Cloth &cloth)
Definition: Rasterization.cpp:22
ccCSFDlg
Dialog for qCSF plugin.
Definition: ccCSFDlg.h:13
ecvHObjectCaster.h
Vec3::z
double z
Definition: Vec3.h:18
Vec3
Definition: Vec3.h:13
Particle::isVisited
bool isVisited
Definition: Particle.h:33
Cloth
Definition: Cloth.h:44
ccDefaultPluginInterface::getIcon
virtual QIcon getIcon() const override
Returns icon.
Definition: ecvDefaultPluginInterface.cpp:108
Particle::timeStep
void timeStep()
Definition: Particle.cpp:13
cloudViewer::DgmOctree::octreeCell::level
unsigned char level
Cell level of subdivision.
Definition: DgmOctree.h:367
count
int count
Definition: FileIOFactory.cpp:132
Cloth::num_particles_height
int num_particles_height
Definition: Cloth.h:89
ecvMainAppInterface::getSelectedEntities
virtual const ccHObject::Container & getSelectedEntities() const =0
Returns currently selected entities ("read only")
cloudViewer::ReferenceCloud
A very simple point cloud (no point duplication)
Definition: ReferenceCloud.h:29
Cloth::origin_pos
Vec3 origin_pos
Definition: Cloth.h:90
Cloth::getSize
int getSize() const
Definition: Cloth.h:93
std
Definition: Eigen.h:85
qCSF::qCSF
qCSF(QObject *parent=nullptr)
Default constructor.
Definition: qCSF.cpp:41
cloudViewer::DistanceComputationTools::DISJOINT
@ DISJOINT
Definition: DistanceComputationTools.h:563
Cloth::getParticleByIndex
Particle & getParticleByIndex(int index)
Definition: Cloth.h:83
ccMesh
Triangular mesh.
Definition: ecvMesh.h:35
ReferenceCloud.h
ccHObject
Hierarchical CLOUDVIEWER Object.
Definition: ecvHObject.h:25
Tuple3Tpl::y
Type y
Definition: CVGeom.h:137
ccObject::getName
virtual QString getName() const
Returns object name.
Definition: ecvObject.h:72
CSF::params
Parameters params
Definition: CSF.h:63
Cloth::step_x
double step_x
Definition: Cloth.h:91
CSF::saveGroundPoints
void saveGroundPoints(const std::vector< int > &grp, std::string path="")
Definition: CSF.cpp:211
cloudViewer::PointCloudTpl::addPoint
void addPoint(const CCVector3 &P)
Adds a 3D point to the database.
Definition: PointCloudTpl.h:246
Cloth.h
CellsFusionDlg::ALGO_KD_TREE
@ ALGO_KD_TREE
Definition: cellsFusionDlg.h:17
Rasterization::RasterTerrain
static bool RasterTerrain(Cloth &cloth, const wl::PointCloud &pc, std::vector< double > &heightVal, unsigned KNN=1)
Definition: Rasterization.cpp:86
Cloth::addForce
void addForce(const Vec3 &direction)
Definition: Cloth.cpp:187
CSF::Parameters::iterations
int iterations
Definition: CSF.h:60
cloudViewer::NormalizedProgress
Definition: GenericProgressCallback.h:78
PointCoordinateType
float PointCoordinateType
Type of the coordinates of a (N-D) point.
Definition: CVTypes.h:16
z
normal_z z
Definition: my_point_types.h:165
ccCommandLineInterface::registerCommand
virtual bool registerCommand(Command::Shared command)=0
Registers a new command.
Cloth::toMesh
ccMesh * toMesh() const
Converts the cloth to a CC mesh structure.
Definition: Cloth.cpp:104
ccStdPluginInterface
Standard ECV plugin interface.
Definition: ecvStdPluginInterface.h:31
ccCSFDlg::ccCSFDlg
ccCSFDlg(QWidget *parent=0)
Default constructor.
Definition: ccCSFDlg.cpp:16
Particle::neighborsList
std::vector< Particle * > neighborsList
Definition: Particle.h:44
Cloth::movableFilter
void movableFilter()
Definition: Cloth.cpp:214
Cloth::handle_slop_connected
void handle_slop_connected(const std::vector< int > &edgePoints, const std::vector< XY > &connected, const std::vector< std::vector< int >> &neighbors, const std::vector< double > &heightvals)
Definition: Cloth.cpp:393
Particle::pos_x
int pos_x
Definition: Particle.h:35
DistanceComputationTools.h
ccHObject::addChild
virtual bool addChild(ccHObject *child, int dependencyFlags=DP_PARENT_OF_OTHER, int insertIndex=-1)
Adds a child.
Definition: ecvHObject.cpp:534
Cloth::getHeightvals
std::vector< double > & getHeightvals()
Definition: Cloth.h:97
Rasterization.h
CSF::Parameters::bSloopSmooth
bool bSloopSmooth
Definition: CSF.h:50
qCSF::onNewSelection
virtual void onNewSelection(const ccHObject::Container &selectedEntities) override
Definition: qCSF.cpp:46
ccObject::setEnabled
virtual void setEnabled(bool state)
Sets the "enabled" property.
Definition: ecvObject.h:102
MIN_INF
#define MIN_INF
Definition: Particle.h:16
CellsFusionDlg
Definition: cellsFusionDlg.h:14
ecvOctree.h
cloudViewer::DgmOctree::getCellPos
void getCellPos(CellCode code, unsigned char level, Tuple3i &cellPos, bool isCodeTruncated) const
Definition: DgmOctree.cpp:498
CSF::CSF
CSF(wl::PointCloud &cloud)
Definition: CSF.cpp:30
ecvPointCloud.h
qCSF.h
qCSF::m_action
QAction * m_action
Associated action.
Definition: qCSF.h:37
Particle::isMovable
bool isMovable() const
Definition: Particle.h:88
Particle::tmpDist
double tmpDist
Definition: Particle.h:54
Particle.h