虚线 VTK C++

问题描述 投票:0回答:0

我是 vtk 的新手,我正在尝试绘制虚线,我使用了该代码,但仍然很稳定

double x1 = 0.0;
double y1 = 0.0;
double x2 = 1.0;
double y2 = 1.0;
linesource->SetPoint1(x1, y1, 0.0);
linesource->SetPoint2(x2, y2, 0.0);
linesource->Update();
linemapper->SetInputConnection(linesource->GetOutputPort());
lineactor->SetMapper(linemapper);
lineactor->GetProperty()->SetColor(1.0, 0.0, 0.0); // Set line color to red
renderer->AddActor(lineactor);
vtkProperty* lineProperty = lineactor->GetProperty();
lineProperty->SetLineStipplePattern(0xf0f0);
lineProperty->SetLineStippleRepeatFactor(5);
c++ qt vtk
© www.soinside.com 2019 - 2024. All rights reserved.