33 #include "boost/bind.hpp"
34 #include <QListWidget>
35 #include <QTableWidget>
54 BaseWidget(parent,
"ClipperWidget",
"Clipper"),
56 mInitializedWithClipper(false)
59 this->setEnabled(
false);
81 mLayout =
new QVBoxLayout(
this);
148 QHBoxLayout *layout =
new QHBoxLayout();
160 QHBoxLayout *layout =
new QHBoxLayout();
161 layout->addWidget(toolSelectorWidget);
169 QGroupBox *groupBox =
new QGroupBox(
"Structures to clip");
170 QVBoxLayout *layout =
new QVBoxLayout();
171 QHBoxLayout *selectCheckBoxes =
new QHBoxLayout();
178 layout->addLayout(selectCheckBoxes);
183 groupBox->setLayout(layout);
200 this->setEnabled(
true);
205 this->setEnabled(
false);
217 tool =
mServices->tracking()->getActiveTool();
247 void ClipperWidget::updateCheckBoxFromClipper(QCheckBox *checkbox,
DataPtr data)
251 std::map<QString, DataPtr> datas =
mClipper->getDatas();
252 bool checked = datas.count(data->getUid());
253 checkbox->setChecked(checked);
258 std::map<QString, DataPtr> datas = this->
getDatas();
259 std::map<QString, DataPtr>::iterator iter = datas.begin();
263 for(; iter != datas.end(); ++iter)
266 QCheckBox *checkbox =
new QCheckBox();
267 checkbox->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
270 QTableWidgetItem *descriptionItem =
new QTableWidgetItem(data->getName());
274 connect(checkbox, &QCheckBox::clicked,
this, func);
275 this->updateCheckBoxFromClipper(checkbox, data);
283 this->setEnabled(
false);
287 std::map<QString, DataPtr> datas = this->
getDatas();
292 QStringList horizontalHeaders;
293 horizontalHeaders <<
"Apply clipper" <<
"Object to be clipped";
304 QStringList dataTypes;
306 dataTypes <<
"image";
310 dataTypes <<
"trackedStream";
312 dataTypes <<
".*Metric$";
313 QString typeRegExp = dataTypes.join(
'|');
321 std::map<QString, DataPtr> datas =
mServices->patient()->getData();
328 bool checked = checkBox->isChecked();
338 std::map<QString, DataPtr> datas = this->
getDatas();
339 std::map<QString, DataPtr>::iterator iter = datas.begin();
341 for(; iter != datas.end(); ++iter)
void dataAddedOrRemoved()
boost::shared_ptr< class VisServices > VisServicesPtr
static std::map< QString, DataPtr > filterOnType(std::map< QString, DataPtr > input, QString regexp)
boost::shared_ptr< class Data > DataPtr
void activeToolChanged(const QString &uId)
void invertPlane(bool on)
void changed()
emit when the underlying data value is changed: The user interface will be updated.
boost::shared_ptr< class InteractiveClipper > InteractiveClipperPtr
boost::shared_ptr< class Tool > ToolPtr