35 #include <QHBoxLayout>
45 MetricBase(visualizationService, patientModelService),
48 mInternalUpdate =
false;
49 connect(mData.get(), SIGNAL(transformChanged()),
this, SLOT(dataChangedSlot()));
50 connect(
mPatientModelService.get(), SIGNAL(dataAddedOrRemoved()),
this, SLOT(dataChangedSlot()));
55 disconnect(
mPatientModelService.get(), SIGNAL(dataAddedOrRemoved()),
this, SLOT(dataChangedSlot()));
60 QWidget* widget =
new QWidget;
61 QVBoxLayout* topLayout =
new QVBoxLayout(widget);
62 QHBoxLayout* hLayout =
new QHBoxLayout;
63 hLayout->setMargin(0);
64 topLayout->setMargin(0);
65 topLayout->addLayout(hLayout);
69 "Select coordinate system to store position in.");
74 connect(mData.get(), SIGNAL(transformChanged()),
this, SLOT(dataChangedSlot()));
75 connect(mData.get(), SIGNAL(propertiesChanged()),
this, SLOT(dataChangedSlot()));
76 connect(mFrameWidget, SIGNAL(changed()),
this, SLOT(frameWidgetChangedSlot()));
77 topLayout->addWidget(mFrameWidget);
79 QPushButton* sampleButton =
new QPushButton(
"Sample");
80 sampleButton->setToolTip(
"Set the position equal to the current tool tip position.");
81 hLayout->addWidget(sampleButton);
83 connect(mSpaceSelector.get(), SIGNAL(valueWasSet()),
this, SLOT(spaceSelected()));
84 connect(sampleButton, SIGNAL(clicked()),
this, SLOT(moveToToolPosition()));
88 this->dataChangedSlot();
110 return mData->getSpace().toString();
114 void FrameMetricWrapper::moveToToolPosition()
118 mData->setFrame(qMt);
121 void FrameMetricWrapper::spaceSelected()
125 CoordinateSystem space = mSpaceSelector->getValue();
127 mData->setSpace(space);
130 void FrameMetricWrapper::dataChangedSlot()
134 void FrameMetricWrapper::frameWidgetChangedSlot()
139 mData->setFrame(matrix);
144 mInternalUpdate =
true;
145 mSpaceSelector->setValue(mData->getSpace());
146 mFrameWidget->
setMatrix(mData->getFrame());
147 mInternalUpdate =
false;
boost::shared_ptr< class FrameMetric > FrameMetricPtr
Transform3D Transform3D
Transform3D is a representation of an affine 3D transform.
boost::shared_ptr< DataMetric > DataMetricPtr
void addColorWidget(QVBoxLayout *layout)
static SpacePropertyPtr initialize(const QString &uid, QString name, QString help, Space value=Space(), std::vector< Space > range=std::vector< Space >(), QDomNode root=QDomNode())
QString prettyFormat(Vector3D val, int decimals, int fieldWidth)
FrameMetricWrapper(VisualizationServicePtr visualizationService, PatientModelServicePtr patientModelService, cx::FrameMetricPtr data)
PatientModelServicePtr mPatientModelService
virtual QString getType() const
virtual DataMetricPtr getData() const
virtual QString getArguments() const
boost::shared_ptr< class PatientModelService > PatientModelServicePtr
virtual QWidget * createWidget()
cxLogicManager_EXPORT SpaceProviderPtr spaceProvider()
virtual QString getValue() const
virtual ~FrameMetricWrapper()