35 #include <QHBoxLayout> 47 mInternalUpdate =
false;
56 QWidget* widget = this->
newWidget(
"frame_metric");
57 QVBoxLayout* topLayout =
new QVBoxLayout(widget);
58 QHBoxLayout* hLayout =
new QHBoxLayout;
59 hLayout->setMargin(0);
60 topLayout->setMargin(0);
61 topLayout->addLayout(hLayout);
65 "Select coordinate system to store position in.");
66 mSpaceSelector->setSpaceProvider(
mServices->spaceProvider());
70 connect(mFrameWidget, SIGNAL(changed()),
this, SLOT(frameWidgetChangedSlot()));
71 topLayout->addWidget(mFrameWidget);
73 QPushButton* sampleButton =
new QPushButton(
"Sample");
74 sampleButton->setToolTip(
"Set the position equal to the current tool tip position.");
75 hLayout->addWidget(sampleButton);
77 connect(mSpaceSelector.get(), SIGNAL(valueWasSet()),
this, SLOT(spaceSelected()));
78 connect(sampleButton, SIGNAL(clicked()),
this, SLOT(moveToToolPosition()));
102 return mData->getSpace().toString();
106 void FrameMetricWrapper::moveToToolPosition()
109 Transform3D qMt =
mServices->spaceProvider()->getActiveToolTipTransform(mData->getSpace(),
true);
110 mData->setFrame(qMt);
113 void FrameMetricWrapper::spaceSelected()
119 mData->setSpace(space);
122 void FrameMetricWrapper::frameWidgetChangedSlot()
127 mData->setFrame(matrix);
132 mInternalUpdate =
true;
133 mSpaceSelector->setValue(mData->getSpace());
134 mFrameWidget->
setMatrix(mData->getFrame());
135 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.