Program: bbtk
Module: $RCSfile: bbtkComplexBlackBox.cxx,v $
Language: C++
-Date: $Date: 2008/04/18 12:59:15 $
-Version: $Revision: 1.10 $
+Date: $Date: 2008/04/22 06:59:31 $
+Version: $Revision: 1.13 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
"ComplexBlackBox::bbBackwardUpdate("
<<(caller?caller->GetFullName():"0")<<") ["
<<bbGetFullName()<<"]"<<std::endl);
- bbtkInternalError("ComplexBlackBox::bbBackwardUpdate should never be called !");
- /*
+ // bbtkInternalError("ComplexBlackBox::bbBackwardUpdate should never be called !");
+
if (caller==0)
{
bbtkInternalError("ComplexBlackBox::bbBackwardUpdate called with caller=0");
}
- if (bbGetExecuting())
- {
- bbtkWarning(bbGetFullName()<<" : Cyclic execution stopped");
- return UPTODATE;
- }
- bbSetExecuting(true);
+ std::cout << "CBB BUP : "<<caller->GetBlackBoxFrom()->bbGetFullName()
+ <<"."<<caller->GetBlackBoxFromOutput()<<"----"
+ <<caller->GetOriginalBlackBoxFrom()->bbGetFullName()
+ <<"."<<caller->GetOriginalBlackBoxFromOutput()<<std::endl;
+
+
+
IOStatus s = UPTODATE;
const BlackBoxDescriptor::OutputDescriptorMapType& omap
ComplexBlackBoxOutputDescriptor* d =
(ComplexBlackBoxOutputDescriptor*)i->second;
// Get the internal box
- BlackBox* b = bbUnsafeGetBlackBox ( d->GetTarget() );
+ BlackBox::Pointer b = bbUnsafeGetBlackBox ( d->GetTarget() );
// Calls BackwardUpdate on it
bbtkDebugMessageInc("Process",2,"Internal box connected to output : "<<d->GetTarget()<<std::endl);
// Because internal box can also be a complex box we have to
}
bbtkDebugDecTab("Process",1);
- bbSetExecuting(false);
-
return s;
- */
- return UPTODATE;
+
}
//==================================================================
/// Connects the input <name> to the connection c
void ComplexBlackBox::bbConnectInput( const std::string& name, Connection::Pointer c)
{
- bbtkDebugMessageInc("Kernel",7,
- "ComplexBlackBox::bbConnectInput(\""
- <<name<<"\","<<c<<") ["
- <<bbGetFullName()<<"]"
- <<std::endl);
-
+ bbtkDebugMessage("connection",2,
+ "==> ComplexBlackBox::bbConnectInput(\""
+ <<name<<"\","<<c->GetFullName()<<") ["
+ <<bbGetFullName()<<"]"
+ <<std::endl);
+
ComplexBlackBoxInputDescriptor* d = (ComplexBlackBoxInputDescriptor*)
bbGetDescriptor()->GetInputDescriptor(name);
+
BlackBox::Pointer t = bbGetBlackBox(d->GetTarget());
+
+ bbtkDebugMessage("connection",2," - Target = "<<d->GetTarget()<<" = "<<t->bbGetFullName()<<std::endl);
+
c->SetBlackBoxTo(t);
c->SetBlackBoxToInput(d->GetInput());
- t->bbConnectInput(d->GetInput(),c);
- bbtkMessage("Debug",1,"ComplexBlackBox["<<bbGetFullName()<<"]::bbConnectInput : "
- <<c->GetFullName()<<std::endl);
+ bbtkDebugMessage("connection",2," - New conn = "<<c->GetFullName()<<std::endl);
+ t->bbConnectInput(d->GetInput(),c);
- bbtkDebugDecTab("Kernel",7);
+ bbtkDebugMessage("connection",2,
+ "<== ComplexBlackBox::bbConnectInput(\""
+ <<name<<"\","<<c->GetFullName()<<") ["
+ <<bbGetFullName()<<"]"
+ <<std::endl);
}
//=========================================================================
/// Connects the output <name> to the connection c
void ComplexBlackBox::bbConnectOutput( const std::string& name, Connection::Pointer c)
{
- bbtkDebugMessageInc("Kernel",7,
- "ComplexBlackBox::bbConnectOutput(\""
- <<name<<"\","<<c<<") ["
- <<bbGetFullName()<<"]"<<std::endl);
+ bbtkDebugMessage("connection",2,
+ "==> ComplexBlackBox::bbConnectOutput(\""
+ <<name<<"\","<<c->GetFullName()<<") ["
+ <<bbGetFullName()<<"]"<<std::endl);
ComplexBlackBoxOutputDescriptor* d = (ComplexBlackBoxOutputDescriptor*)
bbGetDescriptor()->GetOutputDescriptor(name);
BlackBox::Pointer t = bbGetBlackBox(d->GetTarget());
+
+ bbtkDebugMessage("connection",2," - Target = "<<d->GetTarget()<<" = "<<t->bbGetFullName()<<std::endl);
c->SetBlackBoxFrom(t);
c->SetBlackBoxFromOutput(d->GetOutput());
+
+ bbtkDebugMessage("connection",2," - New conn = "<<c->GetFullName()<<std::endl);
+
t->bbConnectOutput(d->GetOutput(),c);
- bbtkMessage("Debug",5,"ComplexBlackBox["<<bbGetFullName()<<"]::bbConnectOutput : "
- <<c->GetFullName()<<std::endl);
-
- bbtkDebugDecTab("Kernel",7);
+ bbtkDebugMessage("connection",2,
+ "<== ComplexBlackBox::bbConnectOutput(\""
+ <<name<<"\","<<c->GetFullName()<<") ["
+ <<bbGetFullName()<<"]"<<std::endl);
}
//=========================================================================
for ( j = mConnectionList.begin();
j != mConnectionList.end(); ++j )
{
- //(*j)->Check();
+ (*j)->Check();
}
}
if (p.use_count()!=1)