]> Creatis software - bbtk.git/commitdiff
Create Black Box bbs + .bat + Bug interface Windows
authorEduardo Davila <Eduardo.Davila@creatis.insa-lyon.fr>
Mon, 17 Mar 2008 07:04:06 +0000 (07:04 +0000)
committerEduardo Davila <Eduardo.Davila@creatis.insa-lyon.fr>
Mon, 17 Mar 2008 07:04:06 +0000 (07:04 +0000)
21 files changed:
kernel/appli/CMakeLists.txt
kernel/appli/bbCreateBlackBox/CMakeLists.txt [new file with mode: 0644]
kernel/appli/bbCreateBlackBox/bbCreateBlackBox.bat.in [new file with mode: 0644]
kernel/appli/bbCreateBlackBox/bbCreateBlackBox.sh.in [new file with mode: 0644]
kernel/appli/bbCreateBlackBox/xml-templates/VTK_ImageAlgorithm-template.xml [new file with mode: 0644]
kernel/appli/bbCreateBlackBox/xml-templates/VTK_PolyDataAlgorithm-template.xml [new file with mode: 0644]
kernel/appli/bbCreateBlackBox/xml-templates/std-template.xml [new file with mode: 0644]
kernel/appli/bbCreateBlackBox/xml-templates/widget-template.xml [new file with mode: 0644]
kernel/appli/bbCreatePackage/CMakeLists.txt
kernel/appli/bbCreatePackage/bbCreatePackage.bat.in
kernel/cmake/BBTKKernelConfig.cmake
kernel/doc/CMakeLists.txt
kernel/src/bbtkInterpreter.cxx
kernel/src/bbtkWxBrowser.cxx
kernel/src/bbtkWxConsole.cxx
kernel/src/bbtkWxConsole.h
packages/toolsbbtk/bbs/appli/CreateBlackBox.bbs [new file with mode: 0644]
packages/toolsbbtk/bbs/appli/CreateBox.bbs [deleted file]
packages/toolsbbtk/bbs/appli/CreatePackage.bbs
packages/wx/src/bbwxDirectorySelector.cxx
packages/wxvtk/bbs/appli/ExampleBasicImageApplication.bbs

index c049009ef51e51f82cb59cd68c2fb5a5117a5cd2..9e03012a7720f06cf74eb2946634b71d22c98265 100644 (file)
@@ -16,3 +16,6 @@ SUBDIRS(bbfy)
 SUBDIRS(bbCreatePackage)
 
 
