26 BaseWidget(parent,
"PipelineWidgetFilterLine",
"PipelineWidgetFilterLine"),
29 QHBoxLayout* layout =
new QHBoxLayout(
this);
30 connect(
this, SIGNAL(
requestRunFilter()),
this, SLOT(requestRunFilterSlot()));
34 connect(
mRadioButton, SIGNAL(toggled(
bool)),
this, SLOT(radioButtonSelectedSlot(
bool)));
37 layout->setSpacing(2);
48 QIcon(
":/icons/open_icon_library/arrow-right-3.png"),
55 button->setObjectName(
"RunFilterButton");
56 button->setDefaultAction(
mAction);
57 layout->addWidget(button);
61 void PipelineWidgetFilterLine::requestRunFilterSlot()
66 void PipelineWidgetFilterLine::radioButtonSelectedSlot(
bool on)
76 QWidget::mousePressEvent(event);
86 BaseWidget(parent,
"PipelineWidget",
"Pipeline"),
89 this->setToolTip(
"Run a series of filters");
91 std::vector<SelectDataStringPropertyBasePtr> nodes = mPipeline->getNodes();
92 if (filters->size()+1 != nodes.size())
95 QVBoxLayout* topLayout =
new QVBoxLayout(
this);
96 mButtonGroup =
new QButtonGroup(
this);
100 static QHBoxLayout* addHMargin(QWidget* base)
102 QHBoxLayout* layout =
new QHBoxLayout;
103 layout->addWidget(base);
104 layout->setContentsMargins(4,0,4,0);
109 for (
unsigned i=0; i<filters->size(); ++i)
111 topLayout->addLayout(Inner::addHMargin(
new DataSelectWidget(viewService, patientModelService,
this, nodes[i])));
114 connect(algoLine, SIGNAL(requestRunFilter()),
this, SLOT(runFilterSlot()));
115 connect(algoLine, SIGNAL(filterSelected(QString)),
this, SLOT(filterSelectedSlot(QString)));
118 mAlgoLines.push_back(algoLine);
120 frame->layout()->setContentsMargins(4,4,4,4);
121 frame->setObjectName(
"FilterBackground");
122 topLayout->addWidget(frame);
124 topLayout->addLayout(Inner::addHMargin(
new DataSelectWidget(viewService, patientModelService,
this, nodes.back())));
126 topLayout->addSpacing(12);
129 topLayout->addWidget(mSetupWidget);
131 topLayout->addStretch();
133 this->filterSelectedSlot(filters->get(0)->getUid());
137 void PipelineWidget::filterSelectedSlot(QString uid)
139 FilterPtr filter = mPipeline->getFilters()->get(uid);
142 for (
unsigned i=0; i<mAlgoLines.size(); ++i)
143 if (mAlgoLines[i]->mFilter->getUid()==uid)
144 mAlgoLines[i]->mRadioButton->setChecked(
true);
147 void PipelineWidget::runFilterSlot()
154 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