/*========================================================================= Program: Visualization Toolkit Module: TestQtWithMSAA.cxx Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen All rights reserved. See Copyright.txt or http://www.kitware.com/Copyright.htm for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notice for more information. =========================================================================*/ // Tests QVTKOpenGLStereoWidget/QVTKOpenGLNativeWidget/QVTKOpenGLWindow with MSAA #include "TestQtCommon.h" #include "vtkActor.h" #include "vtkGenericOpenGLRenderWindow.h" #include "vtkNew.h" #include "vtkPolyDataMapper.h" #include "vtkProperty.h" #include "vtkRenderer.h" #include "vtkSphereSource.h" #include "vtkTesting.h" #include #include int TestQtWithMSAA(int argc, char* argv[]) { // disable multisampling globally. vtkOpenGLRenderWindow::SetGlobalMaximumNumberOfMultiSamples(0); auto type = detail::select_widget(argc, argv); // setup default format, if needed. detail::set_default_format(type); QApplication app(argc, argv); vtkNew vtktesting; vtktesting->AddArguments(argc, argv); vtkNew window; window->SetMultiSamples(8); // enable multisampling auto widgetOrWindow = detail::create_widget_or_window(type, window); vtkNew ren; ren->SetGradientBackground(true); ren->SetBackground2(0.7, 0.7, 0.7); window->AddRenderer(ren); vtkNew sphere; vtkNew mapper; mapper->SetInputConnection(sphere->GetOutputPort()); vtkNew actor; actor->SetMapper(mapper); actor->GetProperty()->SetRepresentationToWireframe(); ren->AddActor(actor); detail::show(widgetOrWindow, QSize(300, 300)); vtktesting->SetRenderWindow(window); int retVal = vtktesting->RegressionTest(10); switch (retVal) { case vtkTesting::DO_INTERACTOR: return QApplication::exec(); case vtkTesting::FAILED: case vtkTesting::NOT_RUN: return EXIT_FAILURE; } return EXIT_SUCCESS; }