+# Utility that creates the file architecture for a new user package 
+SUBDIRS(bbCreateBlackBox)
+
diff --git a/kernel/appli/bbCreateBlackBox/CMakeLists.txt b/kernel/appli/bbCreateBlackBox/CMakeLists.txt
new file mode 100644 (file)
index 0000000..ea745ba
--- /dev/null
@@ -0,0 +1,70 @@
+# Installs bbCreatePackage.bat/.sh  
+# used to creates the file architecture for a new user package
+
+# go to data which install the input data to the script
+#SUBDIRS(data)
+
+# Sets the data install path
+
+# Relative path to the data used by bbCreatePackage from data root folder
+SET(bbCreateBlackBox_DATA_REL_PATH_FROM_DATA kernel/bbCreateBlackBox)
+
+# Configure / Install the empty package structure used by bbCreatePackage
+# Copy it into build tree
+FILE(GLOB_RECURSE LST_FILE_VOID_CREATE_PACKAGE RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/xml-templates *.xml )
+FOREACH( iLST  ${LST_FILE_VOID_CREATE_PACKAGE})
+     STRING(SUBSTRING ${iLST} 0 3 subStrTmp )
+  IF( ${subStrTmp} STREQUAL "../" )
+       # ...
+  ELSE( ${subStrTmp} STREQUAL "../" )
+    CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/xml-templates/${iLST} 
+      ${BBTK_DATA_BUILD_PATH}/${bbCreateBlackBox_DATA_REL_PATH_FROM_DATA}/xml-templates/${iLST} 
+      COPYONLY )
+  ENDIF( ${subStrTmp} STREQUAL "../" )
+ENDFOREACH(iLST)
+# Install the build tree folder
+INSTALL( 
+  DIRECTORY ${BBTK_DATA_BUILD_PATH}/${bbCreateBlackBox_DATA_REL_PATH_FROM_DATA}/xml-templates
+  DESTINATION ${BBTK_DATA_INSTALL_PATH}/${bbCreateBlackBox_DATA_REL_PATH_FROM_DATA}
+  )  
+
+# Configure / Install the script bbCreatePackage
+SET(bbCreateBlackBox_DATA_REL_PATH_FROM_BIN ../${BBTK_DATA_REL_PATH}/${bbCreateBlackBox_DATA_REL_PATH_FROM_DATA})
+FILE(TO_NATIVE_PATH ${bbCreateBlackBox_DATA_REL_PATH_FROM_BIN} bbCreateBlackBox_DATA_REL_PATH_FROM_BIN)
+IF(WIN32)
+  # Build tree 
+  CONFIGURE_FILE(
+    ${CMAKE_CURRENT_SOURCE_DIR}/bbCreateBlackBox.bat.in
+    ${BBTK_BINARY_DIR}/Debug/bbCreateBlackBox.bat
+    @ONLY IMMEDIATE
+    )
+  CONFIGURE_FILE(
+    ${CMAKE_CURRENT_SOURCE_DIR}/bbCreateBlackBox.bat.in
+    ${BBTK_BINARY_DIR}/Release/bbCreateBlackBox.bat
+    @ONLY IMMEDIATE
+    )
+  # install tree
+  INSTALL(
+    PROGRAMS ${BBTK_BINARY_DIR}/Debug/bbCreateBlackBox.bat
+    DESTINATION bin
+    )
+ENDIF(WIN32)
+
+
+IF(UNIX)
+  # Build tree 
+  CONFIGURE_FILE(
+    ${CMAKE_CURRENT_SOURCE_DIR}/bbCreateBlackBox.sh.in
+    ${BBTK_BINARY_DIR}/bin/bbCreateBlackBox
+    @ONLY IMMEDIATE
+    )
+  # Install tree
+  INSTALL(
+    PROGRAMS ${BBTK_BINARY_DIR}/bin/bbCreateBlackBox
+    DESTINATION bin
+    )
+ENDIF(UNIX)
+
+
+
+
diff --git a/kernel/appli/bbCreateBlackBox/bbCreateBlackBox.bat.in b/kernel/appli/bbCreateBlackBox/bbCreateBlackBox.bat.in
new file mode 100644 (file)
index 0000000..b30c85f
--- /dev/null
@@ -0,0 +1,91 @@
+@echo off
+
+echo creates the file architecture for a new blackbox
+
+
+if %0%5==%0 goto ERROR01
+
+
+rem bbCreatePackage path
+set BINPATH=%~dp0
+rem Input data path
+set INPUT="%BINPATH%\@bbCreateBlackBox_DATA_REL_PATH_FROM_BIN@\xml-templates"
+
+set OUTPUT=%1
+set PACK=%2
+set BLACKBOX=%3
+set TYPE=%4
+set FORMAT=%5
+set AUTHOR=%6
+set DESCRIPTION=%7
+set FILENAME=bb%PACK%%BLACKBOX%
+
+echo output=  %OUTPUT%
+echo bin   =  %BINPATH%
+echo input =  %INPUT%
+echo pack  =  %PACK%
+echo blackbox  =  %BLACKBOX%
+echo type  =  %TYPE%
+echo format  =  %FORMAT%
+echo author  =  %AUTHOR%
+echo description  =  %DESCRIPTION%
+echo filename  =  %FILENAME%
+
+echo "** Creating new black box  '%BLACKBOX%'  xml/c++ in folder '%OUTPUT%'"
+
+echo Creating XML file..
+echo copy %INPUT%\%type%-template.xml %OUTPUT%\%FILENAME%.xml
+copy %INPUT%\%type%-template.xml %OUTPUT%\%FILENAME%.xml_tmp
+%BINPATH%\bbSed %OUTPUT%\%FILENAME%.xml_tmp  __BLACKBOXNAME__ %BLACKBOX% > %OUTPUT%\%FILENAME%_1.xml
+%BINPATH%\bbSed %OUTPUT%\%FILENAME%_1.xml  __AUTHOR__ %AUTHOR% > %OUTPUT%\%FILENAME%_2.xml
+%BINPATH%\bbSed %OUTPUT%\%FILENAME%_2.xml  __DESCRIPTION__ %DESCRIPTION% > %OUTPUT%\%FILENAME%.xml_tmp
+del %OUTPUT%\%FILENAME%_1.xml 
+del %OUTPUT%\%FILENAME%_2.xml 
+
+
+IF %FORMAT%==XML GOTO module_XML
+IF %FORMAT%==C++ GOTO module_C++
+
+goto ERROR03
+
+:module_XML
+  IF EXIST %OUTPUT%\%FILENAME%.xml GOTO ERROR02
+  move %OUTPUT%\%FILENAME%.xml_tmp %OUTPUT%\%FILENAME%.xml 
+goto END
+
+:module_C++
+  IF EXIST %OUTPUT%\%FILENAME%.cxx GOTO ERROR02
+  echo %BINPATH%\bbfy %OUTPUT%\%FILENAME%.xml_tmp %PACK% %OUTPUT% 
+  %BINPATH%\bbfy %OUTPUT%\%FILENAME%.xml_tmp %PACK% %OUTPUT%\
+  del %OUTPUT%\%FILENAME%.xml_tmp 
+goto END
+
+
+
+:ERROR01
+echo -----------------------------------------------------------------------------  
+echo bbCreateBlackBox.bat "<dir-path> <package-name> <blackbox-name> <type> <format> [author] [description] "
+echo    type:  
+echo          std  
+echo          VTK_ImageAlgorithm  
+echo          VTK_PolyDataAlgorithm  
+echo          widget  
+echo    format:  
+echo          XML  
+echo          C++ 
+echo -----------------------------------------------------------------------------  
+goto END
+
+:ERROR02
+echo "ERROR : File '%OUTPUT%\%FILENAME%'  %FORMAT%  already exists !"  
+del %OUTPUT%\%FILENAME%.xml_tmp 
+goto end
+
+:ERROR03
+echo "ERROR : format not match '%FORMAT%'  "  
+del %OUTPUT%\%FILENAME%.xml_tmp 
+goto end
+
+
+:END
+
diff --git a/kernel/appli/bbCreateBlackBox/bbCreateBlackBox.sh.in b/kernel/appli/bbCreateBlackBox/bbCreateBlackBox.sh.in
new file mode 100644 (file)
index 0000000..b30c85f
--- /dev/null
@@ -0,0 +1,91 @@
+@echo off
+
+echo creates the file architecture for a new blackbox
+
+
+if %0%5==%0 goto ERROR01
+
+
+rem bbCreatePackage path
+set BINPATH=%~dp0
+rem Input data path
+set INPUT="%BINPATH%\@bbCreateBlackBox_DATA_REL_PATH_FROM_BIN@\xml-templates"
+
+set OUTPUT=%1
+set PACK=%2
+set BLACKBOX=%3
+set TYPE=%4
+set FORMAT=%5
+set AUTHOR=%6
+set DESCRIPTION=%7
+set FILENAME=bb%PACK%%BLACKBOX%
+
+echo output=  %OUTPUT%
+echo bin   =  %BINPATH%
+echo input =  %INPUT%
+echo pack  =  %PACK%
+echo blackbox  =  %BLACKBOX%
+echo type  =  %TYPE%
+echo format  =  %FORMAT%
+echo author  =  %AUTHOR%
+echo description  =  %DESCRIPTION%
+echo filename  =  %FILENAME%
+
+echo "** Creating new black box  '%BLACKBOX%'  xml/c++ in folder '%OUTPUT%'"
+
+echo Creating XML file..
+echo copy %INPUT%\%type%-template.xml %OUTPUT%\%FILENAME%.xml
+copy %INPUT%\%type%-template.xml %OUTPUT%\%FILENAME%.xml_tmp
+%BINPATH%\bbSed %OUTPUT%\%FILENAME%.xml_tmp  __BLACKBOXNAME__ %BLACKBOX% > %OUTPUT%\%FILENAME%_1.xml
+%BINPATH%\bbSed %OUTPUT%\%FILENAME%_1.xml  __AUTHOR__ %AUTHOR% > %OUTPUT%\%FILENAME%_2.xml
+%BINPATH%\bbSed %OUTPUT%\%FILENAME%_2.xml  __DESCRIPTION__ %DESCRIPTION% > %OUTPUT%\%FILENAME%.xml_tmp
+del %OUTPUT%\%FILENAME%_1.xml 
+del %OUTPUT%\%FILENAME%_2.xml 
+
+
+IF %FORMAT%==XML GOTO module_XML
+IF %FORMAT%==C++ GOTO module_C++
+
+goto ERROR03
+
+:module_XML
+  IF EXIST %OUTPUT%\%FILENAME%.xml GOTO ERROR02
+  move %OUTPUT%\%FILENAME%.xml_tmp %OUTPUT%\%FILENAME%.xml 
+goto END
+
+:module_C++
+  IF EXIST %OUTPUT%\%FILENAME%.cxx GOTO ERROR02
+  echo %BINPATH%\bbfy %OUTPUT%\%FILENAME%.xml_tmp %PACK% %OUTPUT% 
+  %BINPATH%\bbfy %OUTPUT%\%FILENAME%.xml_tmp %PACK% %OUTPUT%\
+  del %OUTPUT%\%FILENAME%.xml_tmp 
+goto END
+
+
+
+:ERROR01
+echo -----------------------------------------------------------------------------  
+echo bbCreateBlackBox.bat "<dir-path> <package-name> <blackbox-name> <type> <format> [author] [description] "
+echo    type:  
+echo          std  
+echo          VTK_ImageAlgorithm  
+echo          VTK_PolyDataAlgorithm  
+echo          widget  
+echo    format:  
+echo          XML  
+echo          C++ 
+echo -----------------------------------------------------------------------------  
+goto END
+
+:ERROR02
+echo "ERROR : File '%OUTPUT%\%FILENAME%'  %FORMAT%  already exists !"  
+del %OUTPUT%\%FILENAME%.xml_tmp 
+goto end
+
+:ERROR03
+echo "ERROR : format not match '%FORMAT%'  "  
+del %OUTPUT%\%FILENAME%.xml_tmp 
+goto end
+
+
+:END
+
diff --git a/kernel/appli/bbCreateBlackBox/xml-templates/VTK_ImageAlgorithm-template.xml b/kernel/appli/bbCreateBlackBox/xml-templates/VTK_ImageAlgorithm-template.xml
new file mode 100644 (file)
index 0000000..3f0f0ec
--- /dev/null
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+
+<blackbox name="__BLACKBOXNAME__" type="VTK_ImageAlgorithm">
+
+<author>__AUTHOR__</author>
+<description><PRE>__DESCRIPTION__</PRE></description>
+<category>__CategoryBlackBox__</category>
+
+<include>vtkImageAnisotropicDiffusion3D.h</include> 
+<include>vtkImageData.h</include> 
+<vtkparent>vtkImageAnisotropicDiffusion3D</vtkparent>
+
+<input name="In" type="vtkImageData*" special="vtk input" description="Input image"/>
+<output name="Out" type="vtkImageData*" special="vtk output" description="Output image"/>
+<input name="DiffusionThreshold" type="double" special="vtk parameter" description="Difference threshold that stops diffusion"/>
+
+</blackbox>
+
+
diff --git a/kernel/appli/bbCreateBlackBox/xml-templates/VTK_PolyDataAlgorithm-template.xml b/kernel/appli/bbCreateBlackBox/xml-templates/VTK_PolyDataAlgorithm-template.xml
new file mode 100644 (file)
index 0000000..b6eca38
--- /dev/null
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+
+
+<blackbox name="__BLACKBOXNAME__" type="VTK_PolyDataAlgorithm">
+
+<author>__AUTHOR__</author>
+<description><PRE>__DESCRIPTION__</PRE></description>
+<category>__CategoryBlackBox__</category>
+
+<include>vtkAppendPolyData.h</include> 
+<vtkparent>vtkAppendPolyData</vtkparent>
+
+<output name="Out" type="vtkPolyData*" special="vtk output" description="Output Mesh"/>
+<input name="In1" type="vtkPolyData *" description="PolyData 1"/>
+<input name="In2" type="vtkPolyData *" description="PolyData 2"/>
+<input name="In3" type="vtkPolyData *" description="PolyData 3"/>
+<input name="In4" type="vtkPolyData *" description="PolyData 4"/>
+<input name="In5" type="vtkPolyData *" description="PolyData 5"/>
+
+<process>
+<PRE>
+  SetInput(bbGetInputIn1());
+  SetInput(bbGetInputIn2());
+  SetInput(bbGetInputIn3());
+  SetInput(bbGetInputIn4());
+  SetInput(bbGetInputIn5());
+   
+  Update();
+</PRE>
+</process>
+
+<constructor>
+<PRE>
+  bbSetInputIn1((vtkPolyData *)0);
+  bbSetInputIn2((vtkPolyData *)0);
+  bbSetInputIn3((vtkPolyData *)0);
+  bbSetInputIn4((vtkPolyData *)0);
+  bbSetInputIn5((vtkPolyData *)0);
+  bbSetOutputOut((vtkPolyData *)0);
+</PRE>
+</constructor>   
+
+
+</blackbox>
+
+
diff --git a/kernel/appli/bbCreateBlackBox/xml-templates/std-template.xml b/kernel/appli/bbCreateBlackBox/xml-templates/std-template.xml
new file mode 100644 (file)
index 0000000..70e19b1
--- /dev/null
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+
+<blackbox name="__BLACKBOXNAME__">
+
+  <author>__AUTHOR__</author>
+  <description>__DESCRIPTION__</description>
+  <category>__CategoryBlackBox__</category>
+
+  <input name="In1" type="double" description="First number to add"/>
+  <input name="In2" type="double" description="Second number to add"/>
+  <output name="Out" type="double" description="Result"/>
+
+  <process><PRE>
+    bbSetOutputOut( bbGetInputIn1() + bbGetInputIn2() );
+  </PRE></process>
+  
+  <constructor><PRE>
+    bbSetInputIn1(0);
+    bbSetInputIn2(0);
+    bbSetOutputOut(0);
+  </PRE></constructor>    
+
+</blackbox>
+
diff --git a/kernel/appli/bbCreateBlackBox/xml-templates/widget-template.xml b/kernel/appli/bbCreateBlackBox/xml-templates/widget-template.xml
new file mode 100644 (file)
index 0000000..4e321db
--- /dev/null
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+
+<blackbox name="__BLACKBOXNAME__" widget>
+
+  <author>__AUTHOR__</author>
+  <description>__DESCRIPTION__</description>
+  <category>__CategoryBlackBox__</category>
+
+  <input name="Title" type="std::string" description="Title prepended to the text"/>
+  <input name="In" type="std::string" description="Text"/>
+
+  <createwidget><PRE>
+   bbSetOutputWidget( new wxStaticText ( bbGetWxParent() , -1 , _T("") ) );
+   Process();
+  </PRE></createwidget>
+  <process><PRE>
+   std::string msg;
+    if (bbGetInputTitle()!="")
+      {
+       msg = bbGetInputTitle()+": " + bbGetInputIn();
+      }  
+    else 
+      {
+       msg = bbGetInputIn();
+      }
+   ((wxStaticText*)bbGetOutputWidget())->SetLabel( bbtk::std2wx( msg ) ); 
+  </PRE></process>
+  
+  <constructor><PRE> 
+    bbSetInputIn("");
+    bbSetInputTitle("");
+  </PRE></constructor>    
+
+
+</blackbox>
+
index 71b851869036fe6439a1c2380f55b54b19207709..31a21b6ceedf8c58a92640e156bea2ed57001cf1 100644 (file)
@@ -36,6 +36,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(
@@ -49,7 +50,10 @@ IF(WIN32)
     @ONLY IMMEDIATE
     )
   # install tree
