34 #include "boost/bind.hpp"
35 #include <QTableWidget>
51 BaseWidget(parent,
"SelectClippersForImageWidget",
"Select Clippers")
55 QVBoxLayout *mLayout =
new QVBoxLayout(
this);
60 mLayout->addWidget(selectClippersWidget);
66 BaseWidget(parent,
"SelectClippersForMeshWidget",
"Select Clippers")
70 QVBoxLayout *mLayout =
new QVBoxLayout(
this);
75 mLayout->addWidget(selectClippersWidget);
81 BaseWidget(parent,
"SelectClippersForDataWidget",
"Select Clippers"),
103 mHeading =
new QLabel(
"Active clippers");
105 mLayout =
new QVBoxLayout(
this);
118 QStringList horizontalHeaders;
119 horizontalHeaders <<
"Clip data" <<
"Clipper" <<
"Invert";
126 QStringList clipperNames = clippers->getClipperNames();
129 for(
int i = 0; i < clipperNames.size(); ++i)
131 QString clipperName = clipperNames.at(i);
132 this->createDataCheckBox(row, clipperName);
134 QTableWidgetItem *descriptionItem =
new QTableWidgetItem(clipperName);
139 void SelectClippersForDataWidget::createDataCheckBox(
int row, QString clipperName)
141 QCheckBox *dataCheckBox = this->createCheckBox(clipperName);
142 QCheckBox *invertCheckbox = this->createCheckBox(clipperName);
147 connect(dataCheckBox, &QCheckBox::clicked,
this, func);
150 connect(invertCheckbox, &QCheckBox::clicked,
this, invertFunc);
152 this->updateCheckBoxesFromClipper(dataCheckBox, invertCheckbox, clipperName);
155 void SelectClippersForDataWidget::updateCheckBoxesFromClipper(QCheckBox *dataCheckBox, QCheckBox *invertCheckBox, QString clipperName)
160 bool checkData = clipper->exists(activeData);
161 dataCheckBox->setChecked(checkData);
163 bool checkInvert = clipper->getInvertPlane();
164 invertCheckBox->setChecked(checkInvert);
167 QCheckBox *SelectClippersForDataWidget::createCheckBox(QString clipperName)
169 QCheckBox *checkbox =
new QCheckBox();
170 checkbox->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
185 bool checked = checkBox->isChecked();
188 clipper->addData(activeData);
190 clipper->removeData(activeData);
195 bool checked = checkBox->isChecked();
196 this->getClipper(clipperName)->invertPlane(checked);
boost::shared_ptr< class VisServices > VisServicesPtr
boost::shared_ptr< class StringPropertyActiveImage > StringPropertyActiveImagePtr
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 Clippers > ClippersPtr
boost::shared_ptr< class StringPropertyActiveData > StringPropertyActiveDataPtr