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

200 lines
6.1 KiB
C

#ifndef FITKABSGEOREFERENCEPLANE_H
#define FITKABSGEOREFERENCEPLANE_H
#include "FITKInterfaceGeometryAPI.h"
#include "FITKAbsGeoDatum.h"
#include <array>
namespace Interface
{
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-16
*/
class FITKInterfaceGeometryAPI FITKAbsGeoReferencePlane :
public FITKAbsGeoDatumPlane
{
public:
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-16
*/
FITKAbsGeoReferencePlane() = default;
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-16
*/
virtual ~FITKAbsGeoReferencePlane() = default;
void setPosition(double x, double y, double z) {
m_pos[0] = x; m_pos[1] = y; m_pos[2] = z;
}
void setNormal(double x, double y, double z) {
m_nor[0] = x; m_nor[1] = y; m_nor[2] = z;
}
void setUp(double x, double y, double z) {
m_up[0] = x; m_up[1] = y; m_up[2] = z;
}
};
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-16
*/
class FITKInterfaceGeometryAPI FITKAbsGeoReferenceOffsetPlane :
public FITKAbsGeoReferencePlane
{
public:
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-16
*/
FITKAbsGeoReferenceOffsetPlane() = default;
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-16
*/
virtual ~FITKAbsGeoReferenceOffsetPlane() = default;
/**
* @brief .
* @return
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-16
*/
FITKGeoEnum::FITKDatumType getDatumType() override;
SourceObject sourceSurface() const { return m_SourceSurface; }
void setSourceSurface(SourceObject obj) { m_SourceSurface = obj; }
std::array<double, 3> direction() const { return m_Direction; };
void setDirection(std::array<double, 3> dir) { m_Direction = dir; };
void setDirection(double x, double y, double z) { m_Direction = { x,y,z }; };
double offset() const { return m_Offset; };
void setOffset(double offset) { m_Offset = offset; };
protected:
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-23
*/
SourceObject m_SourceSurface{};
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-23
*/
std::array<double, 3> m_Direction{};
/**
* @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 FITKAbsGeoReferenceThreePointsPlane :
public FITKAbsGeoReferencePlane
{
public:
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-16
*/
FITKAbsGeoReferenceThreePointsPlane() = default;
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-16
*/
virtual ~FITKAbsGeoReferenceThreePointsPlane() = default;
/**
* @brief .
* @return
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-16
*/
FITKGeoEnum::FITKDatumType getDatumType() override;
std::array<double, 3> point(int index) {
assert(index >= 0 && index < 3);
return m_Points[index];
}
void setPoint(int index, std::array<double, 3> xyz) {
assert(index >= 0 && index < 3);
m_Points[index] = xyz;
}
void setPoint(int index, double x, double y, double z) {
assert(index >= 0 && index < 3);
m_Points[index] = { x,y,z };
}
protected:
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-09-04
*/
std::array<std::array<double, 3>, 3> m_Points{};
};
/**
* @brief Ax+By+Cz+D=0.
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-16
*/
class FITKInterfaceGeometryAPI FITKAbsGeoReferenceEquationPlane :
public FITKAbsGeoReferencePlane
{
public:
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-16
*/
FITKAbsGeoReferenceEquationPlane() = default;
/**
* @brief .
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-16
*/
virtual ~FITKAbsGeoReferenceEquationPlane() = default;
/**
* @brief .
* @return
* @author YanZhiHui (chanyuantiandao@126.com)
* @date 2024-08-16
*/
FITKGeoEnum::FITKDatumType getDatumType() override;
double a() const { return m_A; }
void setA(double val) { m_A = val; }
double b() const { return m_B; }
void setB(double val) { m_B = val; }
double c() const { return m_C; }
void setC(double val) { m_C = val; }
double d() const { return m_D; }
void setD(double val) { m_D = val; }
protected:
/* 平面方程Ax+By+Cz+D=0系数 */
/* @{ */
double m_A{ 0 };
double m_B{ 0 };
double m_C{ 0 };
double m_D{ 0 };
/* @} */
};
}
#endif // !FITKABSGEOREFERENCEPLANE_H