|
|
|
|
/*****************************************************************//**
|
|
|
|
|
* @file FITKAbsGeoSketch2D.h
|
|
|
|
|
* @brief 2D平面草绘数据抽象类。
|
|
|
|
|
|
|
|
|
|
* @author ChengHaotian (yeguangbaozi@foxmail.com)
|
|
|
|
|
* @date 2024-09-03
|
|
|
|
|
*********************************************************************/
|
|
|
|
|
|
|
|
|
|
#ifndef FITKABSGEOSKETCH2D_H
|
|
|
|
|
#define FITKABSGEOSKETCH2D_H
|
|
|
|
|
|
|
|
|
|
#include "FITK_Kernel/FITKCore/FITKAbstractNDataObject.h"
|
|
|
|
|
|
|
|
|
|
#include "FITKGeoEnum.h"
|
|
|
|
|
#include "FITKAbsGeoCommand.h"
|
|
|
|
|
|
|
|
|
|
#include "FITKInterfaceGeometryAPI.h"
|
|
|
|
|
|
|
|
|
|
namespace Interface
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* @brief 2D平面草绘数据抽象类。
|
|
|
|
|
* @author ChengHaotian (yeguangbaozi@foxmail.com)
|
|
|
|
|
* @date 2024-09-03
|
|
|
|
|
*/
|
|
|
|
|
class FITKInterfaceGeometryAPI FITKAbsGeoSketch2D : public Interface::FITKAbsGeoCommand, public FITKGeoCommandManager
|
|
|
|
|
{
|
|
|
|
|
FITKCLASS(Interface, FITKAbsGeoSketch2D);
|
|
|
|
|
public:
|
|
|
|
|
/**
|
|
|
|
|
* @brief 构造函数。
|
|
|
|
|
* @author ChengHaotian (yeguangbaozi@foxmail.com)
|
|
|
|
|
* @date 2024-09-03
|
|
|
|
|
*/
|
|
|
|
|
FITKAbsGeoSketch2D();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief 析构函数。[虚函数]
|
|
|
|
|
* @author ChengHaotian (yeguangbaozi@foxmail.com)
|
|
|
|
|
* @date 2024-09-03
|
|
|
|
|
*/
|
|
|
|
|
virtual ~FITKAbsGeoSketch2D();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief 获取数据类型。[重写]
|
|
|
|
|
* @return 数据类型
|
|
|
|
|
* @author ChengHaotian (yeguangbaozi@foxmail.com)
|
|
|
|
|
* @date 2024-09-04
|
|
|
|
|
*/
|
|
|
|
|
FITKGeoEnum::FITKGeometryComType getGeometryCommandType() override;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief 获取数据类型。[重写]
|
|
|
|
|
* @return 是否更新成功
|
|
|
|
|
* @author ChengHaotian (yeguangbaozi@foxmail.com)
|
|
|
|
|
* @date 2024-09-04
|
|
|
|
|
*/
|
|
|
|
|
bool update() override;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief 设置草图平面信息。
|
|
|
|
|
* @param pos:面中心点坐标
|
|
|
|
|
* @param normal:面法向
|
|
|
|
|
* @param up:面向上方向
|
|
|
|
|
* @return 是否为有效平面
|
|
|
|
|
* @author ChengHaotian (yeguangbaozi@foxmail.com)
|
|
|
|
|
* @date 2024-09-20
|
|
|
|
|
*/
|
|
|
|
|
void setPlane(double* pos, double* normal, double* up);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief 获取草图平面信息。
|
|
|
|
|
* @param pos:面中心点坐标
|
|
|
|
|
* @param normal:面法向
|
|
|
|
|
* @param up:面向上方向
|
|
|
|
|
* @return 是否为有效平面
|
|
|
|
|
* @author ChengHaotian (yeguangbaozi@foxmail.com)
|
|
|
|
|
* @date 2024-09-20
|
|
|
|
|
*/
|
|
|
|
|
void getPlane(double* pos, double* normal, double* up);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief 设置基准元素位置。
|
|
|
|
|
* @param pos:坐标
|
|
|
|
|
* @author ChengHaotian (yeguangbaozi@foxmail.com)
|
|
|
|
|
* @date 2024-09-05
|
|
|
|
|
*/
|
|
|
|
|
void setPosition(double* pos);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief 获取基准元素位置。
|
|
|
|
|
* @param pos:坐标
|
|
|
|
|
* @author ChengHaotian (yeguangbaozi@foxmail.com)
|
|
|
|
|
* @date 2024-09-05
|
|
|
|
|
*/
|
|
|
|
|
void getPosition(double* pos);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief 设置基准面法向。
|
|
|
|
|
* @param nor:法向
|
|
|
|
|
* @author ChengHaotian (yeguangbaozi@foxmail.com)
|
|
|
|
|
* @date 2024-09-05
|
|
|
|
|
*/
|
|
|
|
|
void setNormal(double* nor);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief 获取基准面法向。
|
|
|
|
|
* @param nor:法向
|
|
|
|
|
* @author ChengHaotian (yeguangbaozi@foxmail.com)
|
|
|
|
|
* @date 2024-09-05
|
|
|
|
|
*/
|
|
|
|
|
void getNormal(double* nor);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief 设置基准面向上方向。
|
|
|
|
|
* @param up:向上方向
|
|
|
|
|
* @author ChengHaotian (yeguangbaozi@foxmail.com)
|
|
|
|
|
* @date 2024-09-05
|
|
|
|
|
*/
|
|
|
|
|
void setUp(double* up);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief 获取基准面向上方向。
|
|
|
|
|
* @param up:向上方向
|
|
|
|
|
* @author ChengHaotian (yeguangbaozi@foxmail.com)
|
|
|
|
|
* @date 2024-09-05
|
|
|
|
|
*/
|
|
|
|
|
void getUp(double* up);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief 内部子命令撤销。
|
|
|
|
|
* @return 是否执行成功
|
|
|
|
|
* @author ChengHaotian (yeguangbaozi@foxmail.com)
|
|
|
|
|
* @date 2024-09-20
|
|
|
|
|
*/
|
|
|
|
|
bool undoInternal();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief 内部子命令重做。
|
|
|
|
|
* @return 是否执行成功
|
|
|
|
|
* @author ChengHaotian (yeguangbaozi@foxmail.com)
|
|
|
|
|
* @date 2024-09-20
|
|
|
|
|
*/
|
|
|
|
|
bool redoInternal();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief 重写添加数据对象功能。(添加命令并清空RedoList)[虚函数][重写]
|
|
|
|
|
* @param obj:数据对象
|
|
|
|
|
* @author ChengHaotian (yeguangbaozi@foxmail.com)
|
|
|
|
|
* @date 2024-09-20
|
|
|
|
|
*/
|
|
|
|
|
virtual void appendDataObj(Core::FITKAbstractDataObject* obj) override;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @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-20
|
|
|
|
|
*/
|
|
|
|
|
FITKGeoCommandManager* getUndoList();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief 获取重做列表。
|
|
|
|
|
* @return 重做列表
|
|
|
|
|
* @author ChengHaotian (yeguangbaozi@foxmail.com)
|
|
|
|
|
* @date 2024-09-20
|
|
|
|
|
*/
|
|
|
|
|
FITKGeoCommandManager* getRedoList();
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
/**
|
|
|
|
|
* @brief 位置坐标。
|
|
|
|
|
* @author ChengHaotian (yeguangbaozi@foxmail.com)
|
|
|
|
|
* @date 2024-09-05
|
|
|
|
|
*/
|
|
|
|
|
double m_pos[3]{ 0., 0., 0. };
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief 基准面法向。
|
|
|
|
|
* @author ChengHaotian (yeguangbaozi@foxmail.com)
|
|
|
|
|
* @date 2024-09-05
|
|
|
|
|
*/
|
|
|
|
|
double m_nor[3]{ 0., 0., 1. };
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief 基准面向上方向。
|
|
|
|
|
* @author ChengHaotian (yeguangbaozi@foxmail.com)
|
|
|
|
|
* @date 2024-09-05
|
|
|
|
|
*/
|
|
|
|
|
double m_up[3]{ 0., 1., 0. };
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief 子命令重做列表。
|
|
|
|
|
* @author ChengHaotian (yeguangbaozi@foxmail.com)
|
|
|
|
|
* @date 2024-09-20
|
|
|
|
|
*/
|
|
|
|
|
FITKGeoCommandManager* m_redoList{ nullptr };
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif // !FITKABSGEOSKETCH2D_H
|