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.

176 lines
5.1 KiB
C

/**
*
* @file FITKGraphWidget.h
* @brief
* @author BaGuijun (baguijun@163.com)
* @date 2024-04-08
*
*/
#ifndef FITKGraphWidget_H_
#define FITKGraphWidget_H_
#include "FITKCoreAPI.h"
#include "FITKAbstractGUI.h"
namespace Core
{
class FITKAbstractGraphObject;
/**
* @brief
* @author libaojun (libaojunqd@foxmail.com)
* @date 2024-04-08
*/
class FITKCoreAPI FITKAbstractGraphWidget :public FITKWidget
{
public:
explicit FITKAbstractGraphWidget(QWidget* parent = nullptr);
/**
* @brief Destroy the FITKGraphWidget object
* @author libaojun (libaojunqd@foxmail.com)
* @date 2024-04-08
*/
virtual ~FITKAbstractGraphWidget() = 0 ;
/**
* @brief
* @author libaojun (libaojunqd@foxmail.com)
* @date 2024-03-28
*/
virtual void clear();
/**
* @brief
* @param[i] image
* @param[i] w
* @param[i] h
* @author libaojun (libaojunqd@foxmail.com)
* @date 2024-04-11
*/
virtual void saveImage(const QString& image, int w = -1, int h = -1);
/**
* @brief
* @author libaojun (libaojunqd@foxmail.com)
* @date 2024-04-18
*/
virtual void fitView();
/**
* @brief
* @param[i] rgb1
* @param[i] rgb2 rgb1
* @author libaojun (libaojunqd@foxmail.com)
* @date 2024-05-08
*/
virtual void setBackgroundColor(float* rgb1, float* rgb2 = nullptr);
/**
* @brief
* @param[o] rgb1
* @param[o] rgb2
* @author libaojun (libaojunqd@foxmail.com)
* @date 2024-05-08
*/
virtual void getBackgroundColor(float* rgb1, float* rgb2 = nullptr);
/**
* @brief
* @param[i] FITKAbstractGraphObject
* @author libaojun (libaojunqd@foxmail.com)
* @date 2024-04-11
*/
virtual void removeGraphObj(FITKAbstractGraphObject* gobj);
/**
* @brief IDwidgetid
* @return int
* @author libaojun (libaojunqd@foxmail.com)
* @date 2024-05-08
*/
int getGraphWidgetID() const;
private:
/**
* @brief ID
* @author libaojun (libaojunqd@foxmail.com)
* @date 2024-05-08
*/
int _graphWidgetID{ -1 };
};
enum FITKGraph3DStandardView
{
F3DVXPos,
F3DVXNeg,
F3DVYPos,
F3DVYNeg,
F3DVZPos,
F3DVZNeg,
F3DVISO,
};
/**
* @brief
* @author libaojun (libaojunqd@foxmail.com)
* @date 2024-04-08
*/
class FITKCoreAPI FITKAbstractGraph3DWidget : public FITKAbstractGraphWidget
{
public:
using FITKAbstractGraphWidget::FITKAbstractGraphWidget;
virtual ~FITKAbstractGraph3DWidget() = 0 ;
/**
* @brief
* @param[i] focalPoint
* @param[i] viewUp
* @param[i] position
* @author libaojun (libaojunqd@foxmail.com)
* @date 2024-03-14
*/
virtual void setView(double* focalPoint, double* viewUp, double* position);
/**
* @brief
* @param[i] v
* @author libaojun (libaojunqd@foxmail.com)
* @date 2024-06-13
*/
virtual void setView(FITKGraph3DStandardView v);
/**
* @brief
* @param[o] pos
* @param[o] focual
* @param[o] viewup
* @return true
* @return false
* @author libaojun (libaojunqd@foxmail.com)
* @date 2024-04-08
*/
virtual bool getView(double* pos, double* focual, double* viewup);
/**
* @brief
* @param[i] on
* @author libaojun (libaojunqd@foxmail.com)
* @date 2024-03-14
*/
virtual void setParallelProjection(bool on = true);
};
/**
* @brief
* @author libaojun (libaojunqd@foxmail.com)
* @date 2024-04-08
*/
class FITKCoreAPI FITKAbstractGraph2DWidget : public FITKAbstractGraphWidget
{
public:
using FITKAbstractGraphWidget::FITKAbstractGraphWidget;
virtual ~FITKAbstractGraph2DWidget() = 0 ;
};
}
#endif