-  INSTALL_FILES(/bin .bat bbCreatePackage)
+  INSTALL(
+    PROGRAMS ${BBTK_BINARY_DIR}/Debug/bbCreatePackage.bat
+    DESTINATION bin
+    )
 ENDIF(WIN32)
 
 
index 42859182a68199c89083e82e102b2ce3250dca8a..855bffe336be1c45fa0419d43d18fac4e67473e6 100755 (executable)
@@ -6,65 +6,48 @@ echo creates the file architecture for a new user package
 if %0%1==%0 goto ERROR01
 
 
-set BBTKINPUT="@bbCreatePackage_DATA_PATH@"
-set BBTKOUTPUT=%1
-
-
-echo %0
-echo %PWD%
-
-# bbCreatePackage path
-##EED TMP=$(which $0|rev)
-##EED BINPATH=$(echo ${TMP#*/}|rev)
-# Input data path
-set INPUT="${BINPATH}/@bbCreatePackage_DATA_REL_PATH_FROM_BIN@/void-Package"
-
-
+rem bbCreatePackage path
+set BINPATH=%~dp0
+rem Input data path
+set INPUT="%BINPATH%\@bbCreatePackage_DATA_REL_PATH_FROM_BIN@\void-Package"
 
 set OUTPUT=%1
 set PACK=%2
 set AUTHOR=%3
 set DESCRIPTION=%4
 
-echo "output= " %OUTPUT%
-echo "bin   = " %BINPATH%
-echo "input = " %INPUT%
-echo "pack  = " %PACK%
-
+echo output=  %OUTPUT%
+echo bin   =  %BINPATH%
+echo input =  %INPUT%
+echo pack  =  %PACK%
+echo author  =  %AUTHOR%
+echo description  =  %DESCRIPTION%
 
-echo "----- Creating black box package '%BBTKNAME%' in repository '%BBTKOUTPUT%' -----"
+IF EXIST %OUTPUT%\%PACK% GOTO ERROR02
 
+echo "** Creating new black box package '%PACK%' in folder '%OUTPUT%'"
 
-IF EXIST %BBTKOUTPUT% GOTO ERROR02
+mkdir %OUTPUT%\%PACK%
+xcopy %INPUT% %OUTPUT%\%PACK% /S
+%BINPATH%\bbSed %OUTPUT%\%PACK%\CMakeLists.txt  WITHOUT_NAME "%PACK%" > %OUTPUT%\%PACK%\CMakeLists2.txt
+%BINPATH%\bbSed %OUTPUT%\%PACK%\CMakeLists2.txt  WITHOUT_AUTHOR %AUTHOR% > %OUTPUT%\%PACK%\CMakeLists3.txt
+%BINPATH%\bbSed %OUTPUT%\%PACK%\CMakeLists3.txt  WITHOUT_DESCRIPTION %DESCRIPTION% > %OUTPUT%\%PACK%\CMakeLists.txt
+del %OUTPUT%\%PACK%\CMakeLists2.txt 
+del %OUTPUT%\%PACK%\CMakeLists3.txt
+echo "Done !" 
+echo "Edit the file '%OUTPUT%\%PACK%\CMakeLists.txt' to customize your package"
 
