44 mAcquisitionService(acquisitionService),
45 mDrawAqquisitionIn3D(true)
47 QVBoxLayout* mVerticalLayout =
new QVBoxLayout(
this);
51 mSelectRecordSession.reset(
new SelectRecordSession(mOptions, acquisitionService, services));
52 connect(mSelectRecordSession->getSessionSelector().get(), &
StringProperty::changed,
this, &RecordTrackingWidget::onMergeChanged);
55 "Merge new recording with selected recorded session",
57 connect(mMergeWithExistingSession.get(), &
BoolProperty::changed,
this, &RecordTrackingWidget::onMergeChanged);
60 mRecordSessionWidget =
new RecordSessionWidget(mAcquisitionService,
this, context, category);
62 mVerticalLayout->setMargin(0);
66 mVerticalLayout->addWidget(mToolSelectorWidget);
67 mVerticalLayout->addWidget(mRecordSessionWidget);
68 mVerticalLayout->addWidget(mMergeWithExistingSessionWidget);
69 mVerticalLayout->addWidget(
new LabeledComboBoxWidget(
this, mSelectRecordSession->getSessionSelector()));
72 connect(mObscuredListener.get(), SIGNAL(obscured(
bool)),
this, SLOT(obscuredSlot(
bool)));
77 mToolSelectorWidget->setVisible(on);
82 return mSelectRecordSession->getSessionSelector();
85 void RecordTrackingWidget::acquisitionStarted()
89 if(!mDrawAqquisitionIn3D)
95 if (!mMergeWithExistingSession->getValue())
96 activeRep3D->getTracer()->clear();
97 activeRep3D->getTracer()->setColor(QColor(
"magenta"));
98 activeRep3D->getTracer()->start();
102 void RecordTrackingWidget::acquisitionStopped()
104 QString newUid = mAcquisitionService->getLatestSession()->getUid();
105 mSelectRecordSession->getSessionSelector()->setValue(newUid);
107 mServices->patient()->autoSave();
112 activeRep3D->getTracer()->stop();
114 mRecordingTool.reset();
119 void RecordTrackingWidget::acquisitionCancelled()
124 activeRep3D->getTracer()->stop();
125 activeRep3D->getTracer()->clear();
127 mRecordingTool.reset();
130 void RecordTrackingWidget::onMergeChanged()
132 QString mergeSession =
"";
133 if (mMergeWithExistingSession->getValue())
134 mergeSession = mSelectRecordSession->getSessionSelector()->getValue();
141 return mServices->view()->get3DReps(0, 0)->findFirst<
ToolRep3D>(mRecordingTool);
144 void RecordTrackingWidget::obscuredSlot(
bool obscured)
147 mAcquisitionService->cancelRecord();
166 mSelectRecordSession->setVisible(!obscured);
169 void RecordTrackingWidget::onToolChanged()
171 mSelectRecordSession->setTool(mToolSelector->getTool());
177 ToolPtr retval = mToolSelector->getTool();
180 retval = mServices->tracking()->getActiveTool();
182 mToolSelector->setValue(retval->getUid());
190 ToolPtr tool = mToolSelector->getTool();
193 mSelectRecordSession->setTool(tool);
196 ToolPtr baseTool = tool->getBaseTool();
198 mSelectRecordSession->setTool(baseTool);
204 return mSelectRecordSession->getRecordedTrackerData_prMt();
210 ToolPtr tool = mToolSelector->getTool();
212 return RecordedTrackerData_prMt;
213 Transform3D tMs = tool->getCalibration_sMt().inverse();
216 for(TimedTransformMap::iterator iter=RecordedTrackerData_prMs.begin(); iter!=RecordedTrackerData_prMs.end(); ++iter)
217 iter->second = iter->second*tMs;
219 return RecordedTrackerData_prMs;
224 if(!mMergeWithExistingSessionWidget->isHidden())
225 mMergeWithExistingSessionWidget->hide();
230 mDrawAqquisitionIn3D = draw;
static BoolPropertyPtr initialize(const QString &uid, QString name, QString help, bool value, QDomNode root=QDomNode())
void acquisitionStopped()
boost::shared_ptr< class AcquisitionService > AcquisitionServicePtr
boost::shared_ptr< class VisServices > VisServicesPtr
Transform3D Transform3D
Transform3D is a representation of an affine 3D transform.
void activeToolChanged(const QString &uId)
boost::shared_ptr< class StringProperty > StringPropertyPtr
void changed()
emit when the underlying data value is changed: The user interface will be updated.
boost::shared_ptr< class ToolRep3D > ToolRep3DPtr
Helper class for xml files used to store ssc/cx data.
std::map< double, Transform3D > TimedTransformMap
Namespace for all CustusX production code.
boost::shared_ptr< class Tool > ToolPtr