13 #include "boost/bind.hpp" 14 #include <QTableWidget> 30 BaseWidget(parent,
"select_clippers_for_image_widget",
"Select Clippers")
34 QVBoxLayout *mLayout =
new QVBoxLayout(
this);
35 mLayout->setMargin(0);
40 mLayout->addWidget(selectClippersWidget);
46 BaseWidget(parent,
"select_clippers_for_mesh_widget",
"Select Clippers")
50 QVBoxLayout *mLayout =
new QVBoxLayout(
this);
51 mLayout->setMargin(0);
56 mLayout->addWidget(selectClippersWidget);
62 BaseWidget(parent,
"select_clippers_for_data_widget",
"Select Clippers"),
84 mHeading =
new QLabel(
"Active clippers");
86 mLayout =
new QVBoxLayout(
this);
100 QStringList horizontalHeaders;
101 horizontalHeaders <<
"Clip data" <<
"Clipper" <<
"Invert";
108 QStringList clipperNames = clippers->getClipperNames();
111 for(
int i = 0; i < clipperNames.size(); ++i)
113 QString clipperName = clipperNames.at(i);
114 this->createDataCheckBox(row, clipperName);
116 QTableWidgetItem *descriptionItem =
new QTableWidgetItem(clipperName);
121 void SelectClippersForDataWidget::createDataCheckBox(
int row, QString clipperName)
123 QCheckBox *dataCheckBox = this->createCheckBox(clipperName);
124 QCheckBox *invertCheckbox = this->createCheckBox(clipperName);
129 connect(dataCheckBox, &QCheckBox::clicked,
this, func);
132 connect(invertCheckbox, &QCheckBox::clicked,
this, invertFunc);
134 this->updateCheckBoxesFromClipper(dataCheckBox, invertCheckbox, clipperName);
137 void SelectClippersForDataWidget::updateCheckBoxesFromClipper(QCheckBox *dataCheckBox, QCheckBox *invertCheckBox, QString clipperName)
142 bool checkData = clipper->exists(activeData);
143 dataCheckBox->setChecked(checkData);
145 bool checkInvert = clipper->getInvertPlane();
146 invertCheckBox->setChecked(checkInvert);
149 QCheckBox *SelectClippersForDataWidget::createCheckBox(QString clipperName)
151 QCheckBox *checkbox =
new QCheckBox();
152 checkbox->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
167 bool checked = checkBox->isChecked();
170 clipper->addData(activeData);
172 clipper->removeData(activeData);
177 bool checked = checkBox->isChecked();
178 this->getClipper(clipperName)->invertPlane(checked);
boost::shared_ptr< class VisServices > VisServicesPtr
boost::shared_ptr< class StringPropertyActiveImage > StringPropertyActiveImagePtr
boost::shared_ptr< class Clippers > ClippersPtr
boost::shared_ptr< class Data > DataPtr
boost::shared_ptr< class SelectDataStringPropertyBase > SelectDataStringPropertyBasePtr
static StringPropertyActiveImagePtr New(PatientModelServicePtr patientModelService)
void changed()
emit when the underlying data value is changed: The user interface will be updated.
boost::shared_ptr< class InteractiveClipper > InteractiveClipperPtr
static StringPropertyActiveDataPtr New(PatientModelServicePtr patientModelService, QString typeRegexp=".*")
boost::shared_ptr< class StringPropertyActiveData > StringPropertyActiveDataPtr
Namespace for all CustusX production code.