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/FITKInterfacePhysics/FITKFieldDiscrete.h

193 lines
5.1 KiB
C

/**
*
* @file FITKFieldDiscrete.h
* @brief
* @author libaojun (libaojunqd@foxmail.com)
* @date 2024-07-11
*
*/
#ifndef __FITK_FIELD_DISCRETE_H__
#define __FITK_FIELD_DISCRETE_H__
#include "FITKAbstractFields.h"
#include <QList>
namespace Interface
{
//离散场数据
struct FieldData
{
int _id{ -1 };
double _value{ 0.0 };
};
/**
* @brief
* @author libaojun (libaojunqd@foxmail.com)
* @date 2024-07-11
*/
class FITKInterfacePhysicsAPI FITKFieldDiscrete :
public FITKAbstractFiled
{
Q_OBJECT
public:
/**
* @brief
* @author libaojun (libaojunqd@foxmail.com)
* @date 2024-07-11
*/
enum FITKDisFieldLoc
{
FDFLNone,
FDFLEle,
FDFLNode,
};
Q_ENUM(FITKDisFieldLoc);
public:
/**
* @brief Construct a new FITKFieldDiscrete object
* @author libaojun (libaojunqd@foxmail.com)
* @date 2024-07-11
*/
explicit FITKFieldDiscrete() = default;
/**
* @brief Destroy the FITKFieldDiscrete object
* @author libaojun (libaojunqd@foxmail.com)
* @date 2024-07-11
*/
virtual ~FITKFieldDiscrete() = default;
/**
* @brief
* @return FITKFieldType
* @author libaojun (libaojunqd@foxmail.com)
* @date 2024-07-11
*/
virtual FITKFieldType getFieldType() override;
/**
* @brief
* @return FITKDisFieldLoc
* @author libaojun (libaojunqd@foxmail.com)
* @date 2024-07-11
*/
FITKDisFieldLoc getFieldLoc()const;
/**
* @brief
* @param loc
* @author libaojun (libaojunqd@foxmail.com)
* @date 2024-07-11
*/
void setDisFieldLoc(FITKDisFieldLoc loc);
/**
* @brief
* @return double
* @author libaojun (libaojunqd@foxmail.com)
* @date 2024-07-11
*/
bool hasDefaultValue() const;
/**
* @brief
* @param v
* @author libaojun (libaojunqd@foxmail.com)
* @date 2024-07-11
*/
void hasDefaultValue(const bool v);
/**
* @brief
* @param[i] v
* @author libaojun (libaojunqd@foxmail.com)
* @date 2024-07-11
*/
void setDefaultValue(const double v);
/**
* @brief
* @return double
* @author libaojun (libaojunqd@foxmail.com)
* @date 2024-07-11
*/
double getDefaultValue() const;
/**
* @brief
* @return int
* @author libaojun (libaojunqd@foxmail.com)
* @date 2024-07-11
*/
int getFileDataCount();
/**
* @brief
* @param index
* @return FieldData
* @author libaojun (libaojunqd@foxmail.com)
* @date 2024-07-11
*/
FieldData getFieldData(const int index);
/**
* @brief
* @param id
* @param v
* @author libaojun (libaojunqd@foxmail.com)
* @date 2024-07-11
*/
void appendFieldData(int id ,double v);
/**
* @brief
* @param index
* @param id
* @param v
* @author libaojun (libaojunqd@foxmail.com)
* @date 2024-07-11
*/
void insertFieldData(int index, int id, int v);
/**
* @brief
* @param index
* @author libaojun (libaojunqd@foxmail.com)
* @date 2024-07-11
*/
void removeFieldData(int index);
/**
* @brief
* @author libaojun (libaojunqd@foxmail.com)
* @date 2024-07-11
*/
void clearFieldData();
/**
* @brief ,id
* @param[i] obj
* @return true
* @return false
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-07-12
*/
bool copy(FITKAbstractDataObject* obj) override;
private:
/**
* @brief
* @author libaojun (libaojunqd@foxmail.com)
* @date 2024-07-11
*/
FITKDisFieldLoc _fieldLoc{ FDFLEle };
/**
* @brief
* @author libaojun (libaojunqd@foxmail.com)
* @date 2024-07-11
*/
bool _hasDefaultValue{ false };
/**
* @brief
* @author libaojun (libaojunqd@foxmail.com)
* @date 2024-07-11
*/
double _defaultValue{ 0 };
/**
* @brief
* @author libaojun (libaojunqd@foxmail.com)
* @date 2024-07-11
*/
QList<FieldData> _fieldData{};
};
}
#endif