14 #include <QHBoxLayout> 26 mInternalUpdate =
false;
35 QWidget* widget = this->
newWidget(
"frame_metric");
36 QVBoxLayout* topLayout =
new QVBoxLayout(widget);
37 QHBoxLayout* hLayout =
new QHBoxLayout;
38 hLayout->setMargin(0);
39 topLayout->setMargin(0);
40 topLayout->addLayout(hLayout);
44 "Select coordinate system to store position in.");
45 mSpaceSelector->setSpaceProvider(
mServices->spaceProvider());
49 connect(mFrameWidget, SIGNAL(changed()),
this, SLOT(frameWidgetChangedSlot()));
50 topLayout->addWidget(mFrameWidget);
52 QPushButton* sampleButton =
new QPushButton(
"Sample");
53 sampleButton->setToolTip(
"Set the position equal to the current tool tip position.");
54 hLayout->addWidget(sampleButton);
56 connect(mSpaceSelector.get(), SIGNAL(valueWasSet()),
this, SLOT(spaceSelected()));
57 connect(sampleButton, SIGNAL(clicked()),
this, SLOT(moveToToolPosition()));
81 return mData->getSpace().toString();
85 void FrameMetricWrapper::moveToToolPosition()
88 Transform3D qMt =
mServices->spaceProvider()->getActiveToolTipTransform(mData->getSpace(),
true);
92 void FrameMetricWrapper::spaceSelected()
98 mData->setSpace(space);
101 void FrameMetricWrapper::frameWidgetChangedSlot()
106 mData->setFrame(matrix);
111 mInternalUpdate =
true;
112 mSpaceSelector->setValue(mData->getSpace());
113 mFrameWidget->
setMatrix(mData->getFrame());
114 mInternalUpdate =
false;
boost::shared_ptr< class FrameMetric > FrameMetricPtr
boost::shared_ptr< class VisServices > VisServicesPtr
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(VisServicesPtr services, FrameMetricPtr data)
virtual QString getType() const
virtual DataMetricPtr getData() const
virtual QString getArguments() const
virtual QWidget * createWidget()
Identification of a Coordinate system.
virtual QString getValue() const
virtual ~FrameMetricWrapper()
QWidget * newWidget(QString objectName)
Namespace for all CustusX production code.