/
klischa
/
AstraScanner2
Обзор
Документация
Войти
/
klischa
/
AstraScanner2
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
src/services/CloudFiltersService.h
65 строк
2 KB
klischa
refactor: сервисы → поддержка std::function callback (обратная совместимость)
19 июн 2026, 22:17
19 июн 2026, 22:17
88e3a45
Код
Авторство
О чём код?
#ifndef CLOUDFILTERSSERVICE_H #define CLOUDFILTERSSERVICE_H #include <QObject> #include <pcl/point_cloud.h> #include <pcl/point_types.h> #include <functional> class PointCloudFiltersCUDA; class CloudFiltersService : public QObject { Q_OBJECT public: using ProgressCb = std::function<void(int)>; using FilterCompletedCb = std::function<void(const QString&, int, int)>; explicit CloudFiltersService(QObject *parent = nullptr); void setProgressCallback(ProgressCb cb) { m_progressCb = std::move(cb); } void setFilterCompletedCallback(FilterCompletedCb cb) { m_filterCompletedCb = std::move(cb); } pcl::PointCloud<pcl::PointXYZRGB>::Ptr applyStatisticalOutlierRemoval( const pcl::PointCloud<pcl::PointXYZRGB>::Ptr &cloud, int meanK = 50, double stddevMulThresh = 1.0); pcl::PointCloud<pcl::PointXYZRGB>::Ptr applyRadiusOutlierRemoval( const pcl::PointCloud<pcl::PointXYZRGB>::Ptr &cloud, double radius = 0.02, int minNeighbors = 10); pcl::PointCloud<pcl::PointXYZRGB>::Ptr applyVoxelGrid( const pcl::PointCloud<pcl::PointXYZRGB>::Ptr &cloud, float leafSize = 0.005f); pcl::PointCloud<pcl::PointXYZRGB>::Ptr applyMagicWand( const pcl::PointCloud<pcl::PointXYZRGB>::Ptr &cloud, float leafSize = 0.005f, int meanK = 50, double stddevMulThresh = 1.0); pcl::PointCloud<pcl::PointXYZRGB>::Ptr removeBackgroundPlane( const pcl::PointCloud<pcl::PointXYZRGB>::Ptr &cloud, float distanceThreshold = 0.01f, int maxIterations = 1000); pcl::PointCloud<pcl::PointXYZRGB>::Ptr applyRegionGrowingSegmentation( const pcl::PointCloud<pcl::PointXYZRGB>::Ptr &cloud, float clusterTolerance = 0.02f, int minClusterSize = 100, int maxClusterSize = 250000); // Оценка нормалей (автоматическая диспетчеризация GPU/CPU) pcl::PointCloud<pcl::Normal>::Ptr estimateNormals( const pcl::PointCloud<pcl::PointXYZRGB>::Ptr &cloud, float searchRadius); signals: void progressUpdated(int percentage); void filterCompleted(const QString &filterName, int pointsBefore, int pointsAfter); private: PointCloudFiltersCUDA* m_cudaFilters = nullptr; ProgressCb m_progressCb; FilterCompletedCb m_filterCompletedCb; }; #endif // CLOUDFILTERSSERVICE_H