NorMIT-nav  22.09
An IGT application
cxActiveImageProxy.cpp
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 #include "cxActiveImageProxy.h"
13 #include "cxImage.h"
14 #include "cxLandmark.h"
15 #include "cxActiveData.h"
16 
17 namespace cx
18 {
19 
21  mActiveData(activeData)
22 {
23  connect(mActiveData.get(), &ActiveData::activeImageChanged, this,
24  &ActiveImageProxy::activeImageChangedSlot);
25  connect(mActiveData.get(), &ActiveData::activeImageChanged, this,
27 }
28 
30 {
31  disconnect(mActiveData.get(), &ActiveData::activeImageChanged, this,
32  &ActiveImageProxy::activeImageChangedSlot);
33  disconnect(mActiveData.get(), &ActiveData::activeImageChanged, this,
35 }
36 
37 void ActiveImageProxy::activeImageChangedSlot(const QString& uid)
38 {
39  if (mImage && mImage->getUid() == uid)
40  return;
41 
42  if (mImage)
43  {
44  disconnect(mImage.get(), SIGNAL(transformChanged()), this, SIGNAL(transformChanged()));
45  disconnect(mImage.get(), SIGNAL(propertiesChanged()), this, SIGNAL(propertiesChanged()));
46  disconnect(mImage->getLandmarks().get(), SIGNAL(landmarkRemoved(QString)), this, SIGNAL(landmarkRemoved(QString)));
47  disconnect(mImage->getLandmarks().get(), SIGNAL(landmarkAdded(QString)), this, SIGNAL(landmarkAdded(QString)));
48  disconnect(mImage.get(), SIGNAL(vtkImageDataChanged()), this, SIGNAL(vtkImageDataChanged()));
49  disconnect(mImage.get(), SIGNAL(transferFunctionsChanged()), this, SIGNAL(transferFunctionsChanged()));
50  disconnect(mImage.get(), SIGNAL(clipPlanesChanged()), this, SIGNAL(clipPlanesChanged()));
51  disconnect(mImage.get(), SIGNAL(cropBoxChanged()), this, SIGNAL(cropBoxChanged()));
52  }
53  mImage = mActiveData->getActive<Image>();
54  if (mImage)
55  {
56  connect(mImage.get(), SIGNAL(transformChanged()), this, SIGNAL(transformChanged()));
57  connect(mImage.get(), SIGNAL(propertiesChanged()), this, SIGNAL(propertiesChanged()));
58  connect(mImage->getLandmarks().get(), SIGNAL(landmarkRemoved(QString)), this, SIGNAL(landmarkRemoved(QString)));
59  connect(mImage->getLandmarks().get(), SIGNAL(landmarkAdded(QString)), this, SIGNAL(landmarkAdded(QString)));
60  connect(mImage.get(), SIGNAL(vtkImageDataChanged()), this, SIGNAL(vtkImageDataChanged()));
61  connect(mImage.get(), SIGNAL(transferFunctionsChanged()), this, SIGNAL(transferFunctionsChanged()));
62  connect(mImage.get(), SIGNAL(clipPlanesChanged()), this, SIGNAL(clipPlanesChanged()));
63  connect(mImage.get(), SIGNAL(cropBoxChanged()), this, SIGNAL(cropBoxChanged()));
64  }
65 }
66 
67 } //namespace cx
cxActiveData.h
cx
Namespace for all CustusX production code.
Definition: cx_dev_group_definitions.h:13
cx::ActiveImageProxy::activeImageChanged
void activeImageChanged(const QString &uid)
The original image changed signal from DataManager.
cxImage.h
cx::ActiveImageProxy::vtkImageDataChanged
void vtkImageDataChanged()
cxActiveImageProxy.h
cx::ActiveImageProxy::transformChanged
void transformChanged()
cx::ActiveImageProxy::transferFunctionsChanged
void transferFunctionsChanged()
cx::ActiveImageProxy::~ActiveImageProxy
~ActiveImageProxy()
Definition: cxActiveImageProxy.cpp:29
cx::ActiveImageProxy::clipPlanesChanged
void clipPlanesChanged()
cx::ActiveImageProxy::landmarkRemoved
void landmarkRemoved(QString uid)
cx::ActiveImageProxy::ActiveImageProxy
ActiveImageProxy(ActiveDataPtr activeData)
Definition: cxActiveImageProxy.cpp:20
cx::ActiveData::activeImageChanged
void activeImageChanged(const QString &uId)
cx::ActiveImageProxy::landmarkAdded
void landmarkAdded(QString uid)
cx::ActiveDataPtr
boost::shared_ptr< class ActiveData > ActiveDataPtr
Definition: cxColorWidget.h:21
cx::ActiveImageProxy::propertiesChanged
void propertiesChanged()
cx::ActiveImageProxy::cropBoxChanged
void cropBoxChanged()
cxLandmark.h