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/FITKInterfaceModel/FITKCoordinateSystem.h

215 lines
6.8 KiB
C

/**
*
* @file FITKCoordinateSystem.h
* @brief
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-05-25
*
*/
#ifndef __FITKCOORDINATE_SYSTEM_H___
#define __FITKCOORDINATE_SYSTEM_H___
#include "FITKInterfaceModelAPI.h"
#include "FITK_Kernel/FITKCore/FITKAbstractNDataObject.h"
#include "FITK_Kernel/FITKCore/FITKAbstractDataManager.hpp"
namespace Core
{
class FITKPoint;
}
namespace Interface
{
/**
* @brief
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-05-25
*/
class FITKInerfaceModelAPI FITKCoordinateSystem : public Core::FITKAbstractNDataObject
{
Q_OBJECT
FITKCLASS(Interface, FITKCoordinateSystem);
public:
/**
* @brief
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-05-25
*/
enum FCSysType
{
FCSCartesian, ///< 笛卡尔坐标系
FCSCylinder, ///< 圆柱坐标系
FCSSphere, ///< 球坐标系
};
Q_ENUM(FCSysType);
public:
/**
* @brief Construct a new FITKCoordinateSystem object
* @param[i] sysType
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-05-25
*/
explicit FITKCoordinateSystem(FCSysType sysType);
/**
* @brief Destroy the FITKCoordinateSystem object
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-05-25
*/
virtual ~FITKCoordinateSystem();
/***
* @brief
* @return FCSysType
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-05-25
*/
FCSysType getSysType();
/**
* @brief
* @param[i] x x
* @param[i] y y
* @param[i] z z
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-05-25
*/
virtual void setOrigin(const double x, const double y, const double z);
/**
* @brief
* @param[i] x x
* @param[i] y y
* @param[i] z z
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-05-25
*/
virtual void setPoint1(const double x, const double y, const double z);
/**
* @brief
* @param[i] x x
* @param[i] y y
* @param[i] z z
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-05-25
*/
virtual void setPoint2(const double x, const double y, const double z);
/**
* @brief
* @param[o] origin
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-05-25
*/
virtual void getOrigin(double* origin );
/**
* @brief 线
* @param[o] dir 线
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-05-25
*/
virtual void getDirection1(double* dir );
/**
* @brief 线
* @param[o] dir 线
* @param[i] vertialToD1 线
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-05-25
*/
virtual void getDirection2(double* dir, bool vertialToD1 = true );
/**
* @brief 线
* @param[o] dir 线
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-05-25
*/
virtual void getDirection3(double* dir );
/**
* @brief
* @param[i] pxyz
* @param[o] dirs 线9dx1,dy1,dz1,dx2,dy2,dz2,dx3,dx3,dz3
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-05-25
*/
virtual void get3DirectionAtPoint(const double* pxyz, double* dirs);
/**
* @brief ,id
* @param[i] obj
* @return true
* @return false
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-05-30
*/
virtual bool copy(FITKAbstractDataObject* obj) override;
protected:
/**
* @brief
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-05-25
*/
FCSysType _sysType{ FCSCartesian };
/**
* @brief
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-05-25
*/
Core::FITKPoint* _originPt{};
/**
* @brief
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-05-25
*/
Core::FITKPoint* _xPt{};
/**
* @brief
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-05-25
*/
Core::FITKPoint* _yPt{};
};
/**
* @brief
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-06-06
*/
class FITKInerfaceModelAPI FITKCoordinateSystemManager :
public Core::FITKAbstractDataManager<FITKCoordinateSystem>
{
public:
/**
* @brief Construct a new FITKCoordinateSystemManager object
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-06-06
*/
explicit FITKCoordinateSystemManager() = default;
/**
* @brief Destroy the FITKCoordinateSystemManager object
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-06-06
*/
virtual ~FITKCoordinateSystemManager() = default;
template<class T>
/**
* @brief ID
* @param[i] id ID
* @return T*
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-06-06
*/
T* getCoordinateSystemT(const int id)
{
return dynamic_cast<T*>(this->getDataByID(id));
}
/**
* @brief
* @param[i] type
* @return QList<FITKCoordinateSystem*>
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-06-06
*/
QList<FITKCoordinateSystem*> getCoordinateSystems(FITKCoordinateSystem::FCSysType type);
};
}
#endif