From: guigues Date: Thu, 15 May 2008 08:02:35 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: r0.6.1~36 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=857e5e5bd003d20cb8bc4539b6fca4ca9d50929c;p=bbtk.git *** empty log message *** --- diff --git a/kernel/appli/bbCreateBlackBox/CMakeLists.txt b/kernel/appli/bbCreateBlackBox/CMakeLists.txt index 0069e42..ad8f600 100644 --- a/kernel/appli/bbCreateBlackBox/CMakeLists.txt +++ b/kernel/appli/bbCreateBlackBox/CMakeLists.txt @@ -56,7 +56,7 @@ IF(UNIX) ) # 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 ) diff --git a/kernel/appli/bbCreatePackage/CMakeLists.txt b/kernel/appli/bbCreatePackage/CMakeLists.txt index 31a21b6..d31261a 100644 --- a/kernel/appli/bbCreatePackage/CMakeLists.txt +++ b/kernel/appli/bbCreatePackage/CMakeLists.txt @@ -37,6 +37,7 @@ INSTALL( # 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( @@ -54,10 +55,7 @@ IF(WIN32) 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 @@ -66,10 +64,11 @@ IF(UNIX) ) # 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) diff --git a/kernel/cmake/BBTKConfigurePackage_bbs.cmake b/kernel/cmake/BBTKConfigurePackage_bbs.cmake index 17c24d4..025a901 100644 --- a/kernel/cmake/BBTKConfigurePackage_bbs.cmake +++ b/kernel/cmake/BBTKConfigurePackage_bbs.cmake @@ -70,12 +70,12 @@ IF (BUILD_BBTK_PACKAGE_${BBTK_PACKAGE_NAME}_BBS_APP) 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) #---------------------------------------------------------------------------- diff --git a/kernel/install/linux/CMakeLists.txt b/kernel/install/linux/CMakeLists.txt index 3c73550..853259d 100644 --- a/kernel/install/linux/CMakeLists.txt +++ b/kernel/install/linux/CMakeLists.txt @@ -1,4 +1,5 @@ # Uninstall script -INSTALL( PROGRAMS bbtk-uninstall.sh +INSTALL( + PROGRAMS bbtk-uninstall.sh DESTINATION bin ) diff --git a/kernel/src/bbtkBlackBox.cxx b/kernel/src/bbtkBlackBox.cxx index 7b3c4a8..5cffb50 100644 --- a/kernel/src/bbtkBlackBox.cxx +++ b/kernel/src/bbtkBlackBox.cxx @@ -3,8 +3,8 @@ 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 @@ -434,6 +434,16 @@ namespace bbtk this->bbSetStatus(MODIFIED); return; } + if ( (c==bbGetInputConnectorMap().find("WinClose")->second) ) + // && (bbCanReact())) + { + bbtkDebugMessage("modified",2, + "-> Close triggered by WinClose input change" + <bbHideWindow(); + this->bbSetStatus(MODIFIED); + return; + } if ( ( bbBoxProcessModeIsReactive() || (c==bbGetInputConnectorMap().find("BoxExecute")->second)) diff --git a/kernel/src/bbtkBlackBox.h b/kernel/src/bbtkBlackBox.h index eb6f46c..ba86ed6 100644 --- a/kernel/src/bbtkBlackBox.h +++ b/kernel/src/bbtkBlackBox.h @@ -3,8 +3,8 @@ 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 @@ -340,6 +340,7 @@ bool reaction = true); virtual void bbShowWindow(Connection::Pointer caller) { } virtual void bbHideWindow() {} + virtual void bbCloseWindow() { } //================================================================== //@} diff --git a/kernel/src/bbtkInterpreter.cxx b/kernel/src/bbtkInterpreter.cxx index 62f5233..f908f65 100644 --- a/kernel/src/bbtkInterpreter.cxx +++ b/kernel/src/bbtkInterpreter.cxx @@ -3,8 +3,8 @@ 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 @@ -42,25 +42,48 @@ namespace bbtk //======================================================================= Interpreter::Pointer Interpreter::New(const std::string& cpp_file) { - bbtkDebugMessage("Kernel",9,"Interpreter::New()"<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()" <(bbtk::Transcriptor::New(cpp_file)); } @@ -72,7 +95,7 @@ namespace bbtk } // 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 diff --git a/kernel/src/bbtkInterpreter.h b/kernel/src/bbtkInterpreter.h index 2e7ba4d..2970854 100644 --- a/kernel/src/bbtkInterpreter.h +++ b/kernel/src/bbtkInterpreter.h @@ -3,8 +3,8 @@ 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 @@ -90,6 +90,7 @@ namespace bbtk typedef Object Superclass; public: static Pointer New(const std::string& cpp_file = ""); + static Pointer New(VirtualExec::Pointer); typedef enum { @@ -267,6 +268,10 @@ namespace bbtk /// 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, diff --git a/kernel/src/bbtkWxBlackBox.cxx b/kernel/src/bbtkWxBlackBox.cxx index 37bfe4d..781d025 100644 --- a/kernel/src/bbtkWxBlackBox.cxx +++ b/kernel/src/bbtkWxBlackBox.cxx @@ -3,8 +3,8 @@ 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 @@ -93,6 +93,11 @@ namespace bbtk } //========================================================================= + //========================================================================= + void WxBlackBoxWindow::bbClose() + { + } + //========================================================================= //========================================================================= @@ -153,6 +158,13 @@ namespace bbtk } //========================================================================= + //========================================================================= + void WxBlackBoxDialog::bbClose() + { + wxDialog::Close(); + } + //========================================================================= + //========================================================================= WxBlackBoxDialog::~WxBlackBoxDialog() { @@ -234,6 +246,12 @@ namespace bbtk } //========================================================================= + //========================================================================= + void WxBlackBoxFrame::bbClose() + { + wxFrame::Close(); + } + //========================================================================= @@ -645,6 +663,19 @@ namespace bbtk //================================================================== + //================================================================== + void WxBlackBox::bbCloseWindow() + { + bbtkDebugMessageInc("wx",1,"=> WxBlackBox::bbCloseWindow() [" + <bbClose(); + + bbtkDebugMessageDec("wx",1,"<= WxBlackBox::bbCloseWindow() [" + <InterpretFile(command); diff --git a/kernel/src/bbtkWxGUIScriptingInterface.cxx b/kernel/src/bbtkWxGUIScriptingInterface.cxx index 77a0d3a..de7e616 100644 --- a/kernel/src/bbtkWxGUIScriptingInterface.cxx +++ b/kernel/src/bbtkWxGUIScriptingInterface.cxx @@ -3,8 +3,8 @@ 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 @@ -349,7 +349,7 @@ namespace bbtk void WxGUIScriptingInterface::OnMenuCreatePackage(wxCommandEvent& WXUNUSED(event)) { - std::string command("toolsbbtk/appli/CreatePackage"); + std::string command("toolsbbtk/appli/GUICreatePackage"); bbtkMessage("Debug",1,"Executing : '"<' 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 @@ -53,16 +54,29 @@ 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 @@ -82,29 +96,36 @@ new ConcatStrings descriptionStr -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 diff --git a/packages/wx/src/bbwxCommandButton.cxx b/packages/wx/src/bbwxCommandButton.cxx index e48681d..aeea215 100644 --- a/packages/wx/src/bbwxCommandButton.cxx +++ b/packages/wx/src/bbwxCommandButton.cxx @@ -3,8 +3,8 @@ 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 @@ -67,21 +67,32 @@ namespace bbwx 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(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()); diff --git a/packages/wxvtk/src/bbwxvtkViewer2D.cxx b/packages/wxvtk/src/bbwxvtkViewer2D.cxx index d36fc6d..a42cff3 100644 --- a/packages/wxvtk/src/bbwxvtkViewer2D.cxx +++ b/packages/wxvtk/src/bbwxvtkViewer2D.cxx @@ -3,8 +3,8 @@ 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 @@ -206,12 +206,12 @@ namespace bbwxvtk 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() ); }