/
klischa
/
AstraScanner2
Обзор
Документация
Войти
/
klischa
/
AstraScanner2
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
src/controllers/ProcessingWorkflow.h
110 строк
4 KB
k k
refactor(P0): Phase 3 — ProcessingWorkflow extracted from MainWindow
14 июл 2026, 13:26
14 июл 2026, 13:26
ce87e14
Код
Авторство
О чём код?
#ifndef PROCESSINGWORKFLOW_H #define PROCESSINGWORKFLOW_H #include <QObject> #include <QMutex> #include <pcl/point_cloud.h> #include <pcl/point_types.h> #include <pcl/PolygonMesh.h> #include "../filters/PointCloudFilters.h" #include "ProcessingController.h" class ProjectManager; class ViewerCoordinator; class QLabel; class QPushButton; class QProgressBar; class QTextEdit; class ProcessingWorkflow : public QObject { Q_OBJECT public: struct Widgets { QPushButton *mergeBtn = nullptr; QPushButton *addMergedBtn = nullptr; QLabel *meshStatusLabel = nullptr; QLabel *icpStatusLabel = nullptr; QProgressBar *poissonProgress = nullptr; QProgressBar *icpProgress = nullptr; QProgressBar *processingProgress = nullptr; QTextEdit *logTextEdit = nullptr; }; explicit ProcessingWorkflow(ProcessingController *processingController, ProjectManager *project, ViewerCoordinator *viewer, QObject *parent = nullptr); ~ProcessingWorkflow() override; void bindWidgets(const Widgets &w); // Cloud processing void runCloudProcessingAction(const pcl::PointCloud<pcl::PointXYZRGB>::Ptr &snapshot, const ProcessingController::CloudOperation &operation, const QString &cancelMessage, bool usesProcessingProgress); // Mesh processing void runMeshProcessingAction(const pcl::PolygonMesh &meshCopy, const ProcessingController::MeshOperation &operation, const QString &cancelMessage); bool currentMeshSnapshot(pcl::PolygonMesh &meshCopy); // Poisson reconstruction void onReconstructMeshClicked(const PointCloudFilters::PoissonParams ¶ms); // ICP merge void onMergeScansClicked(const PointCloudFilters::MergeParams ¶ms); void onSaveMergedToProject(); // Show cloud void onShowCloudClicked(); // Button state void setFilterButtonsEnabled(bool enabled); void setMeshFilterButtonsEnabled(bool enabled); // Accessors for MainWindow const pcl::PolygonMesh& lastMesh() const { return m_lastMesh; } bool isMeshSaved() const { return m_meshSaved; } signals: void cloudProcessed(pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloud); void meshProcessed(pcl::PolygonMesh mesh); void cloudSizeChanged(int size); private: void applyProcessedCloudResult(const pcl::PointCloud<pcl::PointXYZRGB>::Ptr &filtered, bool usesProcessingProgress); void applyProcessedMeshResult(const pcl::PolygonMesh &mesh); void handleCloudProcessingCanceled(const QString &logMessage, bool usesProcessingProgress); void handleMeshProcessingCanceled(const QString &logMessage); void handlePoissonResult(const pcl::PolygonMesh &mesh); void handlePoissonCanceled(); void handleMergeResult(const pcl::PointCloud<pcl::PointXYZRGB>::Ptr &merged); void handleMergeCanceled(); void appendLog(const QString &text); ProcessingController *m_processingController = nullptr; ProjectManager *m_project = nullptr; ViewerCoordinator *m_viewerCoordinator = nullptr; Widgets m_w; // Processing state pcl::PolygonMesh m_lastMesh; pcl::PointCloud<pcl::PointXYZRGB>::Ptr m_lastMerged; QProgressBar *m_activeProgressBar = nullptr; QMutex m_meshMutex; bool m_meshSaved = false; QPushButton *m_sorBtn = nullptr; QPushButton *m_rorBtn = nullptr; QPushButton *m_voxelBtn = nullptr; QPushButton *m_magicWandBtn = nullptr; QPushButton *m_bgBtn = nullptr; QPushButton *m_segBtn = nullptr; QPushButton *m_smoothBtn = nullptr; QPushButton *m_simplBtn = nullptr; QPushButton *m_holeBtn = nullptr; }; #endif // PROCESSINGWORKFLOW_H