00001 /*========================================================================= 00002 00003 Program: Medical Imaging & Interaction Toolkit 00004 Language: C++ 00005 Date: $Date$ 00006 Version: $Revision$ 00007 00008 Copyright (c) German Cancer Research Center, Division of Medical and 00009 Biological Informatics. All rights reserved. 00010 See MITKCopyright.txt or https://www.mitk.org/copyright.html for details. 00011 00012 This software is distributed WITHOUT ANY WARRANTY; without even 00013 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00014 PURPOSE. See the above copyright notices for more information. 00015 00016 =========================================================================*/ 00017 00018 00019 #include "mitkEvent.h" 00020 #include "mitkVtkPropRenderer.h" 00021 #include "mitkTestingMacros.h" 00022 #include "mitkGlobalInteraction.h" 00023 00024 00025 int mitkEventTest(int /*argc*/, char* /*argv*/[]) 00026 { 00027 MITK_TEST_BEGIN("Event") 00028 00029 // Global interaction must(!) be initialized if used 00030 mitk::GlobalInteraction::GetInstance()->Initialize("global"); 00031 00032 vtkRenderWindow* renWin = vtkRenderWindow::New(); 00033 mitk::VtkPropRenderer::Pointer renderer = mitk::VtkPropRenderer::New( "ContourRenderer",renWin, mitk::RenderingManager::GetInstance() ); 00034 00035 //Create Event 00036 mitk::Event * event = new mitk::Event(renderer, 0, 1, 2, 3); 00037 00038 //check Get... 00039 MITK_TEST_CONDITION_REQUIRED( 00040 event->GetSender() == renderer || 00041 event->GetType() == 0 || 00042 event->GetButton() == 1 || 00043 event->GetButtonState() == 2 || 00044 event->GetKey() == 3 00045 , "Checking Get methods of mitk::Event"); 00046 00047 renWin->Delete(); 00048 delete event; 00049 00050 // always end with this! 00051 MITK_TEST_END() 00052 00053 00054 }