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.
155 lines
4.4 KiB
C++
155 lines
4.4 KiB
C++
/**********************************************************************
|
|
* @file FITKAlgGlyph.h
|
|
* @brief 图像符号算法
|
|
* @author BaGuijun (baguijun@163.com)
|
|
* @date 2024-09-23
|
|
*********************************************************************/
|
|
#ifndef _FITKAlgGlyph_H
|
|
#define _FITKAlgGlyph_H
|
|
|
|
#include "FITKInterfaceCFDPostAPI.h"
|
|
#include "FITKCFDPostMacros.hxx"
|
|
|
|
#include <vtkPolyDataAlgorithm.h>
|
|
#include <vtkSetGet.h>
|
|
#include <QString>
|
|
|
|
class vtkPolyData;
|
|
|
|
namespace Interface
|
|
{
|
|
/**
|
|
* @brief 图像符号算法
|
|
* @author BaGuijun (baguijun@163.com)
|
|
* @date 2024-09-24
|
|
*/
|
|
class FITKInterfaceCFDPostAPI FITKAlgGlyph :public vtkPolyDataAlgorithm
|
|
{
|
|
vtkTypeMacro(FITKAlgGlyph, vtkPolyDataAlgorithm);
|
|
/*
|
|
*brief 矢量名称
|
|
*/
|
|
AddProperty(QString, vectorName);
|
|
/*
|
|
*brief 箭头精度
|
|
*/
|
|
AddProperty(int, tipResolution, 6);
|
|
/*
|
|
*brief 箭头半径
|
|
*/
|
|
AddProperty(double, tipRadius, 0.2);
|
|
/*
|
|
*brief 箭头长度
|
|
*/
|
|
AddProperty(double, tipLength, 0.1);
|
|
/*
|
|
*brief 箭柄维度
|
|
*/
|
|
AddProperty(int, shaftResolution, 6);
|
|
/*
|
|
*brief 箭柄半径
|
|
*/
|
|
AddProperty(double, shaftRadius, 0.1);
|
|
/*
|
|
*brief 缩放比例
|
|
*/
|
|
AddProperty(double, scaleFactor, 0.01);
|
|
/*
|
|
*brief 使用点数据
|
|
*/
|
|
AddProperty(bool, pointDataUsed, true);
|
|
/*
|
|
*brief 点的数量
|
|
*/
|
|
AddProperty(int, pointNum, 0);
|
|
/*
|
|
*brief 最大采样点
|
|
*/
|
|
AddProperty(int, maxNumber, 100000);
|
|
/*
|
|
*brief 箭头比例模式:0-scalar,1-vector,2-vectorcomponent,3-off
|
|
*/
|
|
AddProperty(int, scaleMode, 1);
|
|
public:
|
|
/**
|
|
* @brief 创建接口
|
|
* @return FITKAlgGlyph*
|
|
* @author BaGuijun (baguijun@163.com)
|
|
* @date 2024-09-24
|
|
*/
|
|
static FITKAlgGlyph* New();
|
|
|
|
void PrintSelf(ostream& os, vtkIndent indent);
|
|
protected:
|
|
/**
|
|
* @brief 构造函数
|
|
* @author BaGuijun (baguijun@163.com)
|
|
* @date 2024-09-24
|
|
*/
|
|
FITKAlgGlyph();
|
|
/**
|
|
* @brief 析构函数
|
|
* @author BaGuijun (baguijun@163.com)
|
|
* @date 2024-09-24
|
|
*/
|
|
~FITKAlgGlyph();
|
|
/**
|
|
* @brief 输出端口说明
|
|
* @param[i] port 端口
|
|
* @param[i] info 信息
|
|
* @return int
|
|
* @author BaGuijun (baguijun@163.com)
|
|
* @date 2024-09-23
|
|
*/
|
|
int FillOutputPortInformation(int port, vtkInformation* info) override;
|
|
/**
|
|
* @brief 输出端口说明
|
|
* @param[i] port 端口
|
|
* @param[i] info 信息
|
|
* @return int
|
|
* @author BaGuijun (baguijun@163.com)
|
|
* @date 2024-09-23
|
|
*/
|
|
int FillInputPortInformation(int port, vtkInformation* info) override;
|
|
/**
|
|
* @brief 处理外部请求
|
|
* @param[i] request
|
|
* @param[i] inputVector
|
|
* @param[i] outputVector
|
|
* @return int
|
|
* @author BaGuijun (baguijun@163.com)
|
|
* @date 2024-09-23
|
|
*/
|
|
int ProcessRequest(vtkInformation* request, vtkInformationVector** inputVector, vtkInformationVector* outputVector);
|
|
/**
|
|
* @brief 算法实现
|
|
* @param[i] request
|
|
* @param[i] inputVector
|
|
* @param[i] outputVector
|
|
* @return int
|
|
* @author BaGuijun (baguijun@163.com)
|
|
* @date 2024-09-23
|
|
*/
|
|
int RequestData(vtkInformation* request, vtkInformationVector** inputVector, vtkInformationVector* outputVector);
|
|
private:
|
|
/**
|
|
* @brief 提取点
|
|
* @param[i] inputData 输入数据
|
|
* @return bool 是否成功
|
|
* @author BaGuijun (baguijun@163.com)
|
|
* @date 2024-09-23
|
|
*/
|
|
bool extractPoints(vtkDataSet* inputData);
|
|
|
|
void extractPointDataArray(vtkDataSet* inputData);
|
|
private:
|
|
/**
|
|
* @brief 数据对象
|
|
* @author BaGuijun (baguijun@163.com)
|
|
* @date 2024-09-23
|
|
*/
|
|
vtkPolyData* _polyData = nullptr;
|
|
};
|
|
}
|
|
#endif
|