-echo "-> Packages repository '%BBTKOUTPUT%' does not exist : creating it"
-mkdir %BBTKOUTPUT%
-
-
-
-    echo "-> Creating file '%BBTKOUTPUT%/CMakeLists.txt' "
-    copy %BBTKINPUT%\PackageCMakeLists.txt %BBTKOUTPUT%\CMakeLists.txt
-    echo "-> Creating file directory '%BBTKOUTPUT%/cmake' "
-    mkdir %BBTKOUTPUT%\cmake
-    echo "-> Coping files in '%BBTKOUTPUT%/cmake' "
-    copy %BBTKINPUT%\cmake\*.cmake %BBTKOUTPUT%\cmake
-    copy %BBTKINPUT%\cmake\*.in %BBTKOUTPUT%\cmake
-
-echo "Done !"
-echo "Edit the file '%BBTKOUTPUT%/CMakeLists.txt' to customize your package"
 
 
 goto END
 
 
-
-
 :ERROR01
-echo bbCreatePackage.bat "<path-to-package-repository>"
+echo bbCreatePackage.bat "<package-path> <package-name> [author] [description] "
 goto END
 
 :ERROR02
-echo "ERROR : Directory '%BBTKOUTPUT%/%BBTKNAME%' already exists !"  
+echo "ERROR : Directory '%OUTPUT%/%PACK%' already exists !"  
 goto end
 
 
index 86476e55f27a6c93630cedf7e6da3f63a8a75d3d..25d06c12f9005ae149d87205b3f831f3e250be05 100644 (file)
@@ -63,7 +63,7 @@ ENDIF(WIN32)
 # from build tree root or install tree root
 # (different on win/lin)
 IF(WIN32)
-  SET(BBTK_SHARE_REL_PATH " ")
+  SET(BBTK_SHARE_REL_PATH "/")
   SET(BBTK_DOC_REL_PATH doc)
   SET(BBTK_BBS_REL_PATH bbs)
   SET(BBTK_DATA_REL_PATH data)
index c29805c8402bef2946a4294a4a823137b117c853..630b9a2232f711be422bb0938874607badc72c7d 100755 (executable)
@@ -113,6 +113,7 @@ IF(BUILD_bbtk_DOC)
   # Recurse it bbtkWebSite dir
   SUBDIRS(bbtkWebSite)
 
+
   INSTALL(
     DIRECTORY  ${BBTK_BINARY_DIR}/${BBTK_DOC_REL_PATH}
     DESTINATION  ${BBTK_SHARE_REL_PATH}
index 22bd9fb69d3a20d0805876730979521c247c1065..468d41f0ab5909c6ed739b9ecc10fb20cefd1e38 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkInterpreter.cxx,v $ $
   Language:  C++
-  Date:      $Date: 2008/03/14 14:58:53 $
-  Version:   $Revision: 1.44 $
+  Date:      $Date: 2008/03/17 07:04:08 $
+  Version:   $Revision: 1.45 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -179,7 +179,7 @@ bufferNb =0;
     info.help = "Creates an html index of known boxes. If filename is provided then save it to the file 'filename'. The default index entries are the initial letters of the names of the boxes. If 'Packages' or 'Categories' is provided then the entries are either the packages names or the categories. If 'Adaptors' is provided then an alphabetical index of all adaptors is created.";
     mCommandDict[info.category] = info;
 
-    info.category = "reset";  //EED
+    info.category = "reset";  
     info.argmin = 0;
     info.argmax = 0;
     info.code = cReset;
@@ -290,8 +290,6 @@ bufferNb =0;
    */
   Interpreter::~Interpreter()
   {
-
-std::cout << "=========================================~Interpreter()" << std::endl;
     bbtkDebugMessageInc("Interpreter",9,"Interpreter::~Interpreter()" <<std::endl);
     delete mExecuter;
 
@@ -330,13 +328,10 @@ std::cout << "=========================================~Interpreter()" << std::e
             std::cout << "B=== [" << (*it) << "]" << std::endl;
          }
 */      
-//printf("EED --- %s --- Interpreter::InterpretFile \n", mFileName[0].c_str() );
-       //printf("EED --- %s --- Interpreter::InterpretFile \n", mFileName[0].c_str() );
 
          //while ((mFile.size()>0) && !mFile.back()->eof() ) 
          //{
 //      std::cout << "mFile.size() "<< mFile.size() << " mFileName.back() [" << mFileName.back() << "]" <<  std::endl;
-        
         while (!mFile.back()->eof()) {
                     mLine.back()++;
             char buf[500];
@@ -349,13 +344,11 @@ std::cout << "=========================================~Interpreter()" << std::e
                str.erase(size-1,1);
             }
       
-            InterpretLine(str, insideComment);
-
-//printf("EED Interpreter::InterpretFile %s\n", str.c_str() );
+               InterpretLine(str, insideComment);
 
-         }
-        //if (mFile.size()>0) 
-        CloseCurrentFile();
+       }//while
+       //if (mFile.size()>0) 
+       CloseCurrentFile();
       }
     }
     catch (QuitException e) 
@@ -402,7 +395,6 @@ std::cout << "=========================================~Interpreter()" << std::e
    */
 void Interpreter::InterpretLine( const std::string& line, bool &insideComment )
 {
-
     bbtkDebugMessageInc("Interpreter",9,"Interpreter::InterpretLine(\""<<line<<"\")"<<std::endl);
     bbtkMessage("Echo",2,"\""<<line<<"\""<<std::endl);
 
@@ -580,7 +572,7 @@ void Interpreter::InterpretLine( const std::string& line, bool &insideComment )
         Config();
         break;
 
-      case cReset :  // EED
+      case cReset :  
         this->mExecuter->Reset();
         break;
 
@@ -836,17 +828,21 @@ void Interpreter::SplitLine ( const std::string& str, std::vector<std::string>&
               continue;      // ignore  '-appli.bbs' files
           }
           */
-           (*stream) << "include " << *i << "\n";
+
+       (*stream) << "include " << *i << "\n";
+//EED  InterpretFile(*i);
+
            nbBssFiles++;
-        }
-        if (nbBssFiles==0)
+        } // for vector
+               if (nbBssFiles==0){
            bbtkMessage("Interpreter",2,
                       "WARNING : No '.bbs' file found in [" 
                       << upath << "]" << std::endl);
-        else
-           SwitchToStream(stream);
+               } else {
+            SwitchToStream(stream);
+               }
         return;
-      }
+      }  // if upath
 
       std::string path;
       std::vector<std::string>::iterator i;
@@ -861,11 +857,10 @@ void Interpreter::SplitLine ( const std::string& str, std::vector<std::string>&
           char * currentDir = getcwd(buf, 2048);
           std::string cwd(currentDir);
           path = currentDir;
-        }
+        } // if path
 
         fullDirectoryName = Utilities::MakePkgnameFromPath(path, upath, false);
 
-        //EED 18 Fev 2008
         // without last slash "\"
         std::string fullDirectoryNameClean = fullDirectoryName.substr(0,fullDirectoryName.size()-1);
 
