Medical Imaging Interaction Toolkit  2018.4.99-389bf124
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 (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #include <mitkSlicesCoordinator.h>
14 
15 #include <mitkApplicationCursor.h>
16 
17 namespace mitk
18 {
19  SlicesCoordinator::SlicesCoordinator() : m_LinkPlanes(true), m_MouseCursorSet(false) {}
22  {
23  if (!snc)
24  return;
25 
26  m_SliceNavigationControllers.push_back(snc);
27 
28  OnSliceControllerAdded(snc); // notify
29  }
30 
32  {
33  if (!snc)
34  return;
35 
36  // see, whether snc is in our list
37  SNCVector::iterator iter;
38  for (iter = m_SliceNavigationControllers.begin(); iter != m_SliceNavigationControllers.end(); ++iter)
39  if (*iter == snc)
40  break;
41 
42  // if found, remove from list
43  if (iter != m_SliceNavigationControllers.end())
44  {
45  m_SliceNavigationControllers.erase(iter);
46 
48  }
49  }
50 
52  {
53  if (m_MouseCursorSet)
54  {
56  m_MouseCursorSet = false;
57  }
58  }
59 
60  void SlicesCoordinator::SetMouseCursor(const char *xpm[], int hotspotX, int hotspotY)
61  {
62  // Remove previously set mouse cursor
63  if (m_MouseCursorSet)
64  {
66  }
67 
68  ApplicationCursor::GetInstance()->PushCursor(xpm, hotspotX, hotspotY);
69  m_MouseCursorSet = true;
70  }
71 
73  {
74  // implement in subclasses
75  }
76 
78  {
79  // implement in subclasses
80  }
81 
82 } // 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)