X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=kernel%2Fsrc%2FbbtkBlackBox.cxx;h=d2137752f2e8aee1d3084543d6c786427e001b71;hb=6bbabb32cba07ce95376c2cdcb804ee97050d453;hp=ae56fd4beb0a3adc978f22e65090b3c25f2625ab;hpb=768afeae7c180d69467cf9f6329af457ce2862e9;p=bbtk.git diff --git a/kernel/src/bbtkBlackBox.cxx b/kernel/src/bbtkBlackBox.cxx index ae56fd4..d213775 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/06/19 09:46:41 $ +Version: $Revision: 1.21 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See doc/license.txt or @@ -65,7 +65,7 @@ namespace bbtk bbtkDebugMessage("object",2,"##> BlackBox::Deleter(\""<bbDelete(); - + bbtkDebugMessage("object",2,"##> BlackBox::Deleter(\""< 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 ( (c==bbGetInputConnectorMap().find("WinClose")->second) ) + // && (bbCanReact())) + { + bbtkDebugMessage("modified",2, + "-> Close triggered by WinClose 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 +645,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 +705,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 +1026,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 +1045,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 +1118,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()" < BlackBox::bbmgExecutionList; -*/ //========================================================================= //========================================================================= @@ -1170,6 +1177,16 @@ namespace bbtk } //========================================================================= + void BlackBox::bbUserOnShowWidget(std::string nameInput) + { + bbtk::BlackBoxInputConnector *cc; + cc = this->bbGetInputConnectorMap().find( nameInput.c_str() )->second; + if (cc->GetConnection()!=NULL) + { + cc->GetConnection()->GetBlackBoxFrom()->bbUserOnShow(); + } + } + } // EO namespace bbtk