#pragma once
#ifndef MODELPROCESS_H
#define MODELPROCESS_H

#include "AllHead.h"
#include <QtWidgets/QMainWindow>
#include "OCCViewer\DocumentCommon.h"
#include "OCCViewer\GeomWidget.h"
#include "ui_ModelProcess.h"
#include "OCCTopoShapeTreeViewer.h"
#include "QtSARAntModelSetting.h"
#include "EchoShowProcess/EchoTableEditWindow.h"
#include "LAMPImageCreateClass.h"
#include "LAMP_ScatterSettingClass.h"
#include "LAMPDataShowClass.h"


class ModelProcess : public QMainWindow
{
    Q_OBJECT

public:
    Q_INVOKABLE  ModelProcess(QWidget *parent = nullptr);
    ~ModelProcess();

private:
    Ui::ModelProcessClass ui;
public:
    QMenu* TaskListContextMenu;

public slots: // 菜单事件
    void on_action_FEKO2csv_triggered();
    void on_action_Open_triggered();
    void on_action_Modelsave_triggered();
    void on_actionCalibrationConstCreate_triggered(); // 创建定标常数
    void on_actionImageSetting_triggered();
    void on_action_ScatterExport_triggered();
    void on_actionFEKOImage_triggered();
    void on_action_antScatteringFEKOSetting_triggered();
    void on_action_openImageShowWindows_triggered(); // 图像展示模块
    void ShowTaskListMenu(QPoint p);
    void ShowTaskWindows();

public slots: // 任务管理器
    void addTaskNode(TaskNode* Node);
    void removeTaskNode(TaskNode* Node);

////////////////////////////////////////////////////////////
// 模型操作功能
////////////////////////////////////////////////////////////
public:
    DocumentCommon* myDocument3d; // 模型管理
    GeomWidget* myGeomWidget; // 模型渲染串口
    OCCTopoShapeTreeViewer* TopoShapeTreeViewer;
    QMenu* selectModeMenu; // 选择模式切换
    QMenu* showModelMenu;

    // 模型相关界面
    QDockWidget* dockWidget=nullptr;
    QWidget* dockWidgetContents = nullptr;
    QVBoxLayout* verticalLayout = nullptr;
    QDockWidget* dockWidget_modelinfoshow = nullptr;
    QWidget* dockWidget_ModelInfoShowWindows = nullptr;
    QVBoxLayout* verticalLayout_ModelInfoShowWindows = nullptr;
    QDockWidget* dockWidget_InnerModel = nullptr;
    QWidget* dockWidget_InnerModelWindows = nullptr;
    QVBoxLayout* verticalLayout_InnerModelWindows = nullptr;


public slots:
    bool showConntentsWindows();
    bool showModelInfoWindows();
    bool showInnerModelWindow();

    // 文件操作类
    void actionOpenRaster();
    void actionOpenModel();



public:
    bool initFileOperatorMenu();
    bool initConstVariable();
    bool initOCCTView();
    bool initSelectModeMenu();
    bool initGeometryShowModelMenu();
    bool initModelInformationShow();
    bool initMenuList();
    bool initBandingEvent();
    bool initTaskDocker();


public:
    QDockWidget*  getdockWidget_command(QString dockerTitle, Qt::DockWidgetArea layoutear= Qt::BottomDockWidgetArea);

signals:
    void OpenCommandWidget(ModelProcess* modelprocess);

public slots: //  Q_INVOKABLE 定义 js 操作函数
    QString moveTopoShape(QString toponame,QString move_x,QString move_y,QString move_z);
    bool ShowTopoShape(TopoDS_Shape topoShape, QString topoName, bool isShow = true); // 显示模型
    bool removeShape(QString topoName); // 删除模型
    QString createBox(QString topoName, double dx, double dy, double dz, double angle); // 测试模型
   
     


// --------------------------------------------------------------


};


#endif
