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/FITKInterfaceGeometry/FITKAbsVirtualTopo.h

222 lines
6.3 KiB
C

/**
*
* @file FITKAbsVirtualTopo.h
* @brief
* @author libaojun (libaojunqd@foxmail.com)
* @date 2024-08-09
*
*/
#ifndef _FITK_ABS_VIRTUAL_TOPO_H___
#define _FITK_ABS_VIRTUAL_TOPO_H___
#include "FITKInterfaceGeometryAPI.h"
#include "FITK_Kernel/FITKCore/FITKAbstractDataObject.h"
#include "FITKGeoEnum.h"
#include <QMutex>
namespace Interface
{
/**
* @brief
* @author libaojun (libaojunqd@foxmail.com)
* @date 2024-08-09
*/
class FITKInterfaceGeometryAPI FITKAbsVirtualTopoShape
{
public:
explicit FITKAbsVirtualTopoShape() = default;
virtual ~FITKAbsVirtualTopoShape() = 0;
/**
* @brief
* @param[i]
* @return true
* @return false
* @author libaojun (libaojunqd@foxmail.com)
* @date 2024-08-09
*/
virtual bool isSameShape( void* ) = 0;
};
/**
* @brief
* @author libaojun (libaojunqd@foxmail.com)
* @date 2024-08-09
*/
class FITKInterfaceGeometryAPI FITKAbsVirtualTopo : public Core::FITKAbstractDataObject
{
FITKCLASS(Interface, FITKAbsVirtualTopo);
friend FITKAbsVirtualTopo;
Q_OBJECT
public:
/**
* @brief Construct a new FITKAbsVirtualTopo object
* @param[i] type
* @author libaojun (libaojunqd@foxmail.com)
* @date 2024-08-09
*/
explicit FITKAbsVirtualTopo(FITKGeoEnum::VTopoShapeType type = FITKGeoEnum::VSNone);
/**
* @brief
* @author libaojun (libaojunqd@foxmail.com)
* @date 2024-08-09
*/
virtual ~FITKAbsVirtualTopo();
/**
* @brief
* @return VTopoShapeType
* @author libaojun (libaojunqd@foxmail.com)
* @date 2024-08-09
*/
FITKGeoEnum::VTopoShapeType getShapeType()const;
/**
* @brief
* @param[i] s
* @author libaojun (libaojunqd@foxmail.com)
* @date 2024-08-09
*/
void setShapeType(FITKGeoEnum::VTopoShapeType s);
/**
* @brief
* @param[i] subTopo
* @author libaojun (libaojunqd@foxmail.com)
* @date 2024-08-09
*/
void addSubTopo(FITKAbsVirtualTopo* subTopo);
/**
* @brief
* @return int
* @author libaojun (libaojunqd@foxmail.com)
* @date 2024-08-09
*/
int getSubTopoCount();
/**
* @brief
* @param[i] index
* @return FITKAbsVirtualTopo*
* @author libaojun (libaojunqd@foxmail.com)
* @date 2024-08-09
*/
FITKAbsVirtualTopo* getSubTopo(const int index);
/**
* @brief
* @return int
* @author libaojun (libaojunqd@foxmail.com)
* @date 2024-08-09
*/
int getParentTopoCount();
/**
* @brief
* @param[i] index
* @return FITKAbsVirtualTopo*
* @author libaojun (libaojunqd@foxmail.com)
* @date 2024-08-09
*/
FITKAbsVirtualTopo* getParentTopo(const int index);
template<class T>
/**
* @brief
* @param[i] index
* @return T*
* @author libaojun (libaojunqd@foxmail.com)
* @date 2024-08-09
*/
T* getTSubTopo(const int index)
{
return dynamic_cast<T*>(this->getSubTopo(index));
}
/**
* @brief
* @author libaojun (libaojunqd@foxmail.com)
* @date 2024-08-09
*/
void clearSubTopo();
/**
* @brief
* @param[i] shape
* @author libaojun (libaojunqd@foxmail.com)
* @date 2024-08-09
*/
void setShape(FITKAbsVirtualTopoShape* shape);
/**
* @brief
* @return FITKAbsVirtualTopoShape*
* @author libaojun (libaojunqd@foxmail.com)
* @date 2024-08-09
*/
FITKAbsVirtualTopoShape* getShape();
template<class T>
/**
* @brief
* @return T*
* @author libaojun (libaojunqd@foxmail.com)
* @date 2024-08-09
*/
T* getShapeT()
{
return dynamic_cast<T*>(_shape);
}
/**
* @brief
* @param[i] index
* @author libaojun (libaojunqd@foxmail.com)
* @date 2024-08-27
*/
void setIndexLabel(const int index);
/**
* @brief
* @return int
* @author libaojun (libaojunqd@foxmail.com)
* @date 2024-08-27
*/
int getIndexLabel() const;
private:
/**
* @brief
* @param[i] pTopo
* @author libaojun (libaojunqd@foxmail.com)
* @date 2024-08-09
*/
void addParentTopo(FITKAbsVirtualTopo* pTopo);
private:
/**
* @brief
* @author libaojun (libaojunqd@foxmail.com)
* @date 2024-08-09
*/
QList<FITKAbsVirtualTopo*> _parents{};
/**
* @brief
* @author libaojun (libaojunqd@foxmail.com)
* @date 2024-08-09
*/
FITKGeoEnum::VTopoShapeType _topoShapeType{ FITKGeoEnum::VSNone };
/**
* @brief
* @author libaojun (libaojunqd@foxmail.com)
* @date 2024-08-09
*/
FITKAbsVirtualTopoShape* _shape{};
/**
* @brief
* @author libaojun (libaojunqd@foxmail.com)
* @date 2024-08-09
*/
QList<FITKAbsVirtualTopo*> _subTopo{};
/**
* @brief
* @author libaojun (libaojunqd@foxmail.com)
* @date 2024-08-27
*/
int _indexLabel{ -1 };
};
}
#endif