From: Eduardo Davila Date: Sat, 2 Jul 2011 08:00:34 +0000 (+0000) Subject: no message X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=0a4e8193b1c12923f11f2f5637558d2d44f0941f;p=bbtk.git no message --- diff --git a/kernel/src/bbtkBlackBox.cxx b/kernel/src/bbtkBlackBox.cxx index 805dd6f..dc496cb 100644 --- a/kernel/src/bbtkBlackBox.cxx +++ b/kernel/src/bbtkBlackBox.cxx @@ -2,8 +2,8 @@ Program: bbtk Module: $RCSfile: bbtkBlackBox.cxx,v $ Language: C++ - Date: $Date: 2011/03/03 14:37:57 $ - Version: $Revision: 1.52 $ + Date: $Date: 2011/07/02 08:00:34 $ + Version: $Revision: 1.53 $ =========================================================================*/ /* --------------------------------------------------------------------- @@ -349,6 +349,7 @@ namespace bbtk //========================================================================= bool BlackBox::bbCanReact() const { + return ( bbGlobalGetSomeBoxExecuting() #ifdef USE_WXWIDGETS || Wx::IsSomeWindowAlive() @@ -453,8 +454,8 @@ namespace bbtk } } - if ( ( bbBoxProcessModeIsReactive() || - (c==bbGetInputConnectorMap().find("BoxExecute")->second)) + + if ( ( bbBoxProcessModeIsReactive() || (c==bbGetInputConnectorMap().find("BoxExecute")->second)) && (bbCanReact() ) ) { bbtkBlackBoxDebugMessage("change",2, @@ -476,6 +477,7 @@ namespace bbtk <second->SignalChange(GetThisPointer(),i->first); // } - } + } // for - if (reaction) bbGlobalProcessExecutionList(); + if (reaction) + { + bbGlobalProcessExecutionList(); + } bbtkBlackBoxDebugMessage("change",5, "<= BlackBox::bbSignalOutputModification()" <::iterator j = Filenames.begin(); j!= Filenames.end(); ++j) { @@ -1957,6 +1958,7 @@ void InterpreterVirtual::SwitchToStream( std::stringstream* stream ) tcsetattr(0,TCSANOW,&ter); #endif + mCommandLine = true; bool again = true; // bool insideComment = false; // for multiline comment diff --git a/packages/std/src/bbstdGetVectorElement.h b/packages/std/src/bbstdGetVectorElement.h index 53182c5..d85ad98 100644 --- a/packages/std/src/bbstdGetVectorElement.h +++ b/packages/std/src/bbstdGetVectorElement.h @@ -2,8 +2,8 @@ Program: bbtk Module: $RCSfile: bbstdGetVectorElement.h,v $ Language: C++ - Date: $Date: 2009/07/23 12:27:36 $ - Version: $Revision: 1.6 $ + Date: $Date: 2011/07/02 08:00:35 $ + Version: $Revision: 1.7 $ =========================================================================*/ /* --------------------------------------------------------------------- @@ -45,6 +45,7 @@ namespace bbstd BBTK_TEMPLATE_BLACK_BOX_INTERFACE(GetVectorElement,bbtk::AtomicBlackBox,T); BBTK_DECLARE_INPUT(In,std::vector); BBTK_DECLARE_INPUT(I,int); + BBTK_DECLARE_INPUT(ErrorValue,T); BBTK_DECLARE_OUTPUT(Out,T); BBTK_PROCESS(DoIt); void DoIt(); @@ -61,6 +62,7 @@ namespace bbstd typedef std::vector Tvector; BBTK_TEMPLATE_INPUT(GetVectorElement, In,"Input",Tvector); BBTK_TEMPLATE_INPUT(GetVectorElement, I, "Input",int); + BBTK_TEMPLATE_INPUT(GetVectorElement, ErrorValue, "ErrorValue",T); BBTK_TEMPLATE_OUTPUT(GetVectorElement,Out,"Output",T); BBTK_END_DESCRIBE_TEMPLATE_BLACK_BOX(GetVectorElement); //================================================================= @@ -69,8 +71,12 @@ namespace bbstd template void GetVectorElement::DoIt() { - // unsigned int i = bbGetInputI(); - bbSetOutputOut(bbGetInputIn()[bbGetInputI()]); + if (( bbGetInputI() < bbGetInputIn().size() ) && ( bbGetInputI() >= 0 ) ) + { + bbSetOutputOut( bbGetInputIn()[bbGetInputI()] ); + } else { + bbSetOutputOut( bbGetInputErrorValue() ); + } } //================================================================= diff --git a/packages/vtk/src/bbvtkGetVectorElement.h b/packages/vtk/src/bbvtkGetVectorElement.h index 3bf6996..6993b5c 100644 --- a/packages/vtk/src/bbvtkGetVectorElement.h +++ b/packages/vtk/src/bbvtkGetVectorElement.h @@ -2,8 +2,8 @@ Program: bbtk Module: $RCSfile: bbvtkGetVectorElement.h,v $ Language: C++ - Date: $Date: 2010/04/01 15:46:54 $ - Version: $Revision: 1.1 $ + Date: $Date: 2011/07/02 08:00:36 $ + Version: $Revision: 1.2 $ =========================================================================*/ /* --------------------------------------------------------------------- @@ -44,7 +44,8 @@ namespace bbvtk { BBTK_TEMPLATE_BLACK_BOX_INTERFACE(GetVectorElement,bbtk::AtomicBlackBox,T); BBTK_DECLARE_INPUT(In,std::vector); - BBTK_DECLARE_INPUT(I,int); + BBTK_DECLARE_INPUT(I,int); + BBTK_DECLARE_INPUT(ErrorValue,T); BBTK_DECLARE_OUTPUT(Out,T); BBTK_PROCESS(DoIt); void DoIt(); @@ -61,7 +62,8 @@ namespace bbvtk BBTK_DESCRIPTION("Gets the i-th element from the input vector ("+bbtk::TypeName >()); typedef std::vector Tvector; BBTK_TEMPLATE_INPUT(GetVectorElement, In,"Input",Tvector); - BBTK_TEMPLATE_INPUT(GetVectorElement, I, "Input",int); + BBTK_TEMPLATE_INPUT(GetVectorElement, I, "Input",int); + BBTK_TEMPLATE_INPUT(GetVectorElement, ErrorValue, "ErrorValue",T); BBTK_TEMPLATE_OUTPUT(GetVectorElement,Out,"Output",T); BBTK_END_DESCRIBE_TEMPLATE_BLACK_BOX(GetVectorElement); //================================================================= @@ -70,8 +72,13 @@ namespace bbvtk template void GetVectorElement::DoIt() { - // unsigned int i = bbGetInputI(); - bbSetOutputOut(bbGetInputIn()[bbGetInputI()]); + if (( bbGetInputI() < bbGetInputIn().size() ) && ( bbGetInputI() >= 0 ) ) + { + bbSetOutputOut( bbGetInputIn()[bbGetInputI()] ); + } else + { + bbSetOutputOut( bbGetInputErrorValue() ); + } } //================================================================= diff --git a/packages/vtk/src/bbvtkMagnitud.cxx b/packages/vtk/src/bbvtkMagnitud.cxx index 000320e..cc4a2a2 100644 --- a/packages/vtk/src/bbvtkMagnitud.cxx +++ b/packages/vtk/src/bbvtkMagnitud.cxx @@ -26,7 +26,9 @@ void Magnitud::Process() // * TYPE is the C++ type of the input/output // (the one provided in the attribute 'type' of the tag 'input') -// ---------- + + // ---------- + if (bbGetInputIn()!=NULL) { vGreenToRedLut->SetHueRange(0.6667,0.0); vGreenToRedLut->Build(); @@ -314,8 +316,13 @@ void Magnitud::Process() //temp->GetData( vMultipleContourMapper->GetOutput() ); //bbSetOutputOutTest( temp ); -// ---------- ] -} + + } // if + +} // process + + + //===== // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) //===== diff --git a/packages/vtk/src/bbvtkStructuredPointsReader.cxx b/packages/vtk/src/bbvtkStructuredPointsReader.cxx index 9d3d6a0..1c0b182 100644 --- a/packages/vtk/src/bbvtkStructuredPointsReader.cxx +++ b/packages/vtk/src/bbvtkStructuredPointsReader.cxx @@ -26,11 +26,15 @@ void StructuredPointsReader::Process() // * TYPE is the C++ type of the input/output // (the one provided in the attribute 'type' of the tag 'input') - - spr -> SetFileName( bbGetInputIn().c_str() ); - sp = spr->GetOutput(); - sp -> Update(); - bbSetOutputOut( sp ); + if ( bbGetInputIn().c_str()!="") + { + spr -> SetFileName( bbGetInputIn().c_str() ); + sp = spr->GetOutput(); + sp -> Update(); + bbSetOutputOut( sp ); + } else { + bbSetOutputOut( NULL ); + } } //===== @@ -42,7 +46,8 @@ void StructuredPointsReader::bbUserSetDefaultValues() // SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX // Here we initialize the input 'In' to 0 bbSetInputIn(""); - + bbSetOutputOut( NULL ); + } //===== // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)