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

95 lines
2.5 KiB
C

/**
*
* @file FITKAbstractModelComponent.h
* @brief
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-02-27
*
*/
#ifndef __FITKABSTRACTCOMPONENT_H___
#define __FITKABSTRACTCOMPONENT_H___
#include "FITK_Kernel/FITKCore/FITKAbstractNDataObject.h"
#include "FITKModelEnum.h"
#include "FITKInterfaceModelAPI.h"
namespace Interface
{
class FITKAbstractModel;
/**
* @brief
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-02-27
*/
class FITKInerfaceModelAPI FITKAbstractModelComponent : public Core::FITKAbstractNDataObject
{
public:
/**
* @brief Construct a new FITKAbstractModelComponent object
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-02-27
*/
FITKAbstractModelComponent() = default;
/**
* @brief Destroy the FITKAbstractModelComponent object
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-02-27
*/
virtual ~FITKAbstractModelComponent() = 0;
/**
* @brief ID
* @param[i] ID
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-02-27
*/
void setModel(const int & parentID);
/**
* @brief
* @param[i] model
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-02-27
*/
void setModel(FITKAbstractModel* model);
/**
* @brief ID
* @return int
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-02-27
*/
int getAbsModelID() const;
/**
* @brief
* @return FITKAbstractModel*
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-02-27
*/
FITKAbstractModel* getAbstractModel();
template <class T>
/**
* @brief
* @return T*
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-02-27
*/
T* getAbstractModelAs()
{
return dynamic_cast<T*>(this->getAbstractModel());
}
private:
/**
* @brief ID
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-02-27
*/
int _absModelID{-1};
};
}
#endif