You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
AppFlow/FITK_Interface/FITKInterfaceGeometry/FITKGeoCommandList.h

164 lines
4.9 KiB
C++

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

/**
*
* @file FITKGeoCommandList.h
* @brief 几何命令列表(撤销列表)
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-07-30
*
*/
#ifndef _FITK_GEO_COMMANDLIST__H___
#define _FITK_GEO_COMMANDLIST__H___
#include "FITKInterfaceGeometryAPI.h"
#include "FITK_Kernel/FITKCore/FITKAbstractDataManager.hpp"
#include "FITKAbsGeoCommand.h"
#include "FITKAbsGeoDatum.h"
#include "FITKAbsGeoSketch2D.h"
namespace Interface
{
/**
* @brief 几何命令列表(撤销列表)
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-07-30
*/
class FITKInterfaceGeometryAPI FITKGeoCommandList : public Core::FITKAbstractDataObject, public FITKGeoCommandManager
{
public:
/**
* @brief Construct a new FITKGeoCommandList object
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-07-30
*/
explicit FITKGeoCommandList();
/**
* @brief Destroy the FITKGeoCommandList object
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-07-30
*/
virtual ~FITKGeoCommandList();
/**
* @brief 获取是否可以执行撤销操作。[虚函数]
* @return 是否可以撤销
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-09-20
*/
virtual bool canUndo();
/**
* @brief 获取是否可以执行重做操作。[虚函数]
* @return 是否可以重做
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-09-20
*/
virtual bool canRedo();
/**
* @brief 撤销。[虚函数]
* @return 是否撤销成功
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-09-06
*/
virtual bool undo();
/**
* @brief 重做。[虚函数]
* @return 是否重做成功
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-09-06
*/
virtual bool redo();
/**
* @brief 重写添加数据对象功能。添加命令并清空RedoList[虚函数][重写]
* @param obj数据对象
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-09-06
*/
virtual void appendDataObj(Core::FITKAbstractDataObject* obj) override;
/**
* @brief 获取基准元素管理器。
* @return 基准元素类型
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-08-30
*/
FITKDatumList* getDatumManager();
/**
* @brief 设置当前激活草图数据ID。
* @param sketchDataId草图数据ID-1或ID为非草图数据则清除当前激活草图[缺省]
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-09-04
*/
void setCurrentSketchID(int sketchDataId = -1);
/**
* @brief 获取当前激活中的草图数据。
* @return 草图对象
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-09-04
*/
FITKAbsGeoSketch2D* getCurrentSketchData();
/**
* @brief 获取全部模型包围盒
* @param[o] minPt 最小点位置
* @param[o] maxPt 最大点位置
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-07-30
*/
void getBoundaryBox(double* minPt, double* maxPt);
/**
* @brief 获取撤销列表。
* @return 撤销列表
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-09-06
*/
FITKGeoCommandManager* getUndoList();
/**
* @brief 获取重做列表。
* @return 重做列表
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-09-06
*/
FITKGeoCommandManager* getRedoList();
/**
* @brief 获取未被引用的命令列表。
* @return 根节点命令列表
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-09-07
*/
QList<FITKAbsGeoCommand*> getRootCommandList();
protected:
/**
* @brief 重做列表。
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-09-06
*/
FITKGeoCommandManager* m_redoList{ nullptr };
/**
* @brief 基准元素管理器。
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-08-30
*/
FITKDatumList* m_datumMgr{ nullptr };
/**
* @brief 当前激活草图数据ID。
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-09-04
*/
int m_currentSketchID = -1;
};
}
#endif