Program: bbtk
Module: $RCSfile: bbtkBlackBox.cxx,v $
Language: C++
-Date: $Date: 2008/04/21 12:43:05 $
-Version: $Revision: 1.11 $
+Date: $Date: 2008/04/22 06:59:31 $
+Version: $Revision: 1.12 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See doc/license.txt or
/// Connects the input <name> to the connection c
void BlackBox::bbConnectInput( const std::string& name, Connection::Pointer c)
{
- bbtkDebugMessageInc("Kernel",7,
- "BlackBox::bbConnectInput(\""<<name<<"\","<<c<<") ["
+ bbtkDebugMessage("connection",2,
+ "==> BlackBox::bbConnectInput(\""
+ <<name<<"\","<<c->GetFullName()<<") ["
<<bbGetFullName()<<"]"
<<std::endl);
+
+
InputConnectorMapType::iterator i = bbGetInputConnectorMap().find(name);
if (i==bbGetInputConnectorMap().end())
{
}
i->second->SetConnection(c);
+ bbtkDebugMessage("connection",2,
+ "<== BlackBox::bbConnectInput(\""
+ <<name<<"\","<<c->GetFullName()<<") ["
+ <<bbGetFullName()<<"]"
+ <<std::endl);
// bbSetModifiedStatus();
- bbtkDebugDecTab("Kernel",7);
}
//=========================================================================
/// Connects the output <name> to the connection c
void BlackBox::bbConnectOutput( const std::string& name, Connection::Pointer c)
{
- bbtkDebugMessageInc("Kernel",7,
- "BlackBox::bbConnectOutput(\""<<name<<"\","<<c<<") ["
- <<bbGetFullName()<<"]"<<std::endl);
-
+ bbtkDebugMessage("connection",2,
+ "==> BlackBox::bbConnectOutput(\""<<name<<"\","
+ <<c->GetFullName()<<") ["
+ <<bbGetFullName()<<"]"<<std::endl);
+
OutputConnectorMapType::iterator i = bbGetOutputConnectorMap().find(name);
if (i==bbGetOutputConnectorMap().end())
{
}
i->second->SetConnection(c);
- bbtkDebugDecTab("Kernel",7);
+ bbtkDebugMessage("connection",2,
+ "<== BlackBox::bbConnectOutput(\""<<name<<"\","
+ <<c->GetFullName()<<") ["
+ <<bbGetFullName()<<"]"<<std::endl);
+
}
//=========================================================================
/// Disconnects the input <name> from the connection c
void BlackBox::bbDisconnectInput( const std::string& name, Connection::Pointer c)
{
- if (!c) return;
- bbtkDebugMessageInc("Kernel",7,
- "BlackBox::bbDisconnectInput(\""<<name
- <<"\","<<c<<") ["
- <<bbGetFullName()<<"]"
- <<std::endl);
+
+ bbtkDebugMessage("connection",2,
+ "==> BlackBox::bbDisconnectInput(\""<<name
+ <<"\","<<c->GetFullName()<<") ["
+ <<bbGetFullName()<<"]"
+ <<std::endl);
+
+ if (!c)
+ {
+
+ bbtkDebugMessage("connection",2,"c==0"<<std::endl);
+ return;
+ }
InputConnectorMapType::iterator i = bbGetInputConnectorMap().find(name);
if (i==bbGetInputConnectorMap().end())
}
i->second->UnsetConnection(c);
- bbtkDebugDecTab("Kernel",7);
+ bbtkDebugMessage("connection",2,
+ "<== BlackBox::bbDisconnectInput(\""<<name
+ <<"\","<<c->GetFullName()<<") ["
+ <<bbGetFullName()<<"]"
+ <<std::endl);
+
}
//=========================================================================
/// Disconnects the output <name> from the connection c
void BlackBox::bbDisconnectOutput( const std::string& name, Connection::Pointer c)
{
- if (!c) return;
- bbtkDebugMessageInc("Kernel",7,
- "BlackBox::bbDisconnectOutput(\""<<name
- <<"\","<<c<<") ["
- <<bbGetFullName()<<"]"
- <<std::endl);
+ bbtkDebugMessage("connection",2,
+ "==> BlackBox::bbDisconnectOutput(\""<<name
+ <<"\","<<c->GetFullName()<<") ["
+ <<bbGetFullName()<<"]"
+ <<std::endl);
+ if (!c)
+ {
+
+ bbtkDebugMessage("connection",2,"c==0"<<std::endl);
+ return;
+ }
OutputConnectorMapType::iterator i = bbGetOutputConnectorMap().find(name);
if (i==bbGetOutputConnectorMap().end())
}
i->second->UnsetConnection(c);
- bbtkDebugDecTab("Kernel",7);
+ bbtkDebugMessage("connection",2,
+ "<== BlackBox::bbDisconnectOutput(\""<<name
+ <<"\","<<c->GetFullName()<<") ["
+ <<bbGetFullName()<<"]"
+ <<std::endl);
}
//=========================================================================
Program: bbtk
Module: $RCSfile: bbtkBlackBoxDescriptor.h,v $
Language: C++
- Date: $Date: 2008/04/18 12:59:15 $
- Version: $Revision: 1.9 $
+ Date: $Date: 2008/04/22 06:59:31 $
+ Version: $Revision: 1.10 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
STANDARD=0,
ADAPTOR=1,
DEFAULT_ADAPTOR=2,
- WIDGET_ADAPTOR=3,
- DEFAULT_WIDGET_ADAPTOR=4
+ GUI=3,
+ DEFAULT_GUI=4
}
Kind;
Program: bbtk
Module: $RCSfile: bbtkComplexBlackBox.cxx,v $
Language: C++
-Date: $Date: 2008/04/21 12:43:05 $
-Version: $Revision: 1.12 $
+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
bbtkInternalError("ComplexBlackBox::bbBackwardUpdate called with caller=0");
}
+ std::cout << "CBB BUP : "<<caller->GetBlackBoxFrom()->bbGetFullName()
+ <<"."<<caller->GetBlackBoxFromOutput()<<"----"
+ <<caller->GetOriginalBlackBoxFrom()->bbGetFullName()
+ <<"."<<caller->GetOriginalBlackBoxFromOutput()<<std::endl;
+
+
+
IOStatus s = UPTODATE;
const BlackBoxDescriptor::OutputDescriptorMapType& omap
/// 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)
Program: bbtk
Module: $RCSfile: bbtkConnection.cxx,v $
Language: C++
- Date: $Date: 2008/04/18 12:59:15 $
- Version: $Revision: 1.7 $
+ Date: $Date: 2008/04/22 06:59:31 $
+ Version: $Revision: 1.8 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See doc/license.txt or
<<to->bbGetName()<<"\",\""<<input<<"\")"
<<std::endl);
+ bbtkDebugMessage("connection",1,"==> Connection::Connection(\""
+ <<from->bbGetFullName()<<"\",\""<<output<<"\",\""
+ <<to->bbGetFullName()<<"\",\""<<input<<"\")"
+ <<std::endl);
+
if (! from->bbHasOutput(output) )
}
}
- // Lock this pointer !!!
- Pointer p = MakePointer(this,true);
- from->bbConnectOutput(output,p);
- to->bbConnectInput(input,p);
+
mFrom = from;
mOriginalFrom = from;
mTo = to;
mInput = mOriginalInput = input;
mOutput = mOriginalOutput = output;
+ // Lock this pointer !!!
+ Pointer p = MakePointer(this,true);
+ from->bbConnectOutput(output,p);
+ to->bbConnectInput(input,p);
+
+ bbtkDebugMessage("connection",1,"<== Connection::Connection(\""
+ <<from->bbGetFullName()<<"\",\""<<output<<"\",\""
+ <<to->bbGetFullName()<<"\",\""<<input<<"\")"
+ <<std::endl);
+
bbtkDebugMessage("object",2,"==> Connection::Connection(\""
<<from->bbGetName()<<"\",\""<<output<<"\",\""
<<to->bbGetName()<<"\",\""<<input<<"\")"
Program: bbtk
Module: $RCSfile: bbtkExecuter.cxx,v $ $
Language: C++
- Date: $Date: 2008/04/18 12:59:15 $
- Version: $Revision: 1.18 $
+ Date: $Date: 2008/04/22 06:59:31 $
+ Version: $Revision: 1.19 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
Current()->AddToCategory("adaptor");
Current()->SetKind(bbtk::BlackBoxDescriptor::DEFAULT_ADAPTOR);
}
- if (kind=="WIDGET_ADAPTOR")
+ if (kind=="GUI")
{
- Current()->AddToCategory("adaptor");
- Current()->SetKind(bbtk::BlackBoxDescriptor::WIDGET_ADAPTOR);
+ Current()->AddToCategory("gui");
+ Current()->SetKind(bbtk::BlackBoxDescriptor::GUI);
}
- else if (kind=="DEFAULT_WIDGET_ADAPTOR")
+ else if (kind=="DEFAULT_GUI")
{
- Current()->AddToCategory("adaptor");
- Current()->SetKind(bbtk::BlackBoxDescriptor::DEFAULT_WIDGET_ADAPTOR);
+ Current()->AddToCategory("gui");
+ Current()->SetKind(bbtk::BlackBoxDescriptor::DEFAULT_GUI);
}
else
{
bbtkError("Unknown box kind : '"<<kind<<"'. "
<<"Valid kinds are 'ADAPTOR','DEFAULT_ADAPTOR',"
- <<"'WIDGET_ADAPTOR','DEFAULT_WIDGET_ADAPTOR'");
+ <<"'GUI','DEFAULT_GUI'");
}
}
//=======================================================================
Module: $RCSfile: bbtkFactory.cxx,v $
Language: C++
-Date: $Date: 2008/04/21 11:38:19 $
-Version: $Revision: 1.34 $
+Date: $Date: 2008/04/22 06:59:31 $
+Version: $Revision: 1.35 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
++j)
{
if ( ( j->first.mKind ==
- BlackBoxDescriptor::DEFAULT_WIDGET_ADAPTOR) &&
+ BlackBoxDescriptor::DEFAULT_GUI) &&
//(j->first.mTypeIn == typein) &&
(j->first.mTypeOut.GetNature() == typeout.GetNature() )
)
Program: bbtk
Module: $RCSfile: bbtkInterpreter.cxx,v $ $
Language: C++
- Date: $Date: 2008/04/18 12:59:15 $
- Version: $Revision: 1.60 $
+ Date: $Date: 2008/04/22 06:59:31 $
+ Version: $Revision: 1.61 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
/// Runs the interpretation of a command
Interpreter::ExitStatus Interpreter::InterpretLine( const std::string& line )
{
-printf("EED Interpreter::InterpretLine %s \n", line.c_str() );
bbtkDebugMessageInc("Interpreter",9,"Interpreter::InterpretLine('"<<line<<"')"<<std::endl);
ExitStatus status = Interpreter_OK;
Program: bbtk
Module: $RCSfile: bbtkMessageManager.cxx,v $
Language: C++
- Date: $Date: 2008/04/18 12:59:15 $
- Version: $Revision: 1.5 $
+ Date: $Date: 2008/04/22 06:59:31 $
+ Version: $Revision: 1.6 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
mMessageLevel[key] = 0;
mMessageHelp[key] = "Packages related messages";
if (mMaxMessageLength<key.length()) mMaxMessageLength = key.length();
+ key = "connection";
+ mMessageLevel[key] = 0;
+ mMessageHelp[key] = "Connections related messages";
+ if (mMaxMessageLength<key.length()) mMaxMessageLength = key.length();
}
Program: bbtk
Module: $RCSfile: bbtkPackage.cxx,v $
Language: C++
- Date: $Date: 2008/04/18 12:59:15 $
- Version: $Revision: 1.13 $
+ Date: $Date: 2008/04/22 06:59:31 $
+ Version: $Revision: 1.14 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See doc/license.txt or
<<name<<"\")"<<bbtkendl);
AdaptorKey key(typein,typeout,
- BlackBoxDescriptor::DEFAULT_WIDGET_ADAPTOR);
+ BlackBoxDescriptor::DEFAULT_GUI);
AdaptorMapType::const_iterator i = mAdaptorMap.find(key);
if (i == mAdaptorMap.end())
{
AdaptorKey key(/*typein*/
DataInfo(typeid(void),""),
typeout,
- BlackBoxDescriptor::DEFAULT_WIDGET_ADAPTOR);
+ BlackBoxDescriptor::DEFAULT_GUI);
// First try to find a single widget adaptor
AdaptorMapType::const_iterator i = mAdaptorMap.find(key);
if (i == mAdaptorMap.end())
}
}
// If it is a default adaptor, also register it in the adaptors map
- else if ( d->GetKind() == BlackBoxDescriptor::DEFAULT_WIDGET_ADAPTOR)
+ else if ( d->GetKind() == BlackBoxDescriptor::DEFAULT_GUI)
{
bbtkDebugMessage("Kernel",8,"Package<"<<GetName()<<">::RegisterBlackBox(\""<<d->GetTypeName()<<"\") : The box is a widget adaptor, inserting it in adaptors map ..."<<std::endl);
Program: bbtk
Module: $RCSfile: bbtkVirtualExec.h,v $ $
Language: C++
- Date: $Date: 2008/04/18 12:59:16 $
- Version: $Revision: 1.12 $
+ 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
/// Prints the string ... MORE : TO EXPLAIN
virtual void Print(const std::string & message) = 0;
- ComplexBlackBoxDescriptor::Pointer GetWorkspace()
+ virtual ComplexBlackBoxDescriptor::Pointer GetWorkspace()
{ return ComplexBlackBoxDescriptor::Pointer(); }
// static const std::string& GetObjectDescription() = 0;
--- /dev/null
+load wx
+define GUIcolour wx
+ kind DEFAULT_GUI
+ new ColourSelectorButton colour
+ input In colour.In "Initial colour"
+ input Label colour.WinTitle "Label"
+ output Out colour.Out "Selected colour"
+ output Widget colour.Widget "Widget"
+ output BoxChange colour.BoxChange "BoxChange"
+endefine
--- /dev/null
+load std
+load wx
+define GUIint wx
+ kind DEFAULT_GUI
+ new Slider slider
+ set slider.Label true
+# set slider.ReactiveOnTrack true
+ set slider.ChangeResolution true
+ input In slider.In "Initial position"
+ input Label slider.Title "Label"
+ output Out slider.Out "Current position"
+ output Widget slider.Widget "Widget"
+ output BoxChange slider.BoxChange "BoxChange"
+endefine