当我尝试构建VTK项目时,它向我显示此错误:

class 'vtkTexture' has no member named 'SetInput' texture->SetInput(imgRedear->GetOutput());

码:
vtkTexture* ManipFile3D::plaquageTexture(QString nameTex)
{
    vtkBMPReader* imgRedear = vtkBMPReader::New();
    imgRedear->SetFileName(nameTex);
    imgRedear->ReleaseDataFlagOn();
    imgRedear->Update();
    vtkTexture* texture = vtkTexture::New();
    texture->SetInput(imgRedear->GetOutput());
    texture->InterpolateOn();
    texture->ReleaseDataFlagOn();
    return texture;
 }

最佳答案

看来您正在使用vtk 6(需要SetInputData)和为vtk 5(使用SetInput)编写的代码。参见vtk.org/Wiki/VTK/VTK_6_Migration/Replacement_of_SetInput

关于c++ - 我尝试在linuxLite上使用qt creator运行qt-vtk-project,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/28585408/

10-11 22:43