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

132 lines
3.7 KiB
C

/**
*
* @file FITKMaterialAssign.h
* @brief
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-03-07
*
*/
#ifndef __FITKMATERIAL_ASSIGN_H__
#define __FITKMATERIAL_ASSIGN_H__
#include "FITKInterfacePhysicsAPI.h"
#include "FITK_Kernel/FITKCore/FITKAbstractDataObject.h"
#include "FITK_Kernel/FITKCore/FITKAbstractDataManager.hpp"
namespace Interface
{
/**
* @brief
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-03-07
*/
class FITKInterfacePhysicsAPI FITKMaterialAssign : public Core::FITKAbstractDataObject
{
public:
/**
* @brief Construct a new FITKMaterialAssign object
* @param[i] modelID ID
* @param[i] materialID ID
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-03-07
*/
explicit FITKMaterialAssign(int modelID, int materialID);
explicit FITKMaterialAssign() = default;
/**
* @brief Destroy the FITKMaterialAssign object
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-03-07
*/
virtual ~FITKMaterialAssign() = default;
/**
* @brief ID
* @return int
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-03-07
*/
virtual int getMaterialID();
/**
* @brief ID
* @return int
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-03-07
*/
virtual int getModelID();
/**
* @brief
* @param[] modelID My Param doc
* @param[] materialID My Param doc
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-03-07
*/
virtual void assign(int modelID, int materialID);
/**
* @brief
* @return true
* @return false
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-03-07
*/
virtual bool isValid();
/**
* @brief
* @return true
* @return false
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-03-07
*/
virtual bool isAssignComponent();
template<class T>
/**
* @brief
* @return T*
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-03-07
*/
T* getMaterial()
{
return dynamic_cast<T*>(this->getMaterialObj());
}
private:
/**
* @brief
* @return FITKAbstractDataObject*
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-03-07
*/
FITKAbstractDataObject* getMaterialObj();
protected:
/**
* @brief IDID
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-03-07
*/
int _modelID{ -1 };
/**
* @brief ID
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-03-07
*/
int _materialID{ -1 };
};
/**
* @brief
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-03-07
*/
class FITKInterfacePhysicsAPI FITKMaterialAssignManager : public Core::FITKAbstractDataObject
, public Core::FITKAbstractDataManager<FITKMaterialAssign>
{
public:
explicit FITKMaterialAssignManager() = default;
virtual ~FITKMaterialAssignManager() = default;
};
}
#endif