13 #include "boost/bind.hpp" 14 #include <QTableWidget> 31 BaseWidget(parent,
"select_clippers_for_image_widget",
"Select Clippers")
35 QVBoxLayout *mLayout =
new QVBoxLayout(
this);
36 mLayout->setMargin(0);
41 mLayout->addWidget(selectClippersWidget);
47 BaseWidget(parent,
"select_clippers_for_mesh_widget",
"Select Clippers")
51 QVBoxLayout *mLayout =
new QVBoxLayout(
this);
52 mLayout->setMargin(0);
57 mLayout->addWidget(selectClippersWidget);
63 BaseWidget(parent,
"select_clippers_for_data_widget",
"Select Clippers"),
85 mHeading =
new QLabel(
"Active clippers");
87 mLayout =
new QVBoxLayout(
this);
101 QStringList horizontalHeaders;
102 horizontalHeaders <<
"Clip data" <<
"Clipper" <<
"Invert";
109 QStringList clipperNames = clippers->getClipperNames();
112 for(
int i = 0; i < clipperNames.size(); ++i)
114 QString clipperName = clipperNames.at(i);
115 this->createDataCheckBox(row, clipperName);
117 QTableWidgetItem *descriptionItem =
new QTableWidgetItem(clipperName);
122 void SelectClippersForDataWidget::createDataCheckBox(
int row, QString clipperName)
124 QCheckBox *dataCheckBox = this->createCheckBox(clipperName);
125 QCheckBox *invertCheckbox = this->createCheckBox(clipperName);
130 connect(dataCheckBox, &QCheckBox::clicked,
this, func);
133 connect(invertCheckbox, &QCheckBox::clicked,
this, invertFunc);
135 this->updateCheckBoxesFromClipper(dataCheckBox, invertCheckbox, clipperName);
138 void SelectClippersForDataWidget::updateCheckBoxesFromClipper(QCheckBox *dataCheckBox, QCheckBox *invertCheckBox, QString clipperName)
143 bool checkData = clipper->exists(activeData);
144 dataCheckBox->setChecked(checkData);
146 bool checkInvert = clipper->getInvertPlane();
147 invertCheckBox->setChecked(checkInvert);
150 QCheckBox *SelectClippersForDataWidget::createCheckBox(QString clipperName)
152 QCheckBox *checkbox =
new QCheckBox();
153 checkbox->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
168 bool checked = checkBox->isChecked();
171 clipper->addData(activeData);
173 clipper->removeData(activeData);
178 bool checked = checkBox->isChecked();
179 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 QString getTypeName()
static StringPropertyActiveDataPtr New(PatientModelServicePtr patientModelService, QString typeRegexp=".*")
boost::shared_ptr< class StringPropertyActiveData > StringPropertyActiveDataPtr
Namespace for all CustusX production code.