bbtk::AtomicBlackBoxInputDescriptor
(typeid(AtomicBlackBoxDescriptor),
"BoxProcessMode",
- "Sets the processing mode of the box (Pipeline | Always | Reactive | Manual)",
+ "(Default Pipeline) - Sets the processing mode of the box (Pipeline | Always | Reactive | Manual)",
"",
new bbtk::AtomicBlackBoxTGetFunctor<BlackBox,std::string,std::string>(&BlackBox::bbGetInputBoxProcessMode),
new bbtk::AtomicBlackBoxTSetFunctor<BlackBox,std::string,std::string>(&BlackBox::bbSetInputBoxProcessMode) ) );
// IOStatus s=OUTOFDATE;
// IOStatus s=MODIFIED;
-
if ( ( bbBoxProcessModeIsManual()==false ) ||
( (bbBoxProcessModeIsManual()==true) && (bbLetRecursiveExecuteManualMode==true) ) )
{
( (bbBoxProcessModeIsManual()==true)&&(bbLetRecursiveExecuteManualMode==true) )
)
{
-// printf("EED BlackBox::bbRecursiveExecute bbProcess start %s \n", bbGetFullName().c_str() );
+
+//auto start = std::chrono::high_resolution_clock::now();
+//printf("EED BlackBox::bbRecursiveExecute bbProcess start %s \n", bbGetFullName().c_str() );
+
this->bbProcess();
-// printf("EED BlackBox::bbRecursiveExecute bbProcess end %s \n", bbGetFullName().c_str() );
+
+//auto stop = std::chrono::high_resolution_clock::now();
+//auto duration = duration_cast<std::chrono::microseconds>(stop - start);
+//printf("EED BlackBox::bbRecursiveExecute bbProcess time= %ld %s \n", duration.count() , bbGetFullName().c_str() );
+//printf("EED BlackBox::bbRecursiveExecute bbProcess end %s \n", bbGetFullName().c_str() );
+
} // Manual analysis
//EED ups if ((bbBoxProcessModeIsManual()==true) && (bbLetRecursiveExecuteManualMode==false))
{
bbtkBlackBoxDebugMessage("kernel",9,
"ComplexBlackBox::GetBlackBox(\""<<name<<"\")"
- <<std::endl);
-
+ <<std::endl);
BlackBoxMapType::iterator i = mBlackBoxMap.find(name);
if ( i == mBlackBoxMap.end() )
- {
- bbtkError("the black box \""<<name<<"\" does not exist");
- }
-
+ {
+ bbtkError("the black box \""<<name<<"\" does not exist");
+ }
return i->second;
}
//==================================================================
<<std::endl);
//
if (!GetFactory())
- {
- bbtkError("ComplexBlackBoxDescriptor::Connect : no factory set");
- }
+ {
+ bbtkError("ComplexBlackBoxDescriptor::Connect : no factory set");
+ }
-
// Verify that a box with the same name does not exist already
BlackBox::Pointer bbfrom = mPrototype->bbGetBlackBox( from );
if ( !bbfrom )
- {
- bbtkError("the black box \""<<from<<"\" does not exist");
- }
+ {
+ bbtkError("the black box \""<<from<<"\" does not exist");
+ }
BlackBox::Pointer bbto = mPrototype->bbGetBlackBox( to );
if ( !bbto )
- {
- bbtkError("the black box \""<<to<<"\" does not exist");
- }
-
- Connection::Pointer c
- = GetFactory()->NewConnection( bbfrom, output, bbto, input );
-
+ {
+ bbtkError("the black box \""<<to<<"\" does not exist");
+ }
+ Connection::Pointer c = GetFactory()->NewConnection( bbfrom, output, bbto, input );
mPrototype->bbAddConnection(c);
-
-
}
//=======================================================================
// bbSetOutputOut( bbGetInputIn() );
// std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
- if ((bbGetInputType()==1) && ( bbGetInputBox_ConcatString()!=NULL) )
+ if ( bbGetInputBox_ConcatString()!=NULL )
{
- bbGetInputBox_ConcatString()->bbSetOutputOut( bbGetInputIn1() );
- bbGetInputBox_ConcatString()->bbSignalOutputModification(std::string("Out"));
-// bbGetInputBox_ConcatString()->bbSignalOutputModification();
- } // if Type == 1 && Box
+ if ( (bbGetInputType()==1) )
+ {
+ bbGetInputBox_ConcatString()->bbSetOutputOut( bbGetInputIn1() );
+ bbGetInputBox_ConcatString()->bbSignalOutputModification(std::string("Out"),true);
+// bbGetInputBox_ConcatString()->bbSignalOutputModification();
+ } // if Type == 1
+ if ( (bbGetInputType()==2) )
+ {
+ bbGetInputBox_ConcatString()->bbSetOutputOut( bbGetInputIn1() );
+ bbGetInputBox_ConcatString()->bbSignalOutputModification(std::string("Out"),false);
+ } // if Type == 2
+ } // if bbGetInputBox_ConcatString!NULL
}
// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
// Here we initialize the input 'In' to 0
bbSetInputIn1("");
+ bbSetInputType(0);
bbSetInputBox_ConcatString(NULL);
}
BBTK_CATEGORY("empty");
BBTK_INPUT(ConcatStrings_tool,In1,"String input",std::string,"");
- BBTK_INPUT(ConcatStrings_tool,Type,"(default 0) 0:Nothing 1:Set Out",int,"");
+ BBTK_INPUT(ConcatStrings_tool,Type,"(default 0) 0:Nothing 1:Set Out with reactivity 2:Set Out witout reactivity",int,"");
BBTK_INPUT(ConcatStrings_tool,Box_ConcatString,"bbtk Box ConcatString",ConcatStrings*,"");
// BBTK_OUTPUT(ConcatStrings_tool,Out,"First output",double,"");
{
}
- void ExecBbiCommand::DoProcess()
+void ExecBbiCommand::DoProcess()
+{
+ printf("EED ExecBbiCommand::DoProcess Start \n");
+ // Look for the interpreter
+ bbtk::Interpreter::Pointer I;
+ bool delete_inter = false;
+ if (bbGetParent() != 0)
{
-
- // Look for the interpreter
- bbtk::Interpreter::Pointer I;
- bool delete_inter = false;
- if (bbGetParent() != 0)
- {
- bbtk::Factory::Pointer f
- = ((bbtk::ComplexBlackBoxDescriptor*)bbGetParent()
- ->bbGetDescriptor().get())->GetFactory();
- if ((f != 0)&&
- (f->GetExecuter()))
- {
- I = f->GetExecuter()->GetInterpreter();
- }
- }
- if (I==0)
- {
- // bbtkError("ExecBbiCommand::DoProcess() : could not find interpreter");
- I = bbtk::Interpreter::New();
- delete_inter = true;
- }
-
- unsigned int i;
-
- bool ok=true;
- int pos1=0,pos2;
- pos2 = bbGetInputIn().find(";",pos1);
- std::string ccommand;
- while (ok==true)
+ printf("EED ExecBbiCommand::DoProcess 1 \n");
+ bbtk::Factory::Pointer f = ((bbtk::ComplexBlackBoxDescriptor*)bbGetParent()->bbGetDescriptor().get())->GetFactory();
+ if ( (f != 0) && (f->GetExecuter()) )
{
- if (pos2==-1)
- {
- ok=false;
- ccommand=bbGetInputIn().substr(pos1,bbGetInputIn().length()-pos1 );
- } else {
- ccommand=bbGetInputIn().substr(pos1,pos2-pos1);
- }
- for ( i=0 ; i < ccommand.length() ; i++)
- {
- if (ccommand[i]==39)
- {
- ccommand[i]=34;
+ printf("EED ExecBbiCommand::DoProcess 2 \n");
+ I = f->GetExecuter()->GetInterpreter();
+ } // if f
+ } // if Parent
+ if (I==NULL)
+ {
+ printf("EED ExecBbiCommand::DoProcess 3 \n");
+ // bbtkError("ExecBbiCommand::DoProcess() : could not find interpreter");
+ I = bbtk::Interpreter::New();
+ delete_inter = true;
+ } // if I
+ unsigned int i;
+ bool ok=true;
+ int pos1=0,pos2;
+ pos2 = bbGetInputIn().find(";",pos1);
+ std::string ccommand;
+ printf("EED ExecBbiCommand::DoProcess 4 \n");
+ while (ok==true)
+ {
+ if (pos2==-1)
+ {
+ ok=false;
+ ccommand=bbGetInputIn().substr(pos1,bbGetInputIn().length()-pos1 );
+ } else {
+ ccommand=bbGetInputIn().substr(pos1,pos2-pos1);
}
- }
-
- I->InterpretLine( ccommand );
- pos1=pos2+1;
- pos2 = bbGetInputIn().find(";",pos2+1);
-
- }
-
+ for ( i=0 ; i < ccommand.length() ; i++)
+ {
+ if (ccommand[i]==39)
+ {
+ ccommand[i]=34;
+ } // if 39
+ } // for i
+ printf("EED ExecBbiCommand::DoProcess 5 \n");
+ printf("EED ExecBbiCommand::DoProcess command=%s \n", ccommand.c_str() );
+ I->InterpretLine( ccommand );
+ pos1=pos2+1;
+ pos2 = bbGetInputIn().find(";",pos2+1);
+ } // while
+
+ printf("EED ExecBbiCommand::DoProcess 6 \n");
+
+
// if (delete_inter) delete I;
/* Grrr not works in windows
pch = strtok (NULL, ";");
}
*/
- }
+
+ printf("EED ExecBbiCommand::DoProcess End\n");
+
+
+}
+
} // EO namespace bbstd
namespace bbstd
{
- void MagicBox::bbComputePostProcessStatus()
- {
- AtomicBlackBox::bbComputePostProcessStatus();
-
+void MagicBox::bbComputePostProcessStatus() // Virtual
+{
+ AtomicBlackBox::bbComputePostProcessStatus();
if (bbGetInputActive()==false)
{
// Update the output statuses
OutputConnectorMapType::iterator o;
for ( o = bbGetOutputConnectorMap().begin(); o!= bbGetOutputConnectorMap().end(); ++o)
{
- o->second->SetStatus(new_output_status);
+ o->second->SetStatus( new_output_status );
} // for o
} // if
+}
- }
-
-
- void MagicBox::bbUserSetDefaultValues()
- {
- bbSetInputActive(true);
- }
+void MagicBox::bbUserSetDefaultValues()
+{
+ bbSetInputActive(true);
+}
- void MagicBox::bbUserInitializeProcessing()
- {
- }
+void MagicBox::bbUserInitializeProcessing()
+{
+}
- void MagicBox::bbUserFinalizeProcessing()
- {
- }
+void MagicBox::bbUserFinalizeProcessing()
+{
+}
- void MagicBox::DoProcess()
- {
- if (bbGetInputActive()==true)
+void MagicBox::DoProcess()
+{
+ if (bbGetInputActive()==true)
{
bbSetOutputOut( bbGetInputIn() );
- } // Active
- }
+ } // if Active
+}
- BBTK_ADD_BLACK_BOX_TO_PACKAGE(std,MagicBox);
- BBTK_BLACK_BOX_IMPLEMENTATION(MagicBox,bbtk::AtomicBlackBox);
+BBTK_ADD_BLACK_BOX_TO_PACKAGE(std,MagicBox);
+BBTK_BLACK_BOX_IMPLEMENTATION(MagicBox,bbtk::AtomicBlackBox);
-}
-// EO namespace bbstd
+} // EO namespace bbstd
double spc[3];
double range[2];
int ext[6];
- if ((bbGetInputImage()!=NULL) && (bbGetInputMesh()!=NULL))
+ if ((bbGetInputImage()!=NULL) && (bbGetInputMesh()!=NULL) && ( bbGetInputColorType()>=0 ))
{
bbGetInputImage()->GetSpacing(spc);
bbGetInputImage()->GetScalarRange(range);
#include "bbvtkPackage.h"
namespace bbvtk {
- BBTK_ADD_BLACK_BOX_TO_PACKAGE(vtk, UpdateRender)
- BBTK_BLACK_BOX_IMPLEMENTATION(UpdateRender, bbtk::AtomicBlackBox);
+BBTK_ADD_BLACK_BOX_TO_PACKAGE(vtk, UpdateRender)
+BBTK_BLACK_BOX_IMPLEMENTATION(UpdateRender, bbtk::AtomicBlackBox);
- void UpdateRender::Process()
+void UpdateRender::Process()
+{
+ if(bbGetInputActive())
{
- if(bbGetInputActive())
- {
- if (bbGetInputRenderer()!=NULL)
- {
- bbGetInputRenderer()->GetRenderWindow()->Render();
+ if (bbGetInputRenderer()!=NULL)
+ {
+printf("EED UpdateRender::Process Ojo -----------\n");
+ bbGetInputRenderer()->GetRenderWindow()->Render();
+
//EED 4 nov 2015 Estelle
// bbGetInputRenderer()->GradientBackgroundOff();
// bbGetInputRenderer()->SetBackground( 0 , 0 , 0 );
- } // Renderer
- } // Active
- }
-
- void UpdateRender::bbUserSetDefaultValues() {
- bbSetInputActive(false);
- bbSetInputRenderer(NULL);
- }
-
- void UpdateRender::bbUserInitializeProcessing() {
+ } // Renderer
+ } // if Active
+}
- }
+void UpdateRender::bbUserSetDefaultValues()
+{
+ bbSetInputActive(false);
+ bbSetInputRenderer(NULL);
+}
- void UpdateRender::bbUserFinalizeProcessing() {
+void UpdateRender::bbUserInitializeProcessing()
+{
+}
- }
+void UpdateRender::bbUserFinalizeProcessing()
+{
}
-// EO namespace bbvtk
+
+} // EO namespace bbvtk
if (bbGetInputTitle()!="")
{
msg = bbGetInputTitle()+": " + bbGetInputIn();
- }
- else
- {
+ } else {
msg = bbGetInputIn();
}
w->SetLabel( bbtk::std2wx( msg ) );