#ifndef FITKABSGEOMODELSURFACE_H #define FITKABSGEOMODELSURFACE_H #include "FITKInterfaceGeometryAPI.h" #include "FITKAbsGeoCommand.h" #include namespace Interface { /** * @brief 曲面抽象类. * @author YanZhiHui (chanyuantiandao@126.com) * @date 2024-08-16 */ class FITKInterfaceGeometryAPI FITKAbsGeoModelSurface : public FITKAbsGeoCommand { public: /** * @brief 构造函数. * @author YanZhiHui (chanyuantiandao@126.com) * @date 2024-08-16 */ FITKAbsGeoModelSurface() = default; /** * @brief 析构函数. * @author YanZhiHui (chanyuantiandao@126.com) * @date 2024-08-16 */ virtual ~FITKAbsGeoModelSurface() = default; }; /** * @brief 封闭曲线形成的面. * @author YanZhiHui (chanyuantiandao@126.com) * @date 2024-08-16 */ class FITKInterfaceGeometryAPI FITKAbsGeoModelClosedWireSurface : public FITKAbsGeoModelSurface { public: /** * @brief 构造函数. * @author YanZhiHui (chanyuantiandao@126.com) * @date 2024-08-16 */ FITKAbsGeoModelClosedWireSurface() = default; /** * @brief 析构函数. * @author YanZhiHui (chanyuantiandao@126.com) * @date 2024-08-16 */ virtual ~FITKAbsGeoModelClosedWireSurface() = default; /** * @brief 获取几何命令类型. * @return 命令类型 * @author YanZhiHui (chanyuantiandao@126.com) * @date 2024-08-16 */ FITKGeoEnum::FITKGeometryComType getGeometryCommandType() override; void addEdge(VirtualShape edge) { m_Edges.push_back(edge); }; void setEdges(QVector edges) { m_Edges = edges; }; QVector edges() const { return m_Edges; } protected: QVector m_Edges{}; }; /** * @brief 偏移曲面抽象类. * @author YanZhiHui (chanyuantiandao@126.com) * @date 2024-08-16 */ class FITKInterfaceGeometryAPI FITKAbsGeoModelOffsetSurface : public FITKAbsGeoModelSurface { public: /** * @brief 构造函数. * @author YanZhiHui (chanyuantiandao@126.com) * @date 2024-08-16 */ FITKAbsGeoModelOffsetSurface() = default; /** * @brief 析构函数. * @author YanZhiHui (chanyuantiandao@126.com) * @date 2024-08-16 */ virtual ~FITKAbsGeoModelOffsetSurface() = default; /** * @brief 获取几何命令类型. * @return 命令类型 * @author YanZhiHui (chanyuantiandao@126.com) * @date 2024-08-16 */ FITKGeoEnum::FITKGeometryComType getGeometryCommandType() override; VirtualShape sourceSurface() const { return m_SourceSurface; } void setSourceSurface(VirtualShape shape) { m_SourceSurface = shape; } double offset() const { return m_Offset; }; void setOffset(double offset) { m_Offset = offset; }; protected: /** * @brief 源曲面虚拓扑. * @author YanZhiHui (chanyuantiandao@126.com) * @date 2024-08-23 */ VirtualShape m_SourceSurface{}; /** * @brief 偏移距离. * @author YanZhiHui (chanyuantiandao@126.com) * @date 2024-08-16 */ double m_Offset{}; }; /** * @brief 拉伸曲面抽象类. * @author YanZhiHui (chanyuantiandao@126.com) * @date 2024-08-16 */ class FITKInterfaceGeometryAPI FITKAbsGeoModelExtrudeSurface : public FITKAbsGeoModelSurface { public: /** * @brief 构造函数. * @author YanZhiHui (chanyuantiandao@126.com) * @date 2024-08-16 */ FITKAbsGeoModelExtrudeSurface() = default; /** * @brief 析构函数. * @author YanZhiHui (chanyuantiandao@126.com) * @date 2024-08-16 */ virtual ~FITKAbsGeoModelExtrudeSurface() = default; /** * @brief 获取几何命令类型. * @return 命令类型 * @author YanZhiHui (chanyuantiandao@126.com) * @date 2024-08-16 */ FITKGeoEnum::FITKGeometryComType getGeometryCommandType() override; VirtualShape sourceCurve() const { return m_SourceCurve; } void setSourceCurve(VirtualShape shape) { m_SourceCurve = shape; } std::array direction() const { return m_Direction; }; void setDirection(double x, double y, double z) { m_Direction = { x, y, z }; }; void setDirection(std::array xyz) { m_Direction = xyz; }; double length() const { return m_Length; } void setLength(double len) { m_Length = len; } protected: /** * @brief 源曲线的虚拓扑. * @author YanZhiHui (chanyuantiandao@126.com) * @date 2024-08-16 */ VirtualShape m_SourceCurve{}; /** * @brief 拉伸方向. * @author YanZhiHui (chanyuantiandao@126.com) * @date 2024-08-16 */ std::array m_Direction{}; /** * @brief 拉伸长度. * @author YanZhiHui (chanyuantiandao@126.com) * @date 2024-08-16 */ double m_Length{}; }; /** * @brief 旋转曲面抽象类. * @author YanZhiHui (chanyuantiandao@126.com) * @date 2024-08-16 */ class FITKInterfaceGeometryAPI FITKAbsGeoModelRevolSurface : public FITKAbsGeoModelSurface { public: /** * @brief 构造函数. * @author YanZhiHui (chanyuantiandao@126.com) * @date 2024-08-16 */ FITKAbsGeoModelRevolSurface() = default; /** * @brief 析构函数. * @author YanZhiHui (chanyuantiandao@126.com) * @date 2024-08-16 */ virtual ~FITKAbsGeoModelRevolSurface() = default; /** * @brief 获取几何命令类型. * @return 命令类型 * @author YanZhiHui (chanyuantiandao@126.com) * @date 2024-08-16 */ FITKGeoEnum::FITKGeometryComType getGeometryCommandType() override; VirtualShape sourceCurve() const { return m_SourceCurve; } void setSourveCurve(VirtualShape shape) { m_SourceCurve = shape; } std::array rotateAxisPoint1() const { return m_RotateAxisPoint1; }; void setRotateAxisPoint1(double x, double y, double z) { m_RotateAxisPoint1 = { x, y, z }; }; void setRotateAxisPoint1(std::array xyz) { m_RotateAxisPoint1 = xyz; }; std::array rotateAxisPoint2() const { return m_RotateAxisPoint2; }; void setRotateAxisPoint2(double x, double y, double z) { m_RotateAxisPoint2 = { x, y, z }; }; void setRotateAxisPoint2(std::array xyz) { m_RotateAxisPoint2 = xyz; }; int angle() const { return m_Angle; }; void setAngle(int degree) { m_Angle = degree; }; protected: /** * @brief 源曲线的虚拓扑. * @author YanZhiHui (chanyuantiandao@126.com) * @date 2024-08-16 */ VirtualShape m_SourceCurve{}; /** * @brief 两点定义旋转轴. * @author YanZhiHui (chanyuantiandao@126.com) * @date 2024-08-16 */ /*@{*/ std::array m_RotateAxisPoint1{}; std::array m_RotateAxisPoint2{}; /*@}*/ /** * @brief 旋转角度. * @author YanZhiHui (chanyuantiandao@126.com) * @date 2024-08-16 */ double m_Angle{}; }; /** * @brief 修剪曲面抽象类. * @author YanZhiHui (chanyuantiandao@126.com) * @date 2024-08-16 */ class FITKInterfaceGeometryAPI FITKAbsGeoModelRectangularTrimmedSurface : public FITKAbsGeoCommand { public: /** * @brief 构造函数. * @author YanZhiHui (chanyuantiandao@126.com) * @date 2024-08-16 */ FITKAbsGeoModelRectangularTrimmedSurface() = default; /** * @brief 析构函数. * @author YanZhiHui (chanyuantiandao@126.com) * @date 2024-08-16 */ virtual ~FITKAbsGeoModelRectangularTrimmedSurface() = default; /** * @brief 获取几何命令类型. * @return 命令类型 * @author YanZhiHui (chanyuantiandao@126.com) * @date 2024-08-16 */ FITKGeoEnum::FITKGeometryComType getGeometryCommandType() override; protected: /** * @brief 源曲面虚拓扑ID. * @author YanZhiHui (chanyuantiandao@126.com) * @date 2024-08-16 */ int m_OriginId{}; /** * @brief U方向裁剪参数1. * @author YanZhiHui (chanyuantiandao@126.com) * @date 2024-08-16 */ double m_U1Trimmed{}; /** * @brief U方向裁剪参数2. * @author YanZhiHui (chanyuantiandao@126.com) * @date 2024-08-16 */ double m_U2Trimmed{}; /** * @brief V方向裁剪参数1. * @author YanZhiHui (chanyuantiandao@126.com) * @date 2024-08-16 */ double m_V1Trimmed{}; /** * @brief V方向裁剪参数2. * @author YanZhiHui (chanyuantiandao@126.com) * @date 2024-08-16 */ double m_V2Trimmed{}; /** * @brief 是否在U方向裁剪. * @author YanZhiHui (chanyuantiandao@126.com) * @date 2024-08-16 */ bool m_IsUTrimmed{ true }; /** * @brief 是否在V方向裁剪. * @author YanZhiHui (chanyuantiandao@126.com) * @date 2024-08-16 */ bool m_IsVTrimmed{ true }; }; /** * @brief 扫略曲面抽象类. * @author YanZhiHui (chanyuantiandao@126.com) * @date 2024-08-16 */ class FITKInterfaceGeometryAPI FITKAbsGeoModelSweepSurface : public FITKAbsGeoModelSurface { public: /** * @brief 构造函数. * @author YanZhiHui (chanyuantiandao@126.com) * @date 2024-08-16 */ FITKAbsGeoModelSweepSurface() = default; /** * @brief 析构函数. * @author YanZhiHui (chanyuantiandao@126.com) * @date 2024-08-16 */ virtual ~FITKAbsGeoModelSweepSurface() = default; /** * @brief 获取几何命令类型. * @return 命令类型 * @author YanZhiHui (chanyuantiandao@126.com) * @date 2024-08-16 */ FITKGeoEnum::FITKGeometryComType getGeometryCommandType() override; VirtualShape profile() const { return m_Profile; } void setProfile(VirtualShape shape) { m_Profile = shape; } VirtualShape curve() const { return m_Curve; } void setCurve(VirtualShape shape) { m_Curve = shape; } protected: /** * @brief 截面曲线的虚拓扑. * @author YanZhiHui (chanyuantiandao@126.com) * @date 2024-08-16 */ VirtualShape m_Profile{}; /** * @brief 脊线的虚拓扑. * @author YanZhiHui (chanyuantiandao@126.com) * @date 2024-08-16 */ VirtualShape m_Curve{}; }; /** * @brief 多截面扫略抽象类. * @author YanZhiHui (chanyuantiandao@126.com) * @date 2024-08-16 */ class FITKInterfaceGeometryAPI FITKAbsGeoModelMultiSectionSurface : public FITKAbsGeoModelSurface { public: /** * @brief 构造函数. * @author YanZhiHui (chanyuantiandao@126.com) * @date 2024-08-16 */ FITKAbsGeoModelMultiSectionSurface() = default; /** * @brief 析构函数. * @author YanZhiHui (chanyuantiandao@126.com) * @date 2024-08-16 */ virtual ~FITKAbsGeoModelMultiSectionSurface() = default; /** * @brief 获取几何命令类型. * @return 命令类型 * @author YanZhiHui (chanyuantiandao@126.com) * @date 2024-08-16 */ FITKGeoEnum::FITKGeometryComType getGeometryCommandType() override; QList sections() const { return m_Sections; } VirtualShape section(int index) const { assert(index >= 0 && index < m_Sections.size()); return m_Sections.at(index); } void setSection(int index, VirtualShape section) { assert(index >= 0 && index < m_Sections.size()); m_Sections[index] = section; } void setSections(QList sections) { m_Sections = sections; } void addSection(VirtualShape section) { m_Sections.push_back(section); } protected: /** * @brief 截面曲线的虚拓扑. * @author YanZhiHui (chanyuantiandao@126.com) * @date 2024-08-16 */ QList m_Sections{}; }; /** * @brief 桥接曲面. * @author YanZhiHui (chanyuantiandao@126.com) * @date 2024-08-27 */ class FITKInterfaceGeometryAPI FITKAbsGeoModelBridgeSurface : public FITKAbsGeoModelSurface { public: FITKAbsGeoModelBridgeSurface() = default; virtual ~FITKAbsGeoModelBridgeSurface() = default; FITKGeoEnum::FITKGeometryComType getGeometryCommandType() override; VirtualShape sourceSurface1() const { return m_SourceSurface1; } void setSourceSurface1(VirtualShape surface) { m_SourceSurface1 = surface; } int edgeVirtualTopoId1() const { return m_EdgeVirtualTopoId1; } void setEdgeVirtualTopoId1(int id) { m_EdgeVirtualTopoId1 = id; } VirtualShape sourceSurface2() const { return m_SourceSurface2; } void setSourceSurface2(VirtualShape surface) { m_SourceSurface2 = surface; } int edgeVirtualTopoId2() const { return m_EdgeVirtualTopoId2; } void setEdgeVirtualTopoId2(int id) { m_EdgeVirtualTopoId2 = id; } protected: VirtualShape m_SourceSurface1{}; int m_EdgeVirtualTopoId1{}; VirtualShape m_SourceSurface2{}; int m_EdgeVirtualTopoId2{}; }; /** * @brief 体的面. * @author YanZhiHui (chanyuantiandao@126.com) * @date 2024-08-27 */ class FITKInterfaceGeometryAPI FITKAbsGeoModelSolidSurface : public FITKAbsGeoModelSurface { public: FITKAbsGeoModelSolidSurface() = default; virtual ~FITKAbsGeoModelSolidSurface() = default; FITKGeoEnum::FITKGeometryComType getGeometryCommandType() override; VirtualShape sourceSolid() const { return m_SourceSolid; } void setSourceSolid(VirtualShape solid) { m_SourceSolid = solid; } int faceVirtualTopoId() const { return m_FaceVirtualTopoId; } void setFaceVirtualTopoId(int id) { m_FaceVirtualTopoId = id; } protected: VirtualShape m_SourceSolid{}; int m_FaceVirtualTopoId{}; }; } #endif // !FITKABSGEOMODELSURFACE_H