Program: bbtk
Module: $RCSfile: bbtkWxBlackBox.cxx,v $
Language: C++
- Date: $Date: 2008/03/10 12:28:43 $
- Version: $Revision: 1.10 $
+ Date: $Date: 2008/04/08 06:59:30 $
+ Version: $Revision: 1.11 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
//=========================================================================
+ //=========================================================================
+ /// Main processing method of the box.
+ IOStatus WxBlackBox::bbBackwardUpdate( Connection* caller )
+ {
+ bbtkDebugMessageInc("Process",1,
+ "=> WxBlackBox::bbBackwardUpdate("
+ <<(caller?caller->GetFullName():"0")<<") ["
+ <<bbGetFullName()<<"]"<<std::endl);
+
+ if (bbGetExecuting())
+ {
+ bbtkWarning(bbGetFullName()<<" : Cyclic execution stopped");
+ return UPTODATE;
+ }
+ bbSetExecuting(true);
+
+ // If the caller is not the connection to the output widget
+ // and the output 'Widget' is connected then
+ // we must execute the parent box
+ bool done = false;
+ if ( (caller==0) ||
+ ((caller!=0)&&(caller->GetBlackBoxFromOutput()!="Widget"))
+ )
+ {
+ BlackBox::OutputConnectorMapType::const_iterator i
+ = bbGetOutputConnectorMap().find("Widget") ;
+ if (
+ i->second->GetConnectionVector().size() != 0 )
+ {
+ bbtkDebugMessage("Process",2,
+ "-> Output 'Widget' connected : transfering execution to parent"
+ <<std::endl);
+
+ i->second->GetConnectionVector().front()
+ ->GetBlackBoxTo()->bbExecute(false);
+ done = true;
+ }
+ }
+ // call 'standard' BlackBox execution method
+ if (!done)
+ {
+ bbSetExecuting(false);
+ AtomicBlackBox::bbBackwardUpdate(caller);
+ }
+
+ bbtkDebugMessageDec("Process",1,
+ "<= WxBlackBox::bbBackwardUpdate() ["
+ <<bbGetFullName()<<"]"<<std::endl);
+
+ bbSetExecuting(false);
+ }
+
//=========================================================================
void WxBlackBox::bbProcess()
{