)
# Install tree
INSTALL(
- PROGRAMS ${BBTK_BINARY_DIR}/bin/bbCreateBlackBox
+ FILES ${BBTK_BINARY_DIR}/bin/bbCreateBlackBox
DESTINATION bin
PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE
)
# Configure / Install the script bbCreatePackage
SET(bbCreatePackage_DATA_REL_PATH_FROM_BIN ../${BBTK_DATA_REL_PATH}/${bbCreatePackage_DATA_REL_PATH_FROM_DATA})
FILE(TO_NATIVE_PATH ${bbCreatePackage_DATA_REL_PATH_FROM_BIN} bbCreatePackage_DATA_REL_PATH_FROM_BIN)
+
IF(WIN32)
# Build tree
CONFIGURE_FILE(
PROGRAMS ${BBTK_BINARY_DIR}/Debug/bbCreatePackage.bat
DESTINATION bin
)
-ENDIF(WIN32)
-
-
-IF(UNIX)
+ELSE(WIN32)
# Build tree
CONFIGURE_FILE(
${CMAKE_CURRENT_SOURCE_DIR}/bbCreatePackage.sh.in
)
# Install tree
INSTALL(
- PROGRAMS ${BBTK_BINARY_DIR}/bin/bbCreatePackage
+ FILES ${BBTK_BINARY_DIR}/bin/bbCreatePackage
DESTINATION bin
+ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
)
-ENDIF(UNIX)
+ENDIF(WIN32)
INSTALL(
FILES ${BBTK_BIN_PATH}/${OUTPUT}
DESTINATION bin
+ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
)
- ADD_CUSTOM_TARGET(${OUTPUT} ALL
+ ADD_CUSTOM_TARGET(
+ ${OUTPUT} ALL
DEPENDS ${BBTK_BIN_PATH}/${OUTPUT}
)
-
-
ENDFOREACH(bbs)
ENDIF (BUILD_BBTK_PACKAGE_${BBTK_PACKAGE_NAME}_BBS_APP)
#----------------------------------------------------------------------------
# Uninstall script
-INSTALL( PROGRAMS bbtk-uninstall.sh
+INSTALL(
+ PROGRAMS bbtk-uninstall.sh
DESTINATION bin
)
Program: bbtk
Module: $RCSfile: bbtkBlackBox.cxx,v $
Language: C++
-Date: $Date: 2008/05/07 12:59:23 $
-Version: $Revision: 1.18 $
+Date: $Date: 2008/05/15 08:02:36 $
+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->bbSetStatus(MODIFIED);
return;
}
+ if ( (c==bbGetInputConnectorMap().find("WinClose")->second) )
+ // && (bbCanReact()))
+ {
+ bbtkDebugMessage("modified",2,
+ "-> Close triggered by WinClose input change"
+ <<std::endl);
+ this->bbHideWindow();
+ this->bbSetStatus(MODIFIED);
+ return;
+ }
if ( ( bbBoxProcessModeIsReactive() ||
(c==bbGetInputConnectorMap().find("BoxExecute")->second))
Program: bbtk
Module: $RCSfile: bbtkBlackBox.h,v $
Language: C++
- Date: $Date: 2008/05/06 13:45:12 $
- Version: $Revision: 1.9 $
+ Date: $Date: 2008/05/15 08:02:36 $
+ 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
virtual void bbShowWindow(Connection::Pointer caller) { }
virtual void bbHideWindow() {}
+ virtual void bbCloseWindow() { }
//==================================================================
//@}
Program: bbtk
Module: $RCSfile: bbtkInterpreter.cxx,v $ $
Language: C++
- Date: $Date: 2008/04/25 08:05:23 $
- Version: $Revision: 1.65 $
+ Date: $Date: 2008/05/15 08:02:36 $
+ Version: $Revision: 1.66 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
//=======================================================================
Interpreter::Pointer Interpreter::New(const std::string& cpp_file)
{
- bbtkDebugMessage("Kernel",9,"Interpreter::New()"<<std::endl);
+ bbtkDebugMessage("Kernel",9,"Interpreter::New('"<<cpp_file<<"')"<<std::endl);
return MakePointer(new Interpreter(cpp_file));
}
//=======================================================================
+ //=======================================================================
+ Interpreter::Pointer Interpreter::New(VirtualExec::Pointer e)
+ {
+ bbtkDebugMessage("Kernel",9,"Interpreter::New(VirtualExec)"<<std::endl);
+ return MakePointer(new Interpreter(e));
+ }
+ //=======================================================================
+
//=======================================================================
Interpreter::Interpreter(const std::string& cpp_file)
- :
- mUser(0),
- mCommandLine(false),
- mThrow(false)
{
+ Init(VirtualExec::Pointer(), cpp_file);
+ }
+ //=======================================================================
+
+ //=======================================================================
+ Interpreter::Interpreter(VirtualExec::Pointer e)
+ {
+ Init(e,"");
+ }
+ //=======================================================================
+ //=======================================================================
+ void Interpreter::Init(VirtualExec::Pointer e, const std::string& cpp_file)
+ {
+ mUser = 0;
+ mCommandLine = false;
+ mThrow = false;
bufferNb =0;
bbtk::MessageManager::RegisterMessageType("echo","Level>0 : Prints the output of the 'print' commands of the user.\n\tLevel>1 : Prints the command being interpreted",1);
bbtk::MessageManager::RegisterMessageType("Interpreter","Messages of the interpreter",0);
bbtkDebugMessageInc("Interpreter",9,"Interpreter::Interpreter()" <<std::endl);
-
- if (cpp_file.size()!=0)
+ if (e)
+ {
+ mVirtualExecuter = e;
+ }
+ else if (cpp_file.size()!=0)
{
mVirtualExecuter = boost::static_pointer_cast<VirtualExec>(bbtk::Transcriptor::New(cpp_file));
}
}
// Lock this pointer or will auto-destruct !!
- mVirtualExecuter->SetInterpreter(MakePointer(this,true));
+ if (!e) mVirtualExecuter->SetInterpreter(MakePointer(this,true));
// For the time being, comment out previous line, and
// uncomment next line to check Transcriptor
Program: bbtk
Module: $RCSfile: bbtkInterpreter.h,v $ $
Language: C++
- Date: $Date: 2008/05/06 13:45:12 $
- Version: $Revision: 1.30 $
+ Date: $Date: 2008/05/15 08:02:36 $
+ Version: $Revision: 1.31 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
typedef Object Superclass;
public:
static Pointer New(const std::string& cpp_file = "");
+ static Pointer New(VirtualExec::Pointer);
typedef enum
{
/// Constructor
Interpreter(const std::string& cpp_file = "");
+ Interpreter(VirtualExec::Pointer);
+
+ void Init(VirtualExec::Pointer, const std::string& cpp_file);
+
/// Opens the file fullPathScriptName
/// includeScriptName is the name as given to the include command
void LoadScript( std::string fullPathScriptName,
Program: bbtk
Module: $RCSfile: bbtkWxBlackBox.cxx,v $
Language: C++
- Date: $Date: 2008/05/14 12:32:26 $
- Version: $Revision: 1.19 $
+ Date: $Date: 2008/05/15 08:02:36 $
+ Version: $Revision: 1.20 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
}
//=========================================================================
+ //=========================================================================
+ void WxBlackBoxWindow::bbClose()
+ {
+ }
+ //=========================================================================
//=========================================================================
}
//=========================================================================
+ //=========================================================================
+ void WxBlackBoxDialog::bbClose()
+ {
+ wxDialog::Close();
+ }
+ //=========================================================================
+
//=========================================================================
WxBlackBoxDialog::~WxBlackBoxDialog()
{
}
//=========================================================================
+ //=========================================================================
+ void WxBlackBoxFrame::bbClose()
+ {
+ wxFrame::Close();
+ }
+ //=========================================================================
//==================================================================
+ //==================================================================
+ void WxBlackBox::bbCloseWindow()
+ {
+ bbtkDebugMessageInc("wx",1,"=> WxBlackBox::bbCloseWindow() ["
+ <<bbGetFullName()<<"]"<<std::endl);
+
+ if (bbGetWindow()!=0) bbGetWindow()->bbClose();
+
+ bbtkDebugMessageDec("wx",1,"<= WxBlackBox::bbCloseWindow() ["
+ <<bbGetFullName()<<"]"<<std::endl);
+ }
+ //==================================================================
+
//==================================================================
WxBlackBox::Window* WxBlackBox::bbGetContainingWindow()
{
Program: bbtk
Module: $RCSfile: bbtkWxBlackBox.h,v $
Language: C++
- Date: $Date: 2008/04/24 10:24:58 $
- Version: $Revision: 1.15 $
+ Date: $Date: 2008/05/15 08:02:36 $
+ Version: $Revision: 1.16 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
BBTK_DECLARE_INPUT(WinHeight,int);
BBTK_DECLARE_INPUT(WinDialog,bool);
BBTK_DECLARE_INPUT(WinHide,Void);
+ BBTK_DECLARE_INPUT(WinClose,Void);
BBTK_DECLARE_OUTPUT(Widget, wxWindow*);//WxBlackBoxWidget*);
public:
void bbShowWindow();
/// Hides the WxBlackBoxWindow associated to the box (if exists)
void bbHideWindow();
+ /// Closes (destroys) the WxBlackBoxWindow associated to the box (if exists)
+ void bbCloseWindow();
//==================================================================
private:
"Title of the window (*)",
std::string,"");
BBTK_INPUT(WxBlackBox,WinWidth,
- "Width of the window (* : only used if the widget is not inserted in another widget)",int,"");
+ "Width of the window (* : only used if the widget is not connected to a Layout box)",int,"");
BBTK_INPUT(WxBlackBox,WinHeight,
"Height of the window (*)",int,"");
BBTK_INPUT(WxBlackBox,WinDialog,
"Set to 'true' to create a dialog window, i.e. which blocks the pipeline until it is closed (modal) (*)",bool,"");
BBTK_INPUT(WxBlackBox,WinHide,
- "Any signal received hides the window (*)",Void,"");
+ "Any signal received hides the window (*)",Void,"signal");
+ BBTK_INPUT(WxBlackBox,WinClose,
+ "Any signal received closes the window (*)",Void,"signal");
BBTK_OUTPUT(WxBlackBox,Widget,"Output widget",wxWindow*,"");
BBTK_END_DESCRIBE_BLACK_BOX(WxBlackBox);
//=================================================================
virtual ~WxBlackBoxWindow();
virtual void bbShow();
virtual void bbHide();
+ virtual void bbClose();
bool bbIsShown() { return mShown; }
virtual WxBlackBox::Pointer bbGetBlackBox() { return mBox.lock(); }
virtual wxDialog* bbGetDialog() { return 0; }
~WxBlackBoxDialog();
void bbShow();
void bbHide();
+ void bbClose();
wxDialog* bbGetDialog() { return this; }
};
//==================================================================
~WxBlackBoxFrame();
void bbShow();
void bbHide();
+ void bbClose();
wxFrame* bbGetFrame() { return this; }
};
//==================================================================
Program: bbtk
Module: $RCSfile: bbtkWxGUIConsole.cxx,v $
Language: C++
- Date: $Date: 2008/05/06 13:45:12 $
- Version: $Revision: 1.11 $
+ Date: $Date: 2008/05/15 08:02:36 $
+ 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
//================================================================
void WxGUIConsole::OnMenuCreatePackage(wxCommandEvent& WXUNUSED(event))
{
- std::string command("toolsbbtk/appli/CreatePackage");
+ std::string command("toolsbbtk/appli/GUICreatePackage");
bbtkMessage("Debug",1,"Executing : '"<<command<<"'"<<std::endl);
Interpreter::Pointer I = Interpreter::New();
//================================================================
void WxGUIConsole::OnMenuCreateBlackBox(wxCommandEvent& WXUNUSED(event))
{
- std::string command("toolsbbtk/appli/CreateBlackBox");
+ std::string command("toolsbbtk/appli/GUICreateBlackBox");
bbtkMessage("Debug",1,"Executing : '"<<command<<"'"<<std::endl);
Interpreter::Pointer I = Interpreter::New();
I->InterpretFile(command);
Program: bbtk
Module: $RCSfile: bbtkWxGUIScriptingInterface.cxx,v $
Language: C++
- Date: $Date: 2008/05/14 12:32:26 $
- Version: $Revision: 1.9 $
+ Date: $Date: 2008/05/15 08:02:36 $
+ 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
void WxGUIScriptingInterface::OnMenuCreatePackage(wxCommandEvent& WXUNUSED(event))
{
- std::string command("toolsbbtk/appli/CreatePackage");
+ std::string command("toolsbbtk/appli/GUICreatePackage");
bbtkMessage("Debug",1,"Executing : '"<<command<<"'"<<std::endl);
Interpreter::Pointer I = Interpreter::New();
//================================================================
void WxGUIScriptingInterface::OnMenuCreateBlackBox(wxCommandEvent& WXUNUSED(event))
{
- std::string command("toolsbbtk/appli/CreateBlackBox");
+ std::string command("toolsbbtk/appli/GUICreateBlackBox");
bbtkMessage("Debug",1,"Executing : '"<<command<<"'"<<std::endl);
Interpreter::Pointer I = Interpreter::New();
{
ccommand[i]=34;
}
- }
+ }
+ std::cout << "*** Executing system command : '"<<ccommand<<"'"<<std::endl;
system ( ccommand.c_str() );
pos1=pos2+1;
pos2 = bbGetInputIn().find(";",pos2+1);
-description "Creates a new bbtk package file structure on disk (Graphical user interface for the script bbCreatePackage)."
-author "laurent.guigues at creatis.insa-lyon.fr"
+description "Creates a new bbtk package file structure on disk (Graphical user interface for the shell script bbCreatePackage)."
+author "laurent.guigues@creatis.insa-lyon.fr"
category "toolsbbtk"
load wx
set name.In "NEW_PACKAGE"
new InputText author
- set author.Title "Author(s) (caracters '<', '>' not accepted...)"
+ set author.Title "Author(s) "
set author.In "_author_"
new InputText description
- set description.Title "Description (caracters '<', '>' not accepted...)"
+ set description.Title "Description (html format)"
set description.In "_description_"
-#new CommandButton cancelButton
-# set cancelButton.In "quit"
-# set cancelButton.Label "Cancel"
+new CommandButton cancelButton
+ set cancelButton.In "print **CANCEL**"
+ set cancelButton.Label "Cancel"
new CommandButton createButton
- set createButton.In "print $concatStr.Out$; exec command; "
+ set createButton.In "print $concatStr.Out$; exec command;"
set createButton.Label "Run"
+
new LayoutLine buttons
set buttons.Orientation Horizontal
- # connect cancelButton.Widget buttons.Widget1
+ connect cancelButton.Widget buttons.Widget1
connect createButton.Widget buttons.Widget2
new LayoutLine main
set main.WinWidth 400
set main.WinHeight 250
-#-----------------------------------------------------------------------------
+new MultipleInputs close
+ connect close.Out main.WinClose
+ connect cancelButton.BoxChange close.In1
+ connect createButton.BoxChange close.In2
-new ASCII ascii
- set ascii.In 34
+#-----------------------------------------------------------------------------
+new Configuration conf
+# on windows : enclose paths between double quotes
+# if system==0 (Linux) dquote=space (ascci code 32)
+# if system==1 (Win) dquote==" (ascii code 34)
+new StringSelect onsystem
+set onsystem.In0 "32"
+set onsystem.In1 "34"
+new ASCII dquote
+connect conf.SystemType onsystem.In
+connect onsystem.Out dquote.In
+#set dquote.In 34
new ConcatStrings dirStr
set dirStr.In1 " "
- connect ascii.Out dirStr.In2
+ connect dquote.Out dirStr.In2
connect dir.Out dirStr.In3
- connect ascii.Out dirStr.In4
+ connect dquote.Out dirStr.In4
set dirStr.In5 " "
new ConcatStrings nameStr
-new Configuration conf
new ConcatStrings concatStrCommand
set concatStrCommand.In1 " "
- connect ascii.Out concatStrCommand.In2
+ connect dquote.Out concatStrCommand.In2
connect conf.BinPath concatStrCommand.In3
connect conf.FileSeparator concatStrCommand.In4
set concatStrCommand.In5 "bbCreatePackage"
- connect ascii.Out concatStrCommand.In6
+ connect dquote.Out concatStrCommand.In6
set concatStrCommand.In7 " "
new ConcatStrings concatStr
- connect ascii.Out concatStr.In1
+ connect dquote.Out concatStr.In1
connect concatStrCommand.Out concatStr.In2
connect dirStr.Out concatStr.In3
connect nameStr.Out concatStr.In4
connect authorStr.Out concatStr.In5
connect descriptionStr.Out concatStr.In6
- connect ascii.Out concatStr.In7
+ connect dquote.Out concatStr.In7
new ExecSystemCommand command
connect concatStr.Out command.In
+/*
+new OutputText FinalMessage
+set FinalMessage.WinWidth 100
+set FinalMessage.WinHeight 100
+set FinalMessage.In "Done !"
+*/
+
exec dir
+#message all 9
exec main
Program: bbtk
Module: $RCSfile: bbwxCommandButton.cxx,v $
Language: C++
- Date: $Date: 2008/04/18 12:59:52 $
- Version: $Revision: 1.7 $
+ Date: $Date: 2008/05/15 08:02:37 $
+ 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
void CommandButtonWidget::OnCommandButton( wxEvent& )
{
- // Look for the interpreter
+ // Look for the interpreter or the executer if no interpreter
bbtk::Interpreter::Pointer I;
+ bbtk::VirtualExec::Pointer E;
if (mBox->bbGetParent() != 0)
{
bbtk::Factory::Pointer f = boost::dynamic_pointer_cast<bbtk::ComplexBlackBoxDescriptor>(mBox->bbGetParent()->bbGetDescriptor())->GetFactory();
if ((f != 0)&&
(f->GetExecuter()))
{
- I = f->GetExecuter()->GetInterpreter();
+ E = f->GetExecuter();
+ I = E->GetInterpreter();
}
}
if (I==0)
{
- // bbtkError("ExecBbiCommand::DoProcess() : could not find interpreter");
- I = bbtk::Interpreter::New();
+ // bbtkError("CommandButton::DoProcess() : could not find interpreter");
+ if (E==0)
+ {
+ // If no executer : create a totally independant interpreter
+ I = bbtk::Interpreter::New();
+ }
+ else
+ {
+ // If executer : create an interpreter using E
+ I = bbtk::Interpreter::New(E);
+ }
}
std::string commandstr(mBox->bbGetInputIn());
Program: bbtk
Module: $RCSfile: bbwxvtkViewer2D.cxx,v $
Language: C++
- Date: $Date: 2008/05/14 12:32:26 $
- Version: $Revision: 1.6 $
+ Date: $Date: 2008/05/15 08:02:37 $
+ Version: $Revision: 1.7 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
void Viewer2D::Process()
{
- // LG : Bug when initial slice != 0 on first time
+ // LG : Bug on Linux (wxGTK) when initial slice != 0 on first time
// (see wxvtk/appli/ExampleSimpleSlicer)
// I think there is a problem with rendering before window
// has been reparented ... we have to check this
- // ((Viewer2DWidget*)bbGetOutputWidget())->UpdateView();
+ ((Viewer2DWidget*)bbGetOutputWidget())->UpdateView();
bbSetOutputOut( bbGetInputSlice() );
}