X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=kernel%2Fsrc%2FbbtkBlackBox.cxx;h=51a9ab7cfe824b790f5cd30cdc780c67003412c4;hb=d8041d1ef54a73acc2306557435f6b04edf60daf;hp=ae56fd4beb0a3adc978f22e65090b3c25f2625ab;hpb=768afeae7c180d69467cf9f6329af457ce2862e9;p=bbtk.git diff --git a/kernel/src/bbtkBlackBox.cxx b/kernel/src/bbtkBlackBox.cxx index ae56fd4..51a9ab7 100644 --- a/kernel/src/bbtkBlackBox.cxx +++ b/kernel/src/bbtkBlackBox.cxx @@ -3,8 +3,8 @@ Program: bbtk Module: $RCSfile: bbtkBlackBox.cxx,v $ Language: C++ -Date: $Date: 2008/04/22 08:29:09 $ -Version: $Revision: 1.13 $ +Date: $Date: 2008/05/06 13:45:12 $ +Version: $Revision: 1.17 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See doc/license.txt or @@ -103,6 +103,9 @@ namespace bbtk } //========================================================================= + //========================================================================= + BlackBox::BlackBox(const BlackBox&) + {} //========================================================================= BlackBox::BlackBox(BlackBox& from, const std::string &name) @@ -138,7 +141,7 @@ namespace bbtk /// Main processing method of the box. void BlackBox::bbExecute(bool force) { - bbtkDebugMessageInc("Process",1, + bbtkDebugMessageInc("process",2, "=> BlackBox::bbExecute() [" < FreezeExecution global flag is 'true' : abort execution"< BlackBox::bbUserDelete() [" < BlackBox::bbSetModifiedStatus("< BlackBox::bbSetModifiedStatus("<second) ) - // && (bbCanReact())) + // && (bbCanReact())) { - bbtkDebugMessage("Process",9, + bbtkDebugMessage("modified",2, "-> Hide triggered by WinHide input change" <bbHideWindow(); this->bbSetStatus(MODIFIED); return; } - + if ( ( bbBoxProcessModeIsReactive() || (c==bbGetInputConnectorMap().find("BoxExecute")->second)) && (bbCanReact() ) ) { - bbtkDebugMessage("Process",9, + bbtkDebugMessage("modified",2, "-> Execution triggered by Reactive mode or BoxExecute input change"<bbSetStatus(MODIFIED); bbGlobalAddToExecutionList( GetThisPointer() ); } else if ( bbGetStatus() == MODIFIED ) //! this->bbIsUptodate()) { - bbtkDebugMessage("Process",5,"-> Already modified"< Already modified"< Status set to modified"< Status set to modified"<bbSetStatus(MODIFIED); } this->bbSignalOutputModification(false); - bbtkDebugMessageDec("Process",5, + /* + bbtkDebugMessageDec("process",5, "<= BlackBox::bbSetModifiedStatus("< BlackBox::bbSignalOutputModification() [" < BlackBox::bbSignalOutputModification(" <& output, bool reaction) { - bbtkDebugMessageInc("Process",5, + bbtkDebugMessageInc("process",5, "=> BlackBox::bbSignalOutputModification(vector of outputs) [" < BlackBox::bbUpdateInputs() [" < to the connection c - void BlackBox::bbConnectInput( const std::string& name, Connection::Pointer c) + void BlackBox::bbConnectInput( const std::string& name, Connection* c) { bbtkDebugMessage("connection",2, "==> BlackBox::bbConnectInput(\"" @@ -631,7 +634,7 @@ namespace bbtk //========================================================================= /// Connects the output to the connection c - void BlackBox::bbConnectOutput( const std::string& name, Connection::Pointer c) + void BlackBox::bbConnectOutput( const std::string& name, Connection* c) { bbtkDebugMessage("connection",2, "==> BlackBox::bbConnectOutput(\""< from the connection c - void BlackBox::bbDisconnectInput( const std::string& name, Connection::Pointer c) + void BlackBox::bbDisconnectInput( const std::string& name, Connection* c) { bbtkDebugMessage("connection",2, @@ -691,7 +694,7 @@ namespace bbtk //========================================================================= /// Disconnects the output from the connection c - void BlackBox::bbDisconnectOutput( const std::string& name, Connection::Pointer c) + void BlackBox::bbDisconnectOutput( const std::string& name, Connection* c) { bbtkDebugMessage("connection",2, "==> BlackBox::bbDisconnectOutput(\""<second) { - Connection::Pointer con = i->second->GetConnection(); + Connection* con = i->second->GetConnection(); if (con!=NULL){ - BlackBox::Pointer a=con->GetBlackBoxFrom(); - BlackBox::Pointer b=con->GetBlackBoxTo(); + BlackBox::Pointer a=con->GetOriginalBlackBoxFrom(); + BlackBox::Pointer b=con->GetOriginalBlackBoxTo(); fprintf(ff," "); a->bbWriteDotInputOutputName(ff,false,detail,level); if (detail==1) { - fprintf(ff,":%s",con->GetBlackBoxFromOutput().c_str()); + fprintf(ff,":%s",con->GetOriginalBlackBoxFromOutput().c_str()); } fprintf(ff,"->"); b->bbWriteDotInputOutputName(ff,true,detail,level); if (detail==1) { - fprintf(ff,":%s",con->GetBlackBoxToInput().c_str()); + fprintf(ff,":%s",con->GetOriginalBlackBoxToInput().c_str()); } fprintf(ff,"%s\n",";"); } // if con @@ -1012,11 +1015,11 @@ namespace bbtk ivalue.push_back(bbGetInputAsString(i->first)); if (ivalue.back().size()>valuelmax) valuelmax = ivalue.back().size(); std::string s(""); - Connection::Pointer con = i->second->GetConnection(); + Connection* con = i->second->GetConnection(); if (con!=0){ - s = con->GetBlackBoxFrom()->bbGetName(); + s = con->GetOriginalBlackBoxFrom()->bbGetName(); s += "."; - s += con->GetBlackBoxFromOutput(); + s += con->GetOriginalBlackBoxFromOutput(); } // if con iconn.push_back(s); } @@ -1031,15 +1034,15 @@ namespace bbtk ovalue.push_back(bbGetOutputAsString(o->first)); if (ovalue.back().size()>valuelmax) valuelmax = ovalue.back().size(); std::vector ss; - const std::vector& con + const std::vector& con = o->second->GetConnectionVector(); - std::vector::const_iterator c; + std::vector::const_iterator c; for (c=con.begin();c!=con.end();++c) { std::string s; - s = (*c).lock()->GetBlackBoxTo()->bbGetName(); + s = (*c)->GetOriginalBlackBoxTo()->bbGetName(); s += "."; - s += (*c).lock()->GetBlackBoxToInput(); + s += (*c)->GetOriginalBlackBoxToInput(); ss.push_back(s); } // if con oconn.push_back(ss); @@ -1104,7 +1107,7 @@ namespace bbtk //========================================================================= void BlackBox::bbGlobalProcessExecutionList() { - bbtkDebugMessageInc("Process",1, + bbtkDebugMessageInc("process",3, "=> BlackBox::bbGlobalProcessExecutionList()" < Executing "<<(*i)->bbGetFullName()<bbExecute(true); } bbmgExecutionList.clear(); - bbtkDebugMessageDec("Process",1, + bbtkDebugMessageDec("process",3, "<= BlackBox::bbGlobalProcessExecutionList()" <