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/FITKAbsGeoModelCurve.h

1192 lines
40 KiB
C

#ifndef FITKABSGEOMODELCURVE_H
#define FITKABSGEOMODELCURVE_H
#include "FITKInterfaceGeometryAPI.h"
#include "FITKAbsGeoCommand.h"
#include <array>
namespace Interface
{
/**
* @brief 线.
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
class FITKInterfaceGeometryAPI FITKAbsGeoModelCurve :
public FITKAbsGeoCommand
{
public:
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
FITKAbsGeoModelCurve() = default;
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
virtual ~FITKAbsGeoModelCurve() = default;
/* 曲线的局部坐标系数据接口 */
/* @{ */
std::array<double, 3> origin() { return m_Origin; }
void setOrigin(double x, double y, double z) {
m_Origin[0] = x;
m_Origin[1] = y;
m_Origin[2] = z;
};
void setOrigin(std::array<double, 3> xyz) {
m_Origin = xyz;
};
std::array<double, 3> xDirection() { return m_XDirection; }
std::array<double, 3> yDirection() { return m_YDirection; }
void setYDirection(double x, double y, double z) {
setYDirection({ x, y,z });
};
void setYDirection(std::array<double, 3> xyz) {
m_YDirection = xyz;
m_XDirection = {
m_YDirection[1] * m_ZDirection[2] - m_ZDirection[1] * m_YDirection[2],
m_ZDirection[0] * m_YDirection[2] - m_YDirection[0] * m_ZDirection[2],
m_YDirection[0] * m_ZDirection[1] - m_ZDirection[0] * m_YDirection[1] };
};
std::array<double, 3> zDirection() { return m_ZDirection; }
void setZDirection(double x, double y, double z) {
setZDirection({ x,y,z });
};
void setZDirection(std::array<double, 3> xyz) {
m_ZDirection = xyz;
m_XDirection = {
m_YDirection[1] * m_ZDirection[2] - m_ZDirection[1] * m_YDirection[2],
m_ZDirection[0] * m_YDirection[2] - m_YDirection[0] * m_ZDirection[2],
m_YDirection[0] * m_ZDirection[1] - m_ZDirection[0] * m_YDirection[1] };
};
/* @} */
protected:
/* 曲线的局部坐标系(非草绘坐标系) */
/* @{ */
std::array<double, 3> m_Origin{ 0, 0, 0 };
std::array<double, 3> m_XDirection{ 1, 0, 0 };
std::array<double, 3> m_YDirection{ 0, 1, 0 };
std::array<double, 3> m_ZDirection{ 0, 0, 1 };
/* @} */
};
/**
* @brief 线.
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
class FITKInterfaceGeometryAPI FITKAbsGeoModelLine : public FITKAbsGeoModelCurve
{
public:
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
FITKAbsGeoModelLine() = default;
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
~FITKAbsGeoModelLine() override = default;
/**
* @brief .
* @return
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
std::array<double, 3> origin() const;
/**
* @brief .
* @return
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
std::array<double, 3> dir() const;
/**
* @brief .
* @param x x
* @param y y
* @param z z
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
void setDir(double x, double y, double z);
/**
* @brief .
* @return
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
FITKGeoEnum::FITKGeometryComType getGeometryCommandType() override;
protected:
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
std::array<double, 3> m_Dir{};
};
/**
* @brief 线.
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
class FITKInterfaceGeometryAPI FITKAbsGeoModelSegment : public FITKAbsGeoModelCurve
{
public:
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
FITKAbsGeoModelSegment() = default;
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
~FITKAbsGeoModelSegment() override = default;
/**
* @brief .
* @return
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
std::array<double, 3> startPoint() const;
/**
* @brief .
* @param x x
* @param y y
* @param z z
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
void setStartPoint(double x, double y, double z);
void setStartPoint(std::array<double, 3> xyz) { m_StartPoint = xyz; };
/**
* @brief .
* @return
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
std::array<double, 3> endPoint() const;
/**
* @brief .
* @param x x
* @param y y
* @param z z
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
void setEndPoint(double x, double y, double z);
void setEndPoint(std::array<double, 3> xyz) { m_EndPoint = xyz; };
/**
* @brief .
* @return
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
FITKGeoEnum::FITKGeometryComType getGeometryCommandType() override;
protected:
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
std::array<double, 3> m_StartPoint{};
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
std::array<double, 3> m_EndPoint{};
};
/**
* @brief 线.
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
class FITKInterfaceGeometryAPI FITKAbsGeoModelWire : public FITKAbsGeoModelCurve
{
public:
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
FITKAbsGeoModelWire() = default;
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
~FITKAbsGeoModelWire() override = default;
/**
* @brief .
* @param x x
* @param y y
* @param z z
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-27
*/
void addPoint(double x, double y, double z);
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-27
*/
int count() const;
/**
* @brief index.
* @param index
* @return
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-27
*/
std::array<double, 3> point(int index) const;
/**
* @brief .
* @return
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
FITKGeoEnum::FITKGeometryComType getGeometryCommandType() override;
protected:
/**
* @brief 线.
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-27
*/
QVector<std::array<double, 3>> m_Points{};
};
/**
* @brief 线.
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
class FITKInterfaceGeometryAPI FITKAbsGeoModelConic : public FITKAbsGeoModelCurve
{
public:
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
FITKAbsGeoModelConic() = default;
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
~FITKAbsGeoModelConic() override = default;
};
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
class FITKInterfaceGeometryAPI FITKAbsGeoModelCircle : public FITKAbsGeoModelConic
{
public:
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
FITKAbsGeoModelCircle() = default;
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
~FITKAbsGeoModelCircle() override = default;
/**
* @brief .
* @return
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
double radius() const;
/**
* @brief .
* @param radius
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
void setRadius(double radius);
/**
* @brief .
* @return
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
FITKGeoEnum::FITKGeometryComType getGeometryCommandType() override;
protected:
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
double m_Radius{};
};
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
class FITKInterfaceGeometryAPI FITKAbsGeoModelCircleArc : public FITKAbsGeoModelCircle
{
public:
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
FITKAbsGeoModelCircleArc() = default;
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
~FITKAbsGeoModelCircleArc() override = default;
/**
* @brief .
* @return
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
FITKGeoEnum::FITKGeometryComType getGeometryCommandType() override;
std::array<double, 3> startPoint() const { return m_StartPoint; }
void setStartPoint(std::array<double, 3> xyz) { m_StartPoint = xyz; }
void setStartPoint(double x, double y, double z) { m_StartPoint = { x,y,z }; }
std::array<double, 3> endPoint() const { return m_EndPoint; }
void setEndPoint(std::array<double, 3> xyz) { m_EndPoint = xyz; }
void setEndPoint(double x, double y, double z) { m_EndPoint = { x,y,z }; }
protected:
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-09-05
*/
std::array<double, 3> m_StartPoint{};
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-09-05
*/
std::array<double, 3> m_EndPoint{};
};
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
class FITKInterfaceGeometryAPI FITKAbsGeoModelThreePointsCircle : public FITKAbsGeoModelCircle
{
public:
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
FITKAbsGeoModelThreePointsCircle() = default;
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
~FITKAbsGeoModelThreePointsCircle() override = default;
/**
* @brief .
* @return
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
FITKGeoEnum::FITKGeometryComType getGeometryCommandType() override;
std::array<double, 3> point(int index) const { assert(index >= 0 && index < 3); return m_Points.at(index); };
void setPoint(int index, double x, double y, double z) { assert(index >= 0 && index < 3); m_Points[index] = { x, y,z }; };
void setPoint(int index, std::array<double, 3> xyz) { assert(index >= 0 && index < 3); m_Points[index] = xyz; };
protected:
QVector<std::array<double, 3>> m_Points{ 3 };
};
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
class FITKInterfaceGeometryAPI FITKAbsGeoModelEllipse : public FITKAbsGeoModelConic
{
public:
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
FITKAbsGeoModelEllipse() = default;
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
~FITKAbsGeoModelEllipse() override = default;
/**
* @brief .
* @return
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
double majorRadius() const;
/**
* @brief .
* @param radius
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
void setMajorRadius(double radius);
/**
* @brief .
* @return
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
double minorRadius() const;
/**
* @brief .
* @param radius
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
void setMinorRadius(double radius);
/**
* @brief .
* @return
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
FITKGeoEnum::FITKGeometryComType getGeometryCommandType() override;
protected:
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
double m_MajorRadius{};
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
double m_MinorRadius{};
};
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
class FITKInterfaceGeometryAPI FITKAbsGeoModelEllipseArc : public FITKAbsGeoModelEllipse
{
public:
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
FITKAbsGeoModelEllipseArc() = default;
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
~FITKAbsGeoModelEllipseArc() override = default;
/**
* @brief .
* @return
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
FITKGeoEnum::FITKGeometryComType getGeometryCommandType() override;
std::array<double, 3> startPoint() const { return m_StartPoint; }
void setStartPoint(std::array<double, 3> xyz) { m_StartPoint = xyz; }
void setStartPoint(double x, double y, double z) { m_StartPoint = { x,y,z }; }
std::array<double, 3> endPoint() const { return m_EndPoint; }
void setEndPoint(std::array<double, 3> xyz) { m_EndPoint = xyz; }
void setEndPoint(double x, double y, double z) { m_EndPoint = { x,y,z }; }
protected:
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-09-05
*/
std::array<double, 3> m_StartPoint{};
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-09-05
*/
std::array<double, 3> m_EndPoint{};
};
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
class FITKInterfaceGeometryAPI FITKAbsGeoModelThreePointsEllipse : public FITKAbsGeoModelEllipse
{
public:
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
FITKAbsGeoModelThreePointsEllipse() = default;
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
~FITKAbsGeoModelThreePointsEllipse() override = default;
/**
* @brief .
* @return
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
FITKGeoEnum::FITKGeometryComType getGeometryCommandType() override;
std::array<double, 3> majorPoint() const { return m_MajorPoint; };
void setMajorPoint(double x, double y, double z) { m_MajorPoint = { x, y,z }; };
void setMajorPoint(std::array<double, 3> xyz) { m_MajorPoint = xyz; };
std::array<double, 3> minorPoint() const { return m_MinorPoint; };
void setMinorPoint(double x, double y, double z) { m_MinorPoint = { x, y,z }; };
void setMinorPoint(std::array<double, 3> xyz) { m_MinorPoint = xyz; };
protected:
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-28
*/
std::array<double, 3> m_MajorPoint{};
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-28
*/
std::array<double, 3> m_MinorPoint{};
};
/**
* @brief 线.
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
class FITKInterfaceGeometryAPI FITKAbsGeoModelHyperbola : public FITKAbsGeoModelConic
{
public:
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
FITKAbsGeoModelHyperbola() = default;
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
~FITKAbsGeoModelHyperbola() override = default;
/**
* @brief .
* @return
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
double majorRadius() const;
/**
* @brief .
* @param radius
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
void setMajorRadius(double radius);
/**
* @brief .
* @return
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
double minorRadius() const;
/**
* @brief .
* @param radius
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
void setMinorRadius(double radius);
/**
* @brief .
* @return
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
FITKGeoEnum::FITKGeometryComType getGeometryCommandType() override;
protected:
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
double m_MajorRadius{};
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
double m_MinorRadius{};
};
/**
* @brief 线.
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
class FITKInterfaceGeometryAPI FITKAbsGeoModelThreePointsHyperbola : public FITKAbsGeoModelHyperbola
{
public:
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
FITKAbsGeoModelThreePointsHyperbola() = default;
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
~FITKAbsGeoModelThreePointsHyperbola() override = default;
/**
* @brief .
* @return
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
FITKGeoEnum::FITKGeometryComType getGeometryCommandType() override;
std::array<double, 3> majorPoint() const { return m_MajorPoint; };
void setMajorPoint(double x, double y, double z) { m_MajorPoint = { x, y,z }; };
void setMajorPoint(std::array<double, 3> xyz) { m_MajorPoint = xyz; };
std::array<double, 3> minorPoint() const { return m_MinorPoint; };
void setMinorPoint(double x, double y, double z) { m_MinorPoint = { x, y,z }; };
void setMinorPoint(std::array<double, 3> xyz) { m_MinorPoint = xyz; };
protected:
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-28
*/
std::array<double, 3> m_MajorPoint{};
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-28
*/
std::array<double, 3> m_MinorPoint{};
};
/**
* @brief 线.
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
class FITKInterfaceGeometryAPI FITKAbsGeoModelHyperbolaArc : public FITKAbsGeoModelHyperbola
{
public:
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
FITKAbsGeoModelHyperbolaArc() = default;
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
~FITKAbsGeoModelHyperbolaArc() override = default;
/**
* @brief .
* @return
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
FITKGeoEnum::FITKGeometryComType getGeometryCommandType() override;
std::array<double, 3> startPoint() const { return m_StartPoint; }
void setStartPoint(std::array<double, 3> xyz) { m_StartPoint = xyz; }
void setStartPoint(double x, double y, double z) { m_StartPoint = { x,y,z }; }
std::array<double, 3> endPoint() const { return m_EndPoint; }
void setEndPoint(std::array<double, 3> xyz) { m_EndPoint = xyz; }
void setEndPoint(double x, double y, double z) { m_EndPoint = { x,y,z }; }
protected:
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-09-05
*/
std::array<double, 3> m_StartPoint{};
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-09-05
*/
std::array<double, 3> m_EndPoint{};
};
/**
* @brief 线.
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
class FITKInterfaceGeometryAPI FITKAbsGeoModelParabola : public FITKAbsGeoModelConic
{
public:
/**
* @brief .
* @param origin
* @param xDir x
* @param yDir y
* @param zDir z
* @param focalLength
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
FITKAbsGeoModelParabola() = default;
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
~FITKAbsGeoModelParabola() override = default;
/**
* @brief .
* @return
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
double focalLength() const;
/**
* @brief .
* @param length
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
void setFocalLength(double length);
/**
* @brief .
* @return
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
FITKGeoEnum::FITKGeometryComType getGeometryCommandType() override;
protected:
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
double m_FocalLength{};
};
/**
* @brief 线.
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
class FITKInterfaceGeometryAPI FITKAbsGeoModelThreePointsParabola : public FITKAbsGeoModelParabola
{
public:
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
FITKAbsGeoModelThreePointsParabola() = default;
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
~FITKAbsGeoModelThreePointsParabola() override = default;
/**
* @brief .
* @return
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
FITKGeoEnum::FITKGeometryComType getGeometryCommandType() override;
std::array<double, 3> point(int index) const { assert(index >= 0 && index < 3); return m_Points.at(index); };
void setPoint(int index, double x, double y, double z) { assert(index >= 0 && index < 3); m_Points[index] = { x, y,z }; };
void setPoint(int index, std::array<double, 3> xyz) { assert(index >= 0 && index < 3); m_Points[index] = xyz; };
protected:
QVector<std::array<double, 3>> m_Points{ 3 };
};
/**
* @brief 线.
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
class FITKInterfaceGeometryAPI FITKAbsGeoModelParabolaArc : public FITKAbsGeoModelParabola
{
public:
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
FITKAbsGeoModelParabolaArc() = default;
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
~FITKAbsGeoModelParabolaArc() override = default;
/**
* @brief .
* @return
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
FITKGeoEnum::FITKGeometryComType getGeometryCommandType() override;
std::array<double, 3> startPoint() const { return m_StartPoint; }
void setStartPoint(std::array<double, 3> xyz) { m_StartPoint = xyz; }
void setStartPoint(double x, double y, double z) { m_StartPoint = { x,y,z }; }
std::array<double, 3> endPoint() const { return m_EndPoint; }
void setEndPoint(std::array<double, 3> xyz) { m_EndPoint = xyz; }
void setEndPoint(double x, double y, double z) { m_EndPoint = { x,y,z }; }
protected:
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-09-05
*/
std::array<double, 3> m_StartPoint{};
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-09-05
*/
std::array<double, 3> m_EndPoint{};
};
/**
* @brief 线.
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-09-07
*/
class FITKInterfaceGeometryAPI FITKAbsGeoModelBeizeByControlPoints : public FITKAbsGeoModelCurve {
public:
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
FITKAbsGeoModelBeizeByControlPoints() = default;
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
~FITKAbsGeoModelBeizeByControlPoints() override = default;
/**
* @brief .
* @return
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
FITKGeoEnum::FITKGeometryComType getGeometryCommandType() override;
QList<std::array<double, 3>> controlPoints() const { return m_ControlPoints; }
std::array<double, 3> controlPoint(int index) const { assert(index >= 0 && index < m_ControlPoints.size()); return m_ControlPoints.at(index); }
void addControlPoint(std::array<double, 3> point) { m_ControlPoints.push_back(point); }
void addControlPoint(double x, double y, double z) { m_ControlPoints.push_back({ x,y,z }); }
void setControlPoint(int index, std::array<double, 3> point) { assert(index >= 0 && index < m_ControlPoints.size()); m_ControlPoints[index] = point; }
void setControlPoint(int index, double x, double y, double z) { assert(index >= 0 && index < m_ControlPoints.size()); m_ControlPoints[index] = { x,y,z }; }
protected:
QList<std::array<double, 3>> m_ControlPoints{};
};
/**
* @brief 线B线.
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-09-07
*/
class FITKInterfaceGeometryAPI FITKAbsGeoModelBsplineByThroughPoints : public FITKAbsGeoModelCurve {
public:
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
FITKAbsGeoModelBsplineByThroughPoints() = default;
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
~FITKAbsGeoModelBsplineByThroughPoints() override = default;
/**
* @brief .
* @return
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
FITKGeoEnum::FITKGeometryComType getGeometryCommandType() override;
QList<std::array<double, 3>> throughPoints() const { return m_ThroughPoints; }
std::array<double, 3> throughPoints(int index) const { assert(index >= 0 && index < m_ThroughPoints.size()); return m_ThroughPoints.at(index); }
void addThroughPoint(std::array<double, 3> point) { m_ThroughPoints.push_back(point); }
void addThroughPoint(double x, double y, double z) { m_ThroughPoints.push_back({ x,y,z }); }
void setThroughPoint(int index, std::array<double, 3> point) { assert(index >= 0 && index < m_ThroughPoints.size()); m_ThroughPoints[index] = point; }
void setThroughPoint(int index, double x, double y, double z) { assert(index >= 0 && index < m_ThroughPoints.size()); m_ThroughPoints[index] = { x,y,z }; }
protected:
QList<std::array<double, 3>> m_ThroughPoints{};
};
/**
* @brief 线.
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
class FITKInterfaceGeometryAPI FITKAbsGeoModelTrimmedCurve : public FITKAbsGeoModelCurve
{
public:
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
FITKAbsGeoModelTrimmedCurve() = default;
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
~FITKAbsGeoModelTrimmedCurve() override = default;
/**
* @brief 线id.
* @return 线id
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
int sourceCurveId() const;
/**
* @brief 线id.
* @param id 线id
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
void setSourceCurveId(int id);
/**
* @brief .
* @return
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
double startTrimmed() const;
/**
* @brief .
* @param val
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
void setStartTrimmed(double val);
/**
* @brief .
* @return
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
double endTrimmed() const;
/**
* @brief .
* @param val
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
void setEndTrimmed(double val);
/**
* @brief .
* @return
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
FITKGeoEnum::FITKGeometryComType getGeometryCommandType() override;
protected:
/**
* @brief 线Id.
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
int m_SourceCurveId{};
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
double m_StartTrimmed{};
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
double m_EndTrimmed{};
};
/**
* @brief 线.
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
class FITKInterfaceGeometryAPI FITKAbsGeoModelOffsetCurve : public FITKAbsGeoModelCurve
{
public:
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
FITKAbsGeoModelOffsetCurve() = default;
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
~FITKAbsGeoModelOffsetCurve() override = default;
/**
* @brief .
* @return
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-13
*/
FITKGeoEnum::FITKGeometryComType getGeometryCommandType() override;
VirtualShape sourceCurve() const { return m_SourceCurve; }
void setSourceCurve(VirtualShape curve) { m_SourceCurve = curve; }
std::array<double, 3> dir() const { return m_Dir; }
void setDir(double x, double y, double z) { m_Dir = { x,y,z }; }
void setDir(std::array<double, 3> dir) { m_Dir = dir; }
double offset() const { return m_Offset; }
void setOffset(double offset) { m_Offset = offset; }
protected:
VirtualShape m_SourceCurve{};
std::array<double, 3> m_Dir{};
double m_Offset{};
};
/**
* @brief 线.
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-27
*/
class FITKInterfaceGeometryAPI FITKAbsGeoModelCurveProjectionOnSurface :
public FITKAbsGeoModelCurve
{
public:
FITKAbsGeoModelCurveProjectionOnSurface() = default;
virtual ~FITKAbsGeoModelCurveProjectionOnSurface() = default;
FITKGeoEnum::FITKGeometryComType getGeometryCommandType() override;
VirtualShape sourceCurve() const;
void setSourceCurve(VirtualShape curve);
VirtualShape sourceSurface() const;
void setSourceSurface(VirtualShape surface);
protected:
VirtualShape m_SourceCurve{};
VirtualShape m_SourceSurface{};
};
/**
* @brief 线.
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-27
*/
class FITKInterfaceGeometryAPI FITKAbsGeoModelSurfaceIntersectionSurface :
public FITKAbsGeoModelCurve
{
public:
FITKAbsGeoModelSurfaceIntersectionSurface() = default;
virtual ~FITKAbsGeoModelSurfaceIntersectionSurface() = default;
FITKGeoEnum::FITKGeometryComType getGeometryCommandType() override;
VirtualShape sourceSurface1() const;
void setSourceSurface1(VirtualShape surface);
VirtualShape sourceSurface2() const;
void setSourceSurface2(VirtualShape surface);
protected:
VirtualShape m_SourceSurface1{};
VirtualShape m_SourceSurface2{};
int m_UseResultIndex{ 0 };
};
/**
* @brief 线.
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-27
*/
class FITKInterfaceGeometryAPI FITKAbsGeoModelBridgeCurve :
public FITKAbsGeoModelCurve
{
public:
FITKAbsGeoModelBridgeCurve() = default;
virtual ~FITKAbsGeoModelBridgeCurve() = default;
FITKGeoEnum::FITKGeometryComType getGeometryCommandType() override;
VirtualShape sourceCurve1() const;
void setSourceCurve1(VirtualShape curve);
bool useStartEnd1() const;
void setUseStartEnd1(bool use);
double parameter1() const;
void setParameter1(double p);
VirtualShape sourceCurve2() const;
void setSourceCurve2(VirtualShape curve);
bool useStartEnd2() const;
void setUseStartEnd2(bool use);
double parameter2() const;
void setParameter2(double p);
protected:
VirtualShape m_SourceCurve1{};
bool m_UseStartEnd1{ true };
double m_Parameter1{ 1.0 };
VirtualShape m_SourceCurve2{};
bool m_UseStartEnd2{ true };
double m_Parameter2{ 1.0 };
};
/**
* @brief 线.
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-27
*/
class FITKInterfaceGeometryAPI FITKAbsGeoModelSurfaceEdge :
public FITKAbsGeoModelCurve
{
public:
FITKAbsGeoModelSurfaceEdge() = default;
virtual ~FITKAbsGeoModelSurfaceEdge() = default;
FITKGeoEnum::FITKGeometryComType getGeometryCommandType() override;
VirtualShape sourceSurface() const;
void setSourceSurface(VirtualShape surface);
int edgeVirtualTopoId() const;
void setEdgeVirtualTopoId(int id);
protected:
VirtualShape m_SourceSurface{};
int m_EdgeVirtualTopoId{};
};
}
#endif // !FITKABSGEOMODELCURVE_H