Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkGetSimulationService.cpp
Go to the documentation of this file.
1 /*===================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
18 #include <mitkISimulationService.h>
19 #include <usModuleContext.h>
20 #include <usServiceReference.h>
21 
22 mitk::ISimulationService* mitk::GetSimulationService(us::ModuleContext* moduleContext)
23 {
24  if (moduleContext == NULL)
25  return NULL;
26 
27  us::ServiceReference<mitk::ISimulationService> serviceReference = moduleContext->GetServiceReference<mitk::ISimulationService>();
28  return moduleContext->GetService<mitk::ISimulationService>(serviceReference);
29 }
MITKSIMULATION_EXPORT ISimulationService * GetSimulationService(us::ModuleContext *moduleContext=us::GetModuleContext())