2023-11-30 19:43:41 +01:00
|
|
|
#include "Eigen/Dense"
|
|
|
|
|
|
2023-12-22 00:26:28 +01:00
|
|
|
#include <ccOctree.h>
|
|
|
|
|
|
2023-12-01 17:54:25 +01:00
|
|
|
#include <vector>
|
|
|
|
|
|
2023-12-22 00:26:28 +01:00
|
|
|
#include <QObject>
|
|
|
|
|
|
|
|
|
|
#include <qG3PointDialog.h>
|
|
|
|
|
|
2023-11-22 12:56:31 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
class ccMainAppInterface;
|
2023-12-01 17:54:25 +01:00
|
|
|
class ccPointCloud;
|
2023-11-22 12:56:31 +01:00
|
|
|
|
|
|
|
|
namespace G3Point
|
|
|
|
|
{
|
2023-12-22 00:26:28 +01:00
|
|
|
class G3PointAction : public QObject
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
static void createAction(ccMainAppInterface *appInterface);
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
bool sfConvertToRandomRGB(const ccHObject::Container &selectedEntities, QWidget* parent);
|
|
|
|
|
void add_to_stack(int index, const Eigen::ArrayXi& n_donors, const Eigen::ArrayXXi& donors, std::vector<int>& stack);
|
|
|
|
|
int segment_labels(bool useParallelStrategy=true);
|
2024-02-06 10:36:20 +01:00
|
|
|
int cluster_labels();
|
2023-12-22 00:26:28 +01:00
|
|
|
int segment_labels_steepest_slope(bool useParallelStrategy=true);
|
|
|
|
|
void add_to_stack_braun_willett(int index, const Eigen::ArrayXi& delta, const Eigen::ArrayXi &Di, std::vector<int>& stack, int local_maximum);
|
|
|
|
|
int segment_labels_braun_willett(bool useParallelStrategy=true);
|
|
|
|
|
void get_neighbors_distances_slopes(unsigned index);
|
|
|
|
|
bool query_neighbors(ccPointCloud* cloud, ccMainAppInterface* appInterface, bool useParallelStrategy=true);
|
|
|
|
|
void run();
|
|
|
|
|
void setkNN(int kNN);
|
|
|
|
|
|
|
|
|
|
Eigen::ArrayXXi m_neighbors_indexes;
|
|
|
|
|
Eigen::ArrayXXd m_neighbors_distances;
|
|
|
|
|
Eigen::ArrayXXd m_neighbors_slopes;
|
|
|
|
|
int m_kNN = 20;
|
|
|
|
|
ccOctree::Shared m_octree;
|
|
|
|
|
ccPointCloud* m_cloud;
|
|
|
|
|
unsigned char m_bestOctreeLevel = 0;
|
|
|
|
|
CCCoreLib::DgmOctree::NearestNeighboursSearchStruct m_nNSS;
|
|
|
|
|
ccMainAppInterface *m_app;
|
2024-02-06 10:36:20 +01:00
|
|
|
std::vector<std::vector<int>> m_stacks;
|
|
|
|
|
Eigen::ArrayXi m_labels;
|
|
|
|
|
Eigen::ArrayXi m_labelsnpoint;
|
|
|
|
|
Eigen::ArrayXi m_localMaximumIndexes;
|
2023-12-22 00:26:28 +01:00
|
|
|
qG3PointDialog* m_dlg;
|
|
|
|
|
|
|
|
|
|
static G3PointAction* s_g3PointAction;
|
|
|
|
|
};
|
2023-11-22 12:56:31 +01:00
|
|
|
}
|