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

82 lines
2.0 KiB
C++

/**
*
* @file FITKAssembly.h
* @brief 声明装配体
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-03-22
*
*/
#ifndef __FITKASSEMBLY_H__
#define __FITKASSEMBLY_H__
#include "FITKInterfaceModelAPI.h"
#include "FITKAbstractModel.h"
#include "FITKAbstractAssInstance.h"
#include "FITK_Kernel/FITKCore/FITKAbstractDataManager.hpp"
namespace Interface
{
/**
* @brief 装配体
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-03-22
*/
class FITKInerfaceModelAPI FITKAssembly : public FITKAbstractModel,
public Core::FITKAbstractDataManager<FITKAbstractAssInstance>
{
FITKCLASS(Interface, FITKAssembly);
public:
/**
* @brief Construct a new FITKAssembly object
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-03-22
*/
explicit FITKAssembly();
/**
* @brief Destroy the FITKAssembly object
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-03-22
*/
virtual ~FITKAssembly();
/**
* @brief 获取模型类型
* @return AbsModelType
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-02-27
*/
virtual FITKModelEnum::AbsModelType getAbsModelType() override;
template<class T>
/**
* @brief 获取装配实例并进行类型转换
* @param[i] index 索引
* @return T*
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-03-22
*/
T* getInstanceTAt(const int index)
{
auto d = this->getDataByIndex(index);
return dynamic_cast<T*>(d);
}
/**
* @brief 通过移除
* @param[i] index 索引
* @return T*
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-03-22
*/
virtual void removeInstanceByModel(const int modelID);
private:
};
}
#endif // !__FITKASSEMBLY_H__