Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
CAMP
campvis-public
Commits
577091b3
Commit
577091b3
authored
Mar 12, 2015
by
Hossain Mahmud
Browse files
fix: AutoEvaluationPipeline and null viewportsize
parent
50b028b6
Changes
4
Hide whitespace changes
Inline
Side-by-side
application/gui/mainwindow.cpp
View file @
577091b3
...
...
@@ -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
);
}
...
...
core/pipeline/abstractpipeline.h
View file @
577091b3
...
...
@@ -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
;
...
...
core/pipeline/autoevaluationpipeline.cpp
View file @
577091b3
...
...
@@ -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
()
{
...
...
modules/processorfactory.cpp
View file @
577091b3
...
...
@@ -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)();
//}
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment