00001 /*========================================================================= 00002 00003 Program: Medical Imaging & Interaction Toolkit 00004 Language: C++ 00005 Date: $Date: 2010-03-31 16:40:27 +0200 (Mi, 31 Mrz 2010) $ 00006 Version: $Revision: 21975 $ 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 #include "mitkWiiMoteActivator.h" 00019 00020 //#include "mitkWiiMoteAddOn.h" 00021 00022 #include "mitkGlobalInteraction.h" 00023 00024 mitk::WiiMoteActivator::WiiMoteActivator() 00025 : m_IsRegistered(false) 00026 //, m_Controller(mitk::WiiMoteVtkCameraController::New()) 00027 { 00028 } 00029 00030 mitk::WiiMoteActivator::~WiiMoteActivator() 00031 { 00032 } 00033 00034 bool mitk::WiiMoteActivator::RegisterInputDevice() 00035 { 00036 //if(!this->m_IsRegistered) 00037 //{ 00038 // mitk::WiiMoteAddOn::GetInstance()->ActivateWiiMotes(); 00039 // mitk::GlobalInteraction::GetInstance()->AddListener(m_Controller); 00040 // mitk::EventMapper* eventMapper(mitk::GlobalInteraction::GetInstance()->GetEventMapper()); 00041 // if (eventMapper != NULL) 00042 // { 00043 // eventMapper->AddEventMapperAddOn(mitk::WiiMoteAddOn::GetInstance()); 00044 // this->m_IsRegistered = true; 00045 // } 00046 // else 00047 // { 00048 // MITK_ERROR << "Eventmapper is not initialized!"; 00049 // return false; 00050 // } 00051 //} 00052 return true; 00053 } 00054 00055 bool mitk::WiiMoteActivator::UnRegisterInputDevice() 00056 { 00057 /* if(this->m_IsRegistered) 00058 { 00059 mitk::WiiMoteAddOn::GetInstance()->DeactivateWiiMotes(); 00060 mitk::GlobalInteraction::GetInstance()->RemoveListener(m_Controller); 00061 mitk::EventMapper* eventMapper(mitk::GlobalInteraction::GetInstance()->GetEventMapper()); 00062 00063 if(eventMapper != NULL) 00064 { 00065 eventMapper->RemoveEventMapperAddOn(mitk::WiiMoteAddOn::GetInstance()); 00066 this->m_IsRegistered = false; 00067 } 00068 else 00069 { 00070 MITK_ERROR << "Eventmapper is not initialized!"; 00071 return false; 00072 } 00073 }*/ 00074 00075 return true; 00076 }