Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkSlicesCoordinator.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 
17 #include <mitkSlicesCoordinator.h>
18 
19 #include <mitkApplicationCursor.h>
20 
21 namespace mitk
22 {
23  SlicesCoordinator::SlicesCoordinator() : m_LinkPlanes(true), m_MouseCursorSet(false) {}
26  {
27  if (!snc)
28  return;
29 
30  m_SliceNavigationControllers.push_back(snc);
31 
32  OnSliceControllerAdded(snc); // notify
33  }
34 
36  {
37  if (!snc)
38  return;
39 
40  // see, whether snc is in our list
41  SNCVector::iterator iter;
42  for (iter = m_SliceNavigationControllers.begin(); iter != m_SliceNavigationControllers.end(); ++iter)
43  if (*iter == snc)
44  break;
45 
46  // if found, remove from list
47  if (iter != m_SliceNavigationControllers.end())
48  {
49  m_SliceNavigationControllers.erase(iter);
50 
52  }
53  }
54 
56  {
57  if (m_MouseCursorSet)
58  {
60  m_MouseCursorSet = false;
61  }
62  }
63 
64  void SlicesCoordinator::SetMouseCursor(const char *xpm[], int hotspotX, int hotspotY)
65  {
66  // Remove previously set mouse cursor
67  if (m_MouseCursorSet)
68  {
70  }
71 
72  ApplicationCursor::GetInstance()->PushCursor(xpm, hotspotX, hotspotY);
73  m_MouseCursorSet = true;
74  }
75 
77  {
78  // implement in subclasses
79  }
80 
82  {
83  // implement in subclasses
84  }
85 
86 } // namespace
virtual void OnSliceControllerAdded(SliceNavigationController *snc)
DataCollection - Class to facilitate loading/accessing structured data.
void PopCursor()
Restore the previous cursor.
void ResetMouseCursor()
Resets the mouse cursor (if modified by the SlicesCoordinator) to its original state.
Controls the selection of the slice the associated BaseRenderer will display.
void SetMouseCursor(const char *xpm[], int hotspotX, int hotspotY)
Sets the specified mouse cursor.
static ApplicationCursor * GetInstance()
This class is a singleton.
void RemoveSliceController(SliceNavigationController *snc)
void PushCursor(const char *XPM[], int hotspotX=-1, int hotspotY=-1)
Change the current application cursor.
SlicesCoordinator()
Default Constructor.
virtual void OnSliceControllerRemoved(SliceNavigationController *snc)
void AddSliceController(SliceNavigationController *snc)