12 #include "boost/bind.hpp"
13 #include <QListWidget>
14 #include <QTableWidget>
34 BaseWidget(parent,
"ClipperWidget",
"Clipper"),
36 mInitializedWithClipper(false)
39 this->setEnabled(
false);
61 mLayout =
new QVBoxLayout(
this);
128 QHBoxLayout *layout =
new QHBoxLayout();
140 QHBoxLayout *layout =
new QHBoxLayout();
141 layout->addWidget(toolSelectorWidget);
149 QGroupBox *groupBox =
new QGroupBox(
"Structures to clip");
150 QVBoxLayout *layout =
new QVBoxLayout();
151 QHBoxLayout *selectCheckBoxes =
new QHBoxLayout();
158 layout->addLayout(selectCheckBoxes);
163 groupBox->setLayout(layout);
180 this->setEnabled(
true);
185 this->setEnabled(
false);
197 tool =
mServices->tracking()->getActiveTool();
227 void ClipperWidget::updateCheckBoxFromClipper(QCheckBox *checkbox,
DataPtr data)
231 std::map<QString, DataPtr> datas =
mClipper->getDatas();
232 bool checked = datas.count(data->getUid());
233 checkbox->setChecked(checked);
238 std::map<QString, DataPtr> datas = this->
getDatas();
239 std::map<QString, DataPtr>::iterator iter = datas.begin();
243 for(; iter != datas.end(); ++iter)
246 QCheckBox *checkbox =
new QCheckBox();
247 checkbox->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
250 QTableWidgetItem *descriptionItem =
new QTableWidgetItem(data->getName());
254 connect(checkbox, &QCheckBox::clicked,
this, func);
255 this->updateCheckBoxFromClipper(checkbox, data);
263 this->setEnabled(
false);
267 std::map<QString, DataPtr> datas = this->
getDatas();
272 QStringList horizontalHeaders;
273 horizontalHeaders <<
"Apply clipper" <<
"Object to be clipped";
284 QStringList dataTypes;
292 dataTypes <<
".*Metric$";
293 QString typeRegExp = dataTypes.join(
'|');
301 std::map<QString, DataPtr> datas =
mServices->patient()->getDatas();
308 bool checked = checkBox->isChecked();
318 std::map<QString, DataPtr> datas = this->
getDatas();
319 std::map<QString, DataPtr>::iterator iter = datas.begin();
321 for(; iter != datas.end(); ++iter)