NorMIT-nav  2023.01.05-dev+develop.0da12
An IGT application
cxRegistrationHistoryWidget.h
Go to the documentation of this file.
1 /*=========================================================================
2 This file is part of CustusX, an Image Guided Therapy Application.
3 
4 Copyright (c) SINTEF Department of Medical Technology.
5 All rights reserved.
6 
7 CustusX is released under a BSD 3-Clause license.
8 
9 See Lisence.txt (https://github.com/SINTEFMedtek/CustusX/blob/master/License.txt) for details.
10 =========================================================================*/
11 
12 #ifndef CXREGISTRATIONHISTORYWIDGET_H_
13 #define CXREGISTRATIONHISTORYWIDGET_H_
14 
15 #include <vector>
16 #include <QtWidgets>
17 
19 #include "cxBaseWidget.h"
20 #include "cxRegServices.h"
21 
22 namespace cx
23 {
40 {
41  Q_OBJECT
42 
43 public:
44  RegistrationHistoryWidget(RegServicesPtr servicesPtr, QWidget* parent, bool compact = false);
46  virtual QString defaultWhatsThis() const;
47 
48 protected slots:
49  void rewindSlot();
50  void removeSlot();
51  void forwardSlot();
52  void fastForwardSlot();
53  void reconnectSlot();
54 
55  virtual void prePaintEvent();
56 protected:
57  virtual void showEvent(QShowEvent* event);
58  virtual void hideEvent(QCloseEvent* event);
59 
60 private:
62  void createControls(QHBoxLayout* layout);
63  QString debugDump();
64  template<class T>
65  QAction* createAction(QLayout* layout, QString iconName, QString text, QString tip, T slot);
66 
67  typedef std::multimap<QDateTime,QString> TimeMap;
68  typedef std::pair<QDateTime,QString> TimeMapPair;
69  typedef std::vector<RegistrationHistoryWidget::TimeMap::iterator> TimeMapIterators;
70  TimeMap generateRegistrationTimes();
71  QDateTime getActiveTime();
72  void setActiveTime(QDateTime active);
73  RegistrationHistoryWidget::TimeMapIterators findActiveRegistrations(TimeMap& times);
74 
75  QFrame* mGroup;
76  std::vector<RegistrationHistoryPtr> mHistories;
77  QAction* mRewindAction;
78  QAction* mRemoveAction;
79  QAction* mForwardAction;
80  QAction* mFastForwardAction;
81 
82  QLabel* mBehindLabel;
83  QLabel* mInFrontLabel;
84  QTextEdit* mTextEdit;
85 
86  std::vector<RegistrationHistoryPtr> getAllRegistrationHistories();
87  std::vector<RegistrationTransform> mergeHistory(const std::vector<RegistrationHistoryPtr>& allHistories);
88 
89  RegServicesPtr mServices;
90  RegistrationHistoryWidget::TimeMap::iterator findActiveRegistration(TimeMap &times);
91 };
92 
96 }//end namespace cx
97 
98 #endif /* CXREGISTRATIONHISTORYWIDGET_H_ */
cxBaseWidget.h
cx
Namespace for all CustusX production code.
Definition: cx_dev_group_definitions.h:13
cx::BaseWidget
Interface for QWidget which handles widgets uniformly for the system.
Definition: cxBaseWidget.h:88
cx::RegistrationHistoryWidget::rewindSlot
void rewindSlot()
Definition: cxRegistrationHistoryWidget.cpp:290
cx::RegistrationHistoryWidget::showEvent
virtual void showEvent(QShowEvent *event)
updates internal info before showing the widget
Definition: cxRegistrationHistoryWidget.cpp:104
cx::RegistrationHistoryWidget::removeSlot
void removeSlot()
Definition: cxRegistrationHistoryWidget.cpp:254
cx::RegistrationHistoryWidget::forwardSlot
void forwardSlot()
Definition: cxRegistrationHistoryWidget.cpp:366
cx::RegistrationHistoryWidget
Definition: cxRegistrationHistoryWidget.h:39
cx::RegistrationHistoryWidget::reconnectSlot
void reconnectSlot()
Definition: cxRegistrationHistoryWidget.cpp:127
cx::RegServicesPtr
boost::shared_ptr< class RegServices > RegServicesPtr
Definition: cxRegServices.h:20
cxRegistrationTransform.h
cx::RegistrationHistoryWidget::hideEvent
virtual void hideEvent(QCloseEvent *event)
disconnects stuff
Definition: cxRegistrationHistoryWidget.cpp:115
cx::RegistrationHistoryWidget::~RegistrationHistoryWidget
virtual ~RegistrationHistoryWidget()
Definition: cxRegistrationHistoryWidget.cpp:60
cx::RegistrationHistoryWidget::defaultWhatsThis
virtual QString defaultWhatsThis() const
Definition: cxRegistrationHistoryWidget.cpp:64
cx::RegistrationHistoryWidget::prePaintEvent
virtual void prePaintEvent()
Definition: cxRegistrationHistoryWidget.cpp:409
cxRegServices.h
cx::RegistrationHistoryWidget::fastForwardSlot
void fastForwardSlot()
Definition: cxRegistrationHistoryWidget.cpp:398