47 BaseWidget(parent,
"PipelineWidgetFilterLine",
"PipelineWidgetFilterLine"),
50 QHBoxLayout* layout =
new QHBoxLayout(
this);
51 connect(
this, SIGNAL(
requestRunFilter()),
this, SLOT(requestRunFilterSlot()));
55 connect(
mRadioButton, SIGNAL(toggled(
bool)),
this, SLOT(radioButtonSelectedSlot(
bool)));
58 layout->setSpacing(2);
69 QIcon(
":/icons/open_icon_library/arrow-right-3.png"),
76 button->setObjectName(
"RunFilterButton");
77 button->setDefaultAction(
mAction);
78 layout->addWidget(button);
82 void PipelineWidgetFilterLine::requestRunFilterSlot()
87 void PipelineWidgetFilterLine::radioButtonSelectedSlot(
bool on)
97 QWidget::mousePressEvent(event);
107 BaseWidget(parent,
"PipelineWidget",
"Pipeline"),
110 this->setToolTip(
"Run a series of filters");
112 std::vector<SelectDataStringPropertyBasePtr> nodes = mPipeline->getNodes();
113 if (filters->size()+1 != nodes.size())
116 QVBoxLayout* topLayout =
new QVBoxLayout(
this);
117 mButtonGroup =
new QButtonGroup(
this);
121 static QHBoxLayout* addHMargin(QWidget* base)
123 QHBoxLayout* layout =
new QHBoxLayout;
124 layout->addWidget(base);
125 layout->setContentsMargins(4,0,4,0);
130 for (
unsigned i=0; i<filters->size(); ++i)
132 topLayout->addLayout(Inner::addHMargin(
new DataSelectWidget(viewService, patientModelService,
this, nodes[i])));
135 connect(algoLine, SIGNAL(requestRunFilter()),
this, SLOT(runFilterSlot()));
136 connect(algoLine, SIGNAL(filterSelected(QString)),
this, SLOT(filterSelectedSlot(QString)));
139 mAlgoLines.push_back(algoLine);
141 frame->layout()->setContentsMargins(4,4,4,4);
142 frame->setObjectName(
"FilterBackground");
143 topLayout->addWidget(frame);
145 topLayout->addLayout(Inner::addHMargin(
new DataSelectWidget(viewService, patientModelService,
this, nodes.back())));
147 topLayout->addSpacing(12);
150 topLayout->addWidget(mSetupWidget);
152 topLayout->addStretch();
154 this->filterSelectedSlot(filters->get(0)->getUid());
158 void PipelineWidget::filterSelectedSlot(QString uid)
160 FilterPtr filter = mPipeline->getFilters()->get(uid);
163 for (
unsigned i=0; i<mAlgoLines.size(); ++i)
164 if (mAlgoLines[i]->mFilter->getUid()==uid)
165 mAlgoLines[i]->mRadioButton->setChecked(
true);
168 void PipelineWidget::runFilterSlot()
175 mPipeline->execute(line->
mFilter->getUid());
void reportError(QString msg)
Show progress for a TimedBaseAlgorithm.
boost::shared_ptr< class Filter > FilterPtr
boost::shared_ptr< class PatientModelService > PatientModelServicePtr
boost::shared_ptr< FilterGroup > FilterGroupPtr
void attach(TimedAlgorithmPtr algorithm)
void setShowTextLabel(bool on)
Namespace for all CustusX production code.
boost::shared_ptr< Pipeline > PipelinePtr