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.
43 lines
1.1 KiB
C++
43 lines
1.1 KiB
C++
#include "FITKAbstractModelComponent.h"
|
|
#include "FITKAbstractModel.h"
|
|
#include "FITK_Kernel/FITKCore/FITKDataRepo.h"
|
|
|
|
namespace Interface
|
|
{
|
|
int Interface::FITKAbstractModelComponent::getAbsModelID() const
|
|
{
|
|
return _absModelID;
|
|
}
|
|
|
|
FITKAbstractModelComponent::~FITKAbstractModelComponent()
|
|
{
|
|
}
|
|
|
|
void FITKAbstractModelComponent::setModel(const int & parentID)
|
|
{
|
|
//判断parentID的有效性
|
|
//数据块被释放得到空指针
|
|
//数据块不是FITKAbstractModel派生类对象返回空指针
|
|
auto model = FITKDATAREPO->getTDataByID<FITKAbstractModel>(parentID);
|
|
if (model == nullptr) return;
|
|
|
|
//通过ID记录model
|
|
_absModelID = parentID;
|
|
}
|
|
|
|
void FITKAbstractModelComponent::setModel(FITKAbstractModel* model)
|
|
{
|
|
if (model == nullptr) return;
|
|
_absModelID = model->getDataObjectID();
|
|
}
|
|
|
|
Interface::FITKAbstractModel* FITKAbstractModelComponent::getAbstractModel()
|
|
{
|
|
return FITKDATAREPO->getTDataByID<FITKAbstractModel>(_absModelID);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|