@@ -878,7 +873,7 @@ void Interpreter::SplitLine ( const std::string& str, std::vector<std::string>&
              bbtkMessage("Interpreter",1,"   [" <<fullDirectoryName 
                      <<"] : doesn't exist" <<std::endl);
           continue;  // try next path
-        }
+        } // if IsDirectory
         foundFile = true;
 
         Filenames.clear();
@@ -887,7 +882,6 @@ void Interpreter::SplitLine ( const std::string& str, std::vector<std::string>&
         nbBssFiles = 0;
         for (std::vector<std::string>::iterator i = Filenames.begin(); i!= Filenames.end(); ++i)
         {
-//EEDprintf("EED Interpreter::SwitchToFile %s\n",(*i).c_str() );
 // std::cout << "JPR==================  iterate [" << *i << "]" << std::endl;
            int lgr = (*i).size();
           if (lgr < 5)
@@ -901,21 +895,25 @@ void Interpreter::SplitLine ( const std::string& str, std::vector<std::string>&
               continue;      // ignore  '-appli.bbs' files
           }
           */
-           (*stream) << "include " << *i << "\n";
+
+      (*stream) << "include " << *i << "\n";
+//EED    InterpretFile(*i);
+
            nbBssFiles++;
-        }
-        if (nbBssFiles==0)
+        } // for vector
+               if (nbBssFiles==0){
            bbtkMessage("Interpreter",1,
                      "WARNING : No '.bbs' file found in [" 
                      << fullDirectoryName << "]" << std::endl);
-        else 
+               } else {
            SwitchToStream(stream);
+               }
 
         //break; // a directory was found; we stop iterating
        // LG : No! We want all files included !
-       }
+       } // for vector
        return;
-    }
+    }  // if *
 
     //std::string::size_type slash_position = name.find_last_of("/\\");
 
