34 #include "boost/bind.hpp" 35 #include <QTableWidget> 51 BaseWidget(parent,
"select_clippers_for_image_widget",
"Select Clippers")
55 QVBoxLayout *mLayout =
new QVBoxLayout(
this);
56 mLayout->setMargin(0);
61 mLayout->addWidget(selectClippersWidget);
67 BaseWidget(parent,
"select_clippers_for_mesh_widget",
"Select Clippers")
71 QVBoxLayout *mLayout =
new QVBoxLayout(
this);
72 mLayout->setMargin(0);
77 mLayout->addWidget(selectClippersWidget);
83 BaseWidget(parent,
"select_clippers_for_data_widget",
"Select Clippers"),
105 mHeading =
new QLabel(
"Active clippers");
107 mLayout =
new QVBoxLayout(
this);
121 QStringList horizontalHeaders;
122 horizontalHeaders <<
"Clip data" <<
"Clipper" <<
"Invert";
129 QStringList clipperNames = clippers->getClipperNames();
132 for(
int i = 0; i < clipperNames.size(); ++i)
134 QString clipperName = clipperNames.at(i);
135 this->createDataCheckBox(row, clipperName);
137 QTableWidgetItem *descriptionItem =
new QTableWidgetItem(clipperName);
142 void SelectClippersForDataWidget::createDataCheckBox(
int row, QString clipperName)
144 QCheckBox *dataCheckBox = this->createCheckBox(clipperName);
145 QCheckBox *invertCheckbox = this->createCheckBox(clipperName);
150 connect(dataCheckBox, &QCheckBox::clicked,
this, func);
153 connect(invertCheckbox, &QCheckBox::clicked,
this, invertFunc);
155 this->updateCheckBoxesFromClipper(dataCheckBox, invertCheckbox, clipperName);
158 void SelectClippersForDataWidget::updateCheckBoxesFromClipper(QCheckBox *dataCheckBox, QCheckBox *invertCheckBox, QString clipperName)
163 bool checkData = clipper->exists(activeData);
164 dataCheckBox->setChecked(checkData);
166 bool checkInvert = clipper->getInvertPlane();
167 invertCheckBox->setChecked(checkInvert);
170 QCheckBox *SelectClippersForDataWidget::createCheckBox(QString clipperName)
172 QCheckBox *checkbox =
new QCheckBox();
173 checkbox->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
188 bool checked = checkBox->isChecked();
191 clipper->addData(activeData);
193 clipper->removeData(activeData);
198 bool checked = checkBox->isChecked();
199 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.