10.12., 9:00 - 11:00: Due to updates GitLab may be unavailable for some minutes between 09:00 and 11:00.

Commit 577091b3 authored by Hossain Mahmud's avatar Hossain Mahmud

fix: AutoEvaluationPipeline and null viewportsize

parent 50b028b6
......@@ -430,21 +430,16 @@ namespace campvis {
DataContainer* dc = _selectedDataContainer;
if (_selectedPipeline == nullptr)
return;
AbstractProcessor* selectedProcessor = _selectedProcessor;
if (selectedProcessor == nullptr) {
selectedProcessor = _selectedPipeline->getProcessors().at(0);
if (selectedProcessor == nullptr)
return;
}
AbstractProcessor* p = ProcessorFactory::getRef().createProcessor(name);
p->init();
AbstractProcessor* p = ProcessorFactory::getRef().createProcessor(name, &_selectedPipeline->getCanvasSize());
if (p == nullptr)
return;
p->init();
_selectedPipeline->addProcessor(p);
std::vector<AbstractPipeline*> pipelines;
std::for_each(_application->_pipelines.begin(), _application->_pipelines.end(), [&] (const CampVisApplication::PipelineRecord& pr) { pipelines.push_back(pr._pipeline); });
//_pipelineWidget->update(_application->_dataContainers, pipelines);
emit updatePipelineWidget(_application->_dataContainers, pipelines);
}
......
......@@ -194,6 +194,12 @@ namespace campvis {
* \return The DataHandle named _renderTargetID in the pipeline's DataContainer, 0 if no such handle exists.
*/
const std::string& getRenderTargetID() const;
/**
* Returns the canvas size
* \return The IVec2Property with current canvas size on it
*/
IVec2Property getCanvasSize() {return _canvasSize;}
/// Signal emitted at the end of AbstractPipeline::init()
sigslot::signal0 s_init;
......
......@@ -46,9 +46,9 @@ namespace campvis {
AbstractPipeline::init();
// connect invalidation of each processor
for (std::vector<AbstractProcessor*>::iterator it = _processors.begin(); it != _processors.end(); ++it) {
(*it)->s_invalidated.connect(this, &AutoEvaluationPipeline::onProcessorInvalidated);
}
//for (std::vector<AbstractProcessor*>::iterator it = _processors.begin(); it != _processors.end(); ++it) {
// (*it)->s_invalidated.connect(this, &AutoEvaluationPipeline::onProcessorInvalidated);
//}
_data->s_dataAdded.connect(this, &AutoEvaluationPipeline::onDataContainerDataAdded);
}
......@@ -75,6 +75,7 @@ namespace campvis {
findDataNamePropertiesAndAddToPortMap(processor);
AbstractPipeline::addProcessor(processor);
processor->s_invalidated.connect(this, &AutoEvaluationPipeline::onProcessorInvalidated);
}
void AutoEvaluationPipeline::executePipeline() {
......
......@@ -68,9 +68,8 @@ namespace campvis {
if (it != _processorMapWithIVec2Param.end()) {
if (viewPortSizeProp != nullptr)
return (it->second)(viewPortSizeProp);
IVec2Property* viewport = new IVec2Property("ViewportSize", "Viewport Size", cgt::ivec2(200), cgt::ivec2(0, 0), cgt::ivec2(10000));
return (it->second)(viewport);
LDEBUGC("CAMPVis.modules.ProcessorFactory", "ViewPortSize should not be NULL");
return nullptr;
}
auto pos = _processorMapDefault.find(id);
......@@ -78,17 +77,6 @@ namespace campvis {
return (pos->second)();
return nullptr;
//if (viewPortSizeProp != nullptr) {
// return nullptr;
// else
//} else {
// auto it = _processorMapDefault.find(id);
// if (it == _processorMapDefault.end())
// return nullptr;
// return (it->second)();
//}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment