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()
96 CoordinateSystem space = mSpaceSelector->getValue();
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;