天天看點

Disable vtk,itk的報警提示框

itk 使用重定向輸出的方式禁止彈出,代碼參考itk的使用示例  
  using myFileOutputWindow = itk::FileOutputWindow;      
myFileOutputWindow::Pointer window = myFileOutputWindow::New();      
window->FlushOn();      
// Set the singelton instance      
itk::OutputWindow::SetInstance(window);      
// Generic output      
itkGenericOutputMacro("This should be in the file: " << window->GetFileName());      
// Warning      
using TransformType = itk::ScaleTransform<float, 2>;      
TransformType::Pointer             transform = TransformType::New();      
TransformType::FixedParametersType parameters(3);      
transform->SetFixedParameters(parameters);      

vtk隻用庫自帶的函數即可

vtkOutputWindow::SetGlobalWarningDisplay(0);