@@ -1014,7 +1012,8 @@ void Interpreter::SplitLine ( const std::string& str, std::vector<std::string>&
 void Interpreter::SwitchToStream( std::stringstream* stream )
 {
 //std::cout << "== 1 Entry in Interpreter::SwitchToStream " << std::endl;
-    mFile.push_back(stream);
+
+       mFile.push_back(stream);
     //std::cout << " mFile.size() " << mFile.size() << std::endl;
     std::ostringstream buffer_name;
     bufferNb++;
@@ -1054,18 +1053,14 @@ void Interpreter::SwitchToStream( std::stringstream* stream )
   void Interpreter::LoadScript( std::string fullPathScriptName,
                                std::string includeScriptName)
   {
-//std::cout << "--------------------------EED Interpreter::LoadScript >>01\n" << std::endl;
      Utilities::replace( fullPathScriptName , INVALID_FILE_SEPARATOR , VALID_FILE_SEPARATOR);
 
      bool okScriptExist=false;
      int iStrScript,sizeVecStricpt=mFileName.size();
      for ( iStrScript=0;iStrScript<sizeVecStricpt;iStrScript++)
      {
-//EED printf("  EED %d Interpreter::LoadScript %s __>>__ %s\n", iStrScript,mFileName[iStrScript].c_str(),fullPathScriptName.c_str() );
-
         if (mFileName[iStrScript] == fullPathScriptName )
         {
-           printf("  EED %d Interpreter::LoadScript iguales\n",iStrScript );
            okScriptExist=true;
         } // if
      } // for
@@ -1073,7 +1068,6 @@ void Interpreter::SwitchToStream( std::stringstream* stream )
      if (find(mFileName.begin(),mFileName.end(),fullPathScriptName)!=mFileName.end())
 //    if (okScriptExist==true)
      {
-//EED printf("EED Interpreter::LoadScript Exit method\n");
            bbtkMessage("Interpreter",1,"file '"<<fullPathScriptName
                    <<"' already open : I do not open it once more to prevent recursive inclusion"<<std::endl);
         return;
@@ -1095,7 +1089,6 @@ void Interpreter::SwitchToStream( std::stringstream* stream )
     mFileName.push_back(fullPathScriptName);
     mIncludeFileName.push_back(includeScriptName);
     mLine.push_back(0);
-//EED printf("EED Interpreter::LoadScript >>02\n");
     return;
   }
 
@@ -1124,15 +1117,6 @@ void Interpreter::SwitchToStream( std::stringstream* stream )
     mFileName.pop_back();
     mIncludeFileName.pop_back();
     mLine.pop_back();
-/*EED3
-    bbtkDebugMessage("Interpreter",9," Closing file '"<<mFileName[0]<<"'"<<std::endl);
-    mFile[0]->close();
-    delete mFile[0];
-    mFile.erase( mFile.begin() );
-    mFileName.erase( mFileName.begin() );
-    mIncludeFileName.erase( mIncludeFileName.begin() );
-    mLine.erase( mLine.begin() );
-*/
 
     bbtkDebugMessage("Interpreter",9," Remains "
                      <<mFile.size()
index 745bcdaf16df3afe726eb2afb2306d66310eb704..874f7f61dec955acccf199639731bff0d31e4f89 100644 (file)
@@ -278,8 +278,6 @@ namespace bbtk
   //======================================================================== 
   void WxBrowser::OnURLEnter( wxCommandEvent&)
   { 
-    std::cout  << "OnURL"<<std::endl;
-    printf ( "EED > WxBrowser::OnURLEnter URL(%s) \n ", (const char*) mwxURL->GetValue().mb_str() );   
     mwxHtmlWindow->LoadPage(mwxURL->GetValue());
   }
   //========================================================================
@@ -288,12 +286,8 @@ namespace bbtk
   //========================================================================
   void WxBrowser::OnLinkClicked(wxHtmlLinkEvent& e)
   {
-    std::cout  << "WxBrowser::OnLinkClicked"<<std::endl;
-    std::cout  << e.GetLinkInfo().GetHref()<<std::endl;
- printf ( "EED > WxBrowser::OnLinkClicked eve(%s) \n ", (const char*) e.GetLinkInfo().GetHref().mb_str() );   
     mwxHtmlWindow->LoadPage( e.GetLinkInfo().GetHref() );
        UpdateURL();
-        printf ( "EED > WxBrowser::OnLinkClicked URL(%s) \n ", (const char*) mwxURL->GetValue().mb_str() );   
     mwxHtmlWindow->LoadPage( mwxURL->GetValue() );
   }
   //========================================================================
index a218586269b5ac855af6bd207b1f613982312dca..11b9f56bd12e6bd9643bd7157f9f846315531aac 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkWxConsole.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/03/14 14:58:53 $
-  Version:   $Revision: 1.13 $
+  Date:      $Date: 2008/03/17 07:04:08 $
+  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
@@ -158,6 +158,8 @@ namespace bbtk
   WxConsole::WxConsole( wxWindow *parent, wxString title, wxSize size)
     : wxFrame((wxFrame *)parent, -1, title, wxDefaultPosition, size)
   {    
+//    m_mgr = new wxAuiManager(this);
+       m_mgr.SetManagedWindow(this);
    
     mInterpreter = new bbtk::Interpreter();
     mInterpreter->SetWxConsole(this);
@@ -173,9 +175,11 @@ namespace bbtk
     menuAbout->Append( ID_Menu_About, _T("&About...") );
 
     wxMenu *menuTools = new wxMenu;
-    menuTools->Append( ID_Menu_CreatePackage, _T("&Create package") );
-    menuTools->Append( ID_Menu_CreateBlackBox, _T("&Create blackbox") );
+    menuTools->Append( ID_Menu_EditConfig, _T("&Edit bbtk config") );
+    menuTools->Append( ID_Menu_CreatePackage, _T("Create &package") );
+    menuTools->Append( ID_Menu_CreateBlackBox, _T("Create &blackbox") );
     menuTools->Append( ID_Menu_ShowImageGraph, _T("&Show last image graph") );
+    menuTools->Append( ID_Menu_CreateIndex, _T("&Generate index") );
     
     
     wxMenuBar *menuBar = new wxMenuBar;
@@ -201,18 +205,9 @@ namespace bbtk
                                     wxSize(500,500),
                                     wxAUI_NB_TAB_SPLIT | wxAUI_NB_TAB_EXTERNAL_MOVE | wxNO_BORDER);
     
-    mwxPageCommand = new wxPanel(mwxNotebook,-1);    
-    mwxNotebook->AddPage( mwxPageCommand, _T("Command"));
-    
+    mwxPageCommand = new wxPanel(mwxNotebook,-1);        
     mwxPageHelp = new wxPanel(mwxNotebook,-1);    
-    mwxNotebook->AddPage( mwxPageHelp, _T("Help"));
     
-
-
-//EED    sizer->Add ( mwxNotebook, 1, wxEXPAND /*| wxALIGN_BOTTOM*/ );
-    wxAuiManager *m_mgr = new wxAuiManager(this);
-       m_mgr->AddPane(mwxNotebook, wxAuiPaneInfo().Name(wxT("notebook_content")).CenterPane().PaneBorder(false)); 
-    m_mgr->Update();
     
     wxBoxSizer *cmdsizer = new wxBoxSizer(wxVERTICAL);
     
@@ -273,10 +268,11 @@ namespace bbtk
    mwxTextCommand = 
      new wxComboBox(mwxPageCommand,
                    ID_Text_Command,
-                   _T("")
-//                 wxDefaultPosition,
-//                 wxDefaultSize,
-//                 wxTE_PROCESS_ENTER
+                   _T(""),
+                   wxDefaultPosition,
+                   wxDefaultSize,
+                       0, NULL,
+                   wxTE_PROCESS_ENTER
 //                 | wxTE_PROCESS_TAB 
 //                 | wxWANTS_CHARS 
 //                 //|  wxTAB_TRAVERSAL
@@ -310,10 +306,10 @@ namespace bbtk
     // Events connection
     // COMMAND
     // ENTER
-    /*
     Connect( mwxTextCommand->GetId(),
             wxEVT_COMMAND_TEXT_ENTER,
             (wxObjectEventFunction)& WxConsole::OnCommandEnter );
+    /*
     Connect( mwxTextCommand->GetId(),
             wxEVT_CHAR,
             //wxEVT_COMMAND_TEXT_UPDATED,
@@ -343,15 +339,24 @@ namespace bbtk
 
     // Layout
 //EED    SetSizer(sizer);
-    SetAutoLayout(true);
+
+       mwxNotebook->AddPage( mwxPageCommand, _T("Command"));
+    mwxNotebook->AddPage( mwxPageHelp, _T("Help"));
+       m_mgr.AddPane(mwxNotebook, wxAuiPaneInfo().Name(wxT("notebook_content")).CenterPane().PaneBorder(false)); 
+    m_mgr.Update();
+
+       
+       SetAutoLayout(true);
     Layout();
-    Refresh();
+//    Refresh();
+//    m_mgr.Update();
   }
   //================================================================
 
  //================================================================
   WxConsole::~WxConsole()
   {
+       m_mgr.UnInit();
     delete mRedirect_cout;
     delete mRedirect_cerr;
   }
@@ -398,9 +403,7 @@ namespace bbtk
     {
       bool insideComment = false;
 
-printf("WxConsole::CommandString 04 \n");
       mInterpreter->InterpretLine( wx2std(line), insideComment );
-printf("WxConsole::CommandString 05 \n");
     }
     catch (bbtk::QuitException)
     {
@@ -435,21 +438,39 @@ printf("WxConsole::CommandString 05 \n");
   //================================================================
   void WxConsole::OnMenuAbout(wxCommandEvent& WXUNUSED(event))
   {
-    
-    wxMessageBox(_T("  bbi\nThe Black Box Toolkit interpreter\n(c) CREATIS-LRMN 2007"),
+    m_mgr.Update();
+       Refresh();
+    wxMessageBox(_T("  bbi\nThe Black Box Toolkit interpreter\n(c) CREATIS-LRMN 2008"),
                  _T("About ..."), wxOK | wxICON_INFORMATION,
                  this);
   }
   //================================================================
 
-  
+
+  //================================================================
+  void WxConsole::OnMenuEditConfig(wxCommandEvent& WXUNUSED(event))
+  {
+       std::string commandStr;
+    std::string configFile = ConfigurationFile::GetInstance().Get_config_xml_full_path();
+#ifdef WIN32
+       commandStr = "notepad.exe ";
+#else
+       commandStr = "gedit ";
+#endif 
+       commandStr = commandStr + configFile;
+       std::cout << "system: " << commandStr << std::endl;
+       system ( commandStr.c_str() );
+  }
+  //================================================================
+
+
   //================================================================
   void WxConsole::OnMenuCreatePackage(wxCommandEvent& WXUNUSED(event))
   {
-    
-    wxMessageBox(_T("  Creating Package"),
-                _T("Creating Package ..."), wxOK | wxICON_INFORMATION, 
-                this);
+       std::cout << "bbi: include CreatePackage" << std::endl;
+    Interpreter* I = new Interpreter;    
+       I->InterpretFile("CreatePackage");
+    delete I;
   }
   //================================================================
 
@@ -457,29 +478,55 @@ printf("WxConsole::CommandString 05 \n");
   //================================================================
   void WxConsole::OnMenuCreateBlackBox(wxCommandEvent& WXUNUSED(event))
   {
-    
-    wxMessageBox(_T("  Creating blackbox"),
-                 _T("Creating blackbox ..."), wxOK | wxICON_INFORMATION,
-                 this);
+       std::cout << "bbi: include CreateBlackBox" << std::endl;
+    Interpreter* I = new Interpreter;    
+       I->InterpretFile("CreateBlackBox");
+    delete I;
   }
   //================================================================
   
   //================================================================
   void WxConsole::OnMenuShowImageGraph(wxCommandEvent& WXUNUSED(event))
   {
-    std::string default_doc_dir = ConfigurationFile::GetInstance().Get_default_temp_dir();
+    std::string default_temp_dir = ConfigurationFile::GetInstance().Get_default_temp_dir();
 
 #if defined(WIN32)
     std::string strappli="start ";
 #else
     std::string strappli="gnome-open ";
 #endif
-    std::string strcommand = strappli +default_doc_dir+"/temp_dir/workspace_workspacePrototype.png";
+    std::string strcommand = strappli +default_temp_dir+"/temp_dir/workspace_workspacePrototype.png";
+       std::cout << "system: " << strcommand << std::endl;
     system ( strcommand.c_str() );
+
   }
   //================================================================
 
-  
+
+  //================================================================
+  void WxConsole::OnMenuCreateIndex(wxCommandEvent& WXUNUSED(event))
+  {
+    std::string doc_path = ConfigurationFile::GetInstance().Get_doc_path();
+    std::string filepath = doc_path+"/bbdoc/make-index.bbs";
+    Interpreter* I = new Interpreter;    
+
+//EED  std::cout << "bbi: include "<<filepath<<std::endl;
+//EED  I->InterpretFile( filepath );
+
+    bool insideComment = false; // for multiline comment
+       I->InterpretLine( "exec freeze" ,insideComment );
+       I->InterpretLine( "include *" ,insideComment );
+       I->InterpretLine( "index "+doc_path+"/bbdoc/index-alpha.html Initials" ,insideComment );
+       I->InterpretLine( "index "+doc_path+"/bbdoc/index-package.html Packages" ,insideComment );
+       I->InterpretLine( "index "+doc_path+"/bbdoc/index-category.html Categories" ,insideComment );
+       I->InterpretLine( "index "+doc_path+"/bbdoc/index-adaptors.html Adaptors",insideComment  );
+
+    delete I;
+  }
+  //================================================================
+
+
+
   
   //================================================================
   void WxConsole::OnCommandChar(wxCommandEvent& event)
@@ -544,10 +591,18 @@ printf("WxConsole::CommandString 05 \n");
      wxButton *btnInclude  = new wxButton( btnsCtrlPanel,-1,_T("Include")  );
      wxButton *btnReset    = new wxButton( btnsCtrlPanel,-1,_T("Reset")    );
      wxButton *btnConfig   = new wxButton( btnsCtrlPanel,-1,_T("Config")   );
-     wxButton *btnGraphS   = new wxButton( btnsCtrlPanel,-1,_T("Graph S.") );
-     wxButton *btnGraphD   = new wxButton( btnsCtrlPanel,-1,_T("Graph D.") );
+     wxButton *btnGraphS   = new wxButton( btnsCtrlPanel,-1,_T("Graph simple") );
+     wxButton *btnGraphD   = new wxButton( btnsCtrlPanel,-1,_T("Graph detailed") );
      wxButton *btnHelp     = new wxButton( btnsCtrlPanel,-1,_T("Help")     );
 
+         btnsSizer->Add( btnInclude    );
+         btnsSizer->Add( btnReset              );
+         btnsSizer->Add( btnConfig             );
+         btnsSizer->Add( btnGraphS     );
+         btnsSizer->Add( btnGraphD     );
+         btnsSizer->Add( btnHelp               );
+         btnsCtrlPanel->SetSizer(btnsSizer);
+
          Connect(btnInclude->GetId()   , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WxConsole::OnBtnInclude       );
          Connect(btnReset->GetId()             , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WxConsole::OnBtnReset         );
          Connect(btnConfig->GetId()    , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WxConsole::OnBtnConfig        );
@@ -584,9 +639,7 @@ printf("WxConsole::CommandString 05 \n");
   //================================================================  
   void WxConsole::OnBtnReset(wxCommandEvent& event)
   {
-printf("WxConsole::OnBtnReset 01 \n");
      CommandString(_T("reset"));
-printf("WxConsole::OnBtnReset 02 \n");
   }
   //================================================================  
 
@@ -626,11 +679,13 @@ printf("WxConsole::OnBtnReset 02 \n");
   BEGIN_EVENT_TABLE(WxConsole, wxFrame)
     EVT_MENU(WxConsole::ID_Menu_Quit, WxConsole::OnMenuQuit)
     EVT_MENU(WxConsole::ID_Menu_About, WxConsole::OnMenuAbout)
+    EVT_MENU(WxConsole::ID_Menu_EditConfig, WxConsole::OnMenuEditConfig)
     EVT_MENU(WxConsole::ID_Menu_CreatePackage, WxConsole::OnMenuCreatePackage)
     EVT_MENU(WxConsole::ID_Menu_CreateBlackBox, WxConsole::OnMenuCreateBlackBox)
     EVT_MENU(WxConsole::ID_Menu_ShowImageGraph, WxConsole::OnMenuShowImageGraph)
+    EVT_MENU(WxConsole::ID_Menu_CreateIndex, WxConsole::OnMenuCreateIndex)
     EVT_TEXT_ENTER(WxConsole::ID_Text_Command, WxConsole::OnCommandEnter)
-  //    EVT_CHAR(WxConsole::ID_Text_Command, WxConsole::OnCommandChar)
+//      EVT_CHAR(WxConsole::ID_Text_Command, WxConsole::OnCommandChar)
     END_EVENT_TABLE()
   //================================================================
 
index 183c9073e20709ae213d5d2c3c9d8bb226e60e71..f66fe3548ceeccd7d9426752da12bc9000dbbc1c 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkWxConsole.h,v $
   Language:  C++
-  Date:      $Date: 2008/03/07 11:37:48 $
-  Version:   $Revision: 1.7 $
+  Date:      $Date: 2008/03/17 07:04:08 $
+  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
@@ -84,9 +84,11 @@ namespace bbtk
 
     void OnMenuQuit(wxCommandEvent& event);
     void OnMenuAbout(wxCommandEvent& event);
+    void OnMenuEditConfig(wxCommandEvent& WXUNUSED(event));
     void OnMenuCreatePackage(wxCommandEvent& WXUNUSED(event));
     void OnMenuCreateBlackBox(wxCommandEvent& WXUNUSED(event));
     void OnMenuShowImageGraph(wxCommandEvent& WXUNUSED(event));
+    void OnMenuCreateIndex(wxCommandEvent& WXUNUSED(event));
    
     void OnBtnGo(wxCommandEvent& event);
     void OnCommandEnter(wxCommandEvent& event);
@@ -103,6 +105,7 @@ namespace bbtk
     void ShowHtmlPage(std::string&);
 
   private:
+       wxAuiManager m_mgr;
     Interpreter* mInterpreter;
     wxTextCtrl* mwxTextHistory;
 //EED    wxTextCtrl* mwxTextCommand;
@@ -119,16 +122,17 @@ namespace bbtk
     
     wxPanel*   CreateBtnsCtrlPanel(wxWindow *parent);
     void               CommandString(wxString line );
   public:
          
      enum
     {
       ID_Menu_Quit = 1,
       ID_Menu_About,
+      ID_Menu_EditConfig,
       ID_Menu_CreatePackage,
       ID_Menu_CreateBlackBox,
       ID_Menu_ShowImageGraph,
+      ID_Menu_CreateIndex,
       ID_Text_Command,
       ID_Text_History,
 
diff --git a/packages/toolsbbtk/bbs/appli/CreateBlackBox.bbs b/packages/toolsbbtk/bbs/appli/CreateBlackBox.bbs
new file mode 100644 (file)
index 0000000..232ac05
--- /dev/null
@@ -0,0 +1,136 @@
+description "Creates the XML or C++ code for a new black box"
+author "eduardo.davila at creatis.insa-lyon.fr"
+category "toolsbbtk"
+
+load std 
+load wx
+
+new OutputText windowTitle
+  set windowTitle.In "- - - - - - - - - - - - - -  Create Blackbox  - - - - - - - - - - - - - -"
+
+new DirectorySelector dir
+    set dir.Title "Select the location of your new package"
+
+new InputText nameBlackbox
+    set nameBlackbox.Title "Blackbox name         (1 word)"
+    set nameBlackbox.In "NEW_BLACKBOX"
+
+new InputText namePackage
+    set namePackage.Title "Package name         (1 word)"
+    set namePackage.In "__PACKAGE__"
+
+
+new InputText author
+    set author.Title "Author(s)           (caracters   '<',  '>' not accepted...)"
+    set author.In "_author_"
+
+new InputText description
+    set description.Title "Description            (caracters   '<',  '>' not accepted...)"
+    set description.In "_description_"
+
+#---------------------------------------------------------------------
+
+
+new RadioButton typeBlackbox
+  set typeBlackbox.Title "Type of the blackbox :"
+  set typeBlackbox.In0 "std-template"
+  set typeBlackbox.In1 "VTK_PolyDataAlgorithm-template"
+  set typeBlackbox.In2 "VTK_ImageAlgorithm-template"
+  set typeBlackbox.In3 "widget-template "
+
+new StringSelect stringselectorType
+  set stringselectorType.In0 "std"
+  set stringselectorType.In1 "VTK_PolyDataAlgorithm"
+  set stringselectorType.In2 "VTK_ImageAlgorithm"
+  set stringselectorType.In3 "widget"
+  connect  typeBlackbox.Out stringselectorType.In
+
+#---------------------------------------------------------------------
+
+new RadioButton formatBlackbox
+  set formatBlackbox.Title "Format of the output file :"
+  set formatBlackbox.In 0
+  set formatBlackbox.In0 "C++"
+  set formatBlackbox.In1 "XML"
+
+new StringSelect stringselectorFormat
+  set stringselectorFormat.In0 "C++"
+  set stringselectorFormat.In1 "XML"
+  connect  formatBlackbox.Out stringselectorFormat.In
+
+#---------------------------------------------------------------------
+
+new LayoutLine layoutHor
+  set  layoutHor.Orientation H
+  connect typeBlackbox.Widget layoutHor.Widget1
+  connect formatBlackbox.Widget layoutHor.Widget2
+
+new LayoutLine info
+    connect windowTitle.Widget info.Widget1
+    connect nameBlackbox.Widget info.Widget2
+    connect namePackage.Widget info.Widget3
+    connect author.Widget info.Widget4
+    connect description.Widget info.Widget5
+    connect layoutHor.Widget info.Widget6
+    set info.WinDialog true
+    set info.WinWidth 350 
+    set info.WinHeight 500 
+exec info
+
+
+#---------------------------------------------------------------------
+
+new ConcatStrings dirStr
+ connect dir.Out dirStr.In1
+ set dirStr.In2 " "
+
+new ConcatStrings packageNameStr
+ connect namePackage.Out packageNameStr.In1
+ set packageNameStr.In2 " "
+
+new ConcatStrings blackboxNameStr
+ connect nameBlackbox.Out blackboxNameStr.In1
+ set blackboxNameStr.In2 " "
+
+new ConcatStrings typeStr
+ connect stringselectorType.Out typeStr.In1
+ set typeStr.In2 " "
+
+new ConcatStrings formatStr
+ connect stringselectorFormat.Out formatStr.In1
+ set formatStr.In2 " "
+
+new ConcatStrings authorStr
+ connect author.Out authorStr.In1
+ set authorStr.In2 " "
+
+new ConcatStrings descriptionStr
+ connect description.Out descriptionStr.In1
+ set descriptionStr.In2 " "
+
+new Configuration conf
+
+new ConcatStrings commandStr
+    set commandStr.In1 "."
+    connect conf.FileSeparator commandStr.In2 
+    set commandStr.In3 "bbCreateBlackBox "
+
+new ConcatStrings concatStr
+    connect  commandStr.Out            concatStr.In1 
+    connect dirStr.Out                         concatStr.In2 
+    connect packageNameStr.Out concatStr.In3 
+    connect blackboxNameStr.Out        concatStr.In4
+    connect typeStr.Out                                concatStr.In5
+    connect formatStr.Out                      concatStr.In6
+    connect authorStr.Out                      concatStr.In7
+    connect descriptionStr.Out         concatStr.In8
+
+
+new ExecSystemCommand command
+    connect concatStr.Out command.In
+    print $concatStr.Out$
+
+exec command
+
+#seg fault :
+#quit
\ No newline at end of file
diff --git a/packages/toolsbbtk/bbs/appli/CreateBox.bbs b/packages/toolsbbtk/bbs/appli/CreateBox.bbs
deleted file mode 100644 (file)
index d479e65..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-description "Creates the XML or C++ code for a new black box"
-author "laurent.guigues at creatis.insa-lyon.fr"
-category "bbtk tool"
-
-print "Not implemented yet !!!"
index 26fa6ad4980a7f0794b6e7946e02f223d163023d..c057ae52634f66676848fdf4ee7177cdc9576bf1 100644 (file)
@@ -5,44 +5,57 @@ category "bbtk tool"
 load wx
 load std 
 
+new OutputText windowTitle
+  set windowTitle.In "- - - - - - - - - - - - - -  Create Blackbox  - - - - - - - - - - - - - -"
+
 new DirectorySelector dir
-set dir.Title "Select the location of your new package"
+    set dir.Title "Select the location of your new package"
 
 new InputText name
-set name.Title "Name"
-set name.In "NEW_PACKAGE"
+    set name.Title "Name         (1 word)"
+    set name.In "NEW_PACKAGE"
 
 new InputText author
-set author.Title "Author(s)"
-set author.In "<author>"
+    set author.Title "Author(s)           (caracters   '<',  '>' not accepted...)"
+    set author.In "_author_"
 
 new InputText description
-set description.Title "Description"
-set description.In "<description>"
+    set description.Title "Description            (caracters   '<',  '>' not accepted...)"
+    set description.In "_description_"
 
 new LayoutLine info
-connect name.Widget info.Widget1
-connect author.Widget info.Widget2
-connect description.Widget info.Widget3
-
-set info.WinDialog true
+    connect windowTitle.Widget info.Widget1
+    connect name.Widget info.Widget2
+    connect author.Widget info.Widget3
+    connect description.Widget info.Widget4
+    set info.WinDialog true
+    set info.WinWidth 400 
+    set info.WinHeight 250 
 exec info
 
+
+new Configuration conf
+new ConcatStrings concatStrCommand
+    set concatStrCommand.In1 "."
+    connect conf.FileSeparator concatStrCommand.In2 
+    set concatStrCommand.In3 "bbCreatePackage "
 new ConcatStrings concatStr
-set concatStr.In1 "./bbCreatePackage "
-connect dir.Out concatStr.In2 
-set concatStr.In3 " "
-connect name.Out concatStr.In4 
-set concatStr.In5 " '"
-connect author.Out concatStr.In6 
-set concatStr.In7 "' '"
-connect description.Out concatStr.In8 
-set concatStr.In9 "'"
+    connect  concatStrCommand.Out concatStr.In1 
+    connect dir.Out concatStr.In2 
+    set concatStr.In3 " "
+    connect name.Out concatStr.In4 
+    set concatStr.In5 " '"
+    connect author.Out concatStr.In6 
+    set concatStr.In7 "' '"
+    connect description.Out concatStr.In8 
+    set concatStr.In9 "'"
 
 
 new ExecSystemCommand command
-connect concatStr.Out command.In
-print $concatStr.Out$
+    connect concatStr.Out command.In
+    print $concatStr.Out$
+
 exec command
+
 #seg fault :
 #quit
index b0c6d62fb4ee87432922e983f04f66ab2ede22f8..a0b4f5c7a6b4a3c450acf5bb7d483cff445963d0 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbwxDirectorySelector.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/02/15 13:52:44 $
-  Version:   $Revision: 1.2 $
+  Date:      $Date: 2008/03/17 07:04:09 $
+  Version:   $Revision: 1.3 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -48,9 +48,7 @@ namespace bbwx
                        bbtk::std2wx(bbGetInputMessage()),
                        bbtk::std2wx(bbGetInputDefaultDir()));
     
-    FD->ShowModal();
-    
-    if (FD->GetReturnCode()==wxID_OK)
+       if (FD->ShowModal()==wxID_OK)
       {
        bbSetOutputOut( bbtk::wx2std (FD->GetPath()) );
        bbSetInputDefaultDir( bbtk::wx2std (FD->GetPath()) );
index da8885756375deccf80511f43df59d2ce487a19f..67da6c8b6a24865eb5b241c3d26a50771460caf2 100644 (file)
@@ -5,8 +5,7 @@ author "laurent.guigues@creatis.insa-lyon.fr"
 category "example"
 
 ## THE APPLICATION BOX
-include /home/guigues/coding/Sofa/bbtk/packages/wxvtk/bbs/boxes/bbBasicImageApplication
-#include wxvtk/boxes/bbBasicImageApplication
+include wxvtk/boxes/bbBasicImageApplication
 new BasicImageApplication appli
 set appli.WinTitle "ExampleBasicImageApplication"