12 #include "boost/bind.hpp" 13 #include <QListWidget> 14 #include <QTableWidget> 33 BaseWidget(parent,
"ClipperWidget",
"Clipper"),
35 mInitializedWithClipper(false)
38 this->setEnabled(
false);
60 mLayout =
new QVBoxLayout(
this);
127 QHBoxLayout *layout =
new QHBoxLayout();
139 QHBoxLayout *layout =
new QHBoxLayout();
140 layout->addWidget(toolSelectorWidget);
148 QGroupBox *groupBox =
new QGroupBox(
"Structures to clip");
149 QVBoxLayout *layout =
new QVBoxLayout();
150 QHBoxLayout *selectCheckBoxes =
new QHBoxLayout();
157 layout->addLayout(selectCheckBoxes);
162 groupBox->setLayout(layout);
179 this->setEnabled(
true);
184 this->setEnabled(
false);
196 tool =
mServices->tracking()->getActiveTool();
226 void ClipperWidget::updateCheckBoxFromClipper(QCheckBox *checkbox,
DataPtr data)
230 std::map<QString, DataPtr> datas =
mClipper->getDatas();
231 bool checked = datas.count(data->getUid());
232 checkbox->setChecked(checked);
237 std::map<QString, DataPtr> datas = this->
getDatas();
238 std::map<QString, DataPtr>::iterator iter = datas.begin();
242 for(; iter != datas.end(); ++iter)
245 QCheckBox *checkbox =
new QCheckBox();
246 checkbox->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
249 QTableWidgetItem *descriptionItem =
new QTableWidgetItem(data->getName());
253 connect(checkbox, &QCheckBox::clicked,
this, func);
254 this->updateCheckBoxFromClipper(checkbox, data);
262 this->setEnabled(
false);
266 std::map<QString, DataPtr> datas = this->
getDatas();
271 QStringList horizontalHeaders;
272 horizontalHeaders <<
"Apply clipper" <<
"Object to be clipped";
283 QStringList dataTypes;
285 dataTypes <<
"image";
289 dataTypes <<
"trackedStream";
291 dataTypes <<
".*Metric$";
292 QString typeRegExp = dataTypes.join(
'|');
300 std::map<QString, DataPtr> datas =
mServices->patient()->getDatas();
307 bool checked = checkBox->isChecked();
317 std::map<QString, DataPtr> datas = this->
getDatas();
318 std::map<QString, DataPtr>::iterator iter = datas.begin();
320 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
Namespace for all CustusX production code.
boost::shared_ptr< class Tool > ToolPtr