学习VTK绘制直线
通过vtkLineSource生成直线,主要控制量包含: (1) 起止点 (2)直线分段数 (3)设置输出点的精度
SetPoint1 | 设置起点 |
SetPoint2 | 设置终点 |
SetPoints | 设置点 |
SetResolution | 设置直线的分段数 |
SetOutputPointsPrecision | 设置输出点精度,单精度浮点数/双精度浮点数 |
/*
* ModuleName: 模块名称
* Description:
* 参考代码:https://lorensen.github.io/VTKExamples/site/Cxx/GeometricObjects/Line/
* Author: hsw
* Date: 2020-03-15
*
*/
// QT
#include <QMainWindow>
#include <QDebug>
// VTK
#include <vtkActor.h>
#include <vtkLineSource.h>
#include <vtkNamedColors.h>
#include <vtkPolyData.h>
#include <vtkPolyDataMapper.h>
#include <vtkProperty.h>
#include <vtkRenderer.h>
#include <vtkRenderWindow.h>
#include <vtkRenderWindowIntera