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/GUIWidget/PickedDataProvider.h

283 lines
8.6 KiB
C

/*****************************************************************//**
* @file PickedDataProvider.h
* @brief
*
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-04-17
*********************************************************************/
#ifndef __PICKEDDATAPROVIDER_H__
#define __PICKEDDATAPROVIDER_H__
#include <QObject>
#include "GUIWidgetAPI.h"
#include "FITK_Interface/FITKInterfaceModel/FITKModelEnum.h"
#include <QHash>
// 前置声明
class vtkActor;
class vtkActor2D;
class vtkPlanes;
class vtkDataSet;
class vtkPoints;
class vtkUnstructuredGrid;
namespace AppFrame
{
class FITKKeyMouseStates;
}
namespace GraphData
{
class PickedData;
}
namespace GraphData
{
/**
* @brief
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-04-17
*/
class GUIWIDGETAPI PickedDataProvider : public QObject
{
Q_OBJECT
public:
/**
* @brief
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-04-17
*/
static PickedDataProvider* getInstance();
/**
* @brief
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-04-17
*/
static void Delete();
/**
* @brief
* @param type
* @param dataObjIdID
* @param indice[]
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-07-23
*/
void addDataManually(Interface::FITKModelEnum::FITKModelSetType type, int dataObjId, QList<int> & indice);
/**
* @brief
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-04-18
*/
void clearPickedData();
/**
* @brief
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-04-30
*/
void clearPickedDataPreview();
/**
* @brief VTK
* @return
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-04-23
*/
vtkDataSet* getPickedPreviewDataSet();
/**
* @brief VTK
* @return
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-04-18
*/
vtkDataSet* getPickedDataSet();
/**
* @brief
* @param actor
* @param index
* @param pickedWorldPos
* @param isPreview
* @return
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-04-24
*/
PickedData* getPickedData(vtkActor* actor, int index, double* pickedWorldPos, bool isPreview = false);
/**
* @brief
* @param actor
* @param isPreview
* @return
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-04-24
*/
PickedData* getPickedData(vtkActor2D* actor, bool isPreview = false);
/**
* @brief
* @param actor
* @param index
* @param pickedWorldPos
* @return
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-04-18
*/
bool addPreviewPicked(vtkActor* actor, int index, double* pickedWorldPos);
/**
* @brief
* @param actor
* @return
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-05-16
*/
bool addPreviewPicked(vtkActor2D* actor);
/**
* @brief
* @param actor
* @param index
* @param pickedWorldPos
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-04-18
*/
void addPicked(vtkActor* actor, int index, double* pickedWorldPos);
/**
* @brief
* @param actor
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-05-16
*/
void addPicked(vtkActor2D* actor);
/**
* @brief
* @param actors
* @param cutPlane
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-04-19
*/
void addPicked(QList<vtkActor*> actors, vtkPlanes* cutPlane);
/**
* @brief
* @return
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-04-19
*/
QList<PickedData*> getPickedList();
signals:
/**
* @brief -
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-05-23
*/
void sig_dataPicked();
protected:
/**
* @brief
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-04-17
*/
PickedDataProvider();
/**
* @brief
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-04-17
*/
~PickedDataProvider();
/**
* @brief
* @param data
* @param isAreaPick
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-04-19
*/
void dealPickedData(PickedData* data, bool isAreaPick = false);
private:
/**
* @brief VTK
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-04-23
*/
void generatePickedPreviewDataSet();
/**
* @brief VTK
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-04-18
*/
void generatePickedDataSet();
/**
* @brief
* @param data
* @return
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-04-19
*/
PickedData* getSameModelPickData(PickedData* data);
private:
/**
* @brief
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-04-17
*/
static PickedDataProvider* s_instance;
/**
* @brief
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-04-18
*/
AppFrame::FITKKeyMouseStates* m_settings{ nullptr };
/**
* @brief
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-04-18
*/
QList<PickedData*> m_pickedDataList;
/**
* @brief
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-04-24
*/
PickedData* m_pickedPreviewData{ nullptr };
/**
* @brief VTK
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-04-23
*/
vtkUnstructuredGrid* m_dataSetPreview{ nullptr };
/**
* @brief VTK
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-04-18
*/
vtkUnstructuredGrid* m_dataSetPicked{ nullptr };
};
}
#endif // __PICKEDDATAPROVIDER_H__