/*========================================================================= Program: Visualization Toolkit Module: TestButtonWidget.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. =========================================================================*/ // Test vtkProp3DButtonRepresentation #include "vtkObjectFactory.h" #include "vtkButtonWidget.h" #include "vtkNew.h" #include "vtkProp3DButtonRepresentation.h" #include "vtkRenderWindow.h" #include "vtkRenderWindowInteractor.h" #include "vtkRenderer.h" // ---------------------------------------------------------------------------- bool TestUnMapped(); // ---------------------------------------------------------------------------- int TestProp3DButtonRepresentation(int vtkNotUsed(argc), char* vtkNotUsed(argv)[]) { vtkObjectFactory::SetAllEnableFlags( false, "vtkRenderWindowInteractor", "vtkTestingInteractor"); bool res = true; res = TestUnMapped() && res; return res ? EXIT_SUCCESS : EXIT_FAILURE; } // ---------------------------------------------------------------------------- bool TestUnMapped() { vtkNew renderWindow; vtkNew iren; iren->SetRenderWindow(renderWindow); vtkNew representation1; vtkNew buttonWidget1; buttonWidget1->SetInteractor(iren); buttonWidget1->SetRepresentation(representation1); buttonWidget1->SetEnabled(1); vtkNew renderer; renderWindow->AddRenderer(renderer); vtkNew representation2; vtkNew buttonWidget2; buttonWidget2->SetInteractor(iren); buttonWidget2->SetRepresentation(representation2); buttonWidget2->SetEnabled(1); iren->Initialize(); vtkNew representation3; vtkNew buttonWidget3; buttonWidget3->SetInteractor(iren); buttonWidget3->SetRepresentation(representation3); buttonWidget3->SetEnabled(1); iren->Start(); vtkNew representation4; vtkNew buttonWidget4; buttonWidget4->SetInteractor(iren); buttonWidget4->SetRepresentation(representation4); buttonWidget4->SetEnabled(1); return true; }