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);
112 BaseWidget(parent,
"PipelineWidget",
"Pipeline"),
116 std::vector<SelectDataStringPropertyBasePtr> nodes = mPipeline->getNodes();
117 if (filters->size()+1 != nodes.size())
120 QVBoxLayout* topLayout =
new QVBoxLayout(
this);
121 mButtonGroup =
new QButtonGroup(
this);
125 static QHBoxLayout* addHMargin(QWidget* base)
127 QHBoxLayout* layout =
new QHBoxLayout;
128 layout->addWidget(base);
129 layout->setContentsMargins(4,0,4,0);
134 for (
unsigned i=0; i<filters->size(); ++i)
136 topLayout->addLayout(Inner::addHMargin(
new DataSelectWidget(visualizationService, patientModelService,
this, nodes[i])));
139 connect(algoLine, SIGNAL(requestRunFilter()),
this, SLOT(runFilterSlot()));
140 connect(algoLine, SIGNAL(filterSelected(QString)),
this, SLOT(filterSelectedSlot(QString)));
143 mAlgoLines.push_back(algoLine);
145 frame->layout()->setContentsMargins(4,4,4,4);
146 frame->setObjectName(
"FilterBackground");
147 topLayout->addWidget(frame);
149 topLayout->addLayout(Inner::addHMargin(
new DataSelectWidget(visualizationService, patientModelService,
this, nodes.back())));
151 topLayout->addSpacing(12);
153 mSetupWidget =
new CompactFilterSetupWidget(visualizationService, patientModelService,
this, filters->getOptions(),
true);
154 topLayout->addWidget(mSetupWidget);
156 topLayout->addStretch();
158 this->filterSelectedSlot(filters->get(0)->getUid());
162 void PipelineWidget::filterSelectedSlot(QString uid)
164 FilterPtr filter = mPipeline->getFilters()->get(uid);
167 for (
unsigned i=0; i<mAlgoLines.size(); ++i)
168 if (mAlgoLines[i]->mFilter->getUid()==uid)
169 mAlgoLines[i]->mRadioButton->setChecked(
true);
172 void PipelineWidget::runFilterSlot()
174 PipelineWidgetFilterLine* line =
dynamic_cast<PipelineWidgetFilterLine*
>(sender());
179 mPipeline->execute(line->mFilter->getUid());
184 return QString(
"<html>"
185 "<h3>Pipeline Widget.</h3>"
186 "<p>Run a series of filters.</p>"
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)
boost::shared_ptr< Pipeline > PipelinePtr