/** * * @file FITKAbsGeoShapeAgent.h * @brief 抽象几何形状代理器,用于几何形状管理与维护 * @author LiBaojun (libaojunqd@foxmail.com) * @date 2024-07-30 * */ #ifndef _FITK_ABS_GEOSHAPE_AGENT_H___ #define _FITK_ABS_GEOSHAPE_AGENT_H___ #include "FITK_Interface/FITKInterfaceModel/FITKAbstractGeoModel.h" #include "FITKInterfaceGeometryAPI.h" #include "FITKGeoEnum.h" namespace Interface { class FITKAbsGeoCommand; class FITKVirtualTopoManager; class FITKGeometryMeshVS; /** * @brief 抽象几何形状代理器 * @author LiBaojun (libaojunqd@foxmail.com) * @date 2024-07-30 */ class FITKInterfaceGeometryAPI FITKAbsGeoShapeAgent : public Interface::FITKAbstractGeoModel { public: /** * @brief Construct a new FITKAbsGeoShapeAgent object * @author LiBaojun (libaojunqd@foxmail.com) * @date 2024-07-30 */ explicit FITKAbsGeoShapeAgent(FITKAbsGeoCommand* command); /** * @brief Destroy the FITKAbsGeoShapeAgent object * @author LiBaojun (libaojunqd@foxmail.com) * @date 2024-07-30 */ virtual ~FITKAbsGeoShapeAgent() = 0; /** * @brief 获取几何引擎类型 * @return FITKGeoEnum::FITKGeoEngine * @author LiBaojun (libaojunqd@foxmail.com) * @date 2024-07-12 */ virtual FITKGeoEnum::FITKGeoEngine getGeoEngine() = 0; /** * @brief 获取代理器对应的命令 * @return FITKAbsGeoCommand * @author LiBaojun (libaojunqd@foxmail.com) * @date 2024-07-31 */ FITKAbsGeoCommand* getGeoCommand(); template /** * @brief 获取代理器对应的命令,并进行类型转换 * @return T* * @author LiBaojun (libaojunqd@foxmail.com) * @date 2024-07-31 */ T* getTGeoCommand() { return dynamic_cast (_command); } /** * @brief 创建虚拓扑 * @author LiBaojun (libaojunqd@foxmail.com) * @date 2024-08-13 */ virtual void buildVirtualTopo() = 0; /** * @brief 获取虚拓扑管理器 * @return FITKVirtualTopoManager* * @author LiBaojun (libaojunqd@foxmail.com) * @date 2024-08-13 */ FITKVirtualTopoManager* getVirtualTopoManager(); /** * @brief 三角化 * @author LiBaojun (libaojunqd@foxmail.com) * @date 2024-08-13 */ virtual void triangulation() = 0; /** * @brief 获取三角化的可视化网格 * @return FITKGeometryMeshVS* * @author LiBaojun (libaojunqd@foxmail.com) * @date 2024-08-13 */ FITKGeometryMeshVS* getMeshVS(); /** * @brief 形状的哈希码 * @return int * @author LiBaojun (libaojunqd@foxmail.com) * @date 2024-08-13 */ virtual int shapeHashCode() = 0; /** * @brief 写出STL文件。 * @param filePath:文件路径 * @author ChengHaotian (yeguangbaozi@foxmail.com) * @date 2024-08-22 */ virtual bool writeSTLFile(QString filePath) override; /** * @brief 根据一组坐标计算坐标所在平面法向。[静态] * @param points:节点坐标[引用] * @param normal:法向(已归一化) * @author ChengHaotian (yeguangbaozi@foxmail.com) * @date 2024-08-22 */ static void GetFaceNormal(QList & points, double* normal); protected: /** * @brief 代理器对应的命令 * @author LiBaojun (libaojunqd@foxmail.com) * @date 2024-07-31 */ FITKAbsGeoCommand* _command{}; /** * @brief 虚拓扑管理器 * @author LiBaojun (libaojunqd@foxmail.com) * @date 2024-08-13 */ FITKVirtualTopoManager* _vtmanager{}; /** * @brief 三角化的可视化网格 * @author LiBaojun (libaojunqd@foxmail.com) * @date 2024-08-13 */ FITKGeometryMeshVS* _meshVS{}; }; } #endif