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.

141 lines
3.8 KiB
C

/**
*
* @file FITKGraphAreaPicker.h
* @brief VTK
* @author BaGuijun (baguijun@163.com)
* @date 2024-03-19
*
*/
#ifndef _FITKGraphAreaPicker_H_
#define _FITKGraphAreaPicker_H_
#include <vtkSmartPointer.h>
#include "FITKRenderWindowVTKAPI.h"
#include <vtkPolyData.h>
#include <vtkActor2D.h>
class vtkRenderer;
// class vtkActor2D;
// class vtkPolyData;
namespace Comp
{
class FITKGraphInteractionStyle;
/**
* @brief VTK
* @author BaGuijun (baguijun@163.com)
* @date 2024-03-19
*/
class FITKRenderWindowVTKAPI FITKGraphAreaPicker
{
public:
/**
* @brief Construct a new FITKGraphAreaPicker object
* @param[i] style
* @author BaGuijun (baguijun@163.com)
* @date 2024-03-19
*/
FITKGraphAreaPicker(FITKGraphInteractionStyle* style);
/**
* @brief Destroy the FITKGraphAreaPicker object
* @author BaGuijun (baguijun@163.com)
* @date 2024-03-19
*/
~FITKGraphAreaPicker();
/**
* @brief
* @param[i] pos
* @author BaGuijun (baguijun@163.com)
* @date 2024-03-19
*/
void setLeftButtonDownPos(int* pos);
/**
* @brief
* @param[i] render
* @author BaGuijun (baguijun@163.com)
* @date 2024-03-19
*/
void setPickerRender(vtkRenderer* render);
/**
* @brief
* @param[i] state
* @author BaGuijun (baguijun@163.com)
* @date 2024-03-19
*/
void enable(bool state = true);
/**
* @brief
* @return bool
* @author libaojun (libaojunqd@foxmail.com)
* @date 2024-04-17
*/
bool isEnable();
/**
* @brief
* @author BaGuijun (baguijun@163.com)
* @date 2024-03-19
*/
void drawRectangle();
/**
* @brief
* @param[i] state
* @author BaGuijun (baguijun@163.com)
* @date 2024-03-19
*/
void pick();
private:
/**
* @brief
* @author BaGuijun (baguijun@163.com)
* @date 2024-03-19
*/
void initRectangle();
/**
* @brief
* @author BaGuijun (baguijun@163.com)
* @date 2024-03-19
*/
void updateRectangle();
private:
/**
* @brief
* @author BaGuijun (baguijun@163.com)
* @date 2024-03-19
*/
FITKGraphInteractionStyle* m_style = nullptr;
/**
* @brief
* @author BaGuijun (baguijun@163.com)
* @date 2024-03-19
*/
vtkRenderer* m_render = nullptr;
/**
* @brief
* @author BaGuijun (baguijun@163.com)
* @date 2024-03-19
*/
int m_startPos[2] = { 0,0 };
/**
* @brief
* @author BaGuijun (baguijun@163.com)
* @date 2024-03-19
*/
int m_endPos[2] = { 0,0 };
/**
* @brief
* @author BaGuijun (baguijun@163.com)
* @date 2024-03-19
*/
vtkSmartPointer<vtkPolyData> m_pickData = nullptr;
/**
* @brief
* @author BaGuijun (baguijun@163.com)
* @date 2024-03-19
*/
vtkSmartPointer<vtkActor2D> m_pickActor = nullptr;
};
}
#endif