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/GraphDataProvider/GraphProviderBase.h

159 lines
5.0 KiB
C

/*****************************************************************//**
* @file GraphProviderBase.h
* @brief
*
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-06-12
*********************************************************************/
#ifndef __GRAPHPROVIDERBASE_H__
#define __GRAPHPROVIDERBASE_H__
#include <QObject>
#include "GraphDataProviderAPI.h"
#include <QHash>
// 前置声明
namespace Core
{
class FITKAbstractDataObject;
}
namespace Comp
{
class FITKGraph3DWindowVTK;
}
namespace Exchange
{
class FITKFluidVTKGraphObject3D;
}
namespace GraphData
{
/**
* @brief
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-06-12
*/
class GRAPHDATAPROVIDERAPI GraphProviderBase : public QObject
{
Q_OBJECT
// 友元,防止外部手动创建或析构。
friend class GraphProviderManager;
public:
/**
* @brief []
* @return
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-06-12
*/
virtual QList<Exchange::FITKFluidVTKGraphObject3D*> getCurrentGraphObjs() = 0;
/**
* @brief
* @return
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-06-12
*/
QList<Exchange::FITKFluidVTKGraphObject3D*> getCurrentVisibleGraphObjs();
/**
* @brief []
* @return
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-06-12
*/
virtual QString getClassName();
/**
* @brief ID[]
* @param dataIdID
* @param info[]
* @return ID
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-06-12
*/
virtual bool updateObjById(int dataId, QVariant info = QVariant());
/**
* @brief
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-06-12
*/
void updateVisibility();
/**
* @brief
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-07-30
*/
void clearHighlight();
protected:
/**
* @brief
* @param graphWidget
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-06-12
*/
GraphProviderBase(Comp::FITKGraph3DWindowVTK* graphWidget);
/**
* @brief []
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-06-12
*/
virtual ~GraphProviderBase();
/**
* @brief
* @param hash
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-06-12
*/
void deleteObjsHash(QHash<int, Exchange::FITKFluidVTKGraphObject3D*>& hash);
/**
* @brief
* @param hash
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-06-12
*/
void deleteObjsHash(QHash<int, QHash<int, Exchange::FITKFluidVTKGraphObject3D*>>& hash);
/**
* @brief
* @param adaptorKeyName
* @param objDict[]
* @param dataObj
* @return
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-07-24
*/
Exchange::FITKFluidVTKGraphObject3D* getGraphObject(QString adaptorKeyName, QHash<int, Exchange::FITKFluidVTKGraphObject3D*>& objDict, Core::FITKAbstractDataObject* dataObj);
protected:
/**
* @brief
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-06-12
*/
Comp::FITKGraph3DWindowVTK* m_graphWidget{ nullptr };
/**
* @brief
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-06-12
*/
QHash<int, Exchange::FITKFluidVTKGraphObject3D*> m_previewObjHash = {};
};
} // namespace GraphData
#endif // __GRAPHPROVIDERBASE_H__