// main frame
bool wxBBIApp::OnInit( )
{
- std::cout << "OnInit"<<std::endl;
+ // std::cout << "OnInit"<<std::endl;
wxApp::OnInit();
#ifdef __WXGTK__
//See http://www.wxwindows.org/faqgtk.htm#locale
// std::cout << "!I->Close"<<std::endl;
}
- std::cout << "EO OnInit"<<std::endl;
+ // std::cout << "EO OnInit"<<std::endl;
return true;
Program: bbtk
Module: $RCSfile: bbtkAtomicBlackBox.cxx,v $
Language: C++
- Date: $Date: 2008/10/17 08:18:12 $
- Version: $Revision: 1.8 $
+ Date: $Date: 2008/11/13 14:46:43 $
+ Version: $Revision: 1.9 $
=========================================================================*/
/* ---------------------------------------------------------------------
"=> AtomicBlackBox::bbBackwardUpdate("
<<(caller?caller->GetFullName():"0")<<") ["
<<bbGetFullName()<<"]"<<std::endl);
-
+
+ // If already executing : return
+ if (bbGetExecuting())
+ {
+ bbtkDebugMessage("process",3,
+ " -> already executing : bailing out"<<std::endl);
+ return bbGetStatus();
+ }
+ bbSetExecuting(true);
+ bool wasExecuting = bbGlobalGetSomeBoxExecuting();
+ bbGlobalSetSomeBoxExecuting(true);
+
bbtkDebugMessage("process",5,"Initial Status = "<<bbGetStatus()
<<std::endl);
bbtkDebugMessage("process",5,"BoxProcessMode = "
( bbBoxProcessModeIsAlways() ) )
{
- bbSetStatus(UPDATING);
-
- bool wasExecuting = bbGlobalGetSomeBoxExecuting();
- bbGlobalSetSomeBoxExecuting(true);
+ // bbSetStatus(UPDATING);
// Updates its inputs
IOStatus s = bbUpdateInputs();
- bbtkDebugMessage("process",6,"Inputs post-update status = "<<s<<std::endl);
+ bbtkDebugMessage("process",6,"=> AtomicBlackBox::bbBackwardUpdate("
+ <<(caller?caller->GetFullName():"0")<<") ["
+ <<bbGetFullName()<<"] : Inputs post-update status = "<<s<<std::endl);
// If all inputs are in UPTODATE post-update status
// and mProcessMode is not "Always"
// then the box is now UPTODATE
// Displays the window (WxBlackbox)
bbShowWindow(caller);
- bbGlobalSetSomeBoxExecuting(wasExecuting);
}
else
bbtkDebugMessage("process",5,"Up-to-date : nothing to do"<<std::endl);
}
- bbtkDebugMessage("process",5,"Final Status = "
- <<bbGetStatus()<<std::endl);
+ bbtkDebugMessage("process",5,"=> AtomicBlackBox::bbBackwardUpdate("
+ <<(caller?caller->GetFullName():"0")<<") ["
+ <<bbGetFullName()<<"] : Final Status = "
+ <<bbGetStatus()<<std::endl);
bbtkDebugMessage("process",3,
"<= AtomicBlackBox::bbBackwardUpdate() ["
<<bbGetFullName()<<"]"<<std::endl);
+ bbSetExecuting(false);
+ bbGlobalSetSomeBoxExecuting(wasExecuting);
return bbGetStatus();
Program: bbtk
Module: $RCSfile: bbtkAtomicBlackBoxMacros.h,v $
Language: C++
- Date: $Date: 2008/10/17 08:18:12 $
- Version: $Revision: 1.11 $
+ Date: $Date: 2008/11/13 14:46:43 $
+ Version: $Revision: 1.12 $
=========================================================================*/
/* ---------------------------------------------------------------------
bbtkDebugMessage("process",1,"**> Processing ["<<bbGetFullName() \
<<"]"<<std::endl); \
CALLBACK(); \
- bbtkDebugMessage("process",2,"<** Processing ["<<bbGetFullName() \
+ bbtkDebugMessage("process",1,"<** Processing ["<<bbGetFullName() \
<<"]"<<std::endl); \
}
//============================================================================
Program: bbtk
Module: $RCSfile: bbtkBlackBox.cxx,v $
Language: C++
- Date: $Date: 2008/11/13 10:37:27 $
- Version: $Revision: 1.27 $
+ Date: $Date: 2008/11/13 14:46:43 $
+ Version: $Revision: 1.28 $
=========================================================================*/
/* ---------------------------------------------------------------------
BlackBox::BlackBox(const std::string &name)
:
bbmStatus(MODIFIED),
+ bbmExecuting(false),
bbmName(name),
bbmBoxProcessMode("Pipeline"),
bbmParent()
BlackBox::BlackBox(BlackBox& from, const std::string &name)
:
bbmStatus(from.bbmStatus),
+ bbmExecuting(false),
bbmName(name),
bbmBoxProcessMode(from.bbmBoxProcessMode),
bbmParent()
void BlackBox::bbExecute(bool force)
{
bbtkDebugMessageInc("process",2,
- "=> BlackBox::bbExecute() ["
+ "=> BlackBox::bbExecute("<<(int)force<<") ["
<<bbGetFullName()<<"]"<<std::endl);
+ // If already executing : return
+ if (bbGetExecuting())
+ {
+ bbtkDebugMessage("process",2,
+ " -> already executing : bailing out"<<std::endl);
+ return;
+ }
// If execution frozen : return
if (bbGlobalGetFreezeExecution())
Program: bbtk
Module: $RCSfile: bbtkBlackBox.h,v $
Language: C++
- Date: $Date: 2008/10/17 08:18:12 $
- Version: $Revision: 1.13 $
+ Date: $Date: 2008/11/13 14:46:43 $
+ Version: $Revision: 1.14 $
=========================================================================*/
/* ---------------------------------------------------------------------
/// which means execute in response to an input change
virtual bool bbCanReact() const;
+ /// Returns true iff the box is executing
+ bool bbGetExecuting() const { return bbmExecuting; }
+
protected:
static void bbGlobalAddToExecutionList( BlackBox::Pointer b );
static void bbGlobalProcessExecutionList();
+ /// Sets the bbmExecuting bool returned by bbGetExecuting
+ void bbSetExecuting(bool b) { bbmExecuting = b; }
//==================================================================
protected:
// PRIVATE PART
/// The status of the box
IOStatus bbmStatus;
+ /// Is the box executing ?
+ bool bbmExecuting;
/// The name of the black-box
std::string bbmName;
/// The name of the package to which it belongs
Program: bbtk
Module: $RCSfile: bbtkConnection.h,v $
Language: C++
- Date: $Date: 2008/10/17 08:18:13 $
- Version: $Revision: 1.8 $
+ Date: $Date: 2008/11/13 14:46:43 $
+ Version: $Revision: 1.9 $
=========================================================================*/
/* ---------------------------------------------------------------------
const int MODIFIED = 0;
///
const int UPTODATE = 1;
- ///
- const int UPDATING = 2;
+ /// OBSOLETE
+ /// const int UPDATING = 2;
class BBTK_EXPORT Connection : public Object
Program: bbtk
Module: $RCSfile: bbtkWxBlackBox.cxx,v $
Language: C++
- Date: $Date: 2008/10/17 08:18:14 $
- Version: $Revision: 1.27 $
+ Date: $Date: 2008/11/13 14:46:43 $
+ Version: $Revision: 1.28 $
=========================================================================*/
/* ---------------------------------------------------------------------
void WxBlackBox::bbExecute(bool force)
{
bbtkDebugMessageInc("process",2,
- "=> WxBlackBox::bbExecute() ["
+ "=> WxBlackBox::bbExecute("<<(int)force<<") ["
<<bbGetFullName()<<"]"<<std::endl);
// If the output 'Widget' is connected then
"=> WxBlackBox::bbBackwardUpdate("
<<(caller?caller->GetFullName():"0")<<") ["
<<bbGetFullName()<<"]"<<std::endl);
- // If the caller's box to is not the box to connected to the
- // output 'Widget'
+
if ( ! (( bbGetStatus() == MODIFIED ) ||
( bbBoxProcessModeIsAlways() )) )
{
return bbGetStatus();
}
+ // If the caller's box to is not the box to connected to the
+ // output 'Widget'
+
BlackBox::OutputConnectorMapType::const_iterator i
= bbGetOutputConnectorMap().find("Widget") ;
if ( i->second->GetConnectionVector().size() != 0 )
((caller!=0) &&
(caller->GetBlackBoxTo() != to))&&
(!bbGetUpdateTransferedToParent())&&
- (to->bbGetStatus()!=UPDATING))
+ (!to->bbGetExecuting()))
{
bbtkDebugMessage("process",3,
" ... Transfering update order to parent"
}
- bbtkDebugMessage("wx",1,"<= WxBlackBox::bbShowWindow() ["
+ bbtkDebugMessage("wx",2,"<= WxBlackBox::bbShowWindow() ["
<<bbGetFullName()<<"]"<<std::endl);
}
if (bbGetWindow()!=0) bbGetWindow()->bbHide();
- bbtkDebugMessageDec("wx",1,"<= WxBlackBox::bbHideWindow() ["
+ bbtkDebugMessageDec("wx",2,"<= WxBlackBox::bbHideWindow() ["
<<bbGetFullName()<<"]"<<std::endl);
}
//==================================================================
if (bbGetWindow()!=0) bbGetWindow()->bbClose();
- bbtkDebugMessageDec("wx",1,"<= WxBlackBox::bbCloseWindow() ["
+ bbtkDebugMessageDec("wx",2,"<= WxBlackBox::bbCloseWindow() ["
<<bbGetFullName()<<"]"<<std::endl);
}
//==================================================================
Program: bbtk
Module: $RCSfile: bbtkWxBlackBox.h,v $
Language: C++
- Date: $Date: 2008/10/17 08:18:15 $
- Version: $Revision: 1.18 $
+ Date: $Date: 2008/11/13 14:46:43 $
+ Version: $Revision: 1.19 $
========================================================================*/
public: \
inline void bbUserCreateWidget() \
{ \
- bbtkDebugMessageInc("process",1,"**> Creating widget for [" \
+ bbtkDebugMessageInc("wx",1,"**> Creating widget for [" \
<<bbGetFullName()<<"]"<<std::endl); \
CALLBACK(); \
- bbtkDebugMessageInc("process",2,"<** Creating widget for [" \
+ bbtkDebugMessageInc("wx",1,"<** Creating widget for [" \
+ <<bbGetFullName()<<"]"<<std::endl); \
+ }
+
+ //======================================================================
+
+ //======================================================================
+ /// Defines the bbUserOnShow method
+#define BBTK_ON_SHOW_WIDGET(CALLBACK) \
+ public: \
+ inline void bbUserOnShow() \
+ { \
+ bbtkDebugMessageInc("wx",1,"**> Showing [" \
+ <<bbGetFullName()<<"]"<<std::endl); \
+ CALLBACK(); \
+ bbtkDebugMessageInc("wx",1,"<** Showing [" \
<<bbGetFullName()<<"]"<<std::endl); \
}
Program: bbtk
Module: $RCSfile: bbwxLayoutLine.cxx,v $
Language: C++
- Date: $Date: 2008/10/17 08:18:32 $
- Version: $Revision: 1.5 $
+ Date: $Date: 2008/11/13 14:46:46 $
+ Version: $Revision: 1.6 $
=========================================================================*/
/* ---------------------------------------------------------------------
// This callback is necessary to get actual processing of the view
// when window is shown
- void LayoutLine::bbUserOnShow()
+ void LayoutLine::OnShowWidget()
{
bbUserOnShowWidget("Widget1");
bbUserOnShowWidget("Widget2");
Program: bbtk
Module: $RCSfile: bbwxLayoutLine.h,v $
Language: C++
- Date: $Date: 2008/10/17 08:18:32 $
- Version: $Revision: 1.5 $
+ Date: $Date: 2008/11/13 14:46:46 $
+ Version: $Revision: 1.6 $
=========================================================================*/
/* ---------------------------------------------------------------------
BBTK_DECLARE_INPUT(Orientation,std::string);
BBTK_PROCESS(Process);
BBTK_CREATE_WIDGET(CreateWidget);
-
+ BBTK_ON_SHOW_WIDGET(OnShowWidget);
+
void Process();
void CreateWidget();
- void bbUserOnShow();
+ void OnShowWidget();
protected:
virtual void bbUserConstructor();
Program: bbtk
Module: $RCSfile: bbwxLayoutSplit.cxx,v $
Language: C++
- Date: $Date: 2008/10/21 08:37:09 $
- Version: $Revision: 1.6 $
+ Date: $Date: 2008/11/13 14:46:46 $
+ Version: $Revision: 1.7 $
=========================================================================*/
/* ---------------------------------------------------------------------
// This callback is necessary to get actual processing of the view
// when window is shown
- void LayoutSplit::bbUserOnShow()
+ void LayoutSplit::OnShowWidget()
{
+ if (bbGetOutputWidget()==0)
+ {
+ return;
+ //bbtkError("LayoutSplit::OnShowWidget() : Output Widget == 0 !");
+ }
wxSplitterWindow* win = (wxSplitterWindow*)bbGetOutputWidget();
int w,h;
+ if (win==0)
+ {
+ return;
+ // bbtkError("LayoutSplit::OnShowWidget() : win == 0 !");
+ }
win->GetClientSize(&w,&h);
int pos = 100;
if (bbtk::Utilities::loosematch(bbGetInputOrientation(),
Program: bbtk
Module: $RCSfile: bbwxLayoutSplit.h,v $
Language: C++
- Date: $Date: 2008/10/17 08:18:32 $
- Version: $Revision: 1.5 $
+ Date: $Date: 2008/11/13 14:46:46 $
+ Version: $Revision: 1.6 $
=========================================================================*/
/* ---------------------------------------------------------------------
BBTK_DECLARE_INPUT(Proportion,int);
BBTK_PROCESS(Process);
BBTK_CREATE_WIDGET(CreateWidget);
+ BBTK_ON_SHOW_WIDGET(OnShowWidget);
void Process();
void CreateWidget();
- void bbUserOnShow();
+ void OnShowWidget();
protected:
virtual void bbUserConstructor();
Program: bbtk
Module: $RCSfile: bbwxLayoutTab.cxx,v $
Language: C++
- Date: $Date: 2008/10/17 08:18:32 $
- Version: $Revision: 1.5 $
+ Date: $Date: 2008/11/13 14:46:46 $
+ Version: $Revision: 1.6 $
=========================================================================*/
/* ---------------------------------------------------------------------
// This callback is necessary to get actual processing of the view
// when window is shown
- void LayoutTab::bbUserOnShow()
+ void LayoutTab::OnShowWidget()
{
bbGetOutputWidget()->Show();
bbUserOnShowWidget("Widget1");
Program: bbtk
Module: $RCSfile: bbwxLayoutTab.h,v $
Language: C++
- Date: $Date: 2008/10/17 08:18:32 $
- Version: $Revision: 1.6 $
+ Date: $Date: 2008/11/13 14:46:46 $
+ Version: $Revision: 1.7 $
=========================================================================*/
/* ---------------------------------------------------------------------
BBTK_DECLARE_INPUT(Orientation,std::string);
BBTK_PROCESS(Process);
BBTK_CREATE_WIDGET(CreateWidget);
-
+ BBTK_ON_SHOW_WIDGET(OnShowWidget);
+
void Process();
void CreateWidget();
- void bbUserOnShow();
+ void OnShowWidget();
protected:
virtual void bbUserConstructor();
Program: bbtk
Module: $RCSfile: bbwxvtkViewer2D.cxx,v $
Language: C++
- Date: $Date: 2008/10/24 12:15:27 $
- Version: $Revision: 1.18 $
+ Date: $Date: 2008/11/13 14:46:48 $
+ 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
// This callback is necessary to get actual processing of the view
// when window is shown
- void Viewer2D::bbUserOnShow()
+ void Viewer2D::OnShowWidget()
{
#if defined(_WIN32)
Program: bbtk
Module: $RCSfile: bbwxvtkViewer2D.h,v $
Language: C++
- Date: $Date: 2008/09/10 12:01:48 $
- Version: $Revision: 1.8 $
+ Date: $Date: 2008/11/13 14:46:48 $
+ Version: $Revision: 1.9 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
BBTK_DECLARE_OUTPUT(Out,int);
BBTK_DECLARE_OUTPUT(Renderer,vtkRenderer*);
BBTK_PROCESS(Process);
- void Process();
BBTK_CREATE_WIDGET(CreateWidget);
+ BBTK_ON_SHOW_WIDGET(OnShowWidget);
+
+ void Process();
void CreateWidget();
- void bbUserOnShow();
+ void OnShowWidget();
void bbUserConstructor();
};
Program: bbtk
Module: $RCSfile: bbwxvtkViewer3D.cxx,v $
Language: C++
- Date: $Date: 2008/06/26 18:45:58 $
- Version: $Revision: 1.8 $
+ Date: $Date: 2008/11/13 14:46:48 $
+ Version: $Revision: 1.9 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
// This callback is necessary to get actual processing of the view
// when window is shown
- void Viewer3D::bbUserOnShow()
+ void Viewer3D::OnShowWidget()
{
((Viewer3DWidget*)bbGetOutputWidget())->Update();
}
Program: bbtk
Module: $RCSfile: bbwxvtkViewer3D.h,v $
Language: C++
- Date: $Date: 2008/09/10 12:01:48 $
- Version: $Revision: 1.9 $
+ Date: $Date: 2008/11/13 14:46:48 $
+ 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
BBTK_DECLARE_OUTPUT(Renderer,vtkRenderer*);
BBTK_DECLARE_OUTPUT(Interactor,wxVTKRenderWindowInteractor*);
BBTK_PROCESS(Process);
- void Process();
BBTK_CREATE_WIDGET(CreateWidget);
+ BBTK_ON_SHOW_WIDGET(OnShowWidget);
+
+ void Process();
void CreateWidget();
- void bbUserOnShow();
+ void OnShowWidget();
protected:
virtual void bbUserConstructor();