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.

202 lines
5.5 KiB
C

/**
*
* @file FITKVec3D.h
* @brief
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-02-27
*
*/
#ifndef _FITKVEC3D_H__
#define _FITKVEC3D_H__
#include "FITKAbstractObject.hpp"
namespace Core
{
/**
* @brief
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-02-27
*/
class FITKCoreAPI FITKPoint : public FITKAbstractObject
{
public:
/**
* @brief Construct a new FITKPoint object
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-02-27
*/
FITKPoint();
/**
* @brief Construct a new FITKPoint object
* @param[i] x x
* @param[i] y y
* @param[i] z z
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-02-27
*/
FITKPoint(double x, double y, double z);
/**
* @brief Construct a new FITKPoint object
* @param[i] c 3
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-02-27
*/
FITKPoint(double* c);
/**
* @brief Construct a new FITKPoint object
* @param[i] point
* @author LiBaojun (libaojunqd@ifoxmail.com)
* @date 2024-02-27
*/
FITKPoint(const FITKPoint& point);
/**
* @brief X
* @return double
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-02-27
*/
double x() const;
/**
* @brief y
* @return double
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-02-27
*/
double y() const;
/**
* @brief z
* @return double
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-02-27
*/
double z() const;
/**
* @brief
* @param[o] c 3
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-02-27
*/
void getCoor(double* c) const;
/**
* @brief
* @param[i] x x
* @param[i] y y
* @param[i] z z
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-05-25
*/
void setCoor(double x, double y, double z);
/**
* @brief
* @author LiBaojun(libaojunqd@foxmail.com)
* @date 2024 - 05 - 25
*/
void operator = (const FITKPoint & p);
/**
* @brief
* @author LiBaojun(libaojunqd@foxmail.com)
* @date 2024 - 05 - 25
*/
double operator [] (const int & index);
protected:
/**
* @brief
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-02-27
*/
double _coor[3] = { 0,0,0 };
};
/**
* @brief ID
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-03-07
*/
class FITKCoreAPI FITKNode : public FITKPoint
{
public:
using FITKPoint::FITKPoint;
FITKNode() = default;
/**
* @brief Construct a new FITKNode object
* @param[i] id id
* @param[i] x x
* @param[i] y y
* @param[i] z z
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-02-27
*/
FITKNode(const int id, const double x, const double y, const double z);
/**
* @brief Construct a new FITKNode objecti
* @param[i] id id
* @param[i] coor
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-02-27
*/
FITKNode(const int id, const double* coor);
/**
* @brief ID
* @param[i] id ID
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-02-27
*/
void setNodeID(const int id);
/**
* @brief ID
* @return int
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-02-27
*/
int getNodeID() const;
private:
/**
* @brief ID
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-02-29
*/
int _nodeID{ -1 };
};
/**
* @brief
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-03-07
*/
class FITKCoreAPI FITKVec3D : public FITKPoint
{
public:
using FITKPoint::FITKPoint;
/**
* @brief Construct a new FITKPoint object
* @param[i] point
* @author LiBaojun (libaojunqd@ifoxmail.com)
* @date 2024-02-27
*/
FITKVec3D(const FITKPoint& point);
FITKVec3D(const FITKPoint& endPt, const FITKPoint& startPt);
/**
* @brief
* @return double
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-05-25
*/
double getNorm() const;
/**
* @brief
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-05-25
*/
void normalize();
};
}
#endif