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/FlowApp/PreWindowInitializer.h

240 lines
6.5 KiB
C

/*****************************************************************//**
* @file PreWindowInitializer.h
* @brief
*
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-04-17
*********************************************************************/
#ifndef __PRE_WIDOWINIINTIALIZER_H___
#define __PRE_WIDOWINIINTIALIZER_H___
#include "FITK_Component/FITKRenderWindowVTK/FITKGraph3DWindowInterface.h"
#include "FITK_Component/FITKRenderWindowVTK/FITKGraphInteractionStyle.h"
#include <QTimer>
// 前置声明
class vtkRenderer;
class vtkRenderWindow;
namespace EventOper
{
class GraphInteractionOperator;
class GraphEventOperator;
};
namespace Comp
{
class FITKGraph3DWindowVTK;
};
/**
* @brief
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-04-17
*/
class PreWindowInitializer : public Comp::Graph3DWindowInitializer
{
public:
/**
* @brief
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-04-17
*/
explicit PreWindowInitializer();
/**
* @brief
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-04-17
*/
virtual ~PreWindowInitializer() = default;
/**
* @brief []
* @return
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-04-17
*/
virtual Comp::FITKGraphInteractionStyle* getStyle() override;
protected:
private:
};
class PreWindowInteractionStyle : public Comp::FITKGraphInteractionStyle
{
Q_OBJECT
public:
/**
* @brief []
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-04-17
*/
static PreWindowInteractionStyle* New();
vtkTypeMacro(PreWindowInteractionStyle,FITKGraphInteractionStyle);
private:
/**
* @brief
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2023-07-25
*/
virtual void OnLeftButtonDown() override;
/**
* @brief
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2023-11-04
*/
virtual void OnLeftButtonUp() override;
/**
* @brief
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2023-07-25
*/
virtual void OnMiddleButtonDown() override;
/**
* @brief
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2023-11-04
*/
virtual void OnMiddleButtonUp() override;
/**
* @brief
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2023-11-03
*/
virtual void OnMouseMove() override;
/**
* @brief
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2023-11-04
*/
void OnMouseWheelForward() override;
/**
* @brief
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2023-11-04
*/
void OnMouseWheelBackward() override;
/**
* @brief
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2023-11-04
*/
void OnRightButtonDown() override;
/**
* @brief
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2023-11-04
*/
void OnRightButtonUp() override;
/**
* @brief
* @param startPos
* @param endPos
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-04-18
*/
void areaPick(int* startPos, int* endPos) override;
private:
/**
* @brief
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-04-17
*/
PreWindowInteractionStyle();
/**
* @brief
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-04-17
*/
~PreWindowInteractionStyle() = default;
/**
* @brief
* @return
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-04-17
*/
Comp::FITKGraph3DWindowVTK* getCurrentGraphWindow();
/**
* @brief
* @param isPreview[]
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-04-17
*/
void pick(bool isPreview = false);
/**
* @brief
* @param graphWindow
* @param pos
* @param isPreview
* @param tol[]
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-04-17
*/
void pickPoint(Comp::FITKGraph3DWindowVTK* graphWindow, int* pos, bool isPreview, double tol = 0.005);
/**
* @brief 线使
* @param graphWindow
* @param pos
* @param isPreview
* @param tol[]
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-04-17
*/
void pickCell(Comp::FITKGraph3DWindowVTK* graphWindow, int* pos, bool isPreview, double tol = 0.003);
private slots:
/**
* @brief -
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-04-17
*/
void slot_prePick();
private:
/**
* @brief 200ms
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-04-17
*/
QTimer m_timerForPrePick;
/**
* @brief
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-04-17
*/
EventOper::GraphInteractionOperator* m_operPreview{ nullptr };
/**
* @brief
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-04-17
*/
EventOper::GraphInteractionOperator* m_operPick{ nullptr };
/**
* @brief
* @author ChengHaotian (yeguangbaozi@foxmail.com)
* @date 2024-04-17
*/
EventOper::GraphEventOperator* m_operGraph{ nullptr };
};
#endif