]> Creatis software - bbtk.git/commitdiff
#3120 BBTK Bug New Normal - merge branch changestoITK3and4 FROM master
authorEduardo DAVILA <davila@localhost.localdomain>
Tue, 29 Aug 2017 12:02:54 +0000 (14:02 +0200)
committerEduardo DAVILA <davila@localhost.localdomain>
Tue, 29 Aug 2017 12:02:54 +0000 (14:02 +0200)
219 files changed:
CMakeLists.txt
INSTALL.txt
INSTALL.txt~ [new file with mode: 0644]
README.txt
README.txt~ [new file with mode: 0644]
kernel/appli/CMakeLists.txt
kernel/appli/bbPlugPackage/bbPlugPackage.cpp
kernel/appli/bbi/CMakeLists.txt
kernel/appli/bbi/bbi.cxx
kernel/appli/bbi/bbiWeb.cxx [new file with mode: 0644]
kernel/appli/bbpConfigurator/CMakeLists.txt [new file with mode: 0644]
kernel/appli/bbpConfigurator/bbpConfigurator.cpp [new file with mode: 0644]
kernel/cmake/BBTKConfigurePackagePaths.cmake
kernel/cmake/BBTKConfigurePackage_bbs.cmake
kernel/cmake/BBTKConfigurePackage_src.cmake
kernel/cmake/BBTKCreatePackageIncludeScript.cmake
kernel/cmake/BBTKKernelConfig.cmake
kernel/cmake/BBTKSetDeducedPaths.cmake
kernel/src/CMakeLists.txt
kernel/src/bbtkAtomicBlackBoxDescriptor.cxx
kernel/src/bbtkBBPInterpreter.cxx [new file with mode: 0644]
kernel/src/bbtkBBPInterpreter.h [new file with mode: 0644]
kernel/src/bbtkBlackBox.cxx
kernel/src/bbtkBlackBox.h
kernel/src/bbtkBlackBoxDescriptor.cxx
kernel/src/bbtkBlackBoxDescriptor.h
kernel/src/bbtkBlackBoxOutputConnector.cxx
kernel/src/bbtkComplexBlackBox.cxx
kernel/src/bbtkComplexBlackBoxDescriptor.cxx
kernel/src/bbtkComplexBlackBoxDescriptor.h
kernel/src/bbtkConfigurationFile.cxx
kernel/src/bbtkConnection.cxx
kernel/src/bbtkExecuter.cxx
kernel/src/bbtkFactory.cxx
kernel/src/bbtkFactory.h
kernel/src/bbtkInterpreter.cxx
kernel/src/bbtkInterpreter.h
kernel/src/bbtkInterpreterVirtual.cxx
kernel/src/bbtkInterpreterVirtual.h
kernel/src/bbtkKW.h
kernel/src/bbtkPackage.cxx
kernel/src/bbtkPackage.h
kernel/src/bbtkQt.h
kernel/src/bbtkUtilities.cxx
kernel/src/bbtkUtilities.h
kernel/src/bbtkVtkBlackBoxMacros.h
kernel/src/bbtkWidgetBlackBox.h
kernel/src/bbtkWt.cxx [new file with mode: 0644]
kernel/src/bbtkWt.h [new file with mode: 0644]
kernel/src/bbtkWtBlackBox.cxx [new file with mode: 0644]
kernel/src/bbtkWtBlackBox.h [new file with mode: 0644]
kernel/src/bbtkWx.cxx
kernel/src/bbtkWx.h
kernel/src/bbtkWxBlackBox.cxx
kernel/src/bbtkWxBlackBox.h
kernel/src/bbtkWxGUIPackageBrowser2.cxx
kernel/src/bbtkWxGUIScriptingInterface.cxx
packages/CMakeLists.txt
packages/gdcmvtk/src/bbgdcmvtkGetXCoherentInfoGdcmReader.cxx
packages/gdcmvtk/src/bbgdcmvtkGetXCoherentInfoGdcmReader.h
packages/itk/src/bbitkBinaryThresholdImageFilter.h~ [new file with mode: 0644]
packages/itk/src/bbitkImageReader.cxx
packages/itk/src/bbitkImageWriter.cxx
packages/itk/src/bbitkResampleImageFilter.h
packages/std/src/bbstdCast.cxx
packages/std/src/bbstdCast.h
packages/std/src/bbstdCastVector.cxx [new file with mode: 0644]
packages/std/src/bbstdCastVector.h [new file with mode: 0644]
packages/std/src/bbstdExecSystemCommand.cxx
packages/std/src/bbstdExit.cxx [new file with mode: 0644]
packages/std/src/bbstdExit.h [new file with mode: 0644]
packages/std/src/bbstdFilesFromDirectory.cxx
packages/std/src/bbstdFilesFromDirectory.h
packages/std/src/bbstdGetBBTKinfo.cxx [new file with mode: 0644]
packages/std/src/bbstdGetBBTKinfo.h [new file with mode: 0644]
packages/std/src/bbstdGetSubVector.cxx [new file with mode: 0644]
packages/std/src/bbstdGetSubVector.h [new file with mode: 0644]
packages/std/src/bbstdGetVectorElement.h
packages/std/src/bbstdMagicBox.cxx
packages/std/src/bbstdMagicBox.h
packages/std/src/bbstdMathOperation.cxx [new file with mode: 0644]
packages/std/src/bbstdMathOperation.h [new file with mode: 0644]
packages/std/src/bbstdMathOperationVector.cxx [new file with mode: 0644]
packages/std/src/bbstdMathOperationVector.h [new file with mode: 0644]
packages/std/src/bbstdRandomString.cxx [new file with mode: 0644]
packages/std/src/bbstdRandomString.h [new file with mode: 0644]
packages/std/src/bbstdReadColumnsDouble.cxx
packages/std/src/bbstdReadColumnsInt.cxx
packages/std/src/bbstdReadColumnsString.cxx
packages/std/src/bbstdReadColumnsString.h
packages/std/src/bbstdReadLinesString.cxx [new file with mode: 0644]
packages/std/src/bbstdReadLinesString.h [new file with mode: 0644]
packages/std/src/bbstdReplaceString.cxx [new file with mode: 0644]
packages/std/src/bbstdReplaceString.h [new file with mode: 0644]
packages/std/src/bbstdSplitFilePathVector.cxx [new file with mode: 0644]
packages/std/src/bbstdSplitFilePathVector.h [new file with mode: 0644]
packages/std/src/bbstdStringWriter.cxx
packages/std/src/bbstdTransposeVectors.cxx [new file with mode: 0644]
packages/std/src/bbstdTransposeVectors.h [new file with mode: 0644]
packages/std/src/bbstdVectorFilterDouble.cxx [new file with mode: 0644]
packages/std/src/bbstdVectorFilterDouble.h [new file with mode: 0644]
packages/std/src/bbstdWriteColumnsString.cxx [new file with mode: 0644]
packages/std/src/bbstdWriteColumnsString.h [new file with mode: 0644]
packages/toolsbbtk/bbs/boxes/ApplyMaskWithTransparence.bbg [new file with mode: 0644]
packages/toolsbbtk/bbs/boxes/ApplyMaskWithTransparence.bbs [new file with mode: 0644]
packages/toolsbbtk/bbs/boxes/BaseViewerInfo.bbg [new file with mode: 0644]
packages/toolsbbtk/bbs/boxes/BaseViewerInfo.bbs [new file with mode: 0644]
packages/toolsbbtk/bbs/boxes/Crop_Widget.bbg [new file with mode: 0644]
packages/toolsbbtk/bbs/boxes/Crop_Widget.bbs [new file with mode: 0644]
packages/toolsbbtk/bbs/boxes/imageVtkPropertiesWidget.bbg
packages/toolsbbtk/bbs/boxes/imageVtkPropertiesWidget.bbs
packages/vtk/bbs/appli/exampleMeasureLength.bbg
packages/vtk/bbs/appli/exampleMeasureLength.bbs
packages/vtk/bbs/appli/exampleSurfaceTexture.bbg [new file with mode: 0644]
packages/vtk/bbs/appli/exampleSurfaceTexture.bbs [new file with mode: 0644]
packages/vtk/bbs/appli/exampleText2D.bbg [new file with mode: 0644]
packages/vtk/bbs/appli/exampleText2D.bbs [new file with mode: 0644]
packages/vtk/bbs/boxes/MaskPoints_Interface.bbg [new file with mode: 0644]
packages/vtk/bbs/boxes/MaskPoints_Interface.bbs [new file with mode: 0644]
packages/vtk/bbs/boxes/RescaleSlopeIntercept_Interface.bbg [new file with mode: 0644]
packages/vtk/bbs/boxes/RescaleSlopeIntercept_Interface.bbs [new file with mode: 0644]
packages/vtk/bbs/boxes/TransformWidget.bbg [new file with mode: 0644]
packages/vtk/bbs/boxes/TransformWidget.bbs [new file with mode: 0644]
packages/vtk/bbs/boxes/bbIsoSurfaceExtractor.bbg [new file with mode: 0644]
packages/vtk/bbs/boxes/bbIsoSurfaceExtractor.bbs
packages/vtk/src/bbtkSimpleUtilities.h
packages/vtk/src/bbtkStaticLecture.cxx
packages/vtk/src/bbtkStaticLecture.h
packages/vtk/src/bbvtkAutoCrop.cxx
packages/vtk/src/bbvtkBinaryOperations.cxx
packages/vtk/src/bbvtkBinaryOperations.h
packages/vtk/src/bbvtkCleanExternalPlane.cxx
packages/vtk/src/bbvtkCleanExternalPlane.h
packages/vtk/src/bbvtkConcatImages.cxx
packages/vtk/src/bbvtkCreateImage.cxx
packages/vtk/src/bbvtkCreateImage.h
packages/vtk/src/bbvtkExtractVtkImageFilter.cxx
packages/vtk/src/bbvtkExtractVtkImageFilter.cxx~ [new file with mode: 0644]
packages/vtk/src/bbvtkFlip.cxx
packages/vtk/src/bbvtkFlip.h
packages/vtk/src/bbvtkGetVectorElement.cxx
packages/vtk/src/bbvtkGetVectorElement.h
packages/vtk/src/bbvtkGetVtkImageVectorSize.cxx [new file with mode: 0644]
packages/vtk/src/bbvtkGetVtkImageVectorSize.h [new file with mode: 0644]
packages/vtk/src/bbvtkImageBoundaries.h
packages/vtk/src/bbvtkImageCastToUShort.cxx
packages/vtk/src/bbvtkImageContinuousDilate3D.xml
packages/vtk/src/bbvtkImageContinuousErode3D.xml
packages/vtk/src/bbvtkImageDilateErode3D.xml
packages/vtk/src/bbvtkImageGaussianSmooth.xml
packages/vtk/src/bbvtkImageVtkProperties.cxx
packages/vtk/src/bbvtkInversCrop.cxx [new file with mode: 0644]
packages/vtk/src/bbvtkInversCrop.h [new file with mode: 0644]
packages/vtk/src/bbvtkMarchingCubes.cxx
packages/vtk/src/bbvtkMarchingCubes.h
packages/vtk/src/bbvtkMaskPoint.cxx [new file with mode: 0644]
packages/vtk/src/bbvtkMaskPoint.h [new file with mode: 0644]
packages/vtk/src/bbvtkMeasureLength.cxx
packages/vtk/src/bbvtkMeasureLength.h
packages/vtk/src/bbvtkMetaImageReader.cxx [new file with mode: 0644]
packages/vtk/src/bbvtkMetaImageReader.h [new file with mode: 0644]
packages/vtk/src/bbvtkMetaImageReader.xml [deleted file]
packages/vtk/src/bbvtkMetaImageWriter.xml
packages/vtk/src/bbvtkPointsXYZtoVTKPoints.cxx
packages/vtk/src/bbvtkPolyDataReader.xml
packages/vtk/src/bbvtkPolyDataToActor.cxx
packages/vtk/src/bbvtkPolyDataToActor.h
packages/vtk/src/bbvtkPolyDataWriter.xml
packages/vtk/src/bbvtkPolyDataWriterPlus.cxx
packages/vtk/src/bbvtkPolyDataWriterPlus.cxx~ [deleted file]
packages/vtk/src/bbvtkPolyDataWriterPlus.h~ [deleted file]
packages/vtk/src/bbvtkProbeFilter.cxx [new file with mode: 0644]
packages/vtk/src/bbvtkProbeFilter.h [new file with mode: 0644]
packages/vtk/src/bbvtkRescaleSlopeIntercept.cxx
packages/vtk/src/bbvtkRescaleSlopeIntercept.h
packages/vtk/src/bbvtkSegmentationConnectivity.cxx
packages/vtk/src/bbvtkSegmentationConnectivity.h
packages/vtk/src/bbvtkSphereList.cxx
packages/vtk/src/bbvtkSphereList.h
packages/vtk/src/bbvtkSphereSource.xml
packages/vtk/src/bbvtkSurfaceTexture.cxx [new file with mode: 0644]
packages/vtk/src/bbvtkSurfaceTexture.h [new file with mode: 0644]
packages/vtk/src/bbvtkText2D.cxx [new file with mode: 0644]
packages/vtk/src/bbvtkText2D.h [new file with mode: 0644]
packages/vtk/src/bbvtkText3D.cxx
packages/vtk/src/bbvtkText3D.h
packages/vtk/src/bbvtkTransform.cxx
packages/vtk/src/bbvtkTransform.h
packages/vtk/src/bbvtkUnaryOperations.cxx
packages/vtk/src/bbvtkUnaryOperations.h
packages/vtk/src/bbvtkUpdateRender.cxx
packages/vtk/src/bbvtkUpdateRender.cxx~ [new file with mode: 0644]
packages/vtk/src/bbvtkVecImageGaussianSmooth.cxx
packages/vtk/src/bbvtkVolumeRenderer.cxx
packages/vtk/src/bbvtkvtkDataSetTovtkDataObject.cxx [new file with mode: 0644]
packages/vtk/src/bbvtkvtkDataSetTovtkDataObject.h [new file with mode: 0644]
packages/vtk/src/bbvtkvtkImageDataToVtkDataObject.cxx [new file with mode: 0644]
packages/vtk/src/bbvtkvtkImageDataToVtkDataObject.h [new file with mode: 0644]
packages/vtk/src/bbvtkvtkPolyDataTovtkDataObject.cxx [new file with mode: 0644]
packages/vtk/src/bbvtkvtkPolyDataTovtkDataObject.h [new file with mode: 0644]
packages/wx/bbs/appli/example_ComboBox.bbg [new file with mode: 0644]
packages/wx/bbs/appli/example_ComboBox.bbs [new file with mode: 0644]
packages/wx/src/bbwxCheckBox.cxx
packages/wx/src/bbwxCheckBox.h
packages/wx/src/bbwxColourSelectorButton.cxx
packages/wx/src/bbwxComboBox.cxx [new file with mode: 0644]
packages/wx/src/bbwxComboBox.h [new file with mode: 0644]
packages/wx/src/bbwxDropFiles.cxx [new file with mode: 0644]
packages/wx/src/bbwxDropFiles.h [new file with mode: 0644]
packages/wx/src/bbwxFileSelector.cxx
packages/wx/src/bbwxLayoutLine.cxx
packages/wx/src/bbwxLayoutSplit.cxx
packages/wx/src/bbwxLayoutTab.cxx
packages/wx/src/bbwxLayoutTab.h
packages/wx/src/bbwxStaticBox.cxx
packages/wxvtk/bbs/boxes/SphereListWidget.bbg [new file with mode: 0644]
packages/wxvtk/bbs/boxes/SphereListWidget.bbs [new file with mode: 0644]
packages/wxvtk/bbs/boxes/bbIsoSurfaceWidget.bbg
packages/wxvtk/bbs/boxes/bbIsoSurfaceWidget.bbs

index 98852157a683342752b5cee6d0070f87433ccd9a..9514401eedcb376b4dd3204a5402a82213af3126 100644 (file)
@@ -37,6 +37,19 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.4)
 PROJECT(bbtk) 
 #-----------------------------------------------------------------------------
 
+#-----------------------------------------------------------------------------
+# Configure Dart testing support.  This should be done before any
+# MESSAGE(FATAL_ERROR ...) commands are invoked.
+IF(INCLUDE_CTEST)
+  INCLUDE(CTest)
+  ENABLE_TESTING()
+ENDIF(INCLUDE_CTEST)
+IF(BUILD_TESTING)
+  SET(BUILDNAME "${BUILDNAME}" CACHE STRING "Name of build on the dashboard")
+  MARK_AS_ADVANCED(BUILDNAME)
+ENDIF(BUILD_TESTING)
+#-----------------------------------------------------------------------------
+
 #-----------------------------------------------------------------------------
 # Set global configuration of the toolkit
 INCLUDE(kernel/cmake/BBTKRootCMakeLists.cmake NO_POLICY_SCOPE )
@@ -69,6 +82,17 @@ ADD_SUBDIRECTORY(packages)
 #-----------------------------------------------------------------------------
 # The samples
 
+
+#----JFGA EED---- 06/10/2015
+OPTION(USE_WT "Build bbtk web" OFF)
+
+#IF(CREA_BUILD_BBTK_WEB)
+#      SET(USE_WT ON)
+#ELSE(CREA_BUILD_BBTK_WEB)
+#      SET(USE_WT OFF)
+#ENDIF(CREA_BUILD_BBTK_WEB)
+
+
 # WARNING
 # Install the creaTools first
 # then build the 'samples' as a separate project
index 719755b5b57e6711c6bf959be3c336b2cb544e0c..6b7bd6eb48b36d1dba5d50216294fda49620993d 100644 (file)
@@ -28,10 +28,13 @@ Read http://www.creatis.insa-lyon.fr/site/en/CreaTools_home
 or ./kernel/doc/bbtkWebSite/install.html
 for details
 
+
+
 ***********
 ** LINUX **
 ***********
 
+
 ==== INSTALL ====
 - create a build dir *OUTSIDE* the source tree; go to that dir
 - type :
diff --git a/INSTALL.txt~ b/INSTALL.txt~
new file mode 100644 (file)
index 0000000..c5c42cc
--- /dev/null
@@ -0,0 +1,70 @@
+ # ---------------------------------------------------------------------
+ #
+ # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
+ #                        pour la SantÈ)
+ # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
+ # Previous Authors : Laurent Guigues, Jean-Pierre Roux
+ # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
+ #
+ #  This software is governed by the CeCILL-B license under French law and
+ #  abiding by the rules of distribution of free software. You can  use,
+ #  modify and/ or redistribute the software under the terms of the CeCILL-B
+ #  license as circulated by CEA, CNRS and INRIA at the following URL
+ #  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+ #  or in the file LICENSE.txt.
+ #
+ #  As a counterpart to the access to the source code and  rights to copy,
+ #  modify and redistribute granted by the license, users are provided only
+ #  with a limited warranty  and the software's author,  the holder of the
+ #  economic rights,  and the successive licensors  have only  limited
+ #  liability.
+ #
+ #  The fact that you are presently reading this means that you have had
+ #  knowledge of the CeCILL-B license and that you accept its terms.
+ # ------------------------------------------------------------------------ */
+
+Basic instructions here. 
+Read http://www.creatis.insa-lyon.fr/site/en/CreaTools_home 
+or ./kernel/doc/bbtkWebSite/install.html
+for details
+
+
+
+***********
+** LINUX **
+***********
+
+==== INSTALL ====
+- create a build dir *OUTSIDE* the source tree; go to that dir
+- type :
+> ccmake PATH_TO_SOURCE_TREE
+- switch BUILD_ALL to ON
+- press 'c' at least 10 times !
+- press 'g'
+- type :
+> make
+> su (NOTE: installing as a sudoer usually fails...)
+type root password 
+> make install
+> exit
+
+==== GNOME DESKTOP ====
+If you use gnome desktop you can install 
+a bbi launcher on desktop and associate it to *.bbs files.
+First, be sure to be logged *WITH YOUR USER NAME, NOT ROOT* 
+(otherwise will be installed for root desktop) and type :
+> bbtk-install-gnome 
+
+==== UNINSTALL ====
+To uninstall bbtk, type :
+> su (NOTE: uninstalling as a sudoer usually fails...)
+type root password
+> bbtk-uninstall
+
+
+
+*************
+** WINDOWS **
+*************
+
+Visit the web site !
index 8905c1aa068744c7eba5dd3c71db8879b6470811..668c2b58b356c8d4c5a874959e93bf72c2d687cf 100644 (file)
@@ -23,6 +23,8 @@
  #  knowledge of the CeCILL-B license and that you accept its terms.
  # ------------------------------------------------------------------------ */
 
+
+
 The Black Box Toolkit
 (c) CREATIS-LRMN 2008
 
@@ -46,4 +48,4 @@ Note Xcode MacOS:
     -> Edit project settings
     -> Build
   3.Copiler Version -> C/C++ CompilerVersion
-    GCC 4.2
\ No newline at end of file
+    GCC 4.2
diff --git a/README.txt~ b/README.txt~
new file mode 100644 (file)
index 0000000..668c2b5
--- /dev/null
@@ -0,0 +1,51 @@
+ # ---------------------------------------------------------------------
+ #
+ # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
+ #                        pour la SantÈ)
+ # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
+ # Previous Authors : Laurent Guigues, Jean-Pierre Roux
+ # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
+ #
+ #  This software is governed by the CeCILL-B license under French law and
+ #  abiding by the rules of distribution of free software. You can  use,
+ #  modify and/ or redistribute the software under the terms of the CeCILL-B
+ #  license as circulated by CEA, CNRS and INRIA at the following URL
+ #  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+ #  or in the file LICENSE.txt.
+ #
+ #  As a counterpart to the access to the source code and  rights to copy,
+ #  modify and redistribute granted by the license, users are provided only
+ #  with a limited warranty  and the software's author,  the holder of the
+ #  economic rights,  and the successive licensors  have only  limited
+ #  liability.
+ #
+ #  The fact that you are presently reading this means that you have had
+ #  knowledge of the CeCILL-B license and that you accept its terms.
+ # ------------------------------------------------------------------------ */
+
+
+
+The Black Box Toolkit
+(c) CREATIS-LRMN 2008
+
+
+
+Note Xcode MacOS:
+- ccmake -G"Xcode" <source>
+
+- LATEX_COMPILER:/opt/local/bin/latex
+
+- QT_QMAKER_EXECUTABLE:/opt/local/libexec/qt4-mac/bin/qmake
+
+- Erase all "-Wno-long-double" from the file
+   BBTK.xcodeproj/project.pbxproj
+   > sed "s/-Wno-long-double/ /g" BBTK.xcodeproj/project.pbxproj > BBTK.xcodeproj/tmp.txt
+   > cp BBTK.xcodeproj/tmp.txt BBTK.xcodeproj/project.pbxproj
+
+- Change compiler version
+  1.open <XXX.xcodeproj>
+  2.Project
+    -> Edit project settings
+    -> Build
+  3.Copiler Version -> C/C++ CompilerVersion
+    GCC 4.2
index b8718fe0f3c7121c9fbc56316450ba091aa7ab7c..009a0115a1bb8d1a0b717570a5633ab3fe7e85b3 100644 (file)
@@ -68,4 +68,7 @@ ADD_SUBDIRECTORY(bbPostInstallPackage)
 
 ADD_SUBDIRECTORY(bbPlugPackage)
 
+#Automatic bbp generator
+ADD_SUBDIRECTORY(bbpConfigurator)
+
 
index bf6081451ad6b6d8844505f654b20e5884c5dc53..8ced93949321a22c41a3e11b1fbd1a412bd4ab4c 100644 (file)
@@ -41,18 +41,18 @@ int main(int argc, char **argv)
       return (int)1;
     }
 
-  std::string path(argv[1]);
+  std::string path = argv[1] ;
   #ifdef WIN32
   std::string fname = path + "\\bbtkPackage"; 
   #else
-  std::string fname = path + "/bbtkPackage"
+  std::string fname = path + "/bbtkPackage" ;
   #endif
   
-
   if ( ! Utilities::FileExists( fname ) )
     {
-      std::cout << "* ERROR : The directory '"<<path<<"' does not contain a 'bbtkPackage' file"        << std::endl;
+      std::cout << "* ERROR : The directory '"<< path <<" ' does not contain a 'bbtkPackage' file" << std::endl;
       return (int)2; 
+
     }
        
   std::ifstream f;
index 71b16c16dfef389ec05658bc56c7e815afefe60c..a8a2ddbce007f178a9b779c6eea37661544bf168 100644 (file)
@@ -45,3 +45,15 @@ ENDIF(BBTK_USE_WXWIDGETS AND WIN32)
 
 TARGET_LINK_LIBRARIES(bbi bbtk)
 INSTALL_TARGETS(/bin/ bbi)
+
+
+IF(USE_WT)
+       SET(SOURCES bbiWeb )
+       ADD_EXECUTABLE(bbiWeb.wt MACOSX_BUNDLE ${SOURCES})  
+       TARGET_LINK_LIBRARIES(bbiWeb.wt bbtk)
+       INSTALL_TARGETS(/bin/ bbiWeb.wt)
+ENDIF(USE_WT)
+
+
+
+
index af2b7fe15e7f67a6484f399b65520c58371a07d3..89a3daa305de477cb5ad38f819a1875e7758de05 100644 (file)
@@ -91,7 +91,7 @@ void WxProcessCmdLine::Process(wxCmdLineParser& parser)
   debug = ( parser.Found(_T("d")) );  
   quiet = ( parser.Found(_T("q")) );
   help = ( parser.Found(_T("h")) );
-  graphical_dialog = ( parser.Found(_T("g")) );
+  graphical_dialog = ( parser.Found(_T("wxcommandlineg")) );
   text_dialog = ( parser.Found(_T("t")) );
   no_console = ( parser.Found(_T("N")) );
   
@@ -178,6 +178,9 @@ bool wxBBIApp::OnCmdLineParsed(wxCmdLineParser& parser)
 // main frame
 bool wxBBIApp::OnInit( )
 {
+//Borrame
+//FILE *ff; ff = fopen ("/tmp/wt.log","a+"); fprintf(ff,"EED wxBBIApp::OnInit\n"); fclose(ff);
+
   //      std::cout << "OnInit"<<std::endl;
   wxApp::OnInit();
 #ifdef __WXGTK__
@@ -190,6 +193,11 @@ bool wxBBIApp::OnInit( )
   if (cmd.debug) bbtk::MessageManager::SetMessageLevel("all",9);
   
 
+//Borrame
+//printf ("EED bbi wxBBIApp::OnInit .....................\n");
+//cmd.input_file.push_back("/home/davila/Borrame/testwt.bbs");
+
+
   bbtk::WxGUIConsole *I = new bbtk::WxGUIConsole(0,_T("bbi"),wxSize(800,600));
   SetTopWindow(I);  
   if (cmd.console) I->Show(true);
@@ -198,9 +206,9 @@ bool wxBBIApp::OnInit( )
   I->SetInputs(cmd.param_map);
 
   bool help_on_script = cmd.help && (cmd.input_file.size() > 0);
-  if (help_on_script)     I->SetNoExecMode(true);
-  if (cmd.graphical_dialog)     I->SetDialogMode(bbtk::VirtualExec::GraphicalDialog);
-  if (cmd.text_dialog)     I->SetDialogMode(bbtk::VirtualExec::TextDialog);
+  if (help_on_script)         I->SetNoExecMode(true);
+  if (cmd.graphical_dialog)   I->SetDialogMode(bbtk::VirtualExec::GraphicalDialog);
+  if (cmd.text_dialog)        I->SetDialogMode(bbtk::VirtualExec::TextDialog);
 
   std::vector<std::string>::const_iterator i;
   bool error = false;
@@ -257,6 +265,10 @@ IMPLEMENT_APP(wxBBIApp);
 //  you need to use the linker option "/subsystem:console" and the following code:
 int main(int argc, char* argv[])
 {
+
+//Borrame
+//FILE *ff; ff = fopen ("/tmp/wt.log","a+"); fprintf(ff,"EED main C\n"); fclose(ff);
+
     return WinMain(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), SW_SHOWNORMAL);
 }
 
@@ -270,6 +282,10 @@ IMPLEMENT_APP_NO_MAIN(wxBBIApp);
 
 int main(int argc, char* argv[])
 {      
+
+//Borrame
+//FILE *ff; ff = fopen ("/tmp/wt.log","a+"); fprintf(ff,"EED main A\n"); fclose(ff);
+
   wxMessageOutput::Set( new wxMessageOutputBest );
 
   wxCmdLineParser parser(cmdLineDesc,argc,argv);
@@ -448,6 +464,8 @@ int main(int argc, char* argv[])
   std::cout << "BBI (Black Box Interpreter) - bbtk "
             << bbtk::GetVersion()<< " - (c) Creatis 2007"
             << std::endl;
+//Borrame
+//FILE *ff; ff = fopen ("/tmp/wt.log","a+"); fprintf(ff,"EED main B\n"); fclose(ff);
 
   bbtk::Interpreter::Pointer I = bbtk::Interpreter::New();
   if (argc==1) 
diff --git a/kernel/appli/bbi/bbiWeb.cxx b/kernel/appli/bbi/bbiWeb.cxx
new file mode 100644 (file)
index 0000000..088433a
--- /dev/null
@@ -0,0 +1,82 @@
+/*
+# ---------------------------------------------------------------------
+#
+# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image 
+#                        pour la Santé)
+# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
+# Previous Authors : Laurent Guigues, Jean-Pierre Roux
+# CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
+#
+#  This software is governed by the CeCILL-B license under French law and 
+#  abiding by the rules of distribution of free software. You can  use, 
+#  modify and/ or redistribute the software under the terms of the CeCILL-B 
+#  license as circulated by CEA, CNRS and INRIA at the following URL 
+#  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html 
+#  or in the file LICENSE.txt.
+#
+#  As a counterpart to the access to the source code and  rights to copy,
+#  modify and redistribute granted by the license, users are provided only
+#  with a limited warranty  and the software's author,  the holder of the
+#  economic rights,  and the successive licensors  have only  limited
+#  liability. 
+#
+#  The fact that you are presently reading this means that you have had
+#  knowledge of the CeCILL-B license and that you accept its terms.
+# ------------------------------------------------------------------------ 
+*/ 
+
+
+#include <stdio.h>
+
+
+//=========================================================================
+#include <bbtkInterpreter.h>
+#include <wx/cmdline.h>
+#include "bbtkWtBlackBox.h"
+
+int main(int argc, char* argv[])
+{
+
+ printf("bbiWeb...A argc=%d \n",argc);
+
+//bbtk::MessageManager::SetMessageLevel("all",9);
+printf("bbiWeb: [0]: %s \n",argv[0]);
+printf("bbiWeb: [1]: %s \n",argv[1]);
+printf("bbiWeb: [2]: %s \n",argv[2]);
+printf("bbiWeb: [3]: %s \n",argv[3]);
+printf("bbiWeb: [4]: %s \n",argv[4]);
+ printf("bbiWeb...B\n");
+
+
+  bbtk::WtBlackBox::wtServerData::argc = argc;
+  bbtk::WtBlackBox::wtServerData::argv = argv;
+
+
+
+//Borrame
+//FILE *ff; ff = fopen ("/tmp/bbi.wt.log","a+"); fprintf(ff,"EED main bbiWeb\n"); fclose(ff);
+
+  bbtk::Interpreter::Pointer I = bbtk::Interpreter::New();
+
+printf("bbiWeb...C\n");
+
+  std::string fileName = argv[0];
+  std::size_t pos      = fileName.find("_");     
+  fileName             = fileName.substr (pos+1);      
+  pos                  = fileName.find(".wt");
+  fileName             = fileName.erase (pos);  
+  fileName             = "bbs/"+fileName;
+
+printf("bbiWeb fileName %s\n", fileName.c_str() );
+//  std::string fileName("/var/www/testwtdbg/docroot/.bbtk/tmp/demoPresentacion1Boton02.bbs");
+
+
+
+
+ printf("bbiWeb...D\n");
+  I->InterpretFile(fileName);
+ printf("bbiWeb...E\n");
+
+  return 0;
+}
diff --git a/kernel/appli/bbpConfigurator/CMakeLists.txt b/kernel/appli/bbpConfigurator/CMakeLists.txt
new file mode 100644 (file)
index 0000000..0cb04b6
--- /dev/null
@@ -0,0 +1,42 @@
+ # ---------------------------------------------------------------------
+ #
+ # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
+ #                        pour la SantÈ)
+ # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
+ # Previous Authors : Laurent Guigues, Jean-Pierre Roux
+ # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
+ #
+ #  This software is governed by the CeCILL-B license under French law and
+ #  abiding by the rules of distribution of free software. You can  use,
+ #  modify and/ or redistribute the software under the terms of the CeCILL-B
+ #  license as circulated by CEA, CNRS and INRIA at the following URL
+ #  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+ #  or in the file LICENSE.txt.
+ #
+ #  As a counterpart to the access to the source code and  rights to copy,
+ #  modify and redistribute granted by the license, users are provided only
+ #  with a limited warranty  and the software's author,  the holder of the
+ #  economic rights,  and the successive licensors  have only  limited
+ #  liability.
+ #
+ #  The fact that you are presently reading this means that you have had
+ #  knowledge of the CeCILL-B license and that you accept its terms.
+ # ------------------------------------------------------------------------ */
+
+
+
+
+SET(
+  SOURCES
+  bbpConfigurator
+)
+
+ADD_EXECUTABLE(
+  bbpConfigurator
+  ${SOURCES}
+)
+  
+TARGET_LINK_LIBRARIES(
+  bbpConfigurator bbtk
+)
+INSTALL_TARGETS(/bin/ bbpConfigurator)
diff --git a/kernel/appli/bbpConfigurator/bbpConfigurator.cpp b/kernel/appli/bbpConfigurator/bbpConfigurator.cpp
new file mode 100644 (file)
index 0000000..a4fa7ac
--- /dev/null
@@ -0,0 +1,393 @@
+/*
+ # ---------------------------------------------------------------------
+ #
+ # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
+ #                        pour la SantÈ)
+ # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
+ # Previous Authors : Laurent Guigues, Jean-Pierre Roux
+ # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
+ #
+ #  This software is governed by the CeCILL-B license under French law and
+ #  abiding by the rules of distribution of free software. You can  use,
+ #  modify and/ or redistribute the software under the terms of the CeCILL-B
+ #  license as circulated by CEA, CNRS and INRIA at the following URL
+ #  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+ #  or in the file LICENSE.txt.
+ #
+ #  As a counterpart to the access to the source code and  rights to copy,
+ #  modify and redistribute granted by the license, users are provided only
+ #  with a limited warranty  and the software's author,  the holder of the
+ #  economic rights,  and the successive licensors  have only  limited
+ #  liability.
+ #
+ #  The fact that you are presently reading this means that you have had
+ #  knowledge of the CeCILL-B license and that you accept its terms.
+ # ------------------------------------------------------------------------ */
+
+#include <cstdlib>
+#include <fstream>
+#include <iostream>
+#include <vector>
+#include <set>
+#include <map>
+#include <algorithm>
+#include "boost/filesystem.hpp"
+#include "bbtkBBPInterpreter.h"
+
+namespace bf = boost::filesystem;
+
+typedef std::vector<std::vector<int> > Graph;
+
+typedef std::set<std::string> Dependencies;
+typedef std::vector<Dependencies> DependenciesVector;
+typedef std::vector<std::string> BoxesVector;
+
+std::vector<bf::path> getFileList(const std::string& path);
+
+bool isCycle(const Graph& g);
+bool checkCycle(const Graph& g, const int& i, std::vector<bool>& v);
+
+void setPriorities(const Graph& g, std::vector<int>& p);
+void setPriority(const Graph& g, const int i, std::vector<int>& p);
+
+int main(int argc, char **argv)
+{
+  // Check arguments
+  if (argc != 4)
+  {
+    std::cout << "bbpConfigurator usage: bbConfigurator <path_to_bbs> <package_name> <output_path>" << std::endl;
+    return 1;
+  }
+
+  std::string path_bbs(argv[1]);
+  std::string package_name(argv[2]);
+  std::string path_out(argv[3]);
+  
+  std::cout << "bbpConfigurator launched with bbs path: '" << path_bbs <<
+      "', package: '" << package_name <<
+      "', output path: '" << path_out << "'." << std::endl;
+
+  // Get bbs files in path_bbs
+  std::vector<bf::path> files = getFileList(path_bbs);
+  if(files.size() == 0)
+  {
+    std::cout << "bbpConfigurator: No files to check in bbs path. "
+        "An empty bbp will be created for the package '" << package_name << "'." << std::endl;
+
+    // Write results to bbp file
+    #ifdef WIN32
+      std::string fname = path_out + "\\" + package_name + ".bbp";
+    #else
+      std::string fname = path_out + "/" + package_name + ".bbp";
+    #endif
+
+      std::ofstream out(fname.c_str());
+      out << "#-----------------------------------------" << std::endl;
+      out << "# Include script for bbtk package '" << package_name << "'" << std::endl;
+      out << "# Automatically generated by bbpConfigurator" << std::endl;
+      out << "#-----------------------------------------" << std::endl;
+      out << "load "<< package_name << std::endl;
+      out << "#-----------------------------------------" << std::endl;
+      out << "package "<< package_name << std::endl;
+      out << "#-----------------------------------------" << std::endl;
+      out << "endpackage" << std::endl;
+      out << "#-- EOF ----------------------------------" << std::endl;
+
+      out.close();
+
+
+    return 0;
+  }
+
+
+  // Order files by dependencies
+  //  Get DependenciesVector and Box Names
+  DependenciesVector deps;
+  BoxesVector boxs;
+
+
+  for (int i = 0; i < (int)files.size(); ++i) 
+  {
+    bbtk::BBPInterpreter::Pointer I = bbtk::BBPInterpreter::New();
+    I->InterpretFile(files[i].string());
+
+
+    boxs.push_back( ((bbtk::BBPInterpreter*)(I.get()))->boxName );
+
+// EED 2016/02/19
+//    deps.push_back( ((bbtk::BBPInterpreter*)(I.get()))->dependencies );
+ //-->  Cleanning string package:boxname -> boxname
+    std::set<std::string> tmpDependencies1=  ((bbtk::BBPInterpreter*)(I.get()))->dependencies  ;
+    std::set<std::string> tmpDependencies2;
+    std::set<std::string>::const_iterator sit(tmpDependencies1.begin()), send(tmpDependencies1.end()); 
+       int pos;
+       std::string tmpStr;
+//    std::cout << ((bbtk::BBPInterpreter*)(I.get()))->boxName << ": ";
+    for(;sit!=send;++sit)
+    { 
+               pos=(*sit).find(":");   
+               if (pos== std::string::npos ) 
+               { 
+                       tmpDependencies2.insert( *sit );
+//                     std::cout << *sit << ' ';
+               } else {
+                       tmpStr=(*sit).substr(pos+1);
+                       tmpDependencies2.insert( tmpStr );
+//                     std::cout << tmpStr << ' ';
+               } // if
+
+    } // for
+//    std::cout << std::endl;
+    deps.push_back( tmpDependencies2 );
+ //<--
+
+
+
+//    //print box name and dependencies  OLD VERSION
+//    std::cout << ((bbtk::BBPInterpreter*)(I.get()))->boxName << ": ";
+//   for(
+//      Dependencies::iterator it = ((bbtk::BBPInterpreter*)(I.get()))->dependencies.begin();
+//      it != ((bbtk::BBPInterpreter*)(I.get()))->dependencies.end();
+//      it++) {
+//      std::cout << *it << ", ";
+//    }
+//    std::cout << std::endl;
+
+  } // for i
+
+  // Only keep dependencies from package
+  Dependencies boxNamesSet(boxs.begin(), boxs.end());
+
+//std::cout << "after: " << std::endl;
+  for (DependenciesVector::iterator it = deps.begin(); it != deps.end(); it++) 
+  {
+    BoxesVector tmp;
+    std::set_intersection(it->begin(), it->end(), boxNamesSet.begin(), boxNamesSet.end(),std::back_inserter(tmp));
+    Dependencies tmp1(tmp.begin(),tmp.end());
+    it->swap( tmp1 );
+//    //print clean dependencies
+//    for( Dependencies::iterator it1 = it->begin();  it1 != it->end(); it1++) 
+//    {
+//      std::cout << *it1 << ", ";
+//    }
+//    std::cout << std::endl;
+
+  }
+
+  // Create dependencies graph
+  std::vector<std::vector<int> > g(boxs.size(), std::vector<int>());
+  std::map<std::string, int> idxs;
+
+
+  for (int i = 0; i < (int)boxs.size(); ++i)
+  {
+    idxs[boxs[i]] = i;
+  }
+
+  int boxit = 0;
+  for (DependenciesVector::iterator dit = deps.begin(); dit != deps.end(); dit++, boxit++)
+  {
+    for (Dependencies::iterator ddit = dit->begin(); ddit != dit->end(); ddit++)
+    {
+      g[boxit].push_back(idxs[*ddit]);
+    }
+  }
+
+  // Check there are no cycles in graph
+  if(isCycle(g))
+  {
+    std::cout << "bbpConfigurator: There are dependency cycles, please check your scripts in '" <<
+        path_bbs << "'. No bbp file created." << std::endl;
+    return 2;
+  }
+  else
+  {
+    std::cout << "bbpConfigurator: No cycles detected in dependency graph." << std::endl;
+    std::vector<int> priorities(boxs.size(), -1);
+    setPriorities(g, priorities);
+//    for (int i = 0; i < (int)priorities.size(); i++)
+//    {
+//      std::cout << priorities[i] << " ";
+//    }
+//    std::cout << std::endl;
+
+    // Write results to bbp file
+  #ifdef WIN32
+    std::string fname = path_out + "\\" + package_name + ".bbp";
+  #else
+    std::string fname = path_out + "/" + package_name + ".bbp";
+  #endif
+
+    std::ofstream out(fname.c_str());
+    out << "#-----------------------------------------" << std::endl;
+    out << "# Include script for bbtk package '" << package_name << "'" << std::endl;
+    out << "# Automatically generated by bbpConfigurator" << std::endl;
+    out << "#-----------------------------------------" << std::endl;
+    out << "load "<< package_name << std::endl;
+    out << "#-----------------------------------------" << std::endl;
+    out << "package "<< package_name << std::endl;
+    out << "#-----------------------------------------" << std::endl;
+
+    //each bbs file ordered.
+    //include [package_name]/boxes/[file_bbs]
+    //#-----------------------------------------
+
+  //  for (int i = 0; i < (int)files.size(); ++i) {
+  //    out << "include " << package_name << "/boxes/" << files[i].filename().string() << std::endl;
+  //    out << "#-----------------------------------------" << std::endl;
+  //  }
+
+    // find max priority level
+    int mx_priority = 0;
+    for (int i = 0; i < (int)priorities.size(); i++)
+    {
+      mx_priority = std::max(mx_priority, priorities[i]);
+    }
+
+    // for each priority level print scripts in that level.
+    for (int i = 0; i <= mx_priority; i++)
+    {
+      for (int j = 0; j < (int)priorities.size(); j++)
+      {
+        if(priorities[j] == i)
+        {
+//EED 2017-03-28
+#if BOOST_MAJOR_VERSION <= 1 && BOOST_MINOR_VERSION <=41 
+          out << "include " << package_name << "/boxes/" << files[j].filename() << std::endl;
+#else
+          out << "include " << package_name << "/boxes/" << files[j].filename().string() << std::endl;
+#endif
+
+          out << "#-----------------------------------------" << std::endl;
+        }
+      }
+    }
+    out << "endpackage" << std::endl;
+    out << "#-- EOF ----------------------------------" << std::endl;
+  
+    out.close();
+
+    std::cout << "bbpConfigurator: bbp file created at '" << fname << "'." << std::endl;
+  }
+  return 0;
+}
+//==========================================================================
+
+// extract of the tarjan's algorithm for strongly connected components
+bool isCycle(const Graph& g)
+{
+  for (int it = 0; it < (int)g.size(); ++it) {
+    std::vector<bool> visited (g.size(), false);
+    if (checkCycle(g, it, visited))
+    {
+      //std::cout << "At " << it << std::endl;
+      return true;
+    }
+  }
+  return false;
+}
+
+//==========================================================================
+
+// dfs search to check cycles.
+bool checkCycle(const Graph& g, const int& i, std::vector<bool>& v)
+{
+
+  v[i] = true;
+  for(int dit = 0; dit < (int)g[i].size(); dit++)
+  {
+    int d = g[i][dit];
+    if(d < 0 || d >= (int)g.size() || v[d])
+    {
+      //std::cout << "Checking " << i << " dependency " << dit << "=" << d << std::endl;
+      return true;
+    }
+    if(checkCycle(g,d,v))
+      return true;
+  }
+  v[i] = false;
+  return false;
+}
+
+//==========================================================================
+
+// find precedence in graph. 0 are the boxes that have no deps, 1 boxes that have deps from 0 or less, 2 boxes that have deps from 1 or less, etc.
+void setPriorities(const Graph& g, std::vector<int>& p)
+{
+  for(int i = 0; i < (int)g.size(); i++)
+  {
+    if(p[i] == -1)
+      setPriority(g, i, p);
+  }
+}
+
+//==========================================================================
+
+// dfs search to find dependencies
+void setPriority(const Graph& g, const int i, std::vector<int>& p)
+{
+  int pi = -1;
+  for(int j = 0; j < (int)g[i].size(); j++)
+  {
+    setPriority(g, g[i][j], p);
+    pi = std::max(pi, p[g[i][j]]);
+  }
+  p[i]=pi+1;
+}
+
+//==========================================================================
+
+std::vector<bf::path> getFileList(const std::string& path)
+{
+  std::vector<bf::path> files;
+
+  bf::path pth(path.c_str());
+  if(bf::exists(pth) && bf::is_directory(pth))
+  {
+    bf::directory_iterator end_itr;
+    bf::directory_iterator itr(pth);
+    for(itr; itr != end_itr; ++itr)
+    {
+      if(!is_directory(itr->status()))
+      {
+//EED 2017-03-28
+#if BOOST_MAJOR_VERSION <= 1 && BOOST_MINOR_VERSION <=41 
+        std::string nm(itr->path().filename());
+#else
+        std::string nm(itr->path().filename().string());
+#endif
+        if(nm.substr(nm.size()-4) == ".bbs")
+        {
+          //std::cout << itr->path().filename().string() << std::endl;
+          files.push_back(itr->path());
+        }
+      }
+    }
+  }
+  else
+  {
+    std::cout<< "bbpConfigurator: The path to the bbs's doesn't exist or is not a folder. ('" << path << "')" << std::endl;
+    return files;
+  }
+
+  // Order files by name
+  for (int i = 0; i < (int)files.size()-1; ++i) {
+    for (int j = i+1; j < (int)files.size(); ++j) {
+
+//EED 2017-03-28
+#if BOOST_MAJOR_VERSION <= 1 && BOOST_MINOR_VERSION <=41 
+      if(files[j].filename() < files[i].filename())
+#else
+      if(files[j].filename().string() < files[i].filename().string())
+#endif
+
+      {
+        bf::path tmp = files[i];
+        files[i] = files[j];
+        files[j] = tmp;
+      }
+    }
+  }
+
+  return files;
+}
index 27352efe28581632688a5951796e147367e980d7..634a2a7bbbe86874a981a0628365395583a8f54d 100644 (file)
@@ -47,6 +47,7 @@ IF(WIN32)
   SET(BBTK_BBS2CPP "${BBTK_BIN_PATH}/bbs2cpp")
   SET(BBTK_BBC "${BBTK_BIN_PATH}/bbc")
   SET(BBTK_BBFY "${BBTK_BIN_PATH}/bbfy")
+  SET(BBTK_BBPCONFIGURATOR "${BBTK_BIN_PATH}/bbpConfigurator")
   SET(BBTK_BBDOC "${BBTK_BIN_PATH}/bbdoc")
   
 ELSE(WIN32)
@@ -57,6 +58,7 @@ ELSE(WIN32)
   SET(BBTK_BBS2CPP "${BBTK_BIN_PATH}/bbs2cpp")
   SET(BBTK_BBC "${BBTK_BIN_PATH}/bbc")
   SET(BBTK_BBFY "${BBTK_BIN_PATH}/bbfy")
+  SET(BBTK_BBPCONFIGURATOR "${BBTK_BIN_PATH}/bbpConfigurator")
   SET(BBTK_BBDOC "${BBTK_BIN_PATH}/bbdoc")  
 ENDIF(WIN32)
 
index c7d7253f8d132172ec33db195b4cf6670b025445..bd5d496151c9bc5d92a2e01eddbab09f2ba97b5e 100644 (file)
@@ -27,6 +27,7 @@
 
 #----------------------------------------------------------------------------
 IF(${BBTK_PACKAGE_NAME}_INCLUDE_ALL_BBS_BOXES) 
+
   FILE(GLOB 
     ${BBTK_PACKAGE_NAME}_BBS_BOXES 
     RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
index b00969be3d8df53fdd6b52c450a77c06beb550cc..eab078afa44f902f6be720483e20e881acedd5cc 100644 (file)
@@ -89,6 +89,8 @@ ENDIF(NOT PROJECT_BINARY_DIR STREQUAL ${PROJECT_SOURCE_DIR})
 #----------------------------------------------------------------------------
 
 
+
+
 #----------------------------------------------------------------------------
 #----------------------------------------------------------------------------
 # bbfy
@@ -98,6 +100,8 @@ ENDIF(NOT PROJECT_BINARY_DIR STREQUAL ${PROJECT_SOURCE_DIR})
 IF(${BBTK_PACKAGE_NAME}_COMPILE_ALL_XML) 
   FILE(GLOB ${BBTK_PACKAGE_NAME}_XML_SOURCES "." "*.xml")
 ENDIF(${BBTK_PACKAGE_NAME}_COMPILE_ALL_XML) 
+
+
 #----------------------------------------------------------------------------
 FOREACH(xmlfile ${${BBTK_PACKAGE_NAME}_XML_SOURCES})
   GET_FILENAME_COMPONENT(filename "${xmlfile}" NAME_WE) 
@@ -109,19 +113,26 @@ FOREACH(xmlfile ${${BBTK_PACKAGE_NAME}_XML_SOURCES})
  #   SET(command00 Path=c:/creatis/dlls__RR__%WXWIN%/lib/vc_dll/__RR__%VTK_DIR%__RR__%ITK_DIR%/../../bin/__RR__%PATH%)
  #   STRING(REPLACE "__RR__" "\;" SETPATH ${command00} )
  #   SET(SETPATH set ${command0} &&)
+
  ADD_CUSTOM_COMMAND(
-    OUTPUT ${BBFY_CXX_OUT}
-    COMMAND
-    set Path=${DLL_PATH} && ${BBTK_BBFY} ${xmlfile} ${BBTK_PACKAGE_NAME} ${CMAKE_CURRENT_BINARY_DIR}/ -q
+    OUTPUT ${BBFY_CXX_OUT} 
+       COMMAND echo ${BBFY_CXX_OUT}
+       COMMAND  echo set "Path=${crea_DIR}/bin/\;"${DLL_PATH} 
+       COMMAND  echo ${BBTK_BBFY} ${xmlfile} ${BBTK_PACKAGE_NAME} ${CMAKE_CURRENT_BINARY_DIR}/ -q
+       COMMAND echo ${BBFY_CXX_OUT}
+       COMMAND  set "Path=${crea_DIR}/bin/\;"${DLL_PATH} && ${BBTK_BBFY} ${xmlfile} ${BBTK_PACKAGE_NAME} ${CMAKE_CURRENT_BINARY_DIR}/ -q
+ ##  COMMAND  set Path=${DLL_PATH} && ${BBTK_BBFY} ${xmlfile} ${BBTK_PACKAGE_NAME} ${CMAKE_CURRENT_BINARY_DIR}/ -q
     DEPENDS ${xmlfile}
-    ${BBTK_BBFY_DEPENDENCY} 
+    ${BBTK_BBFY_DEPENDENCY}
+    ${BBTK_BBPCONFIGURATOR_DEPENDENCY}
     )
   ELSE(WIN32)
     SET(LD_LIBRARY_PATH "$ENV{LD_LIBRARY_PATH}:${LIBRARY_OUTPUT_PATH}")
     ADD_CUSTOM_COMMAND(
       OUTPUT ${BBFY_CXX_OUT}
       COMMAND
-      ${BBTK_BBFY} ${xmlfile} ${BBTK_PACKAGE_NAME} ${CMAKE_CURRENT_BINARY_DIR}/ -q
+      export LD_LIBRARY_PATH=${LD_LIBRARY_PATH} && echo $ENV{LD_LIBRARY_PATH} && ${BBTK_BBFY} ${xmlfile} ${BBTK_PACKAGE_NAME} ${CMAKE_CURRENT_BINARY_DIR}/ -q
       DEPENDS ${xmlfile}
       ${BBTK_BBFY_DEPENDENCY} 
       )
@@ -295,3 +306,49 @@ IF(CHCON_LIBRARIES)
 ENDIF(CHCON_LIBRARIES)
 #----------------------------------------------------------------------------
 
+
+
+#----------------------------------------------------------------------------
+#  bbpConfigurator
+#----------------------------------------------------------------------------
+# --Creates the file ${BBTK_PACKAGE_NAME}.bbp-- 
+## bbpConfigurator   create de PACKAGE.bbp file
+## bbConfigurator <path_to_bbs> <package_name> <output_path>
+
+
+
+IF (WIN32)
+    MAKE_DLL_PATH()
+##    ADD_CUSTOM_TARGET( ${BBTK_PACKAGE_NAME}.bbp  ALL
+ADD_CUSTOM_COMMAND(
+##    OUTPUT ${BBTK_BBS_BUILD_PATH}/${BBTK_PACKAGE_NAME}.bbp
+        TARGET bb${BBTK_PACKAGE_NAME} POST_BUILD
+        COMMAND  set "Path=${crea_DIR}/bin/\;"${DLL_PATH} && ${BBTK_BBPCONFIGURATOR} ${CMAKE_CURRENT_SOURCE_DIR}/../bbs/boxes/  ${BBTK_PACKAGE_NAME}  ${BBTK_BBS_BUILD_PATH}/
+##             DEPENDS ${BBTK_BBPCONFIGURATOR_DEPENDENCY} 
+         ) 
+    add_dependencies( bb${BBTK_PACKAGE_NAME}  bbpConfigurator )
+ELSE(WIN32)
+    SET(LD_LIBRARY_PATH "$ENV{LD_LIBRARY_PATH}:${LIBRARY_OUTPUT_PATH}")
+    ADD_CUSTOM_TARGET( bb${BBTK_PACKAGE_NAME}.bbp  ALL
+         COMMAND  ${BBTK_BBPCONFIGURATOR} ${CMAKE_CURRENT_SOURCE_DIR}/../bbs/boxes/  ${BBTK_PACKAGE_NAME}  ${BBTK_BBS_BUILD_PATH}/
+    ) 
+    add_dependencies( bb${BBTK_PACKAGE_NAME}.bbp  bbpConfigurator )
+ENDIF(WIN32)
+
+
+
+SET(OUTPUT_FILE ${BBTK_BBS_BUILD_PATH}/${BBTK_PACKAGE_NAME}.bbp)
+IF(WIN32)
+   INSTALL(
+     FILES ${OUTPUT_FILE}
+#    DESTINATION ${BBTK_BBS_INSTALL_PATH}
+     DESTINATION ${BBTK_BBS_REL_PATH}
+    )
+ELSE(WIN32     )
+     INSTALL(
+       FILES ${OUTPUT_FILE}
+       DESTINATION ${BBTK_BBS_INSTALL_PATH}
+#      DESTINATION ${BBTK_BBS_REL_PATH}
+     )
+ENDIF(WIN32)
+
index 29d89ad648498e89a8a889b506df2698a289ffbf..342bbb2502784d51f2fec11446ef0a20a92d5e52 100644 (file)
@@ -80,33 +80,39 @@ MACRO(BBTK_CREATE_PACKAGE_INCLUDE_SCRIPT    BBTK_PACKAGE_NAME    BBTK_PACKAGE_BB
 
 
   ##  --Configure and installing bbs boxes--
-  # --Creates the file ${BBTK_PACKAGE_NAME}.bbp--
-  SET(OUTPUT_FILE ${BBTK_BBS_BUILD_PATH}/${BBTK_PACKAGE_NAME}.bbp)
-  FILE(WRITE 
-    "${OUTPUT_FILE}" 
-    "#-----------------------------------------\n"
-    "# Include script for bbtk package '${BBTK_PACKAGE_NAME}'\n"
-    "# Automatically generated by cmake (macro BBTK_CREATE_PACKAGE_INCLUDE_SCRIPT)\n")
-  FILE(APPEND 
-    "${OUTPUT_FILE}"
-    "#-----------------------------------------\n"
-    "load ${BBTK_PACKAGE_NAME}\n"
-    "#-----------------------------------------\n"
-    "package ${BBTK_PACKAGE_NAME}\n"
-    )
-  
-  #FILE(APPEND 
-  #  "${OUTPUT_FILE}"
-  #  "#-----------------------------------------\n"
-  #  "include ${BBTK_PACKAGE_NAME}/boxes/*\n"
-  #  )
-  
+
+
+##EED 24/06/2013
+##  FILE(WRITE 
+##    "${OUTPUT_FILE}" 
+##    "#-----------------------------------------\n"
+##    "# Include script for bbtk package '${BBTK_PACKAGE_NAME}'\n"
+##    "# Automatically generated by cmake (macro BBTK_CREATE_PACKAGE_INCLUDE_SCRIPT)\n")
+##  FILE(APPEND 
+##    "${OUTPUT_FILE}"
+##    "#-----------------------------------------\n"
+##    "load ${BBTK_PACKAGE_NAME}\n"
+##    "#-----------------------------------------\n"
+##    "package ${BBTK_PACKAGE_NAME}\n"
+##    )
+##  
+##  #FILE(APPEND 
+##  #  "${OUTPUT_FILE}"
+##  #  "#-----------------------------------------\n"
+##  #  "include ${BBTK_PACKAGE_NAME}/boxes/*\n"
+##  #  )
+##  
+
   FOREACH(bbs ${BBTK_PACKAGE_BBS_BOXES})  
-    FILE(APPEND 
-      "${OUTPUT_FILE}"
-      "#-----------------------------------------\n"
-      "include ${BBTK_PACKAGE_NAME}/${bbs}\n"
-      )
+
+##EED 24/06/2013
+##    FILE(APPEND 
+##      "${OUTPUT_FILE}"
+##      "#-----------------------------------------\n"
+##      "include ${BBTK_PACKAGE_NAME}/${bbs}\n"
+##      )
+
     CONFIGURE_FILE(
       ${CMAKE_CURRENT_SOURCE_DIR}/${bbs}
       ${BBTK_BBS_BUILD_PATH}/${BBTK_PACKAGE_NAME}/${bbs}
@@ -116,42 +122,36 @@ MACRO(BBTK_CREATE_PACKAGE_INCLUDE_SCRIPT    BBTK_PACKAGE_NAME    BBTK_PACKAGE_BB
     
     
     IF(WIN32)
-    INSTALL(
-      FILES ${CMAKE_CURRENT_SOURCE_DIR}/${bbs}
-#      DESTINATION ${BBTK_BBS_INSTALL_PATH}/${BBTK_PACKAGE_NAME}/${bbs_path}
-      DESTINATION ${BBTK_BBS_REL_PATH}/${BBTK_PACKAGE_NAME}/${bbs_path}
-    )
-ELSE(WIN32)
-INSTALL(
-      FILES ${CMAKE_CURRENT_SOURCE_DIR}/${bbs}
-      DESTINATION ${BBTK_BBS_INSTALL_PATH}/${BBTK_PACKAGE_NAME}/${bbs_path}
-#      DESTINATION ${BBTK_BBS_REL_PATH}/${BBTK_PACKAGE_NAME}/${bbs_path}
-    )
-ENDIF(WIN32)
+      INSTALL(
+        FILES ${CMAKE_CURRENT_SOURCE_DIR}/${bbs}
+#       DESTINATION ${BBTK_BBS_INSTALL_PATH}/${BBTK_PACKAGE_NAME}/${bbs_path}
+        DESTINATION ${BBTK_BBS_REL_PATH}/${BBTK_PACKAGE_NAME}/${bbs_path}
+      )
+    ELSE(WIN32)
+      INSTALL(
+        FILES ${CMAKE_CURRENT_SOURCE_DIR}/${bbs}
+        DESTINATION ${BBTK_BBS_INSTALL_PATH}/${BBTK_PACKAGE_NAME}/${bbs_path}
+#       DESTINATION ${BBTK_BBS_REL_PATH}/${BBTK_PACKAGE_NAME}/${bbs_path}
+      )
+    ENDIF(WIN32)
+
   ENDFOREACH(bbs)
 
 
 
-  ##  --Configure and installing bbs appli--
-  FILE(APPEND 
-    "${OUTPUT_FILE}"
-      "#-----------------------------------------\n"
-      "endpackage\n"
-      "#-- EOF ----------------------------------\n"
-    )
- IF(WIN32)
-  INSTALL(
-    FILES ${OUTPUT_FILE}
-#    DESTINATION ${BBTK_BBS_INSTALL_PATH}
-    DESTINATION ${BBTK_BBS_REL_PATH}
-    )
-ELSE(WIN32)
-  INSTALL(
-    FILES ${OUTPUT_FILE}
-    DESTINATION ${BBTK_BBS_INSTALL_PATH}
-#   DESTINATION ${BBTK_BBS_REL_PATH}
-    )
-ENDIF(WIN32)
+##EED 24/06/2013
+##  ##  --Configure and installing bbs appli--
+##  FILE(APPEND 
+##    "${OUTPUT_FILE}"
+##      "#-----------------------------------------\n"
+##      "endpackage\n"
+##      "#-- EOF ----------------------------------\n"
+##    )
+
+
+
+
+
   # Creates the file ${BBTK_PACKAGE_NAME}-appli.bbp
   SET(OUTPUT_FILE ${BBTK_BBS_BUILD_PATH}/${BBTK_PACKAGE_NAME}-appli.bbp)
   FILE(WRITE 
index bdb2f45cfa5727186cebe39edf7242183ade0341..dc2584328a7bc59e24fe8448216ccbf5fb648fd6 100644 (file)
@@ -87,6 +87,7 @@ IF(WIN32)
   SET(BBTK_BBC ${BBTK_BIN_PATH}/bbc.exe)
   SET(BBTK_BBI ${BBTK_BIN_PATH}/bbi.exe)
   SET(BBTK_BBFY ${BBTK_BIN_PATH}/bbfy.exe)
+  SET(BBTK_BBPCONFIGURATOR ${BBTK_BIN_PATH}/bbpConfigurator.exe)
 
 ELSE(WIN32)
 # For Xcode : have to test the cmake generator !
@@ -99,6 +100,7 @@ ELSE(WIN32)
   SET(BBTK_BBS2CPP ${BBTK_BIN_PATH}/bbs2cpp)
   SET(BBTK_BBC ${BBTK_BIN_PATH}/bbc)
   SET(BBTK_BBFY ${BBTK_BIN_PATH}/bbfy)
+  SET(BBTK_BBPCONFIGURATOR ${BBTK_BIN_PATH}/bbpConfigurator)
 ENDIF(WIN32)  
 SET(BBTK_PACKAGE_LIB_PATH ${BBTK_LIB_PATH})
 
@@ -112,6 +114,7 @@ MESSAGE(STATUS "* BBTK_BBI              =${BBTK_BBI}")
 MESSAGE(STATUS "* BBTK_BBS2CPP          =${BBTK_BBS2CPP}")
 MESSAGE(STATUS "* BBTK_BBC              =${BBTK_BBC}")
 MESSAGE(STATUS "* BBTK_BBFY             =${BBTK_BBFY}")
+MESSAGE(STATUS "* BBTK_BBPCONFIGURATOR  =${BBTK_BBPCONFIGURATOR}")
 #-----------------------------------------------------------------------------
 
 #-----------------------------------------------------------------------------
index 92210a7aaa6d9d560a55329560598dc4c1df7c98..bf1bf560bf0d02d56a6d69faf7305e5e51dfc078 100644 (file)
@@ -106,6 +106,13 @@ IF(BBTK_CORE_PACKAGE)
     SET(BBTK_BBFY_DEPENDENCY ${BBTK_BBFY})
   ENDIF(EXISTS "${BBTK_BBFY}")
 
+  IF(EXISTS "${BBTK_BBPCONFIGURATOR}")
+    SET(BBTK_BBPCONFIGURATOR_DEPENDENCY)
+  ELSE(EXISTS "${BBTK_BBPCONFIGURATOR}")
+    SET(BBTK_BBPCONFIGURATOR_DEPENDENCY ${BBTK_BBPCONFIGURATOR})
+  ENDIF(EXISTS "${BBTK_BBPCONFIGURATOR}")
+
+
 ENDIF(BBTK_CORE_PACKAGE)
 #-----------------------------------------------------------------------------
 
index 449e133436b75f0e3befe4c62b993f7063e62fba..44e3b2c8e411f44021be62f35f67272b1014c838 100644 (file)
@@ -180,6 +180,16 @@ IF(BBTK_USE_QT)
       )
     SET(SOURCES ${SOURCES} ${MOC_SOURCES} ${UI_SOURCES})
   ENDIF(QT_FOUND)
+
+# JFGA 03/12/2014 --  Temporal configuration of WT 
+# *********Missing if conditional Wt********
+   #find_package(Boost COMPONENTS system thread signals)
+   #find_library(wt wt)
+   #find_library(wtext wtext)
+   #find_library(wthttp wthttp)
+   INCLUDE_DIRECTORIES(/usr/local/lib/)
+
+
 ENDIF(BBTK_USE_QT)
 #-----------------------------------------------------------------------------
 
@@ -188,7 +198,7 @@ ENDIF(BBTK_USE_QT)
 # lib definition
 ADD_LIBRARY(bbtk SHARED ${SOURCES} ${SOURCES_H})
 #-----------------------------------------------------------------------------
-TARGET_LINK_LIBRARIES(bbtk ${BBTK_LINK_LIBRARIES} ${BOOST_LIBRARIES}  ${crea_LIBRARIES})
+TARGET_LINK_LIBRARIES(bbtk ${BBTK_LINK_LIBRARIES} ${BOOST_LIBRARIES}  ${crea_LIBRARIES} ${WT_LIBRARIES})
 #-----------------------------------------------------------------------------
 IF(UNIX)
 SET_TARGET_PROPERTIES(bbtk PROPERTIES COMPILE_FLAGS -Wall)
index b60f6bb9dda4fc82afb4635d8d4540e3ae47c037..aafb10de89ee218cb0d80db3a641ec309c4127d0 100644 (file)
@@ -86,4 +86,6 @@ namespace bbtk
   {  
     bbtkDDebugMessage("object",3,"==> ~AtomicBlackBoxDescriptor()"<<std::endl);
   }
+
+       
 }// namespace bbtk
diff --git a/kernel/src/bbtkBBPInterpreter.cxx b/kernel/src/bbtkBBPInterpreter.cxx
new file mode 100644 (file)
index 0000000..a9f246c
--- /dev/null
@@ -0,0 +1,158 @@
+/*
+# ---------------------------------------------------------------------
+#
+# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
+#                        pour la Santé)
+# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
+#
+#  This software is governed by the CeCILL-B license under French law and
+#  abiding by the rules of distribution of free software. You can  use,
+#  modify and/ or redistribute the software under the terms of the CeCILL-B
+#  license as circulated by CEA, CNRS and INRIA at the following URL
+#  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+#  or in the file LICENSE.txt.
+#
+#  As a counterpart to the access to the source code and  rights to copy,
+#  modify and redistribute granted by the license, users are provided only
+#  with a limited warranty  and the software's author,  the holder of the
+#  economic rights,  and the successive licensors  have only  limited
+#  liability.
+#
+#  The fact that you are presently reading this means that you have had
+#  knowledge of the CeCILL-B license and that you accept its terms.
+# ------------------------------------------------------------------------
+ */
+
+/*=========================================================================
+Program:   bbtk
+Module:    $RCSfile$
+Language:  C++
+Date:      $Date$
+Version:   $Revision$
+=========================================================================*/
+
+
+/**
+ *  \file
+ *  \brief Class bbtk::BBPInterpreter
+ */
+
+
+#include "bbtkBBPInterpreter.h"
+
+#include "bbtkExecuter.h"
+#include "bbtkMessageManager.h"
+#include "bbtkFactory.h"
+#include "bbtkUtilities.h"
+
+namespace bbtk
+{
+
+  //=========================================================================
+  BBPInterpreter::Pointer BBPInterpreter::New()
+  {
+    return MakePointer( new BBPInterpreter() );
+  }
+  //=========================================================================
+
+
+
+  //=========================================================================
+  BBPInterpreter::BBPInterpreter()
+  {
+    bbtk::InterpreterVirtual::Init();
+  }
+  //=========================================================================
+
+
+  //=========================================================================
+  BBPInterpreter::~BBPInterpreter()
+  {
+  }
+  //=========================================================================
+
+
+  //=========================================================================
+  /// Creates a new black box in current complex box
+  void BBPInterpreter::commandNew( const std::string& boxType, const std::string& boxName) // virtual
+  {
+    this->dependencies.insert(boxType);
+  }
+  //=========================================================================
+
+
+  //=========================================================================
+  /// Connects the output boxOutput to the input boxInput
+  void BBPInterpreter::commandConnection (const std::string &boxfrom,
+      const std::string &output,
+      const std::string &boxto,
+      const std::string &input)                        // virtual
+  {
+  }
+  //=========================================================================
+
+  //=========================================================================
+  void BBPInterpreter::commandInput(const std::string &name,const std::string &box,const std::string &input,const std::string  &help)
+  {
+  }
+  //=========================================================================
+
+  //=========================================================================
+  void BBPInterpreter::commandOutput(const std::string &name,const std::string &box,const std::string &output,const std::string  &help)
+  {
+  }
+  //=========================================================================
+
+
+  //=========================================================================
+  /// sets the input of the box with the value
+  void BBPInterpreter::commandSet(const std::string &box,const std::string &input,const std::string &value) // virtual
+  {
+  }
+  //=========================================================================
+
+
+  //=========================================================================
+  void BBPInterpreter::commandDefine(const std::string &name,const std::string &pack,const std::string &scriptfilename) // virtual
+  {
+    this->boxName = name;
+  }
+  //=========================================================================
+
+
+  //=========================================================================
+  void BBPInterpreter::commandEndDefine() // virtual
+  {
+  }
+  //=========================================================================
+
+
+  //=========================================================================
+  void BBPInterpreter::commandExec(const std::string &word) // virtual
+  {
+  }
+  //=========================================================================
+
+
+  //=========================================================================
+  void BBPInterpreter::commandAuthor(const std::string &author)  // virtual
+  {
+  }
+  //=========================================================================
+
+  //=========================================================================
+  void BBPInterpreter::commandCategory(const std::string &categorytype)  // virtual
+  {
+  }
+  //=========================================================================
+
+  //=========================================================================
+  void BBPInterpreter::commandDescription(const std::string &description)  // virtual
+  {
+  }
+  //=========================================================================
+
+}  // EO namespace bbtk
+
+// EOF
+
diff --git a/kernel/src/bbtkBBPInterpreter.h b/kernel/src/bbtkBBPInterpreter.h
new file mode 100644 (file)
index 0000000..5fa1c63
--- /dev/null
@@ -0,0 +1,100 @@
+/*
+# ---------------------------------------------------------------------
+#
+# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
+#                        pour la Santé)
+# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
+#
+#  This software is governed by the CeCILL-B license under French law and
+#  abiding by the rules of distribution of free software. You can  use,
+#  modify and/ or redistribute the software under the terms of the CeCILL-B
+#  license as circulated by CEA, CNRS and INRIA at the following URL
+#  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+#  or in the file LICENSE.txt.
+#
+#  As a counterpart to the access to the source code and  rights to copy,
+#  modify and redistribute granted by the license, users are provided only
+#  with a limited warranty  and the software's author,  the holder of the
+#  economic rights,  and the successive licensors  have only  limited
+#  liability.
+#
+#  The fact that you are presently reading this means that you have had
+#  knowledge of the CeCILL-B license and that you accept its terms.
+# ------------------------------------------------------------------------
+*/
+
+/*=========================================================================
+Program:   bbtk
+Module:    $RCSfile$
+Language:  C++
+Date:      $Date$
+Version:   $Revision$
+=========================================================================*/
+
+
+#ifndef __bbtkBBPInterpreter_h__
+#define __bbtkBBPInterpreter_h__
+
+//Includes bbtk
+#include "bbtkInterpreterVirtual.h"
+
+//Includes std
+#include <iostream>
+#include <set>
+
+
+//#include "bbtkSystem.h"
+//#include "bbtkComplexBlackBox.h"
+
+namespace bbtk
+{
+  class BBTK_EXPORT BBPInterpreter : public InterpreterVirtual
+  {
+  public:
+    static Pointer New();
+    BBPInterpreter();
+    ~BBPInterpreter();
+
+    //Public methods
+
+    virtual void commandNew( const std::string& boxType, const std::string& boxName);
+
+    virtual void commandConnection (const std::string &boxfrom,
+                       const std::string &output,
+                       const std::string &boxto,
+                       const std::string &input);
+    virtual void commandSet(const std::string &box,const std::string &input,const std::string &value);
+
+
+    virtual void commandDefine(const std::string &name,const std::string &pack,const std::string &scriptfilename);
+    virtual void commandEndDefine();
+
+    virtual void commandExec(const std::string &word);
+
+    virtual void commandAuthor(const std::string &author);
+    virtual void commandCategory(const std::string &categorytype);
+    virtual void commandDescription(const std::string &description);
+
+    virtual void commandInput(const std::string &name,const std::string &box,const std::string &input,const std::string  &help);
+    virtual void commandOutput(const std::string &name,const std::string &box,const std::string &output,const std::string  &help);
+
+    std::string boxName;
+    std::set<std::string> dependencies;
+
+  private:
+
+    //Private Attributes
+
+    //Private Methods
+
+  protected:
+
+    //Protected Attributes
+
+    //Protected methods
+
+  };
+}
+// namespace bbtk
+#endif
+
index e2dae01bcc2cd42401bc53469cb8106bf3c17005..6fb1fb83a9c749dfce3cc545269c3f0773ad71bf 100644 (file)
@@ -463,17 +463,32 @@ namespace bbtk
       }
     */
 
+
     OutputConnectorMapType::const_iterator o;  
     for ( o = bbGetOutputConnectorMap().begin(); 
          o != bbGetOutputConnectorMap().end(); ++o )                   
-      {                                                                        
-       if (o->second->GetStatus()==UPTODATE) 
+      {
+
+
+       if (o->first=="BoxChange")
+       {
+               o->second->SetStatus(UPTODATE);
+       }
+
+
+
+//EED 24/08/2015
+// EED CASPITAS 2
+       if (o->second->GetStatus()==UPTODATE)
+//     if ((o->second->GetStatus()==UPTODATE) || (o->second->GetStatus()==OUTOFDATE))
+//     if ((o->second->GetStatus()==UPTODATE) || (o->second->GetStatus()==MODIFIED))
          {
            o->second->SetStatus(OUTOFDATE);
            o->second->SignalChange(GetThisPointer<BlackBox>(),o->first); 
-         }
-       }                                                               
+         } // if
+       } // for                                                        
     
+
     if (  ( bbBoxProcessModeIsReactive()
           || (c==bbGetInputConnectorMap().find("BoxExecute")->second))
           && (bbCanReact() ) )
@@ -481,7 +496,7 @@ namespace bbtk
        bbtkBlackBoxDebugMessage("change",2,
                         "-> Execution triggered by Reactive mode or BoxExecute input change"<<std::endl);
         bbGlobalAddToExecutionList( GetThisPointer<BlackBox>() );
-      }    
+      } // if
     bbtkBlackBoxDebugMessage("change",5,
                             "<= BlackBox::bbSetStatusAndPropagate(input)"
                             <<std::endl);
@@ -692,6 +707,7 @@ namespace bbtk
   //=========================================================================
   void BlackBox::bbRecursiveExecute( Connection::Pointer caller )
   {
+
     bbtkBlackBoxDebugMessage("process",3,
                        "=> BlackBox::bbRecursiveExecute("
                        <<(caller?caller->GetFullName():"0")<<")"
@@ -721,8 +737,8 @@ namespace bbtk
          IOStatus s=UPTODATE;
 //       IOStatus s=OUTOFDATE;
 //       IOStatus s=MODIFIED;
-         
-         
+                 
+
          if ( ( bbBoxProcessModeIsManual()==false )  || 
                   ( (bbBoxProcessModeIsManual()==true) && (bbLetRecursiveExecuteManualMode==true) ) )
          {
@@ -781,6 +797,7 @@ namespace bbtk
     bbSetExecuting(false);
     bbGlobalSetSomeBoxExecuting(wasExecuting);
 
+
     return;
   }
   //=========================================================================
@@ -1468,6 +1485,7 @@ namespace bbtk
                         <<std::endl);     
      
      bbmgGlobalProcessingExecutionList = false;
+
      
    }
   //=========================================================================
index adddc294c0f355d03f4d1e2966bfbeb5c6fd0b84..db02118273aaa83c2f12a3e7f912c656dca50d1e 100644 (file)
 #include <set>
 
 // Signal/slot mechanism for output change events
-#include <boost/signal.hpp>
+#include <boost/signals2/signal.hpp>
 #include <boost/bind.hpp>
 
 
 #define bbtkBlackBoxMessage(key,level,mess) \
-  bbtkMessage(key,level,"["<<bbGetName()<<"] "<<mess)
+  bbtkMessage(key,level,"["<<bbGetTypeName()<<":"<<bbGetName()<<"] "<<mess)
 #define bbtkBlackBoxDebugMessage(key,level,mess)       \
-  bbtkDebugMessage(key,level,"["<<bbGetName()<<"] "<<mess)
+  bbtkDebugMessage(key,level,"["<<bbGetTypeName()<<":"<<bbGetName()<<"] "<<mess)
 
 namespace bbtk
 {
@@ -84,8 +84,8 @@ namespace bbtk
     //==================================================================
     // Types
     //==================================================================
-    typedef boost::signals::trackable OutputChangeObserverType;
-    typedef boost::signal<void (bbtk::BlackBox::Pointer,
+    typedef boost::signals2::trackable OutputChangeObserverType;
+    typedef boost::signals2::signal<void (bbtk::BlackBox::Pointer,
                                const std::string&,
                                IOStatus)>  OutputChangeSignalType;
     typedef OutputChangeSignalType::slot_function_type
@@ -488,7 +488,7 @@ namespace bbtk
 
     //==================================================================
     /// Computes the final IOStatus of inputs and outputs after processing
-    void bbComputePostProcessStatus();
+virtual    void bbComputePostProcessStatus();
     //@}
     //==================================================================
 
@@ -567,17 +567,13 @@ namespace bbtk
     //@{
 
     /// Connects the input <name> to the connection c
-    virtual void bbConnectInput( const std::string& name,
-                                Connection* c);
+    virtual void bbConnectInput( const std::string& name, Connection* c);
     /// Connects the output <name> to the connection c
-    virtual void bbConnectOutput( const std::string& name,
-                                 Connection* c);
+    virtual void bbConnectOutput( const std::string& name, Connection* c);
     /// Disconnects the input <name> from the connection c
-    virtual void bbDisconnectInput( const std::string& name,
-                                   Connection* c);
+    virtual void bbDisconnectInput( const std::string& name, Connection* c);
     /// Disconnects the output <name> from the connection c
-    virtual void bbDisconnectOutput( const std::string& name,
-                                    Connection* c);
+    virtual void bbDisconnectOutput( const std::string& name, Connection* c);
     //@}
     //==================================================================
 
@@ -590,8 +586,6 @@ namespace bbtk
     /// Sets the bbmExecuting bool returned by bbGetExecuting
     void bbSetExecuting(bool b) { bbmExecuting = b; }
 
-  protected:
-
     //==================================================================
   protected:
 
index 7427580fddc8c3384797132c343bb8e80e39db88..6a2c7bc67156f33f3625187d5761851bb241c2c9 100644 (file)
@@ -45,6 +45,8 @@
 #include "bbtkUtilities.h"
 #include "bbtkAtomicBlackBoxDescriptor.h"
 #include "bbtkWxBlackBox.h"
+// JFGA 12/12/2014 Adding libraries for Wt
+//#include "bbtkWtBlackBox.h"
 
 namespace bbtk
 {
@@ -315,7 +317,9 @@ namespace bbtk
     return "::" + mTypeName;
   }
   //=========================================================================
+        void BlackBoxDescriptor::GetBoxesInside (NodeTreeC& tree, int cont){
+               
+       }
   //=========================================================================
   void BlackBoxDescriptor::InsertHtmlHelp ( std::ofstream& s, 
                                            int detail, int level,
@@ -379,7 +383,8 @@ namespace bbtk
     std::string usercol("#FFFFFF");
     std::string ubbcol("#DDFFFF");
     std::string wxbbcol("#EEFFFF");
-
+// JFGA 12/12/2014 Adding new variable 
+//    std::string wtbbcol("#CCFFFF");
 
     // (s) << "<h3 class=\"subsection\">Inputs</h3>\n";
     (s) << "<p><TABLE border=1 cellspacing=0 cellpadding=3>\n";
index ca8f3554044564f88d31d8b653066affb8af3bf5..8124b35a10689f9c97d0cb3ccf3aad4108d38996 100644 (file)
@@ -51,7 +51,7 @@
 #include "bbtkBlackBoxOutputDescriptor.h"
 #include <map>
 #include <fstream>
-
+#include "bbtkUtilities.h"
 namespace bbtk
 {
 
@@ -170,7 +170,7 @@ namespace bbtk
     ///
     virtual void Check(bool recursive=true) const;
 
-         
+         virtual void GetBoxesInside (NodeTreeC& tree, int cont);
          
          /// Sets the name of the script file from which it is defined
          void SetScriptFileName(const std::string& n) { mScriptFileName = n; }
index f350f89d49b1839ae77502d4df8295bf7b7905b3..ca794920622ae758b2bc3cda7de70815cfb98962 100644 (file)
@@ -62,8 +62,6 @@ namespace bbtk
     IOStatus mStatus;
     /// The output changed signal 
     BlackBox::OutputChangeSignalType mChangeSignal;
-
-
   };
   //========================================================================
 
index d93d4875406d8698797f02904133ac3a2977f930..195b53a222040423bd4389139ebaf3fde5e904ef 100644 (file)
@@ -1107,13 +1107,13 @@ namespace bbtk
     BlackBoxMapType::const_iterator i;
     for ( i = mBlackBoxMap.begin(); i != mBlackBoxMap.end(); ++i ) 
       {
-       s += i->second->GetObjectRecursiveSize();
+                                       s += i->second->GetObjectRecursiveSize();
       }
     ConnectionListType::const_iterator j;
     for ( j = mConnectionList.begin(); 
          j != mConnectionList.end(); ++j ) 
       {
-       s += (*j)->GetObjectRecursiveSize();
+                               s += (*j)->GetObjectRecursiveSize();
       }
     return s;
   }
index 20d2ca9a2db3572ab4cf3a9306ba77a55e31fa31..b79fed3e10f1a81d3f5456a91313da7bd09651d2 100644 (file)
@@ -416,7 +416,7 @@ namespace bbtk
              Package::Pointer p = d->GetPackage();
            
              std::string name = b->second->bbGetTypeName();
-
+                               
              std::string url;
              if (relative_link) 
                 url = p->GetDocRelativeURL();
@@ -666,6 +666,60 @@ size_t  ComplexBlackBoxDescriptor::GetObjectInternalSize() const
     return s;
   }
   //==========================================================================
-
+void ComplexBlackBoxDescriptor::GetBoxesInside (NodeTreeC& tree, int cont) 
+       {
+               std::cout<<"getBoxesInside recursivo "<<std::endl;
+               cont++;
+               std::string name = GetTypeName();
+               std::cout<<"despues de getTypeName : "<<name<<std::endl;
+    std::string descr = GetDescription();
+    std::string author = GetAuthor();
        
+       //list.push_back(name);
+               tree.setData(name);
+       //list.push_back(descr);
+       //list.push_back(author);
+               int k = 0;
+               
+    const ComplexBlackBox::BlackBoxMapType& B = mPrototype->bbGetBlackBoxMap();
+
+               std::cout<<"----B size "<< B.size() << std::endl;
+               std::cout<<"----antes if "<<std::endl;
+    if (B.size()) 
+    {
+          std::set<BlackBoxDescriptor::Pointer> pdeps;
+          ComplexBlackBox::BlackBoxMapType::const_iterator b;
+                       std::cout<<"----antes for "<<std::endl;
+          for ( b = B.begin(); b != B.end(); ++b ) 
+          {
+                               BlackBoxDescriptor::Pointer d = b->second->bbGetDescriptor();
+                               //std::cout<<"nombre objeto d "<< d->GetObjectName() <<std::endl;
+                               
+             //if (pdeps.find(d) != pdeps.end()) 
+        //    continue;
+             //pdeps.insert(d);
+                               std::cout<<"----1~ "<<std::endl;
+             Package::Pointer p = d->GetPackage();
+             std::string nameBox = b->second->bbGetTypeName();
+                               std::string packageBox = p->GetName();
+                               tree.insertChild(nameBox);
+                               std::cout<<"----2~ "<<std::endl;
+                               //list.push_back(nameBox);
+                               //list.push_back(packageBox);
+                               std::cout<<"-----cont "<<cont<<std::endl;
+                               //tree.treeTour(cont);
+                               d->GetBoxesInside (tree.childs[k], cont);
+                               std::cout<<"----3~ "<<std::endl;
+                               //std::cout<<"--despues de la recursion "<<k<<std::endl;
+                               k++;
+           }   // for
+                       std::cout<<"----despues for "<<std::endl;
+     } // If B.size
+                       std::cout<<"----despues if "<<std::endl;
+                       std::cout<<"end getBoxesInside recursivo"<<std::endl;
+       }
+
+//===================================================
+
+        //==========================================================================
 }
index 34fc4a369f12a234ffc38e730ccb22a3c01e3b23..e39b6d766e9dd1e24a5367b3f3b3b524930192d2 100644 (file)
@@ -51,7 +51,8 @@
 #include "bbtkComplexBlackBoxOutputDescriptor.h"
 #include "bbtkFactory.h"
 #include <fstream>
-
+#include <vector>
+#include "bbtkUtilities.h"
 namespace bbtk
 {
 
@@ -143,7 +144,7 @@ namespace bbtk
                          const std::string& output_dir = "",
                          bool relative_link = false );
     
-
+               void GetBoxesInside (NodeTreeC& tree, int cont);
    ///
     virtual void Check(bool recursive=true) const;
        
@@ -165,7 +166,6 @@ namespace bbtk
   //==========================================================================
 
 
 }
 // namespace bbtk
 #endif
index c79747c0378f512cd63f36182cab6a074831618e..770608440abde5f91c223b2e011f26b41724cce0 100644 (file)
@@ -64,6 +64,7 @@ namespace bbtk
     // ==> Set system paths
     mBin_path = Utilities::GetExecutablePath();
 
+
 /*     EED 23 Mars 2009
 #ifdef MACOSX
     mInstall_path = mBin_path + "/../../../..";
@@ -81,6 +82,7 @@ namespace bbtk
          }
 #endif
 
+
 ///\TODO : better use ??
          mInstall_path = mBin_path + "/..";
 
@@ -230,6 +232,7 @@ namespace bbtk
     if (!Utilities::FileExists(mDot_bbtk_path)) mDot_bbtk_is_new = true;
     Utilities::CreateDirectoryIfNeeded(mDot_bbtk_path);
 
+
     mDoc_path = Utilities::MakeUserSettingsFullFileName("doc");
     Utilities::CreateDirectoryIfNeeded(mDoc_path);
 
@@ -293,6 +296,7 @@ namespace bbtk
     mTemp_path = Utilities::MakeUserSettingsFullFileName("tmp");
     Utilities::CreateDirectoryIfNeeded(mTemp_path);
 
+
   }
   //=========================================================================
 
@@ -346,9 +350,13 @@ namespace bbtk
     strcpy(bbtk_path, Utilities::GetExecutablePath().c_str());  // JPR
     //strcpy(bbtk_path, "/usr/local/bin");
 
+
+    std::string str_home=Utilities::GetEnvHome();
+
+
     // rootDirectory
     char rootDirectory[200];
-    sprintf( rootDirectory,  "%s/.bbtk", getenv("HOME"));
+    sprintf( rootDirectory,  "%s/.bbtk", str_home.c_str());
 
     // configPath
     char configPath[200];
index d3d73a924bd21658dbc7db86e325c9f2915280ce..e6ee23851e7288d08e4cfc37a460528bb797867d 100644 (file)
@@ -166,12 +166,12 @@ Connection::Connection(BlackBox::Pointer from, const std::string& output,
       }
 
 
-    mFrom = from;
-    mOriginalFrom = from;
-    mTo = to;
-    mOriginalTo = to;
-    mInput = mOriginalInput = input;
-    mOutput = mOriginalOutput = output;
+    mFrom                      = from;
+    mOriginalFrom      = from;
+    mTo                        = to;
+    mOriginalTo        = to;
+    mInput                     = mOriginalInput        = input;
+    mOutput            = mOriginalOutput       = output;
 
      // Lock this pointer !!!
     //Pointer p = MakePointer(this,true);
index d20ed655310e3b8dece8b01ec28ca197c055d5c1..bf51fe564d3a1b644ee850f9bbc044d9b3abfa08 100644 (file)
@@ -132,6 +132,7 @@ namespace bbtk
 #if(USE_WXWIDGETS)
     Wx::ProcessPendingEvents();
 #endif
+
  
     // Create user package
     Package::Pointer p =
index 669a9fbc7cfe05bc69a60627b554cec70568a28e..d541db35b9203e89b984a63daa7c2dd1a7760eb5 100644 (file)
@@ -548,23 +548,47 @@ namespace bbtk
 
     bbtkDebugDecTab("kernel",9);
   }
-  //===================================================================
   
 
-//     ups3 EED borrame        
+  //===================================================================
        std::string Factory::GetPackageNameOfaBlackBox(std::string boxType)
        {
-               std::string result="<void bbtk package name>";
+               std::string packageName="<void bbtk package name>";
                PackageMapType::const_iterator i;
-               for (i = mPackageMap.begin(); i!=mPackageMap.end(); ++i )
-               {
-                       if ( i->second->ifBoxExist( boxType ) == true)
+
+               std::size_t found = boxType.find(":");
+               if (found!=std::string::npos)
+               {
+                       packageName     = boxType.substr(0,found);
+               } else {
+                       for (i = mPackageMap.begin(); i!=mPackageMap.end(); ++i )
                        {
-                               result = i->first;
-                       }
-               }
-               return result;
+                               if ( i->second->ifBoxExist( boxType ) == true)
+                               {
+                                       packageName = i->first;
+                               } // if ifBoxExist
+                       } // for i
+
+               } // if found
+               return packageName;
        }
+
+  //===================================================================
+       std::string Factory::GetTypeNameOfaBlackBox(std::string boxType)
+       {
+               std::string typeName="<void bbtk type name>";
+
+               std::size_t found = boxType.find(":");
+               if (found!=std::string::npos)
+               {
+                       typeName                = boxType.substr(found+1);
+               } else {
+                       typeName=boxType;
+               } // if found
+               return typeName;
+       }
+
+
        
        
   //===================================================================
@@ -572,20 +596,52 @@ namespace bbtk
   BlackBox::Pointer Factory::NewBlackBox(const std::string& type, 
                                  const std::string& name) const
   {
-    bbtkDebugMessageInc("kernel",7,"Factory::NewBlackBox(\""
+       bbtkDebugMessageInc("kernel",7,"Factory::NewBlackBox(\""
                         <<type<<"\",\""<<name<<"\")"<<std::endl);
 
     BlackBox::Pointer b; 
     PackageMapType::const_iterator i;
-    for (i = mPackageMap.begin(); i!=mPackageMap.end(); ++i )
-      {
-      b = i->second->NewBlackBox(type,name);
-      if (b) break; 
-      }
+
+       std::string tmp = type;
+       std::string packageName = ((bbtk::Factory*)this)->GetPackageNameOfaBlackBox(tmp);
+       std::string type2               = ((bbtk::Factory*)this)->GetTypeNameOfaBlackBox(tmp);
+       i = mPackageMap.find(packageName);
+       if (i != mPackageMap.end())
+       {
+               b = i->second->NewBlackBox(type2,name);
+       } else {
+               b =BlackBox::Pointer();
+       }
+
+/*
+       std::size_t found = type.find(":");
+       if (found!=std::string::npos)
+       {
+               std::string packageName = type.substr(0,found);
+               std::string type2               = type.substr(found+1);
+               i = mPackageMap.find(packageName);
+               if (i != mPackageMap.end())
+               {
+               b = i->second->NewBlackBox(type2,name);
+               } else {
+                       b =BlackBox::Pointer();
+               }
+       } else {
+       for (i = mPackageMap.begin(); i!=mPackageMap.end(); ++i )
+       {
+               b = i->second->NewBlackBox(type,name);
+               if (b) break; 
+       } // for i
+
+       } // if found :
+*/
+
+
     if (!b) 
-      {
-       bbtkError("black box type \""<<type<<"\" unknown");
-      } 
+    {
+       bbtkError("black box type \""<<type<<"\" unknown");
+    }  // if !b
+
 
     bbtkDebugDecTab("kernel",7);
     return b;
index 8c80ec78da1043d48fe1d645e23b2dea5c109d4d..aab5c9494e433ef7f7ea191034bf7ccba1a4019f 100644 (file)
@@ -161,12 +161,14 @@ namespace bbtk
     /// Gets the executer who created the factory (if any) - const
     //    const Executer::Pointer GetExecuter() const { return mExecuter.lock(); }
 
-         std::string GetPackageNameOfaBlackBox(std::string boxType);
+       std::string GetPackageNameOfaBlackBox(std::string boxType);
+       std::string GetTypeNameOfaBlackBox(std::string boxType);
 
 
   private:
 
 
+
     /// The map of packages
     PackageMapType mPackageMap;
 
@@ -179,6 +181,8 @@ namespace bbtk
     void CloseAllPackages();
     void ClosePackage(PackageMapType::iterator& i);
 
+
+
   };
   // class Factory
 
index 04dcfdf1403a55048857b5f9e3a3cc05d1f233d4..a31fe0f20ceb0b589eae32be38e01864d09a1e5f 100644 (file)
@@ -1577,7 +1577,11 @@ void Interpreter::commandHelp(const std::vector<std::string>& words)
     CommandDictType::iterator c;
     c = mCommandDict.find(s);
     if ( c == mCommandDict.end() ) {
-      bbtkError(s<<" : Unknown command");
+
+//EED 2016-12-22
+//      bbtkError(s<<" : Unknown command");
+     std::string tmpSS=s+" : Unknown command";
+      bbtkError(tmpSS);
     }  
     //    std::cout << " " << s << " : "<<  std::endl;
     //    CommandParamDictType::iterator i;
@@ -2020,8 +2024,21 @@ void  Interpreter::commandNewGUI(const std::string& boxname,
           ( d->GetCreatorTypeInfo() == typeid(WxBlackBoxDescriptor)) )
        continue;
 #else
+// JFGA 12/12/2014 Adding WT options for compile with it.
+
+/*#if USE_WT
+
+       if ( ( d->GetCreatorTypeInfo() == typeid(AtomicBlackBoxDescriptor)) ||
+          ( d->GetCreatorTypeInfo() == typeid(WtBlackBoxDescriptor)) )
+       continue;
+       
+
+#else
+*/
       if ( ( d->GetCreatorTypeInfo() == typeid(AtomicBlackBoxDescriptor)) )
        continue;
+//#endif
+
 #endif
       bool widok = true;
       std::string widget,adaptor;
index 8c0e14446bc072f3da6a7609b1eba02900144f11..e518cfdc4eae35d3966ea80ea0a14a3971215298 100644 (file)
@@ -54,9 +54,6 @@
 #include <fstream>
 #include <deque>
 
-// Signal/slot mechanism for 'break' commands
-//#include <boost/signal.hpp>
-//#include <boost/bind.hpp>
 
 namespace bbtk
 {
@@ -65,82 +62,10 @@ namespace bbtk
   class WxConsole;
 #endif
   
-/* EED Borrame 
-  //=======================================================================
-  class BBTK_EXPORT InterpreterUser
-  {
-  public: 
-    InterpreterUser() {}
-    virtual ~InterpreterUser() {}
-
-    virtual bool InterpreterUserHasOwnHtmlPageViewer() { return false; }
-    virtual void InterpreterUserViewHtmlPage(const std::string&) {}
-  };
-  //=======================================================================
-*/
        
 
-/* EED Borrame
-  //=======================================================================
-  class BBTK_EXPORT InterpreterException : public Exception
-  {
-  public:
-    InterpreterException( const std::string& message,
-                     bool in_script_file,
-                     const std::string& script_file,
-                     int script_line 
-                     );
-    InterpreterException( const Exception& excep,
-                     bool in_script_file,
-                     const std::string& script_file,
-                     int script_line 
-                     );
-    ~InterpreterException() throw() {}
-
-    bool IsInScriptFile() const { return mInScriptFile; }
-    const std::string& GetScriptFile() const { return mScriptFile; }
-    int GetScriptLine() const { return mScriptLine; }
-  private:
-    bool mInScriptFile;
-    std::string mScriptFile;
-    int mScriptLine;
-  };
-  //=======================================================================
-*/
-       
        
        
-  /*
-  //=======================================================================
-  // The "Quit" exception
-  class BBTK_EXPORT QuitException : public InterpreterError
-  {
-  public:
-    QuitException( bool in_script_file,
-                  const std::string& script_file,
-                  int script_line 
-                  )
-      : InterpreterError("QUIT",in_script_file,script_file,script_line) 
-    {}
-    ~QuitException() throw() {}
-  };
-  //=======================================================================
-  const std::string BREAK("BREAK");
-  //=======================================================================
-  // The "Break" exception
-  class BBTK_EXPORT BreakException : public InterpreterError
-  {
-  public:
-    BreakException( bool in_script_file,
-                   std::string script_file,
-                   int script_line 
-                   )
-      : InterpreterError(BREAK,in_script_file,script_file,script_line) 
-    { std::cout << "BUILDING BREAK"<<std::endl; }
-    ~BreakException() throw() {}
-  };
-  //=======================================================================
-  */
 
   //=======================================================================
   class BBTK_EXPORT Interpreter : public InterpreterVirtual
@@ -151,32 +76,6 @@ namespace bbtk
     static Pointer New(const std::string& cpp_file = "");
     static Pointer New(VirtualExec::Pointer);
 
-/* EED Borrame   
-    typedef enum 
-      {
-       Interpreter_OK,
-       Interpreter_ERROR,
-       Interpreter_QUIT,
-       Interpreter_BREAK,
-      }
-      ExitStatus;
-
-    /// Runs the interpretation of a file
-    ExitStatus InterpretFile( const std::string& filename, bool source = false);
-
-    /// Runs the interpretation of a buffer and deletes it !
-    ExitStatus InterpretBuffer( std::stringstream* buffer );
-
-    /// Runs the interpretation of a command
-    ExitStatus InterpretLine( const std::string& line );
-
-    /// Runs the interpretation of the currently open streams
-    ExitStatus InterpretCurrentStreams();
-
-    /// Launches a command line interpreter (with a prompt)
-    void CommandLineInterpreter();
-*/
-
 
     /// Sets the inputs of the workspace :
     /// the map is passed as is to the Executer
@@ -196,22 +95,6 @@ namespace bbtk
 
     void SetDialogMode(DialogModeType t) { mVirtualExecuter->SetDialogMode(t);}
 
-/*EED Borrame    
-    /// Sets the bool that indicates wether we are in command line context
-    void SetCommandLine(bool v = true) { mCommandLine = v; }
-
-    void SetThrow(bool b) { mThrow = b; }
-#ifdef USE_WXWIDGETS
-    /// Sets the user of the interpreter (if any)
-    void SetUser(InterpreterUser* c) { mUser = c; }
-    /// Gets the InterpreterUser of this 
-    InterpreterUser* GetUser() { return mUser; }
-    /// Gets the InterpreterUser of this (const)
-    const InterpreterUser* GetUser() const { return mUser; }
-
-#endif
- */
 
     /// Gets the Executer 
     VirtualExec::Pointer GetExecuter() const { return mVirtualExecuter; }
@@ -228,83 +111,6 @@ namespace bbtk
 
   protected:
 
-/* EED Borrame   
-    /// The enumeration of command codes == Command name
-    typedef enum
-    {
-      cBreak, // LG 12/12/08 : Stops the current script execution (if not exec frozen) - used in tutorial + debugging 
-      cClear, // LG 12/12/08 : Clears the current complex black box (e.g. workspace) - used in tours
-      cNew,
-      cDelete,
-      cConnect,
-      cExec,
-      cPackage,
-      cEndPackage,
-      cDefine,
-      cEndDefine,
-      cInput,
-      cOutput,
-      cSet,
-      cConfig,  // JPR
-      cReset,   // EED
-      cAuthor, 
-      cCategory, // JPR
-      cDescription,
-      cHelp,
-      cMessage,
-      cInclude,
-      cQuit,
-      cLoad,
-      cUnload,
-      cGraph,
-      cPrint,
-      cIndex,
-      cKind, // LG
-      cNewGUI, // LG
-      cWorkspace, // LG
-      cDebug // LG
-    } CommandCodeType;
-
-    /// The structure storing the informations on a command 
-    typedef struct 
-    {
-      std::string keyword;
-      int argmin, argmax;
-      CommandCodeType code;
-      std::string syntax;
-      std::string help;
-    } CommandInfoType;
-
-    /// The type of dictionnary of commands 
-    typedef std::map<std::string,CommandInfoType> CommandDictType;
-
-
-    /// Interprets a line 
-    void DoInterpretLine( const std::string& line ); //, bool &insideComment );
-
-    /// Reads a line from prompt
-    void GetLineFromPrompt( std::string& line );
-
-    /// Splits a line into words
-    void SplitLine ( const std::string& line,
-                     std::vector<std::string>& words );
-
-    /// Executes the right action depending on the command name
-    void InterpretCommand( const std::vector<std::string>& words,
-                           CommandInfoType& info );
-
-    /// Switch to the interpretation of a file
-    void SwitchToFile( const std::string& filename, bool source = false );
-
-   /// Switch to the interpretation of a stringstream
-    void SwitchToStream( std::stringstream* stream );
-
-    /// Closes the currently open file
-    void CloseCurrentFile();
-
-    /// Closes all open files
-    void CloseAllFiles();
-*/
          
     /// Resets all
     virtual void commandReset();
@@ -331,20 +137,14 @@ namespace bbtk
     virtual void commandIndex(const std::string& filename, 
               const std::string& type = "Initials");
 
-/*EED Borrame    
-    ///
-    void FindCommandsWithPrefix( char* buf,
-                                int n,
-                                std::vector<std::string>& commands );
-*/
          
     /// Creates and connects the piece of pipeline which defines a GUI 
     /// for the box box. 
     /// Define it as a complex box type with name instanceName+"Type"
     /// The instance is called instanceName
     /// and connected to the existing pipeline
-      virtual void commandNewGUI(const std::string& box,const std::string& instanceName);
-      virtual void commandDebug(const std::string& arg);
+     virtual void commandNewGUI(const std::string& box,const std::string& instanceName);
+     virtual void commandDebug(const std::string& arg);
          virtual void commandNew(const std::string &boxType,const std::string &boxName);
          virtual void commandDelete(const std::string &boxName);
          virtual void commandConnection(const std::string &nodeFrom,const std::string &outputLabel,const std::string &nodeTo,const std::string &inputLabel);
@@ -383,12 +183,7 @@ namespace bbtk
                  
     void Init(VirtualExec::Pointer, const std::string& cpp_file);
 
-/*EED  Borrame 
-    /// Opens the file fullPathScriptName 
-    /// includeScriptName is the name as given to the include command 
-    void LoadScript( std::string fullPathScriptName,
-                    std::string includeScriptName);
-*/  
+
     //==================================================================
     // ATTRIBUTES
 
@@ -396,49 +191,6 @@ namespace bbtk
     bbtk::VirtualExec::Pointer mVirtualExecuter;
     bbtk::Executer::WeakPointer mRealExecuter;
 
-/*EED Borrame    
-    /// The user of  the interpreter (0 if none)
-    bbtk::InterpreterUser* mUser;
-    /// Vector of open files / buffers (can be stringstream)
-    std::vector<std::istream*> mFile;
-
-    /// Vector of names of open files with full path (as open)
-    std::vector<std::string> mFileName;
-
-    /// Vector of names of files which have been open 
-    /// before (and may closed then which are no more in mFileName)
-    /// with full path (as open)
-    std::vector<std::string> mFileNameHistory;
-
-    /// Vector of names of open files as given to the include command
-    std::vector<std::string> mIncludeFileName;
-
-    /// Stores the current line number in each open file
-    std::vector<int> mLine;
-
-    /// The dictionnary of commands
-    CommandDictType mCommandDict;
-
-    /// Are we in a command line context ?
-    bool mCommandLine;
-
-    /// Are we inside a commented-out zone ?
-    bool mInsideComment;
-    
-    /// The current interpreter status
-    ExitStatus mStatus;
-
-    /// The history of commands
-    std::deque< char* > mHistory;
-
-    int bufferNb;
-    
-    bool mThrow;
-
-    /// The break signal
-    //    BreakSignalType mBreakSignal;
- */
 
   protected:
          ~Interpreter();
index 2498e9018e0738f08468ba04ecd6a6975851bd78..93d05ed5cf88ef1d335734a949476b26cb088134 100644 (file)
@@ -346,7 +346,6 @@ namespace bbtk
     */
 
 
-
   } 
   //=======================================================================
   
@@ -804,8 +803,7 @@ namespace bbtk
        
   //=======================================================================  
   void InterpreterVirtual::DoInterpretLine( const std::string& line )
-  {
-         
+  {  
     bbtkDebugMessage("interpreter",6,"==> InterpreterVirtual::DoInterpretLine(\""
                     <<line<<"\")"<<std::endl);
     std::vector<std::string> words;
@@ -892,19 +890,19 @@ namespace bbtk
 
     // break and quit commands
     if ((command.code==cBreak) || (command.code==cQuit))
-      {
-       bool in_script = false;
-       std::string file("");
-       int line = 0;
-
-       if (mFileName.size()) 
-         {
-           std::ifstream* fs = dynamic_cast<std::ifstream*>(mFile.back());
-           if (fs!=0) in_script = true;          
-           file = mFileName.back();
-           line = mLine.back();
-         } 
-       if (command.code==cBreak)
+    {
+//EED-Borrame  bool in_script = false;
+//EED-Borrame  std::string file("");
+//EED-Borrame  int line = 0;
+
+//EED-Borrame  if (mFileName.size()) 
+//EED-Borrame    {
+//EED-Borrame      std::ifstream* fs = dynamic_cast<std::ifstream*>(mFile.back());
+//EED-Borrame      if (fs!=0) in_script = true;          
+//EED-Borrame      file = mFileName.back();
+//EED-Borrame      line = mLine.back();
+//EED-Borrame    } 
+         if (command.code==cBreak)
          {
            /*
            std::cout << "BreakException(" 
@@ -915,15 +913,13 @@ namespace bbtk
                  commandBreak();
 //EED Borrame      bbtkError("break");//,in_script,file,line);
            //      throw BreakException(in_script,file,line);
-         }       
-       else 
-         {
+         } else {
                  commandQuit();
 //EED Borrame      bbtkError("quit");//,in_script,file,line);
              //throw QuitException(in_script,file,line);
-         }
-       return;
-      }   
+         } // cBreak
+         return;
+   } // cBreak  cQuit  
 //std::cout<<" mVirtualExecuter->Create(words[1],words[2]); "<<line<<std::endl;
     // other cammands
 
@@ -1130,7 +1126,7 @@ namespace bbtk
 
     bbtkDebugMessage("interpreter",6,"<== InterpreterVirtual::DoInterpretLine(\""
                     <<line<<"\")"<<std::endl);
-         
+
   }
   //=======================================================================  
 
@@ -1340,7 +1336,6 @@ namespace bbtk
                 i++)
              {
                std::string full_path(*i);
-printf("EED InterpreterVirtual::SwitchToFile 1. >>%s\n", full_path.c_str() );
                // we *really* want '.' to be the current working directory
                if (full_path == ".") 
                  {
@@ -1371,8 +1366,6 @@ printf("EED InterpreterVirtual::SwitchToFile 1. >>%s\n", full_path.c_str() );
        std::vector<std::string>::iterator i;
        for (i=script_paths.begin();i!=script_paths.end();i++)
          {
-
-printf("EED InterpreterVirtual::SwitchToFile jaja >>  %s\n", (*i).c_str() );
                  
            bbtkMessage("interpreter",1,
                        "--> Looking in '" << *i << "'" << std::endl);
@@ -1405,9 +1398,6 @@ printf("EED InterpreterVirtual::SwitchToFile jaja >>  %s\n", (*i).c_str() );
            for (std::vector<std::string>::iterator j = Filenames.begin(); 
                 j!= Filenames.end(); ++j)
              {
-                         
-printf("EED InterpreterVirtual::SwitchToFile kkkkk     >>  %s\n", (*j).c_str() );
-                         
                int lgr = (*j).size();
                if (lgr < 5) continue;  
                // ignore non .bbp file
@@ -1563,9 +1553,7 @@ printf("EED InterpreterVirtual::SwitchToFile kkkkk     >>  %s\n", (*j).c_str() )
           bbtkError("No ["<<pkgname<<".bbs/.bbp] script found");
        return;
       } else {
-//EED printf("EED D. SwitchToFile %s\n", fullPathScriptName.c_str() );   
                LoadScript(fullPathScriptName,name);
-//EED Borrame    if (source) GetExecuter()->SetCurrentFileName(fullPathScriptName);
                  if (source) 
                  {
                          // Over writing the fullpath of the bbp file.
index eedfe03b6f9b895b33b7864ee602ce677c1a25f1..8370cc2b3025926aa6202000644fd87780521bcb 100644 (file)
@@ -58,7 +58,7 @@
 #include <deque>
 
 // Signal/slot mechanism for 'break' commands
-#include <boost/signal.hpp>
+//#include <boost/signals2/signal.hpp>
 #include <boost/bind.hpp>
 
 namespace bbtk
index b07c9ed7beb3b0418e953cea4bd99d425bcd1083..c3400806991c9d0cf8283acd5ff5b0dbea857155 100644 (file)
@@ -59,7 +59,7 @@
 // SIGNAL/SLOT MECHANISM 
 // FOR bbtk WINDOWS CREATION/DESTRUCTION OBSERVATION 
 // BBTKKWSIG
-#include <boost/signal.hpp>
+#include <boost/signals2/signal.hpp>
 #include <boost/bind.hpp>
 // \BBTKKWSIG
 //===========================================================================
@@ -81,8 +81,8 @@ namespace bbtk
   {    
   public:
     // BBTKKWSIG
-    typedef boost::signals::trackable SignalObserver;
-    typedef boost::signal<void ()>  Signal_type;
+    typedef boost::signals2::signals::trackable SignalObserver;
+    typedef boost::signals2::signal<void ()>  Signal_type;
     typedef Signal_type::slot_function_type Slot_function_type;
     // \BBTKKWSIG
     
index 9b692c9467ec40b980740d5adf6f36edb16d7401..91cdb518372b220f124b1de33af8dc5c22c8912a 100644 (file)
@@ -85,8 +85,10 @@ namespace bbtk
     mDescription(description),
     mVersion(version)
   {
+
     bbtkDebugMessage("object",2,"==> Package('"<<name<<"',...)"
                     <<bbtkendl);
+
     std::string default_doc_dir = ConfigurationFile::GetInstance().Get_default_temp_dir();
     char c = default_doc_dir.c_str()[strlen(default_doc_dir.c_str())-1];
     std::string url = default_doc_dir; 
@@ -396,6 +398,7 @@ namespace bbtk
     bbtkDebugMessage("package",3,"* Symbol ["<<getvername
                     <<"] found"<<std::endl);
     // version matches ?
+
     if (getbbtkversion() != bbtk::GetVersion())
       {
        bbtkMessage("package",0,
@@ -1404,10 +1407,21 @@ namespace bbtk
     return s;
   }
   //==========================================================================
-  
+  void  Package::GetBoxesInside(NodeTreeC& tree, int cont) 
+  {
+               DescriptorMapType::const_iterator i;
+               std::cout<<"*********a********"<<std::endl;
+               for (i=mDescriptorMap.begin(); i!=mDescriptorMap.end(); ++i) 
+               {
+                       i->second->GetBoxesInside(tree, cont);
+                       std::cout<<"*****************"<<std::endl;
+               }    
+  }
+       //==========================================================================
   //==========================================================================
   std::set<Package::WeakPointer> 
   Package::mReleasedDynamicallyLoadedPackages;
   //==========================================================================
+
 }
 
index a6bf8c87d8646cf850da58592736c1e899ff53b3..860cbd9bff956c041d3ade1680ff1b87acf5d8f8 100644 (file)
@@ -49,6 +49,8 @@
 
 #include "bbtkBlackBox.h"
 #include "bbtkDynamicLibraryHandling.h"
+#include "bbtkUtilities.h"
+#include <vector>
 
 namespace bbtk
 {
@@ -71,6 +73,7 @@ namespace bbtk
                                            const std::string& pkgname,
                                            const std::string& path);
 
+       void  GetBoxesInside(NodeTreeC& tree, int cont);
     /// NOTE : All the static methods below for package destruction
     /// are not member because they can cause the package death 
     /// and thus close the dynamic library from which it has been loaded.
index 0b6e94864fd68765f0ba837eebf98889c62c30d1..c5dddc31ff5954ecf19a1362c9b743aa8e1b916a 100644 (file)
@@ -42,9 +42,9 @@
 // SIGNAL/SLOT MECHANISM 
 // FOR bbtk WINDOWS CREATION/DESTRUCTION OBSERVATION 
 // BBTKWXSIG
-#include <boost/signal.hpp>
+#include <boost/signals2/signal.hpp>
 #include <boost/bind.hpp>
-typedef boost::signals::trackable SignalObserver;
+//typedef boost::signals2::signal::trackable SignalObserver;
 // \BBTKWXSIG
 //===========================================================================
 
@@ -88,7 +88,7 @@ namespace bbtk
     // BBTKWXSIG
     // The keyword 'signals' is also a macro in qt
     //    typedef boost::signals::trackable SignalObserver;
-    typedef boost::signal<void ()>  Signal_type;
+    typedef boost::signals2::signal<void ()>  Signal_type;
     typedef Signal_type::slot_function_type Slot_function_type;
     // \BBTKWXSIG
 
index 8cd21b8db5dafabbe02ae8ac621f315ec2fa61e0..7e85dc76787497b9e350fc332188b4283f88304b 100644 (file)
@@ -332,12 +332,8 @@ namespace bbtk
   /// Returns the user settings dir, e.g. /home/username/.bbtk
   std::string Utilities::GetUserSettingsDir()
   {
-#if defined(__GNUC__)
-    std::string str_home(getenv("HOME"));
-#elif defined(_WIN32)
-    std::string str_home(getenv("USERPROFILE"));
-#endif
-    std::string fullname = str_home + "/.bbtk";
+    std::string str_Home=Utilities::GetEnvHome();
+    std::string fullname = str_Home + "/.bbtk";
     MakeValidFileName(fullname);
     return fullname;
   }
@@ -348,11 +344,7 @@ namespace bbtk
   /// in user settings dir, e.g. /home/username/.bbtk/
   std::string Utilities::MakeUserSettingsFullFileName(const std::string& name)
   {
-#if defined(__GNUC__)
-    std::string str_home(getenv("HOME"));
-#elif defined(_WIN32)
-    std::string str_home(getenv("USERPROFILE"));
-#endif
+    std::string str_home=Utilities::GetEnvHome();
     std::string fullname = str_home + "/.bbtk/" + name;
     MakeValidFileName(fullname);
     return fullname;
@@ -768,5 +760,77 @@ namespace bbtk
   //=========================================================================
 
 
+std::string Utilities::GetEnvHome()
+{
+#if defined(__GNUC__)
+       std::string strHome;
+    char *envHome=getenv("HOME");
+    if (envHome!=NULL)  
+       { 
+               strHome=envHome; 
+       } else {
+               strHome = "/var/www/testwtdbg/docroot";
+       } // if
+#elif defined(_WIN32)
+       std::string strHome( getenv("USERPROFILE") );
+#endif
+       return strHome;
+}   
+
+
+
+//TAD Arbol CFT
+
+
+//---------NodeTree---------------
+
+NodeTreeC::NodeTreeC() 
+{
+       
+}
+
+NodeTreeC::NodeTreeC(std::string _data)
+{
+       data = _data;
+}
+
+NodeTreeC::~NodeTreeC()
+{
+
+}
+void NodeTreeC::deleteTree()
+{
+       data = "";
+       std::cout<<"NodeTreeC::deleteTree 1"<<std::endl;
+       childs.erase(childs.begin(),childs.begin()+childs.size());
+       std::cout<<"NodeTreeC::deleteTree 2"<<std::endl;
+}
+
+void NodeTreeC::insertChild(std::string _data)
+{
+       NodeTreeC temp = NodeTreeC(_data);
+       childs.push_back(temp);
+       //std::cout<<"NodeTreeC::insertChild"<<std::endl;
+}
+
+void NodeTreeC::treeTour(int lvl)
+{
+       std::string space = "";
+       for (int j=0; j<lvl ; j++){
+                               space += "   ";
+       }
+       lvl++;
+       std::cout <<space<<"data: "<< data << "  size: "<< childs.size() << std::endl;
+       for(int i = 0 ; i < childs.size(); i++)
+       {
+               childs[i].treeTour(lvl);                
+       }
+}
+
+void NodeTreeC::setData(std::string _data)
+{
+       data = _data;
+       //std::cout<<"NodeTreeC::setData"<<std::endl;
+}
 
 }
index 5a68f5f8b9cf379648b2c4d9ed687faf827d581c..90bb34099c6ab2e10788795647f0626122cdb6ce 100644 (file)
@@ -197,11 +197,25 @@ namespace bbtk
     
     static bool loosematch(std::string stdLine,std::string stdOptions);
     
-   
+
+    static std::string GetEnvHome();
     
     
   };
-
+class BBTK_EXPORT NodeTreeC 
+{
+public:
+       std::string data;
+       std::vector<NodeTreeC> childs;
+
+       NodeTreeC();
+       NodeTreeC(std::string _data);
+       ~NodeTreeC();
+       void insertChild(std::string _data);
+       void treeTour(int lvl);
+       void setData(std::string _data);
+       void deleteTree();
+};
   
 } // namespace bbtk
  
index bd2d0e89d8d3623df6007cf2d6ca247d03110578..0bf9acc1a4756efcfcdc6c5f65349bda5e0101ef 100644 (file)
 
 //===========================================================================
 #define BBTK_VTK_SET_DEFAULT_VALUES()          \
-  mVtkObject = NULL;
+  mVtkObject = bbVtkObject::New();
+//  mVtkObject = NULL;
 
 //===========================================================================
 #define BBTK_VTK_INITIALIZE_PROCESSING()       \
-  mVtkObject = bbVtkObject::New();
+  mVtkObject = mVtkObject;
+//  mVtkObject = bbVtkObject::New();
 
 //===========================================================================
 #define BBTK_VTK_FINALIZE_PROCESSING()         \
index 63be14149b2212b0e382870fca81c995adc27f51..b0333a6985241a0d1668da493a8067fe469098d1 100644 (file)
@@ -158,6 +158,10 @@ namespace bbtk
     virtual void bbDestroyWindow() {}
     //==================================================================
 
+    //==================================================================
+       // method to be added in the proces of a window
+       virtual void PutWinTitle() {}
+    //==================================================================
    
 
   private:
diff --git a/kernel/src/bbtkWt.cxx b/kernel/src/bbtkWt.cxx
new file mode 100644 (file)
index 0000000..6712389
--- /dev/null
@@ -0,0 +1,282 @@
+/*
+ # ---------------------------------------------------------------------
+ #
+ # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
+ #                        pour la SantÈ)
+ # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
+ # Previous Authors : Laurent Guigues, Jean-Pierre Roux
+ # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
+ #
+ #  This software is governed by the CeCILL-B license under French law and
+ #  abiding by the rules of distribution of free software. You can  use,
+ #  modify and/ or redistribute the software under the terms of the CeCILL-B
+ #  license as circulated by CEA, CNRS and INRIA at the following URL
+ #  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+ #  or in the file LICENSE.txt.
+ #
+ #  As a counterpart to the access to the source code and  rights to copy,
+ #  modify and redistribute granted by the license, users are provided only
+ #  with a limited warranty  and the software's author,  the holder of the
+ #  economic rights,  and the successive licensors  have only  limited
+ #  liability.
+ #
+ #  The fact that you are presently reading this means that you have had
+ #  knowledge of the CeCILL-B license and that you accept its
+ terms.
+ # ------------------------------------------------------------------------ */
+
+
+/*=========================================================================
+  Program:   bbtk
+  Module:    $RCSfile: bbtkQt.cxx,v $
+  Language:  C++
+  Date:      $Date: 2012/11/16 08:49:01 $
+  Version:   $Revision: 1.4 $
+=========================================================================*/
+
+
+#include "bbtkWt.h"
+#include "bbtkMessageManager.h"
+
+#ifdef USE_WT
+
+
+
+
+namespace bbtk
+{
+  //=========================================================================
+  class WtApp;
+  Wt::WApplication *createApplication(const Wt::WEnvironment& env);
+  //=========================================================================
+
+  //=========================================================================
+  static WtApp* mgWtApp = 0;
+  static Wt::WContainerWidget* mgTopWindow = 0;
+  static int mgNbWindowsAlive  = 0;
+  //=========================================================================
+  
+  //=========================================================================
+  // BBTKWXSIG
+  static WWt::Signal_type mgWtSignal;
+  // \BBTKWXSIG
+  //=========================================================================
+
+  //=========================================================================
+  // The wxApp class which is used when no user wxApp was created
+ // The application creates itself completly empty.
+// The default values for the port and address are port:8080 address 0.0.0.0
+  class WtApp : public Wt::WApplication
+  {
+  public:
+    WtApp(const Wt::WEnvironment& env);
+    ~WtApp();
+    static int WtWRun();
+               //WtWApplication *createApplication(const WtWEnvironment& env);
+    
+  };
+
+       WtApp::WtApp(const Wt::WEnvironment& env):
+               Wt::WApplication(env)
+       {
+               //root()->addWidget(WWt::GetTopWindow());
+               // There is not additional configuration. The new WtApp must have the same behavior that one Wt::WApplication.
+               
+       }
+
+       WtApp::~WtApp()
+       {
+
+       }
+/*
+       int WtApp::WtWRun()
+       {
+               char  *argv[7] =  {"./WtTest","--docroot",".","--http-address","0.0.0.0","--http-port","8080"};
+               int argc = 7;
+               return Wt::WRun(argc,argv,&createApplication);  
+       }
+
+
+       Wt::WApplication *createApplication(const Wt::WEnvironment& env)
+       {
+               return new WtApp(env);
+       }
+*/
+
+
+
+  //=========================================================================
+
+  //=========================================================================
+  void WWt::CreateWtAppIfNeeded()
+  {
+               std::cout<<"CREATING APP IF NEEDED --------- DELETE ME ------- bbtkWt.cxx"<<std::endl;
+               if(Wt::WApplication::instance()==0)
+               {
+                       if (mgWtApp != 0) 
+               {
+               bbtkGlobalError("Wt::CreateWtAppIfNeeded() : INTERNAL ERROR ! (Wt::WApplication::instance()==0) && (mgWtApp != 0)");
+                       }
+                       bbtkDebugMessage("wt",1,"  --> Creating bbtk WtApp"<<std::endl);  
+                       //WtApp::WtWRun();
+               }               
+               bbtkDebugMessage("process",2,"Create WtApp If needed debuging");
+  }
+  //=========================================================================
+
+  //=========================================================================
+  void WWt::DestroyWtAppIfNeeded()
+  {
+    if (mgWtApp!= 0) 
+      {
+       //      bbtkDebugMessage("wx",1,"  --> Destructing bbtk WxApp"<<std::endl);
+       //delete mgWxApp;
+       //      mgWxApp = 0;
+       // Uninit wx
+       //      wxUninitialize();
+      }
+  }
+  //=========================================================================
+
+
+  //=========================================================================
+  void WWt::ProcessPendingEvents()
+  {
+    /*
+    if (Wx::GetTopWindow() != 0)
+      {
+       Wx::GetTopWindow()->DestroyChildren();
+      }
+    */
+
+    /*
+    wxApp* a = (wxApp*)wxApp::GetInstance();
+    if (a==0) return;
+    
+    std::cout << "$$$$$$$$$$$$$$ PROCESS PENDING "<<std::endl;
+    while (a->Pending())
+      a->Dispatch();
+    std::cout << "$$$$$$$$$$$$$$ PROCESS PENDING DONE"<<std::endl;
+    */
+  }
+
+
+  //=========================================================================
+  Wt::WContainerWidget* WWt::GetTopWindow() 
+  { 
+    return mgTopWindow; 
+  }
+  //=========================================================================
+  
+
+  // BBTKWXSIG
+  //=========================================================================
+  void WWt::AddSignalObserver(Slot_function_type f)
+  {
+    mgWtSignal.connect(f);
+  }
+  //=========================================================================
+  // \BBTKWXSIG
+
+  
+  //=========================================================================
+  void WWt::SetTopWindow(Wt::WContainerWidget* w) 
+  {
+    if ( mgTopWindow ) 
+      {
+       bbtkGlobalError("Wt::SetTopWindow : top window already set !");
+      } 
+    //mgTopWindow = w;
+  }
+  //=========================================================================
+
+
+  //=========================================================================
+  void WWt::IncNbWindowsAlive() 
+  { 
+    mgNbWindowsAlive++; 
+    bbtkDebugMessage("wt",2,"* Number of windows alive = "<<mgNbWindowsAlive
+                    <<std::endl);
+    // BBTKWXSIG
+    mgWtSignal();
+    // \BBTKWXSIG
+  }
+  //=========================================================================
+
+  //=========================================================================
+  void WWt::DecNbWindowsAlive()
+  { 
+    mgNbWindowsAlive--; 
+    bbtkDebugMessage("wt",2,"* Number of windows alive = "<<mgNbWindowsAlive
+                    <<std::endl);
+
+    // BBTKWXSIG
+    mgWtSignal();
+    // \BBTKWXSIG
+  }
+  //=========================================================================
+
+  //=========================================================================
+  int  WWt::GetNbWindowsAlive() 
+  { 
+    return mgNbWindowsAlive; 
+  }
+  //=========================================================================
+  
+  //=========================================================================
+  bool WWt::IsSomeWindowAlive() 
+  { 
+    return (mgNbWindowsAlive!=0);
+  }
+  //=========================================================================
+  
+
+  //=========================================================================
+  WWt::BusyCursor::BusyCursor()
+  {
+   // mCursor = 0;
+    if (Wt::WApplication::instance()!=0) 
+      {        
+       bbtkDebugMessage("wt",2,
+                        "Wt::BusyCursor::BusyCursor() : creating new cursor"
+                        <<std::endl);
+       //mCursor = new wxBusyCursor; 
+    }
+  }
+  //=========================================================================
+  //=========================================================================
+  WWt::BusyCursor::~BusyCursor()
+  {
+   // if (mCursor)
+     // { 
+       //delete mCursor;
+       //bbtkDebugMessage("wt",2,
+       //               "Wt::BusyCursor::~BusyCursor() : deleting cursor"<<std::endl);
+      //}
+  }
+  //=========================================================================
+
+
+
+} // namespace bbtk
+
+#else
+//=======================================================================
+// WITHOUT WX
+//=========================================================================
+namespace bbtk
+{
+   //=========================================================================
+  WWt::BusyCursor::BusyCursor()
+  {
+  }
+  WWt::BusyCursor::~BusyCursor()
+  {
+  }
+  //=========================================================================
+
+} // namespace bbtk
+#endif
+
+
diff --git a/kernel/src/bbtkWt.h b/kernel/src/bbtkWt.h
new file mode 100644 (file)
index 0000000..f1fcd5e
--- /dev/null
@@ -0,0 +1,248 @@
+/*
+ # ---------------------------------------------------------------------
+ #
+ # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
+ #                        pour la SantÈ)
+ # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
+ # Previous Authors : Laurent Guigues, Jean-Pierre Roux
+ # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
+ #
+ #  This software is governed by the CeCILL-B license under French law and
+ #  abiding by the rules of distribution of free software. You can  use,
+ #  modify and/ or redistribute the software under the terms of the CeCILL-B
+ #  license as circulated by CEA, CNRS and INRIA at the following URL
+ #  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+ #  or in the file LICENSE.txt.
+ #
+ #  As a counterpart to the access to the source code and  rights to copy,
+ #  modify and redistribute granted by the license, users are provided only
+ #  with a limited warranty  and the software's author,  the holder of the
+ #  economic rights,  and the successive licensors  have only  limited
+ #  liability.
+ #
+ #  The fact that you are presently reading this means that you have had
+ #  knowledge of the CeCILL-B license and that you accept its terms.
+ # ------------------------------------------------------------------------ */
+
+
+/*=========================================================================
+  Program:   bbtk
+  Module:    $RCSfile: bbtkQt.h,v $
+  Language:  C++
+  Date:      $Date: 2012/11/16 08:49:01 $
+  Version:   $Revision: 1.3 $
+=========================================================================*/
+
+
+
+#ifndef __bbtkWt_h_INCLUDED__
+#define __bbtkWt_h_INCLUDED__
+
+//===========================================================================
+// SIGNAL/SLOT MECHANISM 
+// FOR bbtk WINDOWS CREATION/DESTRUCTION OBSERVATION 
+// BBTKWXSIG
+#include <boost/signal.hpp>
+#include <boost/bind.hpp>
+
+//typedef boost::signals::trackable SignalObserver;
+// \BBTKWXSIG
+//===========================================================================
+
+
+//===========================================================================
+// Wt headers
+// DEFINIR LOS HEADERS Wt que se necesitan  *-*-*-*-*-*-*-*-*-*
+#ifdef USE_WT
+
+//TODO Include libs in the CMake escription
+#include <Wt/WApplication>
+#include <Wt/WEnvironment>
+#include <Wt/WContainerWidget>
+#include <Wt/WWidget>
+#include <Wt/WCheckBox>
+#include <Wt/WServer>
+#include <Wt/WText>
+#include <Wt/WPushButton>
+#include <Wt/WSlider>
+#include <Wt/WHBoxLayout>
+#include <Wt/WVBoxLayout>
+#include <Wt/WBorderLayout>
+#include <Wt/WLineEdit>
+#include <Wt/WComboBox>
+#include <Wt/WSelectionBox>
+#include <Wt/WGroupBox>
+#include <Wt/WRadioButton>
+#include <Wt/WButtonGroup>
+#include <Wt/WLayout>
+#include <Wt/WHBoxLayout>
+#include <Wt/WVBoxLayout>
+#include <Wt/WRadioButton>
+#include <Wt/Ext/Splitter>
+#include <Wt/WTabWidget>
+#include <Wt/WFileUpload>
+#include <Wt/WLength>
+
+
+#else //USE_WT
+
+#endif // EO USE_WT
+
+
+
+
+#ifdef USE_WT
+
+
+// Definition of some classes used in tehe code
+typedef Wt::WEnvironment WtWEnvironment;
+typedef Wt::WWidget WtWWidget;
+//typedef Wt::WContainerWidget WtWContainerWidget;
+typedef Wt::WApplication WtWApplication;
+typedef Wt::WString WtWString;
+
+
+
+#else // EO_USE_WT
+
+
+typedef void WtWidget;
+typedef void WtWContainerWidget;
+typedef void WtWApplication;
+typedef void WtBusyCursor;
+
+#endif // EO USE_WT
+
+
+//==========================================================================
+
+//===========================================================================
+#include "bbtkSystem.h"
+//===========================================================================
+
+
+
+
+
+namespace bbtk
+{
+
+  //==================================================================
+  /// Global wt handlers (cursor...)
+
+
+// BBTKWXSIG BBTK_ADD_BLACK_BOX_TO_PACKAGE(MyProjectWT,Testing)
+
+#define bbtkAddWtSignalObserver(METHOD)                \
+  WWt::AddSignalObserver(boost::bind(&METHOD, this))
+// \BBTKWXSIG
+
+#define BBTK_BUSY_CURSOR bbtk::WWt::BusyCursor __bbtk_dummy_busy_cursor;
+
+  struct BBTK_EXPORT WWt
+  {    
+  public:
+    // BBTKWXSIG
+    // The keyword 'signals' is also a macro in qt
+    //    typedef boost::signals::trackable SignalObserver;
+    typedef boost::signals::trackable SignalObserver;
+    typedef boost::signal<void ()>  Signal_type;
+    typedef Signal_type::slot_function_type Slot_function_type;
+    // \BBTKWXSIG
+               
+    /*
+    static void ResetCursor();
+    static void BeginBusyCursor(); 
+    static void EndBusyCursor();
+    */
+
+    static void LoopUntilAllWindowsClose();
+
+    class BusyCursor
+    {
+    public:
+      BusyCursor();
+      ~BusyCursor();
+      //wxBusyCursor* mCursor; The wxBusyCursor is only for comunicate to the client/user that the program is busy. 
+    };
+
+
+    static void ProcessPendingEvents();
+
+#ifdef USE_WT
+    /// Sets the parent of all bbtk windows
+    static void SetTopWindow(Wt::WContainerWidget*);
+    /// Returns the parent of all bbtk windows 
+    static Wt::WContainerWidget* GetTopWindow();
+#endif // EO USE_WT
+
+    
+    static void IncNbWindowsAlive();
+    static void DecNbWindowsAlive();
+    static int  GetNbWindowsAlive();
+    static bool IsSomeWindowAlive();
+    
+
+    // BBTKWXSIG
+    static void AddSignalObserver(Slot_function_type);
+    // \BBTKWXSIG
+
+
+
+
+  //private:
+    static void CreateWtAppIfNeeded();
+    static void DestroyWtAppIfNeeded();
+
+  }; // struct Wt
+  //==================================================================
+  
+#ifdef USE_WT
+
+
+       static std::string jScript;
+  //==================================================================
+  /// Conversion std::string to wxString 
+  inline Wt::WString std2wt(const std::string& s)
+  {
+  //  Wt::WString wt;
+/*
+    const char* my_string=s.c_str();
+    wxMBConvUTF8 *wxconv= new wxMBConvUTF8();
+    wx=wxString(wxconv->cMB2WC(my_string),wxConvUTF8);
+    delete wxconv;
+    // test if conversion works of not. In case it fails convert from Ascii
+    if(wx.length()==0)
+      wx=wxString(wxString::FromAscii(s.c_str()));
+*/     
+    return Wt::WString::fromUTF8(s,false);
+    //return new Wt::WString(s);//wt;
+  }
+  //==================================================================
+
+  //==================================================================
+  /// Conversion wxString to std::string
+  inline  std::string wt2std(const Wt::WString& s){
+   /* std::string s2;
+    if(s.wxString::IsAscii()) {
+      s2=s.wxString::ToAscii();
+    } else {
+      const wxWX2MBbuf tmp_buf = wxConvCurrent->cWX2MB(s);
+      const char *tmp_str = (const char*) tmp_buf;
+      s2=std::string(tmp_str, strlen(tmp_str));
+    }
+
+    return s2;*/
+       return s.toUTF8();
+  }
+  //==================================================================
+#endif // EO _USE_WXWIDGETS
+
+
+
+
+  
+} // namespace bbtk
+  
+
+#endif // EO __bbtkWt_h_INCLUDED__
diff --git a/kernel/src/bbtkWtBlackBox.cxx b/kernel/src/bbtkWtBlackBox.cxx
new file mode 100644 (file)
index 0000000..a3cb0db
--- /dev/null
@@ -0,0 +1,473 @@
+
+/*
+ # ---------------------------------------------------------------------
+ #
+ # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
+ #                        pour la SantÈ)
+ # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
+ # Previous Authors : Laurent Guigues, Jean-Pierre Roux
+ # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
+ #
+ #  This software is governed by the CeCILL-B license under French law and
+ #  abiding by the rules of distribution of free software. You can  use,
+ #  modify and/ or redistribute the software under the terms of the CeCILL-B
+ #  license as circulated by CEA, CNRS and INRIA at the following URL
+ #  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+ #  or in the file LICENSE.txt.
+ #
+ #  As a counterpart to the access to the source code and  rights to copy,
+ #  modify and redistribute granted by the license, users are provided only
+ #  with a limited warranty  and the software's author,  the holder of the
+ #  economic rights,  and the successive licensors  have only  limited
+ #  liability.
+ #
+ #  The fact that you are presently reading this means that you have had
+ #  knowledge of the CeCILL-B license and that you accept its terms.
+ # ------------------------------------------------------------------------ */
+
+
+/*=========================================================================
+  Program:   bbtk
+  Module:    $RCSfile: bbtkWxBlackBox.cxx,v $
+  Language:  C++
+  Date:      $Date: 2012/11/16 08:49:01 $
+  Version:   $Revision: 1.45 $
+=========================================================================*/
+
+
+
+#ifdef _USE_WT_
+
+/**
+ *  \file 
+ *  \brief 
+ */
+#include "bbtkWtBlackBox.h"
+#include "bbtkBlackBoxOutputConnector.h"
+
+
+//#include "bbtkWxContainerBlackBox.h"
+//#include <wx/dialog.h>
+
+//#include "bbtkData.h"
+//#include "bbtkFactory.h"
+
+
+
+
+namespace bbtk
+{
+
+/*     
+       class jScript
+       {
+               public:
+                       jScript();
+                       std::string jScriptLine;
+       };
+*/
+  //=========================================================================
+  // wtData structure
+  //=========================================================================
+
+       // For the very first contruction of the application
+/*     struct wtServerData
+       {
+         std::string docRoot;
+         std::string port;
+         std::string address;
+       
+       };
+       */
+       struct wtData
+       {
+               Wt::WContainerWidget *parent;
+               WtBlackBox::Pointer b;
+               WtBlackBox *pbox;       
+               Wt::WString title;      
+       };
+
+/*     jScript::jScript()
+       {
+               jScriptLine = "";
+       }
+*/
+//     static bbtk::jScript* js  = new bbtk::jScript();
+       static wtData myWtData;
+//     static wtServerData loadedJS;
+       //static std::string* jss;
+       
+       
+
+  //=========================================================================
+  // javaScript Line
+  //=========================================================================
+       //Contains all the JS statements needed for the bbwt.
+               
+  //=========================================================================
+  // WxFrame
+  //=========================================================================
+       // Application WT deployed
+  //==================================================================
+ class WtWFrame : public Wt::WApplication
+  {
+  public:
+    WtWFrame( const Wt::WEnvironment& env );
+    ~WtWFrame();       
+    WtBlackBox::WeakPointer mBox; 
+  };   
+       
+
+       WtWFrame::WtWFrame( const Wt::WEnvironment& env ):Wt::WApplication(env)
+       {  
+               //std::cout<<"Adding JavaScript --  DELETE ME -- bbtkWtBlackBox.cxx"<<std::endl;
+               //this->require("/home/gonzalez/Documents/CREATOOLS/wt_library/wt/bbtk_wt_PKG/src/js/xtk.js");
+
+               //this->require("http://get.goXTK.com/xtk.js");
+               //this->useStyleSheet("css/demo.css");
+
+       //this->require("http://get.goXTK.com/xtk.js");
+       this->require( "resourcesXTK/xtk.js" );
+               
+       //      this->require("http://get.goXTK.com/xtk_edge.js");
+//     this->require("http://get.goXTK.com/xtk_xdat.gui.js");
+       this->require( "resourcesXTK/xtk_xdat.gui.js" );
+
+  this->useStyleSheet("resourcesXTK/styleWT.css"); 
+       //      std::cout<<"Cargado------------           "<<loadedJS<<std::endl;
+               mBox = myWtData.b;
+
+//EED -->
+               if(!myWtData.parent)
+               {
+                       std::cout<<"        SIN PADRE "<<std::endl;
+                       if(myWtData.parent == 0){std::cout<<"        PARENT 0 "<<std::endl;}
+                       if(myWtData.parent == NULL){std::cout<<"        PARENT NULL "<<std::endl;}
+                       myWtData.parent = new Wt::WContainerWidget();
+                       std::cout<<"Parent created --  DELETE ME -- bbtkWtBlackBox.cxx"<<std::endl;
+               }
+
+               Wt::WContainerWidget *myContainer = new Wt::WContainerWidget(myWtData.parent);
+               myContainer->setMinimumSize(800,500);
+               std::cout<<"Creando WebWIDGET DELETE ME ---- bbtkWtBlackBox.cxx.......50%"<<std::endl;
+               myWtData.b->bbUserCreateWidget(myContainer);
+
+               root()->addWidget(myWtData.parent);
+               //bbmWindow = myCont;
+               this->refresh();
+               //jss = WtBlackBox::jScript;
+               std::cout<<"Creando WebWIDGET DELETE ME ---- bbtkWtBlackBox.cxx........80%"<<std::endl;
+               std::cout<<"Creando WebWIDGET DELETE ME SCRIPT : ---"<<bbtk::jScript<<"......80%"<<std::endl;
+               //this->doJavaScript(bbtk::jScript); 
+
+//EED
+       myWtData.pbox->bbwtUpdateInputs();
+//       myWtData.pbox->bbwtProcess();
+
+
+  }
+  //==================================================================
+  //==================================================================
+  WtWFrame::~WtWFrame() 
+    { 
+      if (mBox.lock())
+       bbtkDebugMessage("widget",9,"["<<mBox.lock()->bbGetName()
+                        <<"] $$$$$$$$$$$$$$$$$$$ ~W()"
+                        <<std::endl);
+      else 
+       bbtkDebugMessage("widget",9,"[DEAD] $$$$$$$$$$$$$$$$$$$$$ ~WtContainer()"<<std::endl);
+      bbtkDebugMessage("widget",9,"WtWFrame::~WtWFrame()"<<std::endl);
+      if (mBox.lock()) mBox.lock()->bbSetWindow(0); 
+      WWt::DecNbWindowsAlive();
+    }
+
+
+   
+       Wt::WApplication *createApplication(const Wt::WEnvironment& env)
+       {
+                       return new WtWFrame(env);                       
+       }
+
+
+  //=========================================================================
+  // WxDialogWxBlackBox::Pointer box
+  //=========================================================================
+
+   //==================================================================
+  // Dialog window which is modal
+ /* class BBTK_EXPORT  WxDialog : public wxDialog
+  {
+  public:
+    WxDialog(WxBlackBox::Pointer box, 
+                    wxWindow *parent, 
+                    wxString title, 
+                    wxSize size);
+    ~WxDialog();Wt::GetTopWindow()
+    void OnCloseWindow(wxCloseEvent& event);
+
+
+    WxBlackBox::WeakPointer mBox;      
+    DECLARE_EVENT_TABLE();
+    
+  };
+  
+  BEGIN_EVENT_TABLE(WxDialog, wxDialog)
+    EVT_CLOSE(WxDialog::OnCloseWindow)
+    END_EVENT_TABLE();
+  //=========================================================================
+
+  //=========================================================================
+  WxDialog::WxDialog(WxBlackBox::Pointer b,
+                    wxWindow *parent,
+                    wxString title,
+                    wxSize size)
+    :
+    wxDialog( parent, 
+               -1, 
+               title,
+               wxDefaultPosition,
+               size,
+               wxRESIZE_BORDER | 
+               wxSYSTEM_MENU  |
+               wxCLOSE_BOX |
+               wxMAXIMIZE_BOX | 
+               wxMINIMIZE_BOX | 
+               wxCAPTION  
+             ),
+    mBox(b)
+  {
+    bbtkDebugMessage("widget",9,"WxDialog::WxDialog ["<<b->bbGetName()<<"]"
+                    <<std::endl);WxBlackBox::Pointer box
+    Wx::IncNbWindowsAlive();
+    b->bbSetWindow(this);
+    // Insert the widget into the window
+    wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL);
+    b->bbUserCreateWidget(this);
+    wxWindow* widget = b->bbGetOutputWidget();
+    sizer->Add( widget, 1, wxALL|wxGROW, 2);
+    SetSizer(sizer);
+    Layout();
+  }
+  //==================================================================
+  //===========================organise=======================================
+  WxDialog::~WxDialog() 
+    { 
+      bbtkDebugMessage("widget",9,"WxDialog::~WxDialog()"<<std::endl);
+      //bbtkDebugMessage("widget",9,"WxFrame::~WxFrame()"<<std::endl);
+      //      if (mBox.lock()) mBox.lock()->bbSetWindow(0); 
+      //      Wx::DecNbWindowsAlive();
+    }
+   //==================================================================
+   //==================================================================
+  void WxDialog::OnCloseWindow(wxCloseEvent& event)
+    {
+      bbtkDebugMessage("widget",9,"WxDialog::OnCloseWindow()"<<wxGUIEditorGraphicBBS:std::endl);
+      if (mBox.lock()) mBox.lock()->bbSetWindow(0); http://doodle.com/qx65tfxismf7d6ku5vxykghs/admin#table
+      Wx::DecNbWindowsAlive();
+      this->Destroy();
+    }
+   //==================================================================
+
+*/
+ //=========================================================================
+  // WxBlackBox
+  //=========================================================================
+
+  //=========================================================================
+  //=========================================================================
+  //=========================================================================
+  //=========================================================================
+  BBTK_BLACK_BOX_IMPLEMENTATION(WtBlackBox,WidgetBlackBox<Wt::WContainerWidget>);
+       
+       //std::string WtBlackBox::wtServerData::docRoot = "/home/gonzalez/Documents/pruebaResources";
+       //std::string WtBlackBox::wtServerData::docRoot = "/usr/local/share/wtResources";
+  //std::string WtBlackBox::wtServerData::port    = "8081";
+
+       std::string WtBlackBox::wtServerData::docRoot   = "<void>";
+       std::string WtBlackBox::wtServerData::port      = "<void>";
+       std::string WtBlackBox::wtServerData::address   = "0.0.0.0";
+       int WtBlackBox::wtServerData::argc                              = 0;
+       char **WtBlackBox::wtServerData::argv                   = NULL;
+
+  //=========================================================================
+  //=========================================================================
+  void WtBlackBox::bbUserSetDefaultValues()
+  {
+    bbtkBlackBoxDebugMessage("widget",5,"WtBlackBox::bbUserSetDefaultValues()"<<std::endl);
+    bbmWindow = 0;
+  }
+  //=========================================================================
+
+  //=========================================================================
+  void WtBlackBox::bbUserInitializeProcessing()
+  {
+
+  }
+  //================================================================http://intranet-if.insa-lyon.fr/temps/5IF39.html==    
+
+  //=========================================================================
+  void WtBlackBox::bbUserFinalizeProcessing()
+  {
+    bbtkBlackBoxDebugMessage("widget",5,"==> WtBlackBox::bbUserFinalizeProcessing()"<<std::endl);
+    bbDestroyWindow();
+    bbtkBlackBoxDebugMessage("widget",5,"<== WtBlackBox::bbUserFinalizeProcessing()"<<std::endl);
+  }
+  //==================================================================    
+
+  //==================================================================    
+  /// Callback for creating a Dialog window (modal)
+  void WtBlackBox::bbCreateDialogWindow()
+  {
+         bbtkBlackBoxDebugMessage("widget",3,
+                    "==> WtBlackBox::bbCreateDialogWindow() - No Dialog must be created, it is a web app"
+                    <<std::endl);
+
+  } 
+  //=========================================================================
+
+  //==================================================================    
+
+  //==================================================================    
+  /// Callback for creating a Frame window 
+       void WtBlackBox::bbCreateFrameWindow()
+       {
+
+               bbtkBlackBoxDebugMessage("widget",3,
+                       "==> WtBlackBox::bbCreateFrameWindow() - parent = "
+                       <<WWt::GetTopWindow()
+                       <<std::endl);
+
+               //Setting necessary data for Wt server deployment
+               myWtData.parent = WWt::GetTopWindow();
+               myWtData.b      = GetThisPointer<WtBlackBox>();
+               myWtData.title  = std2wt( bbGetInputWinTitle() + " - bbtk (c) CREATIS");
+               myWtData.pbox   = this;
+               
+               //char  *argv[7] =  {"./WtTest","--docroot","/home/gonzalez/Documents/pruebaResources","--http-address","0.0.0.0","--http-port","8080"};
+               //int argc = 7;
+               
+/*             
+                       char  *argv[7] =  {"./WtTest"
+,"--docroot",(char*)WtBlackBox::wtServerData::docRoot.c_str()
+,"--http-address",(char*)WtBlackBox::wtServerData::address.c_str()
+,"--http-port",(char*)WtBlackBox::wtServerData::port.c_str()
+};
+               int argc = 3;
+               std::cout<<" ---  PUERTO  :"<<WtBlackBox::wtServerData::port<<std::endl;
+*/
+
+/*             
+char  *argv[2] =  {"./bbiWeb.wt","client"};
+int argc=2;
+*/
+
+
+       /*      if(Wt::WServer::instance()->isRunning())
+               {
+                       std::cout<<"Checking the existence of a Server deployed  -DELETE THIS MESSAGE bbtkWTBlackBox.cxx"<<std::endl;
+                       Wt::WServer::instance()->stop();
+               }
+       */
+
+
+               std::cout<<"EED WtBlackBox::bbCreateFrameWindow  Deploying Server -- Definition of server parameters by default  -DELETE THIS MESSAGE bbtkWTBlackBox.cxx"<<std::endl;
+
+
+//             Wt::WRun(argc,argv,&createApplication); 
+
+               Wt::WRun(WtBlackBox::wtServerData::argc,
+                         WtBlackBox::wtServerData::argv,
+                         &createApplication);  
+
+
+   }
+
+  //==================================================================    
+
+  //==================================================================    
+  void WtBlackBox::bbSetWindow(Wt::WContainerWidget* w) 
+  {
+    bbtkBlackBoxDebugMessage("widget",9,"==> WtBlackBox::bbSetWindow("<<w<<")"<<std::endl);
+    if ((bbmWindow != 0)&&(w!=0)) 
+      { 
+       std::cout << "ERRRRRRRROOOOR"<<std::endl; 
+      }
+    bbmWindow = w;
+  }
+
+       
+
+    //==================================================================    
+
+  //==================================================================
+  void WtBlackBox::bbShowWindow()
+  {
+    if ((bbmWindow) && (!bbIsShown()))
+      {
+       bbtkBlackBoxDebugMessage("widget",3,"==> WtBlackBox::bbShowWindow()"
+                        <<std::endl);
+       if (bbGetInputWinDialog()) 
+         {
+         //  ((WxDialog*)bbmWindow)->ShowModal();
+         }
+       else
+         {
+               // There is not such a thing like show becouse it is a webapp
+          // bbGetWindow()->Show();
+         //  WWt::CreateWtAppIfNeeded();
+
+
+               Wt::WRun(WtBlackBox::wtServerData::argc,
+                         WtBlackBox::wtServerData::argv,
+                         &createApplication);  
+
+
+           bbSetShown(true);
+         } 
+      }
+  }
+  //==================================================================    
+
+  //==================================================================    
+  void WtBlackBox::bbDestroyWindow()
+  {
+    bbtkBlackBoxDebugMessage("widget",3,"==> WtBlackBox::bbDestroyWindow("<<bbmWindow<<")"<<std::endl);
+    if (bbGetWindow()!=NULL) 
+      {
+       //       wxWindow* w = bbGetWindow();
+       //bbSetWindow(0);
+       // WE SHOULD DESTROY THE WINDOW WITH THE Close METHOD
+       // HOWEVER I
+       //w->Close(true);
+       //
+       delete bbGetWindow();
+       bbSetShown(false);
+      }
+    bbtkBlackBoxDebugMessage("widget",3,"<== WtBlackBox::bbDestroyWindow("<<bbmWindow<<")"<<std::endl);
+
+  }
+
+
+//==================================================================    
+       void WtBlackBox::bbwtUpdateInputs()
+       {
+               BlackBox::bbUpdateInputs();
+       }
+
+//==================================================================    
+       void WtBlackBox::bbwtProcess()
+       {
+               BlackBox::bbProcess();
+       }
+
+
+
+}//namespace bbtk
+
+#endif
+
+
diff --git a/kernel/src/bbtkWtBlackBox.h b/kernel/src/bbtkWtBlackBox.h
new file mode 100644 (file)
index 0000000..4725a0d
--- /dev/null
@@ -0,0 +1,162 @@
+/*
+ # ---------------------------------------------------------------------
+ #
+ # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
+ #                        pour la SantÈ)
+ # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
+ # Previous Authors : Laurent Guigues, Jean-Pierre Roux
+ # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
+ #
+ #  This software is governed by the CeCILL-B license under French law and
+ #  abiding by the rules of distribution of free software. You can  use,
+ #  modify and/ or redistribute the software under the terms of the CeCILL-B
+ #  license as circulated by CEA, CNRS and INRIA at the following URL
+ #  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+ #  or in the file LICENSE.txt.
+ #
+ #  As a counterpart to the access to the source code and  rights to copy,
+ #  modify and redistribute granted by the license, users are provided only
+ #  with a limited warranty  and the software's author,  the holder of the
+ #  economic rights,  and the successive licensors  have only  limited
+ #  liability.
+ #
+ #  The fact that you are presently reading this means that you have had
+ #  knowledge of the CeCILL-B license and that you accept its terms.
+ # ------------------------------------------------------------------------ */
+
+
+/*=========================================================================
+  Program:   bbtk
+  Module:    $RCSfile: bbtkWxBlackBox.h,v $
+  Language:  C++
+  Date:      $Date: 2012/11/16 08:49:01 $
+  Version:   $Revision: 1.33 $
+========================================================================*/
+
+
+
+/**
+ * \brief Short description in one line
+ * 
+ * Long description which 
+ * can span multiple lines
+ */
+/**
+ * \file 
+ * \brief 
+ */
+/**
+ * \class bbtk::
+ * \brief 
+ */
+
+
+#ifdef USE_WT
+
+
+
+#ifndef __bbtkWtBlackBox_h__
+#define __bbtkWtBlackBox_h__
+
+
+
+#include "bbtkWidgetBlackBox.h"
+#include "bbtkWt.h"
+
+
+namespace bbtk
+{
+
+
+  //==================================================================
+  /// Widget black boxes
+//EED 10/06/2009 /*BBTK_EXPORT*/
+  class BBTK_EXPORT WtBlackBox : public bbtk::WidgetBlackBox<Wt::WContainerWidget>
+  { 
+  
+
+  
+  
+  
+  public:
+    BBTK_BLACK_BOX_INTERFACE(WtBlackBox,bbtk::WidgetBlackBox<Wt::WContainerWidget>);
+    
+         
+    //  protected:
+    
+  public:
+  
+     struct wtServerData
+          {
+             /*std::string docRoot;
+             std::string port;
+             std::string address;
+           */
+             static std::string docRoot  ;
+             static std::string port     ;
+             static std::string address  ;
+             
+              static int argc;
+              static char **argv;
+           };
+  
+  /*   static std::string* jScript;
+    static void changeJScript(std::string newJScript){jScript=newJScript;};
+    static std::string getJScript(){return jScript;};*/
+   //==================================================================    
+    /// Callback for creating a Dialog window (modal)
+    /// ** Must be defined ** in toolkit specific descendants 
+    virtual void bbCreateDialogWindow();
+    //==================================================================    
+
+    //==================================================================    
+    /// Callback for creating a Frame window 
+    /// ** Must be defined ** in toolkit specific descendants 
+    virtual void bbCreateFrameWindow();
+    //==================================================================    
+    //staticwtServerData serData;
+   // static void setServerInformation(std::string nDocRoot, std::string nPort, std::string nAddress);
+    //==================================================================    
+    Wt::WContainerWidget* bbGetWindow() { return bbmWindow; }
+    void bbSetWindow(Wt::WContainerWidget*) ;
+    bool bbWindowIsCreated() { return (bbGetWindow() != 0); }
+   // Wt::WApplication *createApplication(const Wt::WEnvironment& env);
+    //==================================================================    
+
+
+    //==================================================================    
+    virtual void bbShowWindow();
+    //==================================================================   
+    //==================================================================    
+    virtual void bbDestroyWindow();
+    //==================================================================    
+
+   void bbwtUpdateInputs();
+   void bbwtProcess();
+
+  private:
+    
+    Wt::WApplication* bbApp;
+    Wt::WContainerWidget* bbmWindow;
+  };
+  //=================================================================
+
+  //=================================================================
+  // WxBlackBoxDescriptor declaration
+  class WtBlackBoxDescriptor : public WidgetBlackBoxDescriptor<Wt::WContainerWidget>
+  BBTK_BEGIN_DESCRIBE_BLACK_BOX_BODY(WtBlackBox);
+  BBTK_NAME("WtBlackBox");
+  BBTK_END_DESCRIBE_BLACK_BOX(WtBlackBox);
+  //=================================================================
+
+
+} //namespace bbtk
+
+#endif  //__bbtkWxBlackBox_h__
+
+#endif  //USE_WXWIDGETS
index 69cfc4db3e24dbb42ec2a50c40046a7869d573b7..78848c1cef825e7d66fad5a5c6da2cbc90a38712 100644 (file)
@@ -71,7 +71,8 @@ namespace bbtk
   IMPLEMENT_APP_NO_MAIN(WxApp);
   //=========================================================================
   bool WxApp::OnInit( )
-  {     
+  {
+       std::cout<<"Testing OnINIT Wx ---- JFGA !!!DELETE ME!!! bbtkWx"<<std::endl;      
     wxApp::OnInit();
 #ifdef __WXGTK__
     //See http://www.wxwindows.org/faqgtk.htm#locale
@@ -84,6 +85,8 @@ namespace bbtk
   //=========================================================================
   void Wx::CreateWxAppIfNeeded()
   {
+
+               std::cout<<"Testing CreateWxAppIfNeeded --- DELETE ME ----"<<std::endl;
     if (wxApp::GetInstance()==0)
       {
        if (mgWxApp != 0) 
index 7b306658649dbc8a373009979db58a1e7acb9967..52eca34bd2365486c8308aeb7ecd4835cf86353b 100644 (file)
@@ -77,7 +77,7 @@ typedef void wxBusyCursor;
 // SIGNAL/SLOT MECHANISM 
 // FOR bbtk WINDOWS CREATION/DESTRUCTION OBSERVATION 
 // BBTKWXSIG
-#include <boost/signal.hpp>
+#include <boost/signals2/signal.hpp>
 #include <boost/bind.hpp>
 // \BBTKWXSIG
 //===========================================================================
@@ -99,8 +99,8 @@ namespace bbtk
   {    
   public:
     // BBTKWXSIG
-    typedef boost::signals::trackable SignalObserver;
-    typedef boost::signal<void ()>  Signal_type;
+    typedef boost::signals2::trackable SignalObserver;
+    typedef boost::signals2::signal<void ()>  Signal_type;
     typedef Signal_type::slot_function_type Slot_function_type;
     // \BBTKWXSIG
 
index b436a6a7fbbd1ddff8ca356e7e8ff3f3a6420a29..6a26356ce46850b9e14a029e2e6089ed165bc339 100644 (file)
@@ -77,7 +77,7 @@ namespace bbtk
   BEGIN_EVENT_TABLE(WxFrame, wxFrame)
   //  EVT_CLOSE(WxFrame::OnCloseWindow)
     END_EVENT_TABLE();
-     //==================================================================
+     //==========================================Window  ========================
   
      //==================================================================
   WxFrame::WxFrame(WxBlackBox::Pointer b,
@@ -144,7 +144,7 @@ namespace bbtk
     }
    //==================================================================
 
-  //=========================================================================
+  //====================================================SetWin=====================
   // WxDialog
   //=========================================================================
 
@@ -191,6 +191,7 @@ namespace bbtk
              ),
     mBox(b)
   {
+               
     bbtkDebugMessage("widget",9,"WxDialog::WxDialog ["<<b->bbGetName()<<"]"
                     <<std::endl);
     Wx::IncNbWindowsAlive();
@@ -239,7 +240,7 @@ namespace bbtk
   void WxBlackBox::bbUserSetDefaultValues()
   {
     bbtkBlackBoxDebugMessage("widget",5,"WxBlackBox::bbUserSetDefaultValues()"<<std::endl);
-    bbmWindow = 0;
+    bbmWindow = 0;  
   }
   //=========================================================================
 
@@ -269,8 +270,8 @@ namespace bbtk
     WxDialog* w = 0;  
     w = new WxDialog( GetThisPointer<WxBlackBox>(),
                      Wx::GetTopWindow(),
-                     std2wx( bbGetInputWinTitle()  
-                             + " - bbtk (c) CREATIS"),
+//                   std2wx( bbGetInputWinTitle() + " - bbtk (c) CREATIS"),
+                     std2wx( ConstructWinTitle() ),
                      wxSize( bbGetInputWinWidth() , 
                              bbGetInputWinHeight() ) );
     w->Show(false);
@@ -291,11 +292,13 @@ namespace bbtk
     WxFrame* w = 0;  
     w = new WxFrame( GetThisPointer<WxBlackBox>(),
                     Wx::GetTopWindow(),
-                    std2wx( bbGetInputWinTitle()  
-                            + " - bbtk (c) CREATIS"),
+//                  std2wx( bbGetInputWinTitle() + " - bbtk (c) CREATIS"),
+                    std2wx( ConstructWinTitle() ),
                     wxSize( bbGetInputWinWidth() , 
                             bbGetInputWinHeight() ) );
     w->Show();
+
+
    }
 
   //==================================================================    
@@ -305,9 +308,9 @@ namespace bbtk
   {
     bbtkBlackBoxDebugMessage("widget",9,"==> WxBlackBox::bbSetWindow("<<w<<")"<<std::endl);
     if ((bbmWindow != 0)&&(w!=0)) 
-      { 
-       std::cout << "ERRRRRRRROOOOR"<<std::endl; 
-      }
+       
+               std::cout << "WxBlackBox::bbSetWindow   ?? EED ?? ERRRRRRRROOOOR"<<std::endl; 
+       }
     bbmWindow = w;
   }
   //==================================================================    
@@ -323,12 +326,14 @@ namespace bbtk
          {
            ((WxDialog*)bbmWindow)->ShowModal();
          }
-       else
+       else    
          {
            bbGetWindow()->Show();
            bbSetShown(true);
          } 
-      }
+      } // if
+
+
   }
   //==================================================================    
 
@@ -351,6 +356,27 @@ namespace bbtk
 
   }
   //==================================================================    
+  
+  //==================================================================    
+  void WxBlackBox::PutWinTitle()
+  {
+       if ( ! bbIsOutputWidgetConnected() )
+    {
+               wxTopLevelWindow* wParent = (wxTopLevelWindow*)( bbGetOutputWidget()->GetParent() );
+               wParent->SetTitle( std2wx( ConstructWinTitle() ) );
+       } // if
+  }
+  //==================================================================    
+
+  //==================================================================    
+  std::string WxBlackBox::ConstructWinTitle()
+  {
+       std::string title( bbGetInputWinTitle() + " - bbtk (c) CREATIS");
+       return title;
+  }
+  //==================================================================    
+
+
 
 }//namespace bbtk
 
index 09f88ed94bf4438c6d329272929ee7719dddc7c6..e5e529bdc8afbf4fcdd12822465a3dd6344b4020 100644 (file)
@@ -109,6 +109,12 @@ namespace bbtk
     virtual void bbDestroyWindow();
     //==================================================================    
 
+    //==================================================================    
+       virtual void PutWinTitle();
+    //==================================================================    
+
+       virtual std::string ConstructWinTitle();
+
   private:
 
     wxWindow* bbmWindow;
index b83dbd82ad05cc30ba7c4a93b5f1f1a2a2370180..bc5b5253bffcbc0d811f8e824bcaedc755544c4b 100644 (file)
@@ -264,7 +264,9 @@ namespace bbtk
                  BlackBoxDescriptor* d = (BlackBoxDescriptor*)(info.GetData());
                  if (d!=0)
                  {
-                         sendtext += crea::std2wx(d->GetFullTypeName());
+                     //DFGO -> To identify it is a box
+                     sendtext += crea::std2wx("box:");
+                     sendtext += crea::std2wx(d->GetFullTypeName());
                  }
          }
          else
index 9e8e57dbe5732772b25494f9ad15dfa167bccf49..4425cc80e7b865e5ddb0ea000b83a67d7aa30f06 100644 (file)
@@ -871,7 +871,7 @@ std::cout << "==================================================================
 
                        printf("EED WxGUIScriptingInterface::WxGUIHtmlBrowserUserOnLinkClicked cc %s \n",commandPath.c_str() );
                        // cleanning path
-                       while (commandPath.rfind("\\\\")!=-1 )
+                       while ((int)commandPath.rfind("\\\\")!=-1 )
                        {
                                commandPath.erase( commandPath.rfind("\\\\") , 1 );
                        printf("EED WxGUIScriptingInterface::WxGUIHtmlBrowserUserOnLinkClicked cc %s \n",commandPath.c_str() );
index 2b86b393e8982102555756ec590573b6a9cf817d..07e15f40ecbc91fa49132fb7b9f6abdca880b25c 100644 (file)
@@ -39,6 +39,13 @@ ADD_SUBDIRECTORY(appli)
 ADD_SUBDIRECTORY(gdcmvtk)
 
 
+
+
+
+IF(BBTK_USE_WT)
+  ADD_SUBDIRECTORY(wt)
+ENDIF(BBTK_USE_WT)
+
 IF(BBTK_USE_KWWIDGETS)
   ADD_SUBDIRECTORY(kw)
 ENDIF(BBTK_USE_KWWIDGETS)
index 5c309ae42f2f6e3cdf787ab2dc82596eb7852b7e..197ed037997da829b0de5672b6af03575e0bc767 100644 (file)
@@ -48,18 +48,56 @@ namespace bbgdcmvtk
 
 BBTK_ADD_BLACK_BOX_TO_PACKAGE(gdcmvtk,GetXCoherentInfoGdcmReader)
 BBTK_BLACK_BOX_IMPLEMENTATION(GetXCoherentInfoGdcmReader,bbtk::AtomicBlackBox);
+
+
+vtkImageData* GetXCoherentInfoGdcmReader::CreateDefaultImage()
+{
+       int i;
+       int sizeX, sizeY, sizeZ;
+       sizeX = 200;
+       sizeY = sizeX;
+       sizeZ = 1;
+       vtkImageData *newImage = vtkImageData::New();
+       newImage->Initialize();
+       newImage->SetScalarTypeToUnsignedChar();
+       newImage->SetSpacing( 1,1,1 );
+       newImage->SetDimensions(  sizeX,sizeY,sizeZ );
+       newImage->SetWholeExtent(0,  sizeX-1,0,sizeY-1,0,sizeZ-1 );
+       newImage->SetExtent(0,  sizeX-1,0,sizeY-1,0,sizeZ-1 );
+       newImage->SetNumberOfScalarComponents(1);
+       newImage->AllocateScalars();
+       newImage->Update();
+       memset ( (void*)newImage->GetScalarPointer(), 0, sizeX*sizeY*1 );
+       for (i=0; i<sizeX; i++)
+       {
+               newImage->SetScalarComponentFromDouble(i,i,0, 0, 255 );
+               newImage->SetScalarComponentFromDouble(i,sizeY-1-i,0, 0, 255 );
+       } // for i
+       return newImage;
+} 
+
+
 #if defined USE_GDCM
 void GetXCoherentInfoGdcmReader::Process()
 {
+
  // Read the *first* image file (a SET of file names is given as input) 
    f = GDCM_NAME_SPACE::File::New();
-   f->SetFileName( bbGetInputIn()[0] );
+
+       if ( bbGetInputIn().size()!=0 )
+       {
+               f->SetFileName( bbGetInputIn()[0] );
+       } else {
+               f->SetFileName( "" );
+       }
+   
    bool res = f->Load();  
    if ( !res )
    {
-      f->Delete();
-      bbSetOutputOut(0);
-      return;
+               printf("EED GetXCoherentInfoGdcmReader::Process resultImage NULL\n");
+       f->Delete();
+       bbSetOutputOut( CreateDefaultImage() );
+       return;
    }
  // Get info from the first image file
    int i;
@@ -90,6 +128,7 @@ void GetXCoherentInfoGdcmReader::Process()
       sh->AddFileName(*it);
    }
 
+
    GDCM_NAME_SPACE::FileList::const_iterator it;
    GDCM_NAME_SPACE::FileList *l;
 
@@ -124,8 +163,6 @@ void GetXCoherentInfoGdcmReader::Process()
    //reader->SetFileName( bbGetInputIn().c_str() );
    reader->SetCoherentFileList(l);
    reader->Update();
-   reader->GetOutput();
-
    bbSetOutputOut( reader->GetOutput() );
 }
 #endif
@@ -136,16 +173,18 @@ void GetXCoherentInfoGdcmReader::Process()
 {
  // Read the *first* image file (a SET of file names is given as input) 
        gdcm::Reader *read = new gdcm::Reader();
-       reader->SetFileName( bbGetInputIn()[0].c_str());
+       reader->SetFileName( bbGetInputIn()[0].c_str() );
   
        bool res = read->Read();  
-   if ( !res )
-   {
-      delete read;
-      bbSetOutputOut(0);
-      return;
-   }
+       if ( !res )
+       {
+       delete read;
+       bbSetOutputOut(NULL);
+       return;
+       }
     
+
+
  // Get info from the first image file
    const gdcm::File &f = read->GetFile();
    int i;
@@ -203,7 +242,6 @@ void GetXCoherentInfoGdcmReader::Process()
    }
    reader->SetFileNames(files);
    reader->Update();
-   reader->GetOutput();
    bbSetOutputOut( reader->GetOutput() );
 }
 #endif
index 20f8558cf1ebbbb85c200d834877dc299fa7b5f1..a37304beca30d6ecb9562e799de41b3667abbd05 100644 (file)
@@ -65,6 +65,9 @@ class bbgdcmvtk_EXPORT GetXCoherentInfoGdcmReader
   BBTK_PROCESS(Process);
   void Process();
   
+       vtkImageData* CreateDefaultImage();
+
+
   private:
 
 #if defined USE_GDCM
diff --git a/packages/itk/src/bbitkBinaryThresholdImageFilter.h~ b/packages/itk/src/bbitkBinaryThresholdImageFilter.h~
new file mode 100644 (file)
index 0000000..dcc7ecd
--- /dev/null
@@ -0,0 +1,242 @@
+/*
+ # ---------------------------------------------------------------------
+ #
+ # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
+ #                        pour la SantÈ)
+ # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
+ # Previous Authors : Laurent Guigues, Jean-Pierre Roux
+ # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
+ #
+ #  This software is governed by the CeCILL-B license under French law and
+ #  abiding by the rules of distribution of free software. You can  use,
+ #  modify and/ or redistribute the software under the terms of the CeCILL-B
+ #  license as circulated by CEA, CNRS and INRIA at the following URL
+ #  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+ #  or in the file LICENSE.txt.
+ #
+ #  As a counterpart to the access to the source code and  rights to copy,
+ #  modify and redistribute granted by the license, users are provided only
+ #  with a limited warranty  and the software's author,  the holder of the
+ #  economic rights,  and the successive licensors  have only  limited
+ #  liability.
+ #
+ #  The fact that you are presently reading this means that you have had
+ #  knowledge of the CeCILL-B license and that you accept its terms.
+ # ------------------------------------------------------------------------ */
+
+/*=========================================================================
+  Program:   bbtk
+  Module:    $RCSfile: bbitkBinaryThresholdImageFilter.h,v $
+  Language:  C++
+  Date:      $Date: 2012/11/16 08:50:39 $
+  Version:   $Revision: 1.14 $
+=========================================================================*/
+
+/* ---------------------------------------------------------------------
+
+* Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
+* Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux
+*
+*  This software is governed by the CeCILL-B license under French law and 
+*  abiding by the rules of distribution of free software. You can  use, 
+*  modify and/ or redistribute the software under the terms of the CeCILL-B 
+*  license as circulated by CEA, CNRS and INRIA at the following URL 
+*  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html 
+*  or in the file LICENSE.txt.
+*
+*  As a counterpart to the access to the source code and  rights to copy,
+*  modify and redistribute granted by the license, users are provided only
+*  with a limited warranty  and the software's author,  the holder of the
+*  economic rights,  and the successive licensors  have only  limited
+*  liability. 
+*
+*  The fact that you are presently reading this means that you have had
+*  knowledge of the CeCILL-B license and that you accept its terms.
+* ------------------------------------------------------------------------ */                                                                         
+
+
+#ifdef _USE_ITK_
+
+#include "bbtkAtomicBlackBox.h"
+#include "itkBinaryThresholdImageFilter.h"
+#include "bbtkItkBlackBoxMacros.h"
+#include "bbitkImage.h"
+
+namespace bbitk
+{
+
+  //===================================================
+  template <class T>
+  class /*BBTK_EXPORT*/ BinaryThresholdImageFilter
+    : 
+    public bbtk::AtomicBlackBox,
+    public itk::BinaryThresholdImageFilter<T,T>
+  {
+    BBTK_TEMPLATE_BLACK_BOX_INTERFACE(BinaryThresholdImageFilter,
+                                     bbtk::AtomicBlackBox,T);
+    typedef itk::BinaryThresholdImageFilter<T,T> itkParent;
+    BBTK_DECLARE_ITK_INPUT(In,const T*);
+    BBTK_DECLARE_ITK_PARAM(LowerThreshold,typename T::PixelType);
+    BBTK_DECLARE_ITK_PARAM(UpperThreshold,typename T::PixelType);
+    BBTK_DECLARE_ITK_PARAM(InsideValue,typename T::PixelType);
+    BBTK_DECLARE_ITK_PARAM(OutsideValue,typename T::PixelType);
+    BBTK_DECLARE_ITK_OUTPUT(Out,T*);
+    BBTK_ITK_PROCESS();
+    BBTK_ITK_DELETE();
+
+  };
+  //===================================================
+  
+  //===================================================
+  BBTK_BEGIN_DESCRIBE_TEMPLATE_BLACK_BOX(BinaryThresholdImageFilter,
+                                     bbtk::AtomicBlackBox);
+  BBTK_NAME("BinaryThresholdImageFilter<"+bbtk::TypeName<T>()+">");
+  BBTK_AUTHOR("laurent.guigues@creatis.insa-lyon.fr");
+  BBTK_DESCRIPTION("Binarizes an image by thresholding (bbification of itk::BinaryThresholdImageFilter)");
+  BBTK_TEMPLATE_INPUT(BinaryThresholdImageFilter,In,"Input image",const T*);
+  BBTK_TEMPLATE_INPUT(BinaryThresholdImageFilter,LowerThreshold,
+                     "Lower threshold",typename T::PixelType);
+  BBTK_TEMPLATE_INPUT(BinaryThresholdImageFilter,UpperThreshold,
+                     "Upper threshold",typename T::PixelType);
+  BBTK_TEMPLATE_INPUT(BinaryThresholdImageFilter,InsideValue,
+                     "Output value for pixels inside thresholds",
+                     typename T::PixelType);
+  BBTK_TEMPLATE_INPUT(BinaryThresholdImageFilter,OutsideValue,
+                     "Output value for pixels outside thresholds",
+                     typename T::PixelType);
+  BBTK_TEMPLATE_OUTPUT(BinaryThresholdImageFilter,Out,"Output image",T*);
+  BBTK_END_DESCRIBE_TEMPLATE_BLACK_BOX(BinaryThresholdImageFilter);
+  //===================================================
+
+
+  //===================================================
+  //--
+  template <class T>
+  void BinaryThresholdImageFilter<T>::bbUserSetDefaultValues()
+  {
+    bbSetInputLowerThreshold(0);
+    bbSetInputUpperThreshold(100);
+    bbSetInputInsideValue(255);
+    bbSetInputOutsideValue(0);
+  }
+  template <class T>
+  void BinaryThresholdImageFilter<T>::bbUserInitializeProcessing()
+  {
+  }    
+  template <class T>
+  void BinaryThresholdImageFilter<T>::bbUserFinalizeProcessing()
+  {
+  }
+  
+  //===================================================
+
+
+
+
+
+
+
+
+
+
+  
+  //===================================================
+  // Generic "untemplatized" filter
+  //===================================================
+  class /*BBTK_EXPORT*/ BinaryThresholdImageFilterGeneric
+    : 
+    public bbtk::AtomicBlackBox
+  {
+    BBTK_BLACK_BOX_INTERFACE(BinaryThresholdImageFilterGeneric,
+                                 bbtk::AtomicBlackBox);
+    BBTK_DECLARE_INPUT(In,anyImagePointer);
+    BBTK_DECLARE_INPUT(LowerThreshold,double);
+    BBTK_DECLARE_INPUT(UpperThreshold,double);
+    BBTK_DECLARE_INPUT(InsideValue,double);
+    BBTK_DECLARE_INPUT(OutsideValue,double);
+    BBTK_DECLARE_OUTPUT(Out,anyImagePointer);
+    BBTK_PROCESS(ProcessSwitch);
+  private :
+    inline void ProcessSwitch();
+    template <class T> void Process();
+  };
+  //===================================================
+
+  
+  //===================================================
+
+  BBTK_BEGIN_DESCRIBE_BLACK_BOX(BinaryThresholdImageFilterGeneric,
+                               bbtk::AtomicBlackBox);
+  BBTK_NAME("BinaryThresholdImageFilter");
+  BBTK_AUTHOR("laurent.guigues at creatis.insa-lyon.fr");
+  BBTK_CATEGORY("filter;image");
+  BBTK_DESCRIPTION("Binarizes an image by thresholding (generic bbification of itk::BinaryThresholdImageFilter)");
+  BBTK_INPUT(BinaryThresholdImageFilterGeneric,In,
+            "Input image. Can be any itk::Image<T,D>*",anyImagePointer,"");
+  BBTK_INPUT(BinaryThresholdImageFilterGeneric,LowerThreshold,
+            "Lower threshold",double,"");
+  BBTK_INPUT(BinaryThresholdImageFilterGeneric,UpperThreshold,
+            "Upper threshold",double,"");
+  BBTK_INPUT(BinaryThresholdImageFilterGeneric,InsideValue,
+            "Output value for pixels inside thresholds",double,"");
+  BBTK_INPUT(BinaryThresholdImageFilterGeneric,OutsideValue,
+            "Output value for pixels outside thresholds",double,"");
+  BBTK_OUTPUT(BinaryThresholdImageFilterGeneric,Out,
+             "Output image. Of the same type and dimension than the input image",
+             anyImagePointer,"");
+  BBTK_END_DESCRIBE_BLACK_BOX(BinaryThresholdImageFilterGeneric);
+  //===================================================
+
+
+
+
+  //===================================================
+
+  void BinaryThresholdImageFilterGeneric::ProcessSwitch()
+  {
+    BBTK_TEMPLATE_ITK_IMAGE_SWITCH(bbGetInputIn().type(), this->Process);
+  }
+  //===================================================
+
+
+  //===================================================
+
+  template <class T> 
+  void BinaryThresholdImageFilterGeneric::Process()
+  {
+    bbtkDebugMessageInc("Core",9,
+                       "bbitk::BinaryThresholdImageFilterGeneric::Process<"
+                       <<bbtk::TypeName<T>()<<">()"<<std::endl);
+    typedef BinaryThresholdImageFilter<T> FilterType;
+    typename FilterType::Pointer f = FilterType::New("Temp");
+         typedef T* TPointer; 
+         f->bbSetInputIn( this->bbGetInputIn().get < TPointer > () );
+    f->bbSetInputLowerThreshold ( (typename T::PixelType)
+                                 this->bbGetInputLowerThreshold() );
+    f->bbSetInputUpperThreshold ( (typename T::PixelType)
+                                 this->bbGetInputUpperThreshold() );
+    f->bbSetInputInsideValue ( (typename T::PixelType)
+                              this->bbGetInputInsideValue() );
+    f->bbSetInputOutsideValue ( (typename T::PixelType)
+                               this->bbGetInputOutsideValue() );
+    f->bbExecute();
+    f->bbGetOutputOut()->Register();
+    this->bbSetOutputOut( f->bbGetOutputOut() );
+
+    bbtkDebugDecTab("Core",9);
+  }
+
+  //===================================================
+
+       
+
+
+       
+
+       
+       
+}
+// EO namespace bbtk
+
+#endif 
index 4f03793e97068436fc516c5847466fefc831ea26..493fae94d2bc543318e62c5a28600635d5e8afdb 100644 (file)
@@ -69,7 +69,6 @@ namespace bbitk
   void ImageReader::Read()
   {
     std::string filename = bbGetInputIn();
-
     itk::ImageIOBase::Pointer genericReader = 
       itk::ImageIOFactory::CreateImageIO(filename.c_str(), 
                                         itk::ImageIOFactory::ReadMode);
@@ -79,9 +78,7 @@ namespace bbitk
       }
     genericReader->SetFileName(filename.c_str());
     genericReader->ReadImageInformation();  
-    
     bbtk::TypeInfo typ = GetITKImagePtrTypeInfoFromPixelTypeInfoAndDimension(genericReader->GetComponentTypeInfo(), genericReader->GetNumberOfDimensions());
-
     BBTK_TEMPLATE_ITK_IMAGE_SWITCH( typ, Read);
   }
 
index f5536350f170c2b0b4b717ebd422d960ce29ed98..f8d3b5c10766b0cb645d05b0401ebfe89c058979 100644 (file)
@@ -83,6 +83,10 @@ namespace bbitk
                        <<bbtk::TypeName<itkImageType>()
                        <<">()"<<std::endl);
 
+    std::cout<<"bbitk::ImageWriter::Write<"
+                       <<bbtk::TypeName<itkImageType>()
+                       <<">()"<<std::endl;
+
     typedef itk::ImageFileWriter< itkImageType > itkWriterType;
     typename itkWriterType::Pointer writer = itkWriterType::New();
     writer->SetInput(bbGetInputIn().unsafe_get<const itkImageType*>());
index 65222c55d1be8dd1c49118c752a9cf68f753b982..da653e691025635a64438390c83ad3f1a4404e86 100644 (file)
@@ -121,11 +121,11 @@ namespace bbitk
     size = LPR.GetSize();
     //    origin = LPR.GetIndex(); //in->GetOrigin();
      for (unsigned int i=0;i<Dimension;++i) 
-      {
-       origin[i] = LPR.GetIndex()[i]*in->GetSpacing()[i];
-       spacing[i] = bbGetInputSpacing()[i];
-       double tmp = (LPR.GetSize()[i]*in->GetSpacing()[i]/spacing[i] ) + 0.5;
-       size[i] = (long)floor(tmp);
+     {
+               origin[i]       = LPR.GetIndex()[i]*in->GetSpacing()[i];
+               spacing[i] = bbGetInputSpacing()[i];
+               double tmp = (LPR.GetSize()[i]*in->GetSpacing()[i]/spacing[i] ) + 0.5;
+               size[i] = (long)floor(tmp);
 //     size[i] = (long)lrint(LPR.GetSize()[i]*in->GetSpacing()[i]/spacing[i]);
        }
    
index 7cbb6323f4bd73511317cb0ed345c613287a3afb..5d8367d5a71f03b9c888537c5b0c99923714c3a3 100644 (file)
@@ -127,6 +127,7 @@ namespace bbstd
   BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,Cast,uint8_t,int8_t);
   BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,Cast,int8_t,uint8_t);
   
+
   //====================================================================
   
 
index f14cd05153301176304d2f14851579d8dc22a06a..f42024a511a4e36acfcd8d43e458a19ed19d7188 100644 (file)
@@ -46,20 +46,20 @@ namespace bbstd
   
   //=================================================================
   // BlackBox declaration
-  template <class T, class U>
+  template < class T, class U >
   class bbstd_EXPORT Cast : public bbtk::AtomicBlackBox
   {  
-    BBTK_TEMPLATE2_BLACK_BOX_INTERFACE(Cast,bbtk::AtomicBlackBox,T,U);
-    BBTK_DECLARE_INPUT(In,T);
-    BBTK_DECLARE_OUTPUT(Out,U);
+    BBTK_TEMPLATE2_BLACK_BOX_INTERFACE(Cast,bbtk::AtomicBlackBox , T , U );
+    BBTK_DECLARE_INPUT(In , T );
+    BBTK_DECLARE_OUTPUT(Out , U );
     BBTK_PROCESS(DoIt);
     void DoIt() {  
       bbtkDebugMessage("Data",5,"bbstd::Cast In  = "
-                      <<bbGetInputIn()<<" <"<<bbtk::HumanTypeName<T>()
+                      << bbGetInputIn() <<" <"<<bbtk::HumanTypeName< T >()
                       <<">"<<std::endl);
-      bbSetOutputOut( static_cast<U>(bbGetInputIn()) );
+      bbSetOutputOut( static_cast< U >(bbGetInputIn()) );
       bbtkDebugMessage("Data",5,"bbstd::Cast Out = "
-                      <<(U)bbGetInputIn()<<" <"<<bbtk::HumanTypeName<U>()
+                      <<( U )bbGetInputIn()<<" <"<<bbtk::HumanTypeName< U >()
                       <<">"<<std::endl);
     }
   };
@@ -71,20 +71,20 @@ namespace bbstd
   //=================================================================
   // BlackBox description
   BBTK_BEGIN_DESCRIBE_TEMPLATE2_BLACK_BOX(Cast,bbtk::AtomicBlackBox);
-  BBTK_NAME("Cast"+bbtk::HumanTypeName<T1>()+"To"+bbtk::HumanTypeName<T2>());
+  BBTK_NAME("Cast"+bbtk::HumanTypeName< T1 >()+"To"+bbtk::HumanTypeName< T2 >());
   BBTK_AUTHOR("laurent.guigues@creatis.insa-lyon.fr");
-  BBTK_DESCRIPTION("Static cast from "+bbtk::HumanTypeName<T1>()+" ("
-                  +bbtk::TypeName<T1>()+") to "+bbtk::HumanTypeName<T2>()
-                  +" ("+bbtk::TypeName<T2>()+")");
+  BBTK_DESCRIPTION("Static cast from "+bbtk::HumanTypeName< T1 >()+" ("
+                  +bbtk::TypeName< T1 >()+") to "+bbtk::HumanTypeName< T2 >()
+                  +" ("+bbtk::TypeName< T2 >()+")");
   BBTK_DEFAULT_ADAPTOR();
-  BBTK_TEMPLATE2_INPUT(Cast,In,"Input",T1);
-  BBTK_TEMPLATE2_OUTPUT(Cast,Out,"Output",T2);
+  BBTK_TEMPLATE2_INPUT(Cast,In,"Input", T1 );
+  BBTK_TEMPLATE2_OUTPUT(Cast,Out,"Output", T2 );
   BBTK_END_DESCRIBE_TEMPLATE2_BLACK_BOX(Cast);
   //=================================================================
 
-  template <class T, class U> void Cast<T,U>::bbUserSetDefaultValues() {}
-  template <class T, class U> void Cast<T,U>::bbUserInitializeProcessing() {}
-  template <class T, class U> void Cast<T,U>::bbUserFinalizeProcessing() {}
+  template <class T, class U> void Cast< T , U >::bbUserSetDefaultValues() {}
+  template <class T, class U> void Cast< T , U >::bbUserInitializeProcessing() {}
+  template <class T, class U> void Cast< T , U >::bbUserFinalizeProcessing() {}
 
 
 } // namespace bbstd
diff --git a/packages/std/src/bbstdCastVector.cxx b/packages/std/src/bbstdCastVector.cxx
new file mode 100644 (file)
index 0000000..51c67d7
--- /dev/null
@@ -0,0 +1,134 @@
+/*
+ # ---------------------------------------------------------------------
+ #
+ # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
+ #                        pour la SantÈ)
+ # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
+ # Previous Authors : Laurent Guigues, Jean-Pierre Roux
+ # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
+ #
+ #  This software is governed by the CeCILL-B license under French law and
+ #  abiding by the rules of distribution of free software. You can  use,
+ #  modify and/ or redistribute the software under the terms of the CeCILL-B
+ #  license as circulated by CEA, CNRS and INRIA at the following URL
+ #  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+ #  or in the file LICENSE.txt.
+ #
+ #  As a counterpart to the access to the source code and  rights to copy,
+ #  modify and redistribute granted by the license, users are provided only
+ #  with a limited warranty  and the software's author,  the holder of the
+ #  economic rights,  and the successive licensors  have only  limited
+ #  liability.
+ #
+ #  The fact that you are presently reading this means that you have had
+ #  knowledge of the CeCILL-B license and that you accept its terms.
+ # ------------------------------------------------------------------------ */
+
+
+/*=========================================================================
+  Program:   bbtk
+  Module:    $RCSfile: bbstdCastVector.cxx,v $
+  Language:  C++
+  Date:      $Date: 2012/11/16 08:51:32 $
+  Version:   $Revision: 1.5 $
+=========================================================================*/
+
+#include "bbstdCastVector.h"
+#include "bbstdPackage.h"
+
+namespace bbstd 
+{
+  
+  //====================================================================
+  BBTK_BLACK_BOX_TEMPLATE2_IMPLEMENTATION(CastVector,
+                                         bbtk::AtomicBlackBox);
+  //====================================================================
+  
+  //====================================================================
+  // Add the instanciated adaptors to the package
+  
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,double,int8_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,int8_t,double);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,double,uint8_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,uint8_t,double);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,double,int16_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,int16_t,double);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,double,uint16_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,uint16_t,double);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,double,int32_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,int32_t,double);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,double,uint32_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,uint32_t,double);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,double,float);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,float,double);
+  
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,bool,double);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,double, bool); 
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,bool,float);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,float, bool);    
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,bool,uint32_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,uint32_t, bool);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,bool,int32_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,int32_t, bool);  
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,bool,uint16_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,uint16_t, bool);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,bool,int16_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,int16_t, bool);  
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,bool,uint8_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,uint8_t, bool);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,bool,int8_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,int8_t, bool);   
+       
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,float,int8_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,int8_t,float);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,float,uint8_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,uint8_t,float);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,float,int16_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,int16_t,float);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,float,uint16_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,uint16_t,float);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,float,int32_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,int32_t,float);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,float,uint32_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,uint32_t,float);
+  
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,int32_t,int8_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,int8_t,int32_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,int32_t,uint8_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,uint8_t,int32_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,int32_t,int16_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,int16_t,int32_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,int32_t,uint16_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,uint16_t,int32_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,int32_t,uint32_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,uint32_t,int32_t);
+  
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,uint32_t,int8_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,int8_t,uint32_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,uint32_t,uint8_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,uint8_t,uint32_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,uint32_t,int16_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,int16_t,uint32_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,uint32_t,uint16_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,uint16_t,uint32_t);
+  
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,uint16_t,int8_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,int8_t,uint16_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,uint16_t,uint8_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,uint8_t,uint16_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,uint16_t,int16_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,int16_t,uint16_t);
+  
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,int16_t,int8_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,int8_t,int16_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,int16_t,uint8_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,uint8_t,int16_t);
+  
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,uint8_t,int8_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,int8_t,uint8_t);
+  
+
+  //====================================================================
+  
+
+} // namespace bbstd
diff --git a/packages/std/src/bbstdCastVector.h b/packages/std/src/bbstdCastVector.h
new file mode 100644 (file)
index 0000000..c7bb20d
--- /dev/null
@@ -0,0 +1,106 @@
+/*
+ # ---------------------------------------------------------------------
+ #
+ # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
+ #                        pour la SantÈ)
+ # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
+ # Previous Authors : Laurent Guigues, Jean-Pierre Roux
+ # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
+ #
+ #  This software is governed by the CeCILL-B license under French law and
+ #  abiding by the rules of distribution of free software. You can  use,
+ #  modify and/ or redistribute the software under the terms of the CeCILL-B
+ #  license as circulated by CEA, CNRS and INRIA at the following URL
+ #  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+ #  or in the file LICENSE.txt.
+ #
+ #  As a counterpart to the access to the source code and  rights to copy,
+ #  modify and redistribute granted by the license, users are provided only
+ #  with a limited warranty  and the software's author,  the holder of the
+ #  economic rights,  and the successive licensors  have only  limited
+ #  liability.
+ #
+ #  The fact that you are presently reading this means that you have had
+ #  knowledge of the CeCILL-B license and that you accept its terms.
+ # ------------------------------------------------------------------------ */
+
+
+/*=========================================================================
+  Program:   bbtk
+  Module:    $RCSfile: bbstdCastVector.h,v $
+  Language:  C++
+  Date:      $Date: 2012/11/16 08:51:32 $
+  Version:   $Revision: 1.8 $
+=========================================================================*/
+
+
+
+#ifndef __bbstdCastVector_h_INCLUDED__
+#define __bbstdCastVector_h_INCLUDED__
+
+#include "bbtkAtomicBlackBox.h"
+#include "bbstd_EXPORT.h"
+#include <vector>
+
+namespace bbstd 
+{
+  
+  //=================================================================
+  // BlackBox declaration
+  template < class T, class U >
+  class bbstd_EXPORT CastVector : public bbtk::AtomicBlackBox
+  {  
+    BBTK_TEMPLATE2_BLACK_BOX_INTERFACE(CastVector,bbtk::AtomicBlackBox , T , U );
+    BBTK_DECLARE_INPUT(In , std::vector<T> );
+    BBTK_DECLARE_OUTPUT(Out , std::vector<U> );
+    BBTK_PROCESS(DoIt);
+    void DoIt() {  
+//      bbtkDebugMessage("Data",5,"bbstd::CastVector In  = "
+//                    << bbGetInputIn() <<" <"<<bbtk::HumanTypeName< T >()
+//                    <<">"<<std::endl);
+//      bbSetOutputOut( static_cast< U >(bbGetInputIn()) );
+
+  bbmOutputOut.clear();
+
+    typename std::vector<T>::const_iterator i;
+    for (i=bbmInputIn.begin();i!=bbmInputIn.end();++i)
+    {
+      bbmOutputOut.push_back( *i );
+    }
+
+
+//      bbtkDebugMessage("Data",5,"bbstd::CastVector Out = "
+//                    <<( U )bbGetInputIn()<<" <"<<bbtk::HumanTypeName< U >()
+//                    <<">"<<std::endl);
+    }
+  };
+  //=================================================================
+  
+  
+  
+  
+  //=================================================================
+  // BlackBox description
+  BBTK_BEGIN_DESCRIBE_TEMPLATE2_BLACK_BOX(CastVector,bbtk::AtomicBlackBox);
+  BBTK_NAME("CastVector"+bbtk::HumanTypeName< T1 >()+"To"+bbtk::HumanTypeName< T2 >());
+  BBTK_AUTHOR("laurent.guigues@creatis.insa-lyon.fr");
+  BBTK_DESCRIPTION("Static CastVector from "+bbtk::HumanTypeName< T1 >()+" ("
+                  +bbtk::TypeName< T1 >()+") to "+bbtk::HumanTypeName< T2 >()
+                  +" ("+bbtk::TypeName< T2 >()+")");
+  BBTK_DEFAULT_ADAPTOR();
+  typedef std::vector<T1> T1vector;
+  BBTK_TEMPLATE2_INPUT(CastVector,In,"Input", T1vector );
+  typedef std::vector<T2> T2vector;
+  BBTK_TEMPLATE2_OUTPUT(CastVector,Out,"Output", T2vector );
+  BBTK_END_DESCRIBE_TEMPLATE2_BLACK_BOX(CastVector);
+  //=================================================================
+
+  template <class T, class U> void CastVector< T , U >::bbUserSetDefaultValues() {}
+  template <class T, class U> void CastVector< T , U >::bbUserInitializeProcessing() {}
+  template <class T, class U> void CastVector< T , U >::bbUserFinalizeProcessing() {}
+
+
+} // namespace bbstd
+
+#endif // __bbstdCastVector_h_INCLUDED__
+  
index f319e374d8ec036d1c03ae7bf91efedb7e175f3e..63beb0c99eb947c43fe20cfddf75de534b9caf7a 100755 (executable)
@@ -77,9 +77,9 @@ namespace bbstd
                  ccommand[i]=34;
         }
       }
-      #if defined(_WIN32)
-           ccommand="start /b "+ccommand;
-      #endif // defined(_WIN32)        
+//      #if defined(_WIN32)
+//         ccommand="start /b "+ccommand;
+//      #endif // defined(_WIN32)      
          std::cout << "*** Executing system command : '"<<ccommand<<"'"<<std::endl;
          
          result = system ( ccommand.c_str() );
diff --git a/packages/std/src/bbstdExit.cxx b/packages/std/src/bbstdExit.cxx
new file mode 100644 (file)
index 0000000..a6a8cd9
--- /dev/null
@@ -0,0 +1,73 @@
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+#include "bbstdExit.h"
+#include "bbstdPackage.h"
+namespace bbstd
+{
+
+BBTK_ADD_BLACK_BOX_TO_PACKAGE(std,Exit)
+BBTK_BLACK_BOX_IMPLEMENTATION(Exit,bbtk::AtomicBlackBox);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void Exit::Process()
+{
+
+// THE MAIN PROCESSING METHOD BODY
+//   Here we simply set the input 'In' value to the output 'Out'
+//   And print out the output value
+// INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
+//    void bbSet{Input|Output}NAME(const TYPE&)
+//    const TYPE& bbGet{Input|Output}NAME() const 
+//    Where :
+//    * NAME is the name of the input/output
+//      (the one provided in the attribute 'name' of the tag 'input')
+//    * TYPE is the C++ type of the input/output
+//      (the one provided in the attribute 'type' of the tag 'input')
+
+//    bbSetOutputOut( bbGetInputIn() );
+//    std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
+  
+       exit( bbGetInputIn() );
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void Exit::bbUserSetDefaultValues()
+{
+
+//  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
+//    Here we initialize the input 'In' to 0
+   bbSetInputIn(0);
+  
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void Exit::bbUserInitializeProcessing()
+{
+
+//  THE INITIALIZATION METHOD BODY :
+//    Here does nothing 
+//    but this is where you should allocate the internal/output pointers 
+//    if any 
+
+  
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void Exit::bbUserFinalizeProcessing()
+{
+
+//  THE FINALIZATION METHOD BODY :
+//    Here does nothing 
+//    but this is where you should desallocate the internal/output pointers 
+//    if any
+  
+}
+}
+// EO namespace bbstd
+
+
diff --git a/packages/std/src/bbstdExit.h b/packages/std/src/bbstdExit.h
new file mode 100644 (file)
index 0000000..2764984
--- /dev/null
@@ -0,0 +1,45 @@
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+#ifndef __bbstdExit_h_INCLUDED__
+#define __bbstdExit_h_INCLUDED__
+#include "bbstd_EXPORT.h"
+#include "bbtkAtomicBlackBox.h"
+#include "iostream"
+
+namespace bbstd
+{
+
+class bbstd_EXPORT Exit
+ : 
+   public bbtk::AtomicBlackBox
+{
+  BBTK_BLACK_BOX_INTERFACE(Exit,bbtk::AtomicBlackBox);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+  BBTK_DECLARE_INPUT(In,int);
+//  BBTK_DECLARE_OUTPUT(Out,double);
+  BBTK_PROCESS(Process);
+  void Process();
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+};
+
+BBTK_BEGIN_DESCRIBE_BLACK_BOX(Exit,bbtk::AtomicBlackBox);
+  BBTK_NAME("Exit");
+  BBTK_AUTHOR("Info-Dev");
+  BBTK_DESCRIPTION("No Description.");
+  BBTK_CATEGORY("empty");
+    BBTK_INPUT(Exit,In,"Exit error",int,"");
+//  BBTK_OUTPUT(Exit,Out,"First output",double,"");
+BBTK_END_DESCRIBE_BLACK_BOX(Exit);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+}
+// EO namespace bbstd
+
+#endif // __bbstdExit_h_INCLUDED__
+
index e8d919cebccaf8c3044abbf892d482ddea6de5d2..e444b9ba1a84291479c94335389004a9c255b16d 100644 (file)
@@ -47,19 +47,21 @@ BBTK_BLACK_BOX_IMPLEMENTATION(FilesFromDirectory,bbtk::AtomicBlackBox);
 
 void FilesFromDirectory::Process()
 {
-   DirName = bbGetInputIn();
-   bool rec = bbGetInputRecursive();
-   /*int nbFiles = */ Explore(DirName, rec);
-   bbSetOutputOut(Filenames);   
-   
-//  for (int i=0; i<Filenames.size(); i++)
-//     std::cout << "Filenames [" << i << "] = [" << Filenames[i] << "]" << std::endl;  
+       Filenames.clear();
+       SimpleFilenames.clear();
+       DirName         = bbGetInputIn();
+       bool rec        = bbGetInputRecursive();
+       /*int nbFiles = */ Explore(DirName, rec);
+       CleanFilenames( DirName );
+       bbSetOutputOut(Filenames);   
+       bbSetOutputOutSimple(SimpleFilenames);   
 }
 
 void FilesFromDirectory::bbUserSetDefaultValues()
 {
     bbSetInputIn(".");
     bbSetInputRecursive(false);  
+    bbSetInputType(0);  
 }
 
 void FilesFromDirectory::bbUserInitializeProcessing() 
@@ -85,7 +87,7 @@ std::string FilesFromDirectory::NormalizePath(std::string const &pathname)
    std::string name = pathname;
    int size = name.size();
 
-   if ( name[size-1] != FILESEPARATOR )
+   if (!((name[size-1]=='/')||(name[size-1]=='\\')))
    {
       name += FILESEPARATOR;
    }
@@ -98,8 +100,269 @@ std::string FilesFromDirectory::NormalizePath(std::string const &pathname)
  * @param  dirpath   directory to explore
  * @param  recursive whether we want recursion or not
  */
+
+
+
 int FilesFromDirectory::Explore(std::string const &dirpath, bool recursive)
 {
+       int numberOfFiles               = 0;
+       std::string dirName     = NormalizePath(dirpath);
+       int tmpNumberOfFiles;
+       std::string fileName;
+#ifdef _MSC_VER
+       WIN32_FIND_DATA fileData;
+       //assert( dirName[dirName.size()-1] == '' );
+       HANDLE hFile = FindFirstFile((dirName+"*").c_str(), &fileData);
+
+       for(BOOL b = (hFile != INVALID_HANDLE_VALUE); b;
+       b = FindNextFile(hFile, &fileData))
+       {
+      fileName = fileData.cFileName;
+      if ( fileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY )
+      {
+         // Need to check for . and .. to avoid infinite loop
+         if ( fileName != "." && fileName != ".." && recursive )
+         {
+                       if (bbGetInputType()==1)
+                       {
+                       std::string temp = dirName+fileName;
+                       Filenames.push_back(temp);       
+                       numberOfFiles++;
+                       } // Type ALL_directories
+
+                       tmpNumberOfFiles        =       Explore(dirName+fileName, recursive);
+                       if ((bbGetInputType()==2)&&tmpNumberOfFiles==0)
+                       {
+                       std::string temp = dirName+fileName;
+                       Filenames.push_back(temp);       
+                       numberOfFiles++;
+                       } // Type Lsast_directories
+                       
+                       numberOfFiles           =       numberOfFiles + tmpNumberOfFiles;
+         } // if recursive
+         if ( fileName != "." && fileName != ".." && !recursive )
+                {
+                       if ((bbGetInputType()==1) || (bbGetInputType()==2))
+                       {
+                       std::string temp = dirName+fileName;
+                       Filenames.push_back(temp);       
+                       numberOfFiles++;
+                       } // Type All_directories
+               }// fileName && !recursive
+      } else  {
+//      std::string temp = "\"" +dirName+fileName + "\"";
+        std::string temp = dirName+fileName;
+
+/*
+        std::string::size_type spacePosition = temp.find_first_of(' ');
+               if (spacePosition != std::string::npos) 
+               {
+                       std::cout << "=========================================== File name : [" <<temp << 
+              "] contains space(s); Discarted !" << std::endl;
+               temp.insert(spacePosition, "\\");
+                       continue;  /// \TODO : fix the trouble (vtk?)
+               } // if !npos
+*/
+
+
+               if (bbGetInputType()==0)
+               {
+                       Filenames.push_back(temp);       
+                       numberOfFiles++;
+               } // Type files
+
+      } // if !directory
+       } // for
+       DWORD dwError = GetLastError();
+       if (hFile != INVALID_HANDLE_VALUE) 
+       {
+               FindClose(hFile);
+       }// hFile
+       if (dwError != ERROR_NO_MORE_FILES) 
+       {
+      LPVOID lpMsgBuf;
+      FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER|
+                    FORMAT_MESSAGE_FROM_SYSTEM|
+                    FORMAT_MESSAGE_IGNORE_INSERTS,
+                    NULL,GetLastError(),
+                    MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
+                    (LPTSTR) &lpMsgBuf,0,NULL);
+
+      //gdcmErrorMacro("FindNextFile error. Error is " << (char *)lpMsgBuf
+      //             <<" for the directory : "<<dirName);
+      return -1;
+       } // dwError
+
+#else
+  // Real POSIX implementation: scandir is a BSD extension only, and doesn't 
+  // work on debian for example
+
+       DIR* dir = opendir( dirName.c_str() );
+       if (!dir)
+       {
+               return 0;
+       }
+
+   // According to POSIX, the dirent structure contains a field char d_name[]
+   // of unspecified size, with at most NAME_MAX characters preceeding the
+   // terminating null character. Use of other fields will harm the  porta-
+   // bility of your programs.
+
+       struct stat     buf;
+       dirent                  *d;
+       for (d = readdir(dir); d; d = readdir(dir))
+       {
+       fileName = dirName + d->d_name;
+       std::string temp = fileName;
+       if( stat(fileName.c_str(), &buf) != 0 )
+       {
+                //gdcmErrorMacro( strerror(errno) );
+       } // stat
+       if ( S_ISREG(buf.st_mode) )    //is it a regular file?
+       {
+               if ( d->d_name[0]!='.')
+               {
+
+/*
+                       std::string::size_type  spacePosition = temp.find_first_of(' ');
+               if (spacePosition != std::string::npos)
+                       {
+                                       std::cout << "=========================================== File name : [" <<temp << 
+                               "] contains space(s); Discarted !" << std::endl;
+                       temp.insert(spacePosition, "\\");
+                                       continue;   /// \TODO : fix the trouble (vtk?)
+               } // if spacePosition
+*/
+
+                               if (bbGetInputType()==0)
+                               {
+                       Filenames.push_back(temp);       
+                               numberOfFiles++;
+                               } // Type files
+               } // d_name
+       } else if ( S_ISDIR(buf.st_mode) ) {  //directory?
+               if ( (d->d_name[0]!='.') && recursive ) //we also skip hidden files
+               {
+                               if (bbGetInputType()==1)
+                               {
+                       Filenames.push_back(fileName);   
+                               numberOfFiles++;
+                               } // Type All_directories
+
+                               tmpNumberOfFiles        = Explore( fileName, recursive);
+                               if ((bbGetInputType()==2)&&tmpNumberOfFiles==0)
+                               {
+                                       Filenames.push_back(fileName);   
+                               numberOfFiles++;
+                               } // Type Lsast_directories
+                       numberOfFiles           = numberOfFiles+tmpNumberOfFiles;
+               }// d_name && recursive
+               if ( (d->d_name[0]!='.') && !recursive ) { //we also skip hidden files
+                               if ((bbGetInputType()==1) || (bbGetInputType()==2))
+                               {
+                       Filenames.push_back(fileName);   
+                               numberOfFiles++;
+                               } // Type All_directories
+                       
+                       }// d_name && !recursive
+
+               } else {
+               //gdcmErrorMacro( "Unexpected error" );
+               return -1;
+       } // Regular FILE
+   }
+   if( closedir(dir) != 0 )
+   {
+      //gdcmErrorMacro( strerror(errno) );
+   }// closedir
+#endif
+
+
+       return numberOfFiles;
+}
+
+
+//------------------------------------------------------------------------------
+void FilesFromDirectory::CleanFilenames( std::string basePath )
+{
+       std::string tmpString;
+       int i,ii,sizeFilenames = Filenames.size();
+       int j,sizeFileEnd = bbGetInputFileEnd().size();
+
+       int okEraseElement;
+       
+//Selecting just the files in the FileEnd List
+       if (bbGetInputFileEnd().size()!=0)
+       {
+               for (i=sizeFilenames-1; i>=0; i--)
+               {
+                       okEraseElement=0;
+                       for (j=0; j<sizeFileEnd; j++)
+                       {
+                               std::string tmp=Filenames[i].substr( (Filenames[i].length()) - (bbGetInputFileEnd()[j]).length() ) ;
+                               if (bbGetInputFileEnd()[j].compare( tmp )==0 )
+                               {
+                                       okEraseElement++;
+                               } // if FileEnd
+                       } // for j                                      
+
+                       if (okEraseElement==0) 
+                       { 
+                               Filenames.erase( Filenames.begin()+i );
+                       }
+               } // for i      
+       } // if FileEnd !=0
+
+       sizeFilenames = Filenames.size();
+
+// Cleanning paths with spaces 
+       for (i=0; i<sizeFilenames; i++)
+       {
+               tmpString=Filenames[i];
+
+               std::string::size_type  spacePosition = tmpString.find_first_of(' ');
+               if (spacePosition != std::string::npos)
+               {
+                       std::cout << "=========================================== File name : [" <<tmpString << 
+               "] contains space(s); Discarted !" << std::endl;
+                       tmpString.insert(spacePosition, "\\");
+                       Filenames[i]=tmpString;
+//                     continue;   /// \TODO : fix the trouble (vtk?)
+               } // if spacePosition
+       }
+
+
+// Alphabetical order  
+       for (i=0; i<sizeFilenames; i++)
+       {
+       for (ii=i; ii<sizeFilenames; ii++)
+               {
+                       if (Filenames[i]>Filenames[ii]) 
+               {
+                       tmpString=Filenames[i];
+                       Filenames[i]=Filenames[ii];
+                       Filenames[ii]=tmpString;
+               } // if 
+       } // for ii
+       } // for i
+
+// Creating SimpleFilenames
+       unsigned int lenghtBasePath = basePath.length();
+       for (i=0; i<sizeFilenames; i++)
+       {
+               SimpleFilenames.push_back( Filenames[i].substr( lenghtBasePath ) );
+       } // for i
+
+}
+
+
+
+
+/*
+
+int FilesFromDirectory::Explore(std::string const &dirpath, bool recursive)
+{
+   Filenames.clear();
    int numberOfFiles = 0;
    std::string fileName;
    std::string dirName = NormalizePath(dirpath);
@@ -122,7 +385,8 @@ int FilesFromDirectory::Explore(std::string const &dirpath, bool recursive)
       }
       else
       {
-         std::string temp = "\"" +dirName+fileName + "\"";
+//         std::string temp = "\"" +dirName+fileName + "\"";
+         std::string temp = dirName+fileName;
          std::string::size_type spacePosition = temp.find_first_of(' ');
                 if (spacePosition != std::string::npos) 
         {
@@ -183,7 +447,7 @@ int FilesFromDirectory::Explore(std::string const &dirpath, bool recursive)
          if ( d->d_name[0]!='.')
          {
         
-             std::string::size_type /* long int */ spacePosition = temp.find_first_of(' ');
+             std::string::size_type  spacePosition = temp.find_first_of(' ');
              if (spacePosition != std::string::npos)
             {
    std::cout << "=========================================== File name : [" <<temp << 
@@ -214,9 +478,24 @@ int FilesFromDirectory::Explore(std::string const &dirpath, bool recursive)
    }
 #endif
 
+  std::string tmpString;
+  int i,ii,sizeFilenames = Filenames.size();
+  for (i=0; i<sizeFilenames; i++)
+  {
+    for (ii=i; ii<sizeFilenames; ii++)
+    {
+       if (Filenames[i]>Filenames[ii]) 
+        {
+          tmpString=Filenames[i];
+          Filenames[i]=Filenames[ii];
+          Filenames[ii]=tmpString;
+        } // if 
+    } // for ii
+  } // for i
+
   return numberOfFiles;
 }
-
+*/
 
 }
 // EO namespace bbstd
index 2d49d33d208813a7f563c2eed9546b545555ea0a..852e83b529ac9c603daa477c6d5eb9e4d9c51b07 100644 (file)
@@ -41,16 +41,21 @@ namespace bbstd
     BBTK_BLACK_BOX_INTERFACE(FilesFromDirectory,bbtk::AtomicBlackBox);
     BBTK_DECLARE_INPUT(In,std::string);
     BBTK_DECLARE_INPUT(Recursive,bool);  
+    BBTK_DECLARE_INPUT(Type,int);  
+    BBTK_DECLARE_INPUT(FileEnd,std::vector<std::string>);  
     BBTK_DECLARE_OUTPUT(Out,std::vector<std::string>);
+    BBTK_DECLARE_OUTPUT(OutSimple,std::vector<std::string>);
     BBTK_PROCESS(Process);
     void Process();
     
   private :
     std::string NormalizePath(std::string const &pathname);
-    int Explore(std::string const &dirpath, bool recursive);
-    
+    int        Explore(std::string const &dirpath, bool recursive);
+    void       CleanFilenames( std::string basePath );
+
     /// List of file names
     std::vector<std::string> Filenames;
+    std::vector<std::string> SimpleFilenames;
     /// name of the root directory to explore
     std::string DirName;
   };
@@ -58,14 +63,19 @@ namespace bbstd
   //=================================================================
   // BlackBox description
   BBTK_BEGIN_DESCRIBE_BLACK_BOX(FilesFromDirectory,bbtk::AtomicBlackBox);
-  BBTK_NAME("FilesFromDirectory");
-  BBTK_AUTHOR("jpr@creatis.univ-lyon1.fr");
-  BBTK_DESCRIPTION("returns the fullPathNames of the files in a Directory");
-  BBTK_CATEGORY("");
-  BBTK_INPUT(FilesFromDirectory,In,"Directory Name",std::string,"");
-  BBTK_INPUT(FilesFromDirectory,Recursive,"Recursive directory exploration",bool,"");
+   BBTK_NAME("FilesFromDirectory");
+   BBTK_AUTHOR("jpr@creatis.univ-lyon1.fr");
+   BBTK_DESCRIPTION("returns the fullPathNames of the files in a Directory");
+   BBTK_CATEGORY("");
+
+   BBTK_INPUT(FilesFromDirectory,In,"Directory Name",std::string,"");
+   BBTK_INPUT(FilesFromDirectory,Recursive,"Recursive directory exploration",bool,"");
+   BBTK_INPUT(FilesFromDirectory,Type,"0=files 1=All_directories 2=last_directories  (0 default)",int,"");
+   BBTK_INPUT(FilesFromDirectory,FileEnd,"Select just the files with this end file name",std::vector<std::string>,"");
   
-  BBTK_OUTPUT(FilesFromDirectory,Out,"FullPathNames of the files",std::vector<std::string>,"");
+   BBTK_OUTPUT(FilesFromDirectory,Out,"FullPathNames of the files",std::vector<std::string>,"");
+   BBTK_OUTPUT(FilesFromDirectory,OutSimple,"Simple Full PathNames of the files",std::vector<std::string>,"");
+
   BBTK_END_DESCRIBE_BLACK_BOX(FilesFromDirectory);
 
 }
diff --git a/packages/std/src/bbstdGetBBTKinfo.cxx b/packages/std/src/bbstdGetBBTKinfo.cxx
new file mode 100644 (file)
index 0000000..ff99d44
--- /dev/null
@@ -0,0 +1,72 @@
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+#include "bbstdGetBBTKinfo.h"
+#include "bbstdPackage.h"
+namespace bbstd
+{
+
+BBTK_ADD_BLACK_BOX_TO_PACKAGE(std,GetBBTKinfo)
+BBTK_BLACK_BOX_IMPLEMENTATION(GetBBTKinfo,bbtk::AtomicBlackBox);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void GetBBTKinfo::Process()
+{
+
+// THE MAIN PROCESSING METHOD BODY
+//   Here we simply set the input 'In' value to the output 'Out'
+//   And print out the output value
+// INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
+//    void bbSet{Input|Output}NAME(const TYPE&)
+//    const TYPE& bbGet{Input|Output}NAME() const 
+//    Where :
+//    * NAME is the name of the input/output
+//      (the one provided in the attribute 'name' of the tag 'input')
+//    * TYPE is the C++ type of the input/output
+//      (the one provided in the attribute 'type' of the tag 'input')
+//    bbSetOutputOut( bbGetInputIn() );
+//    std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
+     bbSetOutputExecPath( bbtk::Utilities::GetExecutablePath() );
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void GetBBTKinfo::bbUserSetDefaultValues()
+{
+//  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
+//    Here we initialize the input 'In' to 0
+//   bbSetInputIn(0);
+  
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void GetBBTKinfo::bbUserInitializeProcessing()
+{
+
+//  THE INITIALIZATION METHOD BODY :
+//    Here does nothing 
+//    but this is where you should allocate the internal/output pointers 
+//    if any 
+
+  
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void GetBBTKinfo::bbUserFinalizeProcessing()
+{
+
+//  THE FINALIZATION METHOD BODY :
+//    Here does nothing 
+//    but this is where you should desallocate the internal/output pointers 
+//    if any
+  
+}
+}
+// EO namespace bbstd
+
+
diff --git a/packages/std/src/bbstdGetBBTKinfo.h b/packages/std/src/bbstdGetBBTKinfo.h
new file mode 100644 (file)
index 0000000..252dcc2
--- /dev/null
@@ -0,0 +1,45 @@
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+#ifndef __bbstdGetBBTKinfo_h_INCLUDED__
+#define __bbstdGetBBTKinfo_h_INCLUDED__
+#include "bbstd_EXPORT.h"
+#include "bbtkAtomicBlackBox.h"
+#include "iostream"
+
+namespace bbstd
+{
+
+class bbstd_EXPORT GetBBTKinfo
+ : 
+   public bbtk::AtomicBlackBox
+{
+  BBTK_BLACK_BOX_INTERFACE(GetBBTKinfo,bbtk::AtomicBlackBox);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+//  BBTK_DECLARE_INPUT(In,double);
+  BBTK_DECLARE_OUTPUT(ExecPath,std::string);
+  BBTK_PROCESS(Process);
+  void Process();
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+};
+
+BBTK_BEGIN_DESCRIBE_BLACK_BOX(GetBBTKinfo,bbtk::AtomicBlackBox);
+  BBTK_NAME("GetBBTKinfo");
+  BBTK_AUTHOR("InfoDev");
+  BBTK_DESCRIPTION("No Description.");
+  BBTK_CATEGORY("empty");
+//  BBTK_INPUT(GetBBTKinfo,In,"First input",double,"");
+  BBTK_OUTPUT(GetBBTKinfo,ExecPath,"Executable path",std::string,"");
+BBTK_END_DESCRIBE_BLACK_BOX(GetBBTKinfo);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+}
+// EO namespace bbstd
+
+#endif // __bbstdGetBBTKinfo_h_INCLUDED__
+
diff --git a/packages/std/src/bbstdGetSubVector.cxx b/packages/std/src/bbstdGetSubVector.cxx
new file mode 100644 (file)
index 0000000..ec48c05
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+ # ---------------------------------------------------------------------
+ #
+ # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
+ #                        pour la SantÈ)
+ # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
+ # Previous Authors : Laurent Guigues, Jean-Pierre Roux
+ # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
+ #
+ #  This software is governed by the CeCILL-B license under French law and
+ #  abiding by the rules of distribution of free software. You can  use,
+ #  modify and/ or redistribute the software under the terms of the CeCILL-B
+ #  license as circulated by CEA, CNRS and INRIA at the following URL
+ #  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+ #  or in the file LICENSE.txt.
+ #
+ #  As a counterpart to the access to the source code and  rights to copy,
+ #  modify and redistribute granted by the license, users are provided only
+ #  with a limited warranty  and the software's author,  the holder of the
+ #  economic rights,  and the successive licensors  have only  limited
+ #  liability.
+ #
+ #  The fact that you are presently reading this means that you have had
+ #  knowledge of the CeCILL-B license and that you accept its terms.
+ # ------------------------------------------------------------------------ */
+
+
+/*=========================================================================
+  Program:   bbtk
+  Module:    $RCSfile: bbstdGetVectorElement.cxx,v $
+  Language:  C++
+  Date:      $Date: 2012/11/16 08:51:32 $
+  Version:   $Revision: 1.4 $
+=========================================================================*/
+
+
+#include "bbstdGetSubVector.h"
+#include "bbstdPackage.h"
+
+
+namespace bbstd
+{
+  //====================================================================
+  BBTK_BLACK_BOX_TEMPLATE_IMPLEMENTATION(GetSubVector,
+                                        bbtk::AtomicBlackBox);
+  //====================================================================
+
+  //====================================================================
+  // Add the specialized boxes to the package
+
+  BBTK_ADD_TEMPLATE_BLACK_BOX_TO_PACKAGE(std,GetSubVector,int8_t);
+  BBTK_ADD_TEMPLATE_BLACK_BOX_TO_PACKAGE(std,GetSubVector,uint8_t);
+  BBTK_ADD_TEMPLATE_BLACK_BOX_TO_PACKAGE(std,GetSubVector,int16_t);
+  BBTK_ADD_TEMPLATE_BLACK_BOX_TO_PACKAGE(std,GetSubVector,uint16_t);
+  BBTK_ADD_TEMPLATE_BLACK_BOX_TO_PACKAGE(std,GetSubVector,int32_t);
+  BBTK_ADD_TEMPLATE_BLACK_BOX_TO_PACKAGE(std,GetSubVector,uint32_t);
+  ///\todo : diff between uint32_t and long?
+  BBTK_ADD_TEMPLATE_BLACK_BOX_TO_PACKAGE(std,GetSubVector,long);
+  BBTK_ADD_TEMPLATE_BLACK_BOX_TO_PACKAGE(std,GetSubVector,float);
+  BBTK_ADD_TEMPLATE_BLACK_BOX_TO_PACKAGE(std,GetSubVector,double);
+  typedef std::string string;
+  BBTK_ADD_TEMPLATE_BLACK_BOX_TO_PACKAGE(std,GetSubVector,string);
+  //====================================================================
+
+} // namespace bbstd
diff --git a/packages/std/src/bbstdGetSubVector.h b/packages/std/src/bbstdGetSubVector.h
new file mode 100644 (file)
index 0000000..a2cf2e8
--- /dev/null
@@ -0,0 +1,135 @@
+/*
+ # ---------------------------------------------------------------------
+ #
+ # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
+ #                        pour la SantÈ)
+ # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
+ # Previous Authors : Laurent Guigues, Jean-Pierre Roux
+ # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
+ #
+ #  This software is governed by the CeCILL-B license under French law and
+ #  abiding by the rules of distribution of free software. You can  use,
+ #  modify and/ or redistribute the software under the terms of the CeCILL-B
+ #  license as circulated by CEA, CNRS and INRIA at the following URL
+ #  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+ #  or in the file LICENSE.txt.
+ #
+ #  As a counterpart to the access to the source code and  rights to copy,
+ #  modify and redistribute granted by the license, users are provided only
+ #  with a limited warranty  and the software's author,  the holder of the
+ #  economic rights,  and the successive licensors  have only  limited
+ #  liability.
+ #
+ #  The fact that you are presently reading this means that you have had
+ #  knowledge of the CeCILL-B license and that you accept its terms.
+ # ------------------------------------------------------------------------ */
+
+
+/*=========================================================================
+  Program:   bbtk
+  Module:    $RCSfile: bbstdGetVectorElement.h,v $
+  Language:  C++
+  Date:      $Date: 2012/11/16 08:51:32 $
+  Version:   $Revision: 1.9 $
+=========================================================================*/
+
+
+#ifndef __bbstdGetSubVector_INCLUDED_h__
+#define __bbstdGetSubVector_INCLUDED_h__
+
+#include "bbtkAtomicBlackBox.h"
+#include "bbstd_EXPORT.h"
+
+namespace bbstd
+{
+  //=================================================================
+  // BlackBox declaration
+  template <class T>
+  class bbstd_EXPORT GetSubVector : public bbtk::AtomicBlackBox
+  {
+    BBTK_TEMPLATE_BLACK_BOX_INTERFACE(GetSubVector,bbtk::AtomicBlackBox,T);
+    BBTK_DECLARE_INPUT(In,std::vector<T>);
+    BBTK_DECLARE_INPUT(I,int);
+    BBTK_DECLARE_INPUT(Size,int);
+       BBTK_DECLARE_INPUT(ErrorValue,T);
+    BBTK_DECLARE_OUTPUT(Out,std::vector<T>);
+    BBTK_PROCESS(DoIt);
+    void DoIt();
+  };
+  //=================================================================
+
+  //=================================================================
+  // BlackBox description
+  BBTK_BEGIN_DESCRIBE_TEMPLATE_BLACK_BOX(GetSubVector,bbtk::AtomicBlackBox);
+  BBTK_NAME("Get"+bbtk::HumanTypeName<std::vector<T> >()+"SubVector");
+  BBTK_AUTHOR("info-dev@creatis.insa-lyon.fr");
+ // BBTK_DEFAULT_ADAPTOR();
+  BBTK_DESCRIPTION("Gets the i-th element from the input vector ("+bbtk::TypeName<std::vector<T> >());
+  typedef std::vector<T> Tvector;
+  BBTK_TEMPLATE_INPUT(GetSubVector, In,"Input",Tvector);
+  BBTK_TEMPLATE_INPUT(GetSubVector, I, "Input",int);
+  BBTK_TEMPLATE_INPUT(GetSubVector, Size, "Input",int);
+  BBTK_TEMPLATE_INPUT(GetSubVector, ErrorValue, "ErrorValue",T);
+  BBTK_TEMPLATE_OUTPUT(GetSubVector,Out,"Output",Tvector);
+  BBTK_END_DESCRIBE_TEMPLATE_BLACK_BOX(GetSubVector);
+  //=================================================================
+
+  //=================================================================
+  template <class T>
+  void GetSubVector<T>::DoIt()
+  {
+       int i,iStart,iEnd;
+       bool ok =       true;
+       iStart  =       bbGetInputI();                                  
+       iEnd    =       bbGetInputI() + bbGetInputSize() - 1;  
+       if ((iStart<0) || (iEnd<0))                     { ok=false; }
+       if (iStart>(int)bbGetInputIn().size() ) { ok=false; }
+       if (iEnd>=(int)bbGetInputIn().size() )  { ok=false; }
+
+
+
+       std::vector<T> tmpVectResult;
+       if  ( (ok==true) && (bbGetInputSize()>=1) )
+       {       
+               for ( i=iStart ; i<=iEnd ; i++)
+               {
+                       if ( i<(int)bbGetInputIn().size() ) 
+                       {
+                               tmpVectResult.push_back( bbGetInputIn()[i] );
+                       } // if InputI+i
+
+               }// for
+       } else {
+               tmpVectResult.push_back( bbGetInputErrorValue() );
+       } // if
+       bbSetOutputOut( tmpVectResult );
+
+  }
+  //=================================================================
+
+  //=================================================================  
+  template <class T>
+  void GetSubVector<T>::bbUserSetDefaultValues()
+  {
+
+  }
+  //=================================================================
+  //=================================================================  
+  template <class T>
+  void GetSubVector<T>::bbUserInitializeProcessing()
+  {
+
+  }
+  //=================================================================
+  //=================================================================  
+  template <class T>
+  void GetSubVector<T>::bbUserFinalizeProcessing()
+  {
+
+  }
+  //=================================================================
+
+} // namespace bbstd
+
+#endif //__bbstdGetSubVector_INCLUDED_h__
+
index 621ad34469ced668275104743167d6057a0711dd..a15847032ad6749478ddd2a96441fd4e96e5a0af 100644 (file)
@@ -76,7 +76,7 @@ namespace bbstd
   template <class T>
   void GetVectorElement<T>::DoIt()
   {
-         if (( bbGetInputI() < bbGetInputIn().size() )  &&  ( bbGetInputI() >= 0 ) )
+         if (( bbGetInputI() < (int)bbGetInputIn().size() )  &&  ( bbGetInputI() >= 0 ) )
          {
                  bbSetOutputOut( bbGetInputIn()[bbGetInputI()] );
          } else {
index d8205fb39ea9b79881ee8fe34b31fc0e493dc46e..1a66b5cab35cd605d5813b498bd14fd6b0136083 100644 (file)
@@ -41,19 +41,43 @@ using namespace bbtk;
 namespace bbstd
 {
 
+       void MagicBox::bbComputePostProcessStatus()
+       {
+       AtomicBlackBox::bbComputePostProcessStatus();
+
+       if (bbGetInputActive()==false)
+       {
+               // Update the output statuses
+               IOStatus new_output_status = UPTODATE;
+               OutputConnectorMapType::iterator o;
+               for ( o = bbGetOutputConnectorMap().begin(); o!= bbGetOutputConnectorMap().end(); ++o) 
+               {
+                       o->second->SetStatus(new_output_status);
+               } // for o
+       } // if
+
+  }
+
 
   void MagicBox::bbUserSetDefaultValues()
   {
+       bbSetInputActive(true);
   }
+
   void MagicBox::bbUserInitializeProcessing() 
   { 
   }
+
   void  MagicBox::bbUserFinalizeProcessing() 
   {
   }
+
   void MagicBox::DoProcess()
   { 
-    bbSetOutputOut( bbGetInputIn() );
+       if (bbGetInputActive()==true)
+       {
+               bbSetOutputOut( bbGetInputIn() );
+       } // Active
   }
 
   BBTK_ADD_BLACK_BOX_TO_PACKAGE(std,MagicBox);
index 47d7c9c40fbe8b5b5360fc168937c5b922a1d035..1f3b6e4ed6d6553b4a9fbd6b7323767def46e511 100644 (file)
@@ -50,9 +50,12 @@ namespace bbstd
   {
     BBTK_BLACK_BOX_INTERFACE(MagicBox,bbtk::AtomicBlackBox);
     BBTK_DECLARE_INPUT(In,bbtk::Data);
+    BBTK_DECLARE_INPUT(Active,bool);
     BBTK_DECLARE_OUTPUT(Out,bbtk::Data);
     BBTK_PROCESS(DoProcess);
     void DoProcess();
+
+    virtual void bbComputePostProcessStatus();
  };
   //==================================================================
   
@@ -114,6 +117,9 @@ namespace bbstd
     (&MagicBox::bbGetInputIn),
     new MagicBoxSetFunctor (&MagicBox::bbSetInputIn) ) );
 
+  BBTK_INPUT(MagicBox, Active, "Active True/False (default True)",bool,"");  
+
+
   AddOutputDescriptor
   (new bbtk::AtomicBlackBoxOutputDescriptor
    (typeid(MagicBoxDescriptor),
diff --git a/packages/std/src/bbstdMathOperation.cxx b/packages/std/src/bbstdMathOperation.cxx
new file mode 100644 (file)
index 0000000..fdedc10
--- /dev/null
@@ -0,0 +1,130 @@
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+#include "bbstdMathOperation.h"
+#include "bbstdPackage.h"
+
+#include <math.h>
+#include <stdlib.h>
+#include <time.h>
+
+namespace bbstd
+{
+
+
+BBTK_ADD_BLACK_BOX_TO_PACKAGE(std,MathOperation)
+BBTK_BLACK_BOX_IMPLEMENTATION(MathOperation,bbtk::AtomicBlackBox);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void MathOperation::Process()
+{
+
+// THE MAIN PROCESSING METHOD BODY
+//   Here we simply set the input 'In' value to the output 'Out'
+//   And print out the output value
+// INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
+//    void bbSet{Input|Output}NAME(const TYPE&)
+//    const TYPE& bbGet{Input|Output}NAME() const 
+//    Where :
+//    * NAME is the name of the input/output
+//      (the one provided in the attribute 'name' of the tag 'input')
+//    * TYPE is the C++ type of the input/output
+//      (the one provided in the attribute 'type' of the tag 'input')
+
+        if (firsttime==true)
+        {
+               firsttime=false;
+      /* initialize random seed: */ 
+             srand (time(NULL));
+               if (bbGetInputType()==7) acum=bbGetInputIn1();
+        }
+
+    if (bbGetInputType()==0) 
+       { 
+               bbSetOutputOut( bbGetInputIn1() +  bbGetInputIn2() ); 
+       }
+    if (bbGetInputType()==1) bbSetOutputOut( bbGetInputIn1() -  bbGetInputIn2() );
+    if (bbGetInputType()==2) bbSetOutputOut( bbGetInputIn1() *  bbGetInputIn2() );
+
+    if (bbGetInputType()==3)
+    {
+                       if (bbGetInputIn2()!=0)  bbSetOutputOut( bbGetInputIn1() /  bbGetInputIn2() );
+              else  bbSetOutputOut( 99999999 );
+    }
+
+    if (bbGetInputType()==4) bbSetOutputOut( sqrt( bbGetInputIn1() ) );
+
+    if (bbGetInputType()==5)
+        {
+               if (bbGetInputIn1()>0)  bbSetOutputOut( log( bbGetInputIn1() ) );
+              else  bbSetOutputOut( -99999999 );
+        }
+
+    if (bbGetInputType()==6) bbSetOutputOut( exp( bbGetInputIn1() ) );
+    if (bbGetInputType()==7)
+        {
+               if ( back_acum_In1!=bbGetInputIn1() ) acum=bbGetInputIn1();
+               if (acum<bbGetInputIn1()) acum=bbGetInputIn1();
+               bbSetOutputOut( acum );
+               acum++;
+               if (acum>bbGetInputIn2()) acum=bbGetInputIn1();
+               back_acum_In1=bbGetInputIn1();
+        }
+    if (bbGetInputType()==8 ) bbSetOutputOut( rand() %  (int) (bbGetInputIn2()-bbGetInputIn1()) +  bbGetInputIn1() );
+    if (bbGetInputType()==9 ) bbSetOutputOut( sin( bbGetInputIn1() ) );
+    if (bbGetInputType()==10) bbSetOutputOut( cos( bbGetInputIn1() ) );
+    if (bbGetInputType()==11) bbSetOutputOut( tan( bbGetInputIn1() ) );
+    if (bbGetInputType()==12) bbSetOutputOut( asin( bbGetInputIn1() ) );
+    if (bbGetInputType()==13) bbSetOutputOut( acos( bbGetInputIn1() ) );
+    if (bbGetInputType()==14) bbSetOutputOut( atan( bbGetInputIn1() ) );
+    if (bbGetInputType()==15) bbSetOutputOut( atan2( bbGetInputIn1(),bbGetInputIn2() ) );
+    if (bbGetInputType()==16) bbSetOutputOut( std::min( bbGetInputIn1(),bbGetInputIn2() )  );
+    if (bbGetInputType()==17) bbSetOutputOut( std::max( bbGetInputIn1(),bbGetInputIn2() )  );
+    if (bbGetInputType()==18) bbSetOutputOut( fabs( bbGetInputIn1() ) );
+    if (bbGetInputType()==19) bbSetOutputOut(  (int)bbGetInputIn1() % (int)bbGetInputIn2() );
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void MathOperation::bbUserSetDefaultValues()
+{
+
+//  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
+//    Here we initialize the input 'In' to 0
+   bbSetInputIn1(0);
+   bbSetInputIn2(0);
+   bbSetInputType(0);
+
+   firsttime=true;
+   acum=0;
+}
+
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void MathOperation::bbUserInitializeProcessing()
+{
+
+//  THE INITIALIZATION METHOD BODY :
+//    Here does nothing 
+//    but this is where you should allocate the internal/output pointers 
+//    if any 
+}
+
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void MathOperation::bbUserFinalizeProcessing()
+{
+//  THE FINALIZATION METHOD BODY :
+//    Here does nothing 
+//    but this is where you should desallocate the internal/output pointers 
+//    if any  
+}
+
+}// EO namespace bbstd
+
+
diff --git a/packages/std/src/bbstdMathOperation.h b/packages/std/src/bbstdMathOperation.h
new file mode 100644 (file)
index 0000000..097545e
--- /dev/null
@@ -0,0 +1,56 @@
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+#ifndef __bbstdMathOperation_h_INCLUDED__
+#define __bbstdMathOperation_h_INCLUDED__
+#include "bbstd_EXPORT.h"
+#include "bbtkAtomicBlackBox.h"
+#include "iostream"
+
+namespace bbstd
+{
+
+class bbstd_EXPORT MathOperation
+ : 
+   public bbtk::AtomicBlackBox
+{
+  BBTK_BLACK_BOX_INTERFACE(MathOperation,bbtk::AtomicBlackBox);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+  BBTK_DECLARE_INPUT(In1,double);
+  BBTK_DECLARE_INPUT(In2,double);
+  BBTK_DECLARE_INPUT(Type,int);
+  BBTK_DECLARE_OUTPUT(Out,double);
+  BBTK_PROCESS(Process);
+  void Process();
+
+  bool firsttime;
+  double acum;
+  double back_acum_In1;
+  double back_acum_In2;
+
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+};
+
+BBTK_BEGIN_DESCRIBE_BLACK_BOX(MathOperation,bbtk::AtomicBlackBox);
+  BBTK_NAME("MathOperation");
+  BBTK_AUTHOR("InfoDev");
+  BBTK_DESCRIPTION("Out = In1 <operation> In2");
+  BBTK_CATEGORY("empty");
+  BBTK_INPUT(MathOperation,In1,"First input",double,"");
+  BBTK_INPUT(MathOperation,In2,"Second input",double,"");
+  BBTK_INPUT(MathOperation,Type,"Type (defalult 0): 0  adition (default), 1 sustraction In1-In2, 2 multiplication In1*In2, 3 divisiuon In1/In2, 4 sqrt In1, 5 log In1, 6 exp In1, 7 incremental int [In1..In2], 8 random int [In1..In2], 9 sin In1-rad, 10 cos In1-rad, 11 tan In1-rad, 12 asin In 1, 13 acos In1, 14 atan In1, 15 atan2 In1 In2 , 16 min, 17 max, 18 abs In1, 19 module In1%In2 ",int,"");
+
+  BBTK_OUTPUT(MathOperation,Out,"Output",double,"");
+BBTK_END_DESCRIBE_BLACK_BOX(MathOperation);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+}
+// EO namespace bbstd
+
+#endif // __bbstdMathOperation_h_INCLUDED__
+
diff --git a/packages/std/src/bbstdMathOperationVector.cxx b/packages/std/src/bbstdMathOperationVector.cxx
new file mode 100644 (file)
index 0000000..454311f
--- /dev/null
@@ -0,0 +1,464 @@
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+#include "bbstdMathOperationVector.h"
+#include "bbstdPackage.h"
+
+#include <math.h>
+#include <time.h>
+
+namespace bbstd
+{
+
+BBTK_ADD_BLACK_BOX_TO_PACKAGE(std,MathOperationVector)
+BBTK_BLACK_BOX_IMPLEMENTATION(MathOperationVector,bbtk::AtomicBlackBox);
+
+double MathOperationVector::g(std::vector<double>*v,unsigned int i,double defValue )
+{
+       double result=defValue;
+       if (i < (*v).size()) 
+       {
+               result= (*v)[i];
+       }
+       return result;
+}
+
+void MathOperationVector::SumVector(std::vector<double> *v,std::vector<double> *vr)
+{
+       unsigned int i;
+       double tmpResult=0;
+       unsigned int sizeVec=v->size(); 
+       if ( sizeVec>0) 
+       { 
+               for (i=0;i<sizeVec;i++) 
+               { 
+                       tmpResult = (*v)[i] + tmpResult; 
+               } // for i 
+               vr->push_back( tmpResult ); 
+       } // if sizeVec
+}
+
+
+void MathOperationVector::MinVector(std::vector<double> *v,std::vector<double> *vr)
+{
+       unsigned int i;
+       double tmpResult;               
+       unsigned int sizeVec=v->size(); 
+       if ( sizeVec>0) 
+       { 
+               tmpResult=(*v)[0];
+               for (i=1;i<sizeVec;i++) 
+               { 
+                       tmpResult = std::min ( (*v)[i] , tmpResult ) ; 
+               } // for i 
+               vr->push_back( tmpResult ); 
+       } // if sizeVec
+}
+
+
+void MathOperationVector::MaxVector(std::vector<double> *v,std::vector<double> *vr)
+{
+       unsigned int i;
+       double tmpResult;               
+       unsigned int sizeVec=v->size(); 
+       if ( sizeVec>0) 
+       { 
+               tmpResult=(*v)[0];
+               for (i=1;i<sizeVec;i++) 
+               { 
+                       tmpResult = std::max ( (*v)[i] , tmpResult ) ; 
+               } // for i 
+               vr->push_back( tmpResult ); 
+       } // if sizeVec
+}
+
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void MathOperationVector::Process()
+{
+// THE MAIN PROCESSING METHOD BODY
+//   Here we simply set the input 'In' value to the output 'Out'
+//   And print out the output value
+// INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
+//    void bbSet{Input|Output}NAME(const TYPE&)
+//    const TYPE& bbGet{Input|Output}NAME() const 
+//    Where :
+//    * NAME is the name of the input/output
+//      (the one provided in the attribute 'name' of the tag 'input')
+//    * TYPE is the C++ type of the input/output
+//      (the one provided in the attribute 'type' of the tag 'input')
+
+       bool error;
+       unsigned int i;
+       unsigned int sizeVec = bbGetInputIn0().size();
+       double tmpResult;
+       std::vector<double> resultVec;
+       std::vector<double> _v0=bbGetInputIn0();
+       std::vector<double> _v1=bbGetInputIn1();
+       std::vector<double> _v2=bbGetInputIn2();
+       std::vector<double> _v3=bbGetInputIn3();
+       std::vector<double> _v4=bbGetInputIn4();
+       std::vector<double> _v5=bbGetInputIn5();
+       std::vector<double> _v6=bbGetInputIn6();
+       std::vector<double> _v7=bbGetInputIn7();
+       std::vector<double> _v8=bbGetInputIn8();
+       std::vector<double> _v9=bbGetInputIn9();
+
+       std::vector<double> *v0 = &_v0;
+       std::vector<double> *v1 = &_v1;
+       std::vector<double> *v2 = &_v2;
+       std::vector<double> *v3 = &_v3;
+       std::vector<double> *v4 = &_v4;
+       std::vector<double> *v5 = &_v5;
+       std::vector<double> *v6 = &_v6;
+       std::vector<double> *v7 = &_v7;
+       std::vector<double> *v8 = &_v8;
+       std::vector<double> *v9 = &_v9;
+
+       double minTmp;          
+       double maxTmp;          
+
+        if (firsttime==true)
+        {
+               firsttime=false;
+        /* initialize random seed: */ 
+       srand (time(NULL));
+               if (bbGetInputType()==7) 
+               {
+                       for (i=0;i<sizeVec;i++)
+                       {
+                               acum.push_back(bbGetInputIn0()[i]);
+                       } // for
+               } // if 7
+        } // if firsttime
+
+
+    if (bbGetInputType()==0) 
+       {
+               for (i=0;i<sizeVec;i++)
+               {
+                       tmpResult = g(v0,i,0) + g(v1,i,0) + g(v2,i,0) + g(v3,i,0) +
+                                               g(v4,i,0) + g(v5,i,0) + g(v6,i,0) + 
+                                               g(v7,i,0) + g(v8,i,0) + g(v9,i,0) ;
+                       resultVec.push_back( tmpResult );
+               } // for i
+               bbSetOutputOut( resultVec );
+       } // if Type 0
+
+    if (bbGetInputType()==-99) 
+       {
+               SumVector(v0,&resultVec);
+               SumVector(v1,&resultVec);
+               SumVector(v2,&resultVec);
+               SumVector(v3,&resultVec);
+               SumVector(v4,&resultVec);
+               SumVector(v5,&resultVec);
+               SumVector(v6,&resultVec);
+               SumVector(v7,&resultVec);
+               SumVector(v8,&resultVec);
+               SumVector(v9,&resultVec);
+
+               bbSetOutputOut( resultVec );
+       } // if Type -99
+
+
+
+    if (bbGetInputType()==1)
+       {
+               for (i=0;i<sizeVec;i++)
+               {
+                       tmpResult = g(v0,i,0) - g(v1,i,0) - g(v2,i,0) - g(v3,i,0) -
+                                               g(v4,i,0) - g(v5,i,0) - g(v6,i,0) -
+                                               g(v7,i,0) - g(v8,i,0) - g(v9,i,0) ;
+                       resultVec.push_back( tmpResult );
+               } // for i
+               bbSetOutputOut( resultVec );
+       } // if Type 1  
+
+
+    if (bbGetInputType()==2) 
+       {
+               for (i=0;i<sizeVec;i++)
+               {
+                       tmpResult = g(v0,i,0) * g(v1,i,1) * g(v2,i,1) * g(v3,i,1) *
+                                               g(v4,i,1) * g(v5,i,1) * g(v6,i,1) *
+                                               g(v7,i,1) * g(v8,i,1) * g(v9,i,1) ;
+                       resultVec.push_back( tmpResult );
+               } // for i
+               bbSetOutputOut( resultVec );
+       } // if Type 2
+
+
+
+    if (bbGetInputType()==3)
+    {
+               error = false;
+               for (i=0;i<sizeVec;i++)
+               {
+            if (g(v1,i,1)!=0) tmpResult = g(v0,i,0) / g(v1,i,1); else error=true;
+            if (g(v2,i,1)!=0) tmpResult = tmpResult / g(v2,i,1); else error=true;
+            if (g(v3,i,1)!=0) tmpResult = tmpResult / g(v3,i,1); else error=true;
+            if (g(v4,i,1)!=0) tmpResult = tmpResult / g(v4,i,1); else error=true;
+            if (g(v5,i,1)!=0) tmpResult = tmpResult / g(v5,i,1); else error=true;
+            if (g(v6,i,1)!=0) tmpResult = tmpResult / g(v6,i,1); else error=true;
+            if (g(v7,i,1)!=0) tmpResult = tmpResult / g(v7,i,1); else error=true;
+            if (g(v8,i,1)!=0) tmpResult = tmpResult / g(v8,i,1); else error=true;
+            if (g(v9,i,1)!=0) tmpResult = tmpResult / g(v9,i,1); else error=true;
+                       if (error==true)  tmpResult = 99999;
+                       resultVec.push_back( tmpResult );
+               } // for i
+               bbSetOutputOut( resultVec );
+    } // if Type 3
+
+
+    if (bbGetInputType()==4)
+       { 
+               for (i=0;i<sizeVec;i++)
+               {
+               if (bbGetInputIn0()[i]>=0) tmpResult = sqrt( bbGetInputIn0()[i] ) ;
+               else  tmpResult = 0 ;
+                       resultVec.push_back( tmpResult );
+               } // for i
+               bbSetOutputOut( resultVec );
+       } // if Type 4
+
+
+    if (bbGetInputType()==5)
+        {
+               for (i=0;i<sizeVec;i++)
+               {
+               if (bbGetInputIn0()[i]>0)  tmpResult = log( bbGetInputIn0()[i] ) ;
+               else  tmpResult = -99999 ; 
+                       resultVec.push_back( tmpResult );
+               } // for i
+               bbSetOutputOut( resultVec );
+        } // if Type 5
+
+
+
+    if (bbGetInputType()==6)
+       {
+               for (i=0;i<sizeVec;i++)
+               {
+                       resultVec.push_back(  exp( bbGetInputIn0()[i] )  );
+               } // for i
+               bbSetOutputOut( resultVec );
+       } // Type 6
+
+
+    if (bbGetInputType()==7)
+       {
+               bbSetOutputOut( acum );
+               for (i=0;i<sizeVec;i++)
+               {
+                       acum[i]++;
+               if (acum[i]>g(v1,i,0)) acum[i]=g(v0,i,0);
+               } // for
+       } // if Type 7
+
+    if (bbGetInputType()==8 )
+       {
+               for (i=0;i<sizeVec;i++)
+               {
+                       resultVec.push_back(  rand() % (int)( g(v1,i,0)-g(v0,i,0) ) + g(v0,i,0) );
+               } // for i
+               bbSetOutputOut( resultVec );
+       } // Type 8
+
+    if (bbGetInputType()==9)
+       {
+               for (i=0;i<sizeVec;i++)
+               {
+                       resultVec.push_back(  sin(  bbGetInputIn0()[i] )  );
+               } // for i
+               bbSetOutputOut( resultVec );
+       } // Type 9
+
+    if (bbGetInputType()==10)
+       {
+               for (i=0;i<sizeVec;i++)
+               {
+                       resultVec.push_back(  cos(  bbGetInputIn0()[i] )  );
+               } // for i
+               bbSetOutputOut( resultVec );
+       } // Type 10
+
+    if (bbGetInputType()==11)
+       {
+               for (i=0;i<sizeVec;i++)
+               {
+                       resultVec.push_back(  tan(  bbGetInputIn0()[i] )  );
+               } // for i
+               bbSetOutputOut( resultVec );
+       } // Type 11
+
+    if (bbGetInputType()==12)
+       {
+               for (i=0;i<sizeVec;i++)
+               {
+                       resultVec.push_back(  asin(  bbGetInputIn0()[i] )  );
+               } // for i
+               bbSetOutputOut( resultVec );
+       } // Type 12
+
+    if (bbGetInputType()==13)
+       {
+               for (i=0;i<sizeVec;i++)
+               {
+                       resultVec.push_back(  acos(  bbGetInputIn0()[i] )  );
+               } // for i
+               bbSetOutputOut( resultVec );
+       } // Type 13
+
+    if (bbGetInputType()==14)
+       {
+               for (i=0;i<sizeVec;i++)
+               {
+                       resultVec.push_back(  atan(  bbGetInputIn0()[i] )  );
+               } // for i
+               bbSetOutputOut( resultVec );
+       } // Type 14
+
+    if (bbGetInputType()==15)
+       {
+               for (i=0;i<sizeVec;i++)
+               {
+                       resultVec.push_back(  atan2(  g(v0,i,0) , g(v1,i,0) )  );
+               } // for i
+               bbSetOutputOut( resultVec );
+       } // Type 15
+
+
+    if (bbGetInputType()==16)
+       {
+               for (i=0;i<sizeVec;i++)
+               {
+                       minTmp = std::min(  g(v0,i,999999) , g(v1,i,999999) );
+                       minTmp = std::min(  g(v2,i,999999) , minTmp );
+                       minTmp = std::min(  g(v3,i,999999) , minTmp );
+                       minTmp = std::min(  g(v4,i,999999) , minTmp );
+                       minTmp = std::min(  g(v5,i,999999) , minTmp );
+                       minTmp = std::min(  g(v6,i,999999) , minTmp );
+                       minTmp = std::min(  g(v7,i,999999) , minTmp );
+                       minTmp = std::min(  g(v8,i,999999) , minTmp );
+                       minTmp = std::min(  g(v9,i,999999) , minTmp );
+                       resultVec.push_back( minTmp );
+               } // for i
+               bbSetOutputOut( resultVec );
+       } // Type 16
+
+    if (bbGetInputType()==-16)
+       {
+               MinVector(v0,&resultVec);
+               MinVector(v1,&resultVec);
+               MinVector(v2,&resultVec);
+               MinVector(v3,&resultVec);
+               MinVector(v4,&resultVec);
+               MinVector(v5,&resultVec);
+               MinVector(v6,&resultVec);
+               MinVector(v7,&resultVec);
+               MinVector(v8,&resultVec);
+               MinVector(v9,&resultVec);
+
+               bbSetOutputOut( resultVec );
+       } // Type -16
+
+    if (bbGetInputType()==17)
+       {
+               for (i=0;i<sizeVec;i++)
+               {
+                       maxTmp = std::max(  g(v0,i,-999999) , g(v1,i,-999999) );
+                       maxTmp = std::max(  g(v2,i,-999999) , maxTmp );
+                       maxTmp = std::max(  g(v3,i,-999999) , maxTmp );
+                       maxTmp = std::max(  g(v4,i,-999999) , maxTmp );
+                       maxTmp = std::max(  g(v5,i,-999999) , maxTmp );
+                       maxTmp = std::max(  g(v6,i,-999999) , maxTmp );
+                       maxTmp = std::max(  g(v7,i,-999999) , maxTmp );
+                       maxTmp = std::max(  g(v8,i,-999999) , maxTmp );
+                       maxTmp = std::max(  g(v9,i,-999999) , maxTmp );
+                       resultVec.push_back(  maxTmp  );
+               } // for i
+               bbSetOutputOut( resultVec );
+       } // Type 17
+
+
+    if (bbGetInputType()==-17)
+       {
+               MaxVector(v0,&resultVec);
+               MaxVector(v1,&resultVec);
+               MaxVector(v2,&resultVec);
+               MaxVector(v3,&resultVec);
+               MaxVector(v4,&resultVec);
+               MaxVector(v5,&resultVec);
+               MaxVector(v6,&resultVec);
+               MaxVector(v7,&resultVec);
+               MaxVector(v8,&resultVec);
+               MaxVector(v9,&resultVec);
+               bbSetOutputOut( resultVec );
+       } // Type -17
+
+
+    if (bbGetInputType()==18)
+       {
+               for (i=0;i<sizeVec;i++)
+               {
+                       resultVec.push_back(  fabs( bbGetInputIn0()[i] )  );
+               } // for i
+               bbSetOutputOut( resultVec );
+       } // Type 18
+
+    if (bbGetInputType()==19)
+       {
+               for (i=0;i<sizeVec;i++)
+               {
+                       resultVec.push_back(   (int)bbGetInputIn0()[i] % (int)bbGetInputIn1()[i]   );
+               } // for i
+               bbSetOutputOut( resultVec );
+       } // Type 18
+
+}
+
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void MathOperationVector::bbUserSetDefaultValues()
+{
+
+//  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
+//    Here we initialize the input 'In' to 0
+
+   bbSetInputType(0);
+   firsttime=true;
+  
+
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void MathOperationVector::bbUserInitializeProcessing()
+{
+
+//  THE INITIALIZATION METHOD BODY :
+//    Here does nothing 
+//    but this is where you should allocate the internal/output pointers 
+//    if any 
+
+  
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void MathOperationVector::bbUserFinalizeProcessing()
+{
+
+//  THE FINALIZATION METHOD BODY :
+//    Here does nothing 
+//    but this is where you should desallocate the internal/output pointers 
+//    if any
+  
+}
+}
+// EO namespace bbstd
+
+
diff --git a/packages/std/src/bbstdMathOperationVector.h b/packages/std/src/bbstdMathOperationVector.h
new file mode 100644 (file)
index 0000000..7801557
--- /dev/null
@@ -0,0 +1,78 @@
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+#ifndef __bbstdMathOperationVector_h_INCLUDED__
+#define __bbstdMathOperationVector_h_INCLUDED__
+#include "bbstd_EXPORT.h"
+#include "bbtkAtomicBlackBox.h"
+#include "iostream"
+
+namespace bbstd
+{
+
+class bbstd_EXPORT MathOperationVector
+ : 
+   public bbtk::AtomicBlackBox
+{
+  BBTK_BLACK_BOX_INTERFACE(MathOperationVector,bbtk::AtomicBlackBox);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+  BBTK_DECLARE_INPUT(In0,std::vector <double>);
+  BBTK_DECLARE_INPUT(In1,std::vector <double>);
+  BBTK_DECLARE_INPUT(In2,std::vector <double>);
+  BBTK_DECLARE_INPUT(In3,std::vector <double>);
+  BBTK_DECLARE_INPUT(In4,std::vector <double>);
+  BBTK_DECLARE_INPUT(In5,std::vector <double>);
+  BBTK_DECLARE_INPUT(In6,std::vector <double>);
+  BBTK_DECLARE_INPUT(In7,std::vector <double>);
+  BBTK_DECLARE_INPUT(In8,std::vector <double>);
+  BBTK_DECLARE_INPUT(In9,std::vector <double>);
+  BBTK_DECLARE_INPUT(Type,int);
+  BBTK_DECLARE_OUTPUT(Out,std::vector <double>);
+  BBTK_PROCESS(Process);
+  void Process();
+
+  bool firsttime;
+  std::vector<double> acum;
+
+  double       g(std::vector<double>*v,unsigned int i,double defValue );
+  void                 SumVector(std::vector<double> *v,std::vector<double> *vr);
+  void                 MinVector(std::vector<double> *v,std::vector<double> *vr);
+  void                 MaxVector(std::vector<double> *v,std::vector<double> *vr);
+
+
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+};
+
+BBTK_BEGIN_DESCRIBE_BLACK_BOX(MathOperationVector,bbtk::AtomicBlackBox);
+  BBTK_NAME("MathOperationVector");
+  BBTK_AUTHOR("Info-Dev");
+  BBTK_DESCRIPTION("Out[i] = In0[i] <operation> In1[i]  <operation> In2[i] ... In8[i] <operation> In9[i]");
+  BBTK_CATEGORY("empty");
+
+  BBTK_INPUT(MathOperationVector,In0,"Input vector 0",std::vector<double>,"");
+  BBTK_INPUT(MathOperationVector,In1,"Input vector 1",std::vector<double>,"");
+  BBTK_INPUT(MathOperationVector,In2,"Input vector 2",std::vector<double>,"");
+  BBTK_INPUT(MathOperationVector,In3,"Input vector 3",std::vector<double>,"");
+  BBTK_INPUT(MathOperationVector,In4,"Input vector 4",std::vector<double>,"");
+  BBTK_INPUT(MathOperationVector,In5,"Input vector 5",std::vector<double>,"");
+  BBTK_INPUT(MathOperationVector,In6,"Input vector 6",std::vector<double>,"");
+  BBTK_INPUT(MathOperationVector,In7,"Input vector 7",std::vector<double>,"");
+  BBTK_INPUT(MathOperationVector,In8,"Input vector 8",std::vector<double>,"");
+  BBTK_INPUT(MathOperationVector,In9,"Input vector 9",std::vector<double>,"");
+  BBTK_INPUT(MathOperationVector,Type,"Type (defalult 0): 0  adition (default) In0[i]+In1[i]+..+In9[i], -99 adition In0[i] In1[i] ... In[9], 1 sustraction In0[i]-In1[i]-..-In9[i], 2 multiplication In0[i]*In2[i]*...*In9[i], 3 division In0/In1/.../In9, 4 sqrt In1, 5 log10 In1, 6 exp In1, 7 incremental int [In0..In1], 8 random int [In0..In1], 9 (rad) sin In0, 10 (rad) cos In0, 11 tan (rad) In0, 12 asin In0, 13 acos In0, 14 atan In0, 15 atan2 In0 In1 , 16 min (In0[i],In1[i]..In9[i]), -16 min(In0) min(In1) ... min(In9) , 17 max (In0[i],In1[i]..In9[i]), -17 max(In0) max(In1) ... max(In9) , 18 abs In0 , 19 module In0[i]%In1[i]  " ,int,"");
+
+  BBTK_OUTPUT(MathOperationVector,Out,"Output vector",std::vector<double>,"");
+
+BBTK_END_DESCRIBE_BLACK_BOX(MathOperationVector);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+}
+// EO namespace bbstd
+
+#endif // __bbstdMathOperationVector_h_INCLUDED__
+
diff --git a/packages/std/src/bbstdRandomString.cxx b/packages/std/src/bbstdRandomString.cxx
new file mode 100644 (file)
index 0000000..733617e
--- /dev/null
@@ -0,0 +1,97 @@
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+#include "bbstdRandomString.h"
+#include "bbstdPackage.h"
+#include "time.h"
+
+namespace bbstd
+{
+
+BBTK_ADD_BLACK_BOX_TO_PACKAGE(std,RandomString)
+BBTK_BLACK_BOX_IMPLEMENTATION(RandomString,bbtk::AtomicBlackBox);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+
+
+static const char alphanum[] =
+"0123456789"
+//"!@#$%^&*"
+"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+"abcdefghijklmnopqrstuvwxyz";
+
+/*
+char genRandom()
+{
+}
+*/
+
+void RandomString::Process()
+{
+
+// THE MAIN PROCESSING METHOD BODY
+//   Here we simply set the input 'In' value to the output 'Out'
+//   And print out the output value
+// INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
+//    void bbSet{Input|Output}NAME(const TYPE&)
+//    const TYPE& bbGet{Input|Output}NAME() const 
+//    Where :
+//    * NAME is the name of the input/output
+//      (the one provided in the attribute 'name' of the tag 'input')
+//    * TYPE is the C++ type of the input/output
+//      (the one provided in the attribute 'type' of the tag 'input')
+//    bbSetOutputOut( bbGetInputIn() );
+//    std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
+
+    int stringLength = sizeof(alphanum) - 1;
+    srand(time(NULL));
+    std::string STR;
+    for(unsigned int i = 0; i < 8; ++i)
+    {
+           STR += alphanum[rand() % stringLength];
+    }
+        bbSetOutputOut( STR );
+printf("EED RandomString::Process randomString=%s\n",STR.c_str());
+}
+
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void RandomString::bbUserSetDefaultValues()
+{
+
+//  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
+//    Here we initialize the input 'In' to 0
+//   bbSetInputIn(0);
+  
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void RandomString::bbUserInitializeProcessing()
+{
+
+//  THE INITIALIZATION METHOD BODY :
+//    Here does nothing 
+//    but this is where you should allocate the internal/output pointers 
+//    if any 
+
+  
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void RandomString::bbUserFinalizeProcessing()
+{
+
+//  THE FINALIZATION METHOD BODY :
+//    Here does nothing 
+//    but this is where you should desallocate the internal/output pointers 
+//    if any
+  
+}
+}
+// EO namespace bbstd
+
+
diff --git a/packages/std/src/bbstdRandomString.h b/packages/std/src/bbstdRandomString.h
new file mode 100644 (file)
index 0000000..ec81a6b
--- /dev/null
@@ -0,0 +1,45 @@
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+#ifndef __bbstdRandomString_h_INCLUDED__
+#define __bbstdRandomString_h_INCLUDED__
+#include "bbstd_EXPORT.h"
+#include "bbtkAtomicBlackBox.h"
+#include "iostream"
+
+namespace bbstd
+{
+
+class bbstd_EXPORT RandomString
+ : 
+   public bbtk::AtomicBlackBox
+{
+  BBTK_BLACK_BOX_INTERFACE(RandomString,bbtk::AtomicBlackBox);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+//  BBTK_DECLARE_INPUT(In,double);
+  BBTK_DECLARE_OUTPUT(Out,std::string);
+  BBTK_PROCESS(Process);
+  void Process();
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+};
+
+BBTK_BEGIN_DESCRIBE_BLACK_BOX(RandomString,bbtk::AtomicBlackBox);
+  BBTK_NAME("RandomString");
+  BBTK_AUTHOR("InfoDev");
+  BBTK_DESCRIPTION("No Description.");
+  BBTK_CATEGORY("empty");
+//  BBTK_INPUT(RandomString,In,"First input",double,"");
+  BBTK_OUTPUT(RandomString,Out,"Output random string [8]",std::string,"");
+BBTK_END_DESCRIBE_BLACK_BOX(RandomString);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+}
+// EO namespace bbstd
+
+#endif // __bbstdRandomString_h_INCLUDED__
+
index c74a39fd1ff6e68a03059648200135ad841ce4b2..ca3dd76be41105337377f09a2f51270f0f0a1959 100644 (file)
@@ -39,21 +39,17 @@ BBTK_BLACK_BOX_IMPLEMENTATION(ReadColumnsDouble,bbtk::AtomicBlackBox);
 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
 //===== 
 void ReadColumnsDouble::Process()
-{
-       printf("EED ReadColumnsDouble::Process start \n");
-       
-       std::vector< std::vector<double> * > tlst;
-       
+{      
+       std::vector< std::vector<double> * > tlst;      
        int i;
        for( i=0 ;  i<bbGetInputDimension() ; i++)
        {
                tlst.push_back( new std::vector<double> );
        }       
-       
        int numberOfLines = 0;
-       char tmpValue[50];
+       char tmpValue[1000];
        std::vector<double> *vecData;
-       FILE *ff1 = fopen( bbGetInputFileName().c_str() , "r+" );
+       FILE *ff1 = fopen( bbGetInputFileName().c_str() , "r" );
        if (ff1!=NULL)
        {
                 if (!feof(ff1))
@@ -89,11 +85,6 @@ void ReadColumnsDouble::Process()
        i=13; if (i<=bbGetInputDimension()) { bbSetOutputlstData13( *(tlst[i-1]) ); }
        i=14; if (i<=bbGetInputDimension()) { bbSetOutputlstData14( *(tlst[i-1]) ); }
        i=15; if (i<=bbGetInputDimension()) { bbSetOutputlstData15( *(tlst[i-1]) ); }
-       
-       
-       printf("EED ReadColumnsDouble::Process end \n");
-       
-       
 }
 //===== 
 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
index ec1452b70c32fc528c37a9a63e664de831c936a4..5a0c08a9fc9226431a55c08fee049c2afae95b9c 100644 (file)
@@ -40,37 +40,35 @@ BBTK_BLACK_BOX_IMPLEMENTATION(ReadColumnsInt,bbtk::AtomicBlackBox);
 //===== 
 void ReadColumnsInt::Process()
 {
-       printf("EED ReadColumnsDouble::Process start \n");
-       
-       std::vector< std::vector<int> * > tlst;
-       
+       std::vector< std::vector<int> * > tlst; 
        int i;
        for( i=0 ;  i<bbGetInputDimension() ; i++)
        {
                tlst.push_back( new std::vector<int> );
        }       
-       
        int numberOfLines = 0;
-       char tmpValue[50];
+       char tmpValue[1000];
        std::vector<int> *vecData;
-       FILE *ff1 = fopen( bbGetInputFileName().c_str() , "r+" );
+       FILE *ff1 = fopen( bbGetInputFileName().c_str() , "r" );
        if (ff1!=NULL)
        {
+                if (!feof(ff1))
+                        fscanf(ff1,"%s",tmpValue);
+
                while (!feof(ff1))
                {
                        for( i=0 ;  i<bbGetInputDimension() ; i++)
                        {
-                               fscanf(ff1,"%s",tmpValue);
                                vecData=tlst[i];
                                vecData->push_back( atoi(tmpValue) );
+                               fscanf(ff1,"%s",tmpValue);
                        }       
                        numberOfLines++;                        
                }       
                fclose(ff1);
        } else {   // else ff1
-               printf("bbcreaMaracasVisuReadAxisTree3D::Process  ...Error... reading file InputFileName_Points>%s", bbGetInputFileName().c_str() );
+               printf("ReadColumnsDouble::Process  ...Error... reading file FileName <%s>\n", bbGetInputFileName().c_str() );
        } //ff1 
-       
        i=1; if (i<=bbGetInputDimension()) { bbSetOutputlstData1( *(tlst[i-1]) ); }
        i=2; if (i<=bbGetInputDimension()) { bbSetOutputlstData2( *(tlst[i-1]) ); }
        i=3; if (i<=bbGetInputDimension()) { bbSetOutputlstData3( *(tlst[i-1]) ); }
@@ -79,10 +77,7 @@ void ReadColumnsInt::Process()
        i=6; if (i<=bbGetInputDimension()) { bbSetOutputlstData6( *(tlst[i-1]) ); }
        i=7; if (i<=bbGetInputDimension()) { bbSetOutputlstData7( *(tlst[i-1]) ); }
        i=8; if (i<=bbGetInputDimension()) { bbSetOutputlstData8( *(tlst[i-1]) ); }
-       i=9; if (i<=bbGetInputDimension()) { bbSetOutputlstData9( *(tlst[i-1]) ); }
-       
-       printf("EED ReadColumnsDouble::Process end \n");
-       
+       i=9; if (i<=bbGetInputDimension()) { bbSetOutputlstData9( *(tlst[i-1]) ); }     
 }
 //===== 
 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
index 63c14c79711072ed968c9701cb9be97b8203ebe1..2860219d384957e978256e26e9ff3744bc0c10a8 100644 (file)
@@ -44,23 +44,24 @@ BBTK_BLACK_BOX_IMPLEMENTATION(ReadColumnsString,bbtk::AtomicBlackBox);
 //===== 
 void ReadColumnsString::Process()
 {
-
-       printf("EED ReadColumnsString::Process start \n");
-       
-       std::vector< std::vector<std::string> * > tlst;
-       
+       std::vector< std::vector<std::string> * > tlst; 
        int i;
        for( i=0 ;  i<bbGetInputDimension() ; i++)
        {
                tlst.push_back( new std::vector<std::string> );
        }       
-       
+       int iSkipLines;
        int numberOfLines = 0;
-       char tmpValue[50];
+       char tmpValue[500];
        std::vector<std::string> *vecData;
-       FILE *ff1 = fopen( bbGetInputFileName().c_str() , "r+" );
+       FILE *ff1 = fopen( bbGetInputFileName().c_str() , "r" );
        if (ff1!=NULL)
        {
+               for (iSkipLines=0;iSkipLines<bbGetInputSkipLines(); iSkipLines++ )
+       {
+               fgets( tmpValue , 500, ff1 ); 
+       }
+
                while (!feof(ff1))
                {
                        for( i=0 ;  i<bbGetInputDimension() ; i++)
@@ -70,7 +71,6 @@ void ReadColumnsString::Process()
                                fscanf(ff1,"%s ",tmpValue);
                                vecData=tlst[i];
                                vecData->push_back( tmpValue );
-                                       printf("*******************************************EC ReadColumnsString::Last Value: %s \n",tmpValue);
                        }       
                        numberOfLines++;                        
                }       
@@ -89,8 +89,6 @@ void ReadColumnsString::Process()
        i=8; if (i<=bbGetInputDimension()) { bbSetOutputlstData8( *(tlst[i-1]) ); }
        i=9; if (i<=bbGetInputDimension()) { bbSetOutputlstData9( *(tlst[i-1]) ); }
        
-       printf("EED ReadColumnsString::Process end \n");
-       
 }
 //===== 
 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
@@ -100,6 +98,7 @@ void ReadColumnsString::bbUserSetDefaultValues()
 
 //  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
 //    Here we initialize the input 'In' to 0
+       bbSetInputSkipLines(0); 
        bbSetInputDimension(1); 
        bbSetInputFileName(""); 
   
index 09197bc3dd011e47c8811b882ce390d3e71a06ea..47f18e97d3594519ec4c12d65bc525766a0515fa 100644 (file)
@@ -46,6 +46,7 @@ class bbstd_EXPORT ReadColumnsString
 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
 //===== 
        BBTK_DECLARE_INPUT(FileName,std::string);
+       BBTK_DECLARE_INPUT(SkipLines,int);      
        BBTK_DECLARE_INPUT(Dimension,int);      
        
        BBTK_DECLARE_OUTPUT(lstData1,std::vector<std::string> );
@@ -72,6 +73,7 @@ BBTK_BEGIN_DESCRIBE_BLACK_BOX(ReadColumnsString,bbtk::AtomicBlackBox);
        BBTK_DESCRIPTION("Read Columns from a text file");
        BBTK_CATEGORY("read/write");
        BBTK_INPUT(ReadColumnsString,FileName,"File name of Points",std::string,"");
+       BBTK_INPUT(ReadColumnsString,SkipLines,"(default 0) - Number of lines to be skipe before read data",int,"");
        BBTK_INPUT(ReadColumnsString,Dimension,"(default 1) - The number of columns of the file",int,"");
        
        BBTK_OUTPUT(ReadColumnsString,lstData1,"vector of data",std::vector<std::string>,"");
diff --git a/packages/std/src/bbstdReadLinesString.cxx b/packages/std/src/bbstdReadLinesString.cxx
new file mode 100644 (file)
index 0000000..86c1068
--- /dev/null
@@ -0,0 +1,85 @@
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+#include "bbstdReadLinesString.h"
+#include "bbstdPackage.h"
+namespace bbstd
+{
+
+BBTK_ADD_BLACK_BOX_TO_PACKAGE(std,ReadLinesString)
+BBTK_BLACK_BOX_IMPLEMENTATION(ReadLinesString,bbtk::AtomicBlackBox);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void ReadLinesString::Process()
+{
+
+// THE MAIN PROCESSING METHOD BODY
+//   Here we simply set the input 'In' value to the output 'Out'
+//   And print out the output value
+// INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
+//    void bbSet{Input|Output}NAME(const TYPE&)
+//    const TYPE& bbGet{Input|Output}NAME() const 
+//    Where :
+//    * NAME is the name of the input/output
+//      (the one provided in the attribute 'name' of the tag 'input')
+//    * TYPE is the C++ type of the input/output
+//      (the one provided in the attribute 'type' of the tag 'input')
+
+  
+       std::vector<std::string> lstResult;
+//     FILE *ff = fopen(bbGetInputFileName().c_str(),"r+");
+//     if (ff!=NULL)
+//     {
+               std::ifstream file( bbGetInputFileName().c_str() );
+               std::string str; 
+               while (std::getline(file, str))
+               {
+                       lstResult.push_back(str);
+               }
+               bbSetOutputOut(lstResult);
+//             fclose(ff);
+//     } // if
+
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void ReadLinesString::bbUserSetDefaultValues()
+{
+
+//  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
+//    Here we initialize the input 'In' to 0
+
+//   bbSetInputFileName("");
+  
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void ReadLinesString::bbUserInitializeProcessing()
+{
+
+//  THE INITIALIZATION METHOD BODY :
+//    Here does nothing 
+//    but this is where you should allocate the internal/output pointers 
+//    if any 
+
+  
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void ReadLinesString::bbUserFinalizeProcessing()
+{
+
+//  THE FINALIZATION METHOD BODY :
+//    Here does nothing 
+//    but this is where you should desallocate the internal/output pointers 
+//    if any
+  
+}
+}
+// EO namespace bbstd
+
+
diff --git a/packages/std/src/bbstdReadLinesString.h b/packages/std/src/bbstdReadLinesString.h
new file mode 100644 (file)
index 0000000..2b8c32b
--- /dev/null
@@ -0,0 +1,47 @@
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+#ifndef __bbstdReadLinesString_h_INCLUDED__
+#define __bbstdReadLinesString_h_INCLUDED__
+#include "bbstd_EXPORT.h"
+#include "bbtkAtomicBlackBox.h"
+#include "iostream"
+
+namespace bbstd
+{
+
+class bbstd_EXPORT ReadLinesString
+ : 
+   public bbtk::AtomicBlackBox
+{
+  BBTK_BLACK_BOX_INTERFACE(ReadLinesString,bbtk::AtomicBlackBox);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+  BBTK_DECLARE_INPUT(FileName,std::string);
+  BBTK_DECLARE_OUTPUT(Out,std::vector<std::string>);
+  BBTK_PROCESS(Process);
+  void Process();
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+};
+
+BBTK_BEGIN_DESCRIBE_BLACK_BOX(ReadLinesString,bbtk::AtomicBlackBox);
+  BBTK_NAME("ReadLinesString");
+  BBTK_AUTHOR("Info-Dev");
+  BBTK_DESCRIPTION("No Description.");
+  BBTK_CATEGORY("empty");
+  BBTK_INPUT(ReadLinesString,FileName,"FileName",std::string,"");
+  BBTK_OUTPUT(ReadLinesString,Out,"Vector of Strings",std::vector<std::string>,"");
+
+BBTK_END_DESCRIBE_BLACK_BOX(ReadLinesString);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+}
+// EO namespace bbstd
+
+#endif // __bbstdReadLinesString_h_INCLUDED__
+
diff --git a/packages/std/src/bbstdReplaceString.cxx b/packages/std/src/bbstdReplaceString.cxx
new file mode 100644 (file)
index 0000000..9975048
--- /dev/null
@@ -0,0 +1,107 @@
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+#include "bbstdReplaceString.h"
+#include "bbstdPackage.h"
+namespace bbstd
+{
+
+BBTK_ADD_BLACK_BOX_TO_PACKAGE(std,ReplaceString)
+BBTK_BLACK_BOX_IMPLEMENTATION(ReplaceString,bbtk::AtomicBlackBox);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void ReplaceString::Process()
+{
+
+// THE MAIN PROCESSING METHOD BODY
+//   Here we simply set the input 'In' value to the output 'Out'
+//   And print out the output value
+// INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
+//    void bbSet{Input|Output}NAME(const TYPE&)
+//    const TYPE& bbGet{Input|Output}NAME() const 
+//    Where :
+//    * NAME is the name of the input/output
+//      (the one provided in the attribute 'name' of the tag 'input')
+//    * TYPE is the C++ type of the input/output
+//      (the one provided in the attribute 'type' of the tag 'input')
+
+//    bbSetOutputOut( bbGetInputIn() );
+//    std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
+
+  
+/*
+ // In 
+       std::string subjectIn = bbGetInputIn();
+       size_t pos = 0;
+       while((pos = subjectIn.find(bbGetInputSearch(), pos)) != std::string::npos) 
+       {
+               subjectIn.replace(pos, bbGetInputSearch().length(), bbGetInputReplace());
+               pos += bbGetInputReplace().length();
+       } // while
+*/
+
+
+ // InVec
+//     std::string 
+       std::string subjectInVec;
+       std::vector< std::string > tmpLst;
+       int i,size=bbGetInputIn().size();
+       for ( i=0 ; i<size ; i++ )
+       {
+               subjectInVec = bbGetInputIn()[i];
+               size_t pos = 0;
+               while((pos = subjectInVec.find(bbGetInputSearch(), pos)) != std::string::npos) 
+               {
+                       subjectInVec.replace(pos, bbGetInputSearch().length(), bbGetInputReplace());
+                       pos += bbGetInputReplace().length();
+               } // while
+               tmpLst.push_back( subjectInVec );
+       } // for
+
+//     bbSetOutputOut( subjectIn );
+       bbSetOutputOut( tmpLst );
+
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void ReplaceString::bbUserSetDefaultValues()
+{
+
+//  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
+//    Here we initialize the input 'In' to 0
+//   bbSetInputIn("");
+   bbSetInputReplace("");
+   bbSetInputSearch("");
+  
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void ReplaceString::bbUserInitializeProcessing()
+{
+
+//  THE INITIALIZATION METHOD BODY :
+//    Here does nothing 
+//    but this is where you should allocate the internal/output pointers 
+//    if any 
+
+  
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void ReplaceString::bbUserFinalizeProcessing()
+{
+
+//  THE FINALIZATION METHOD BODY :
+//    Here does nothing 
+//    but this is where you should desallocate the internal/output pointers 
+//    if any
+  
+}
+}
+// EO namespace bbstd
+
+
diff --git a/packages/std/src/bbstdReplaceString.h b/packages/std/src/bbstdReplaceString.h
new file mode 100644 (file)
index 0000000..86821d9
--- /dev/null
@@ -0,0 +1,55 @@
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+#ifndef __bbstdReplaceString_h_INCLUDED__
+#define __bbstdReplaceString_h_INCLUDED__
+#include "bbstd_EXPORT.h"
+#include "bbtkAtomicBlackBox.h"
+#include "iostream"
+
+#include <string>
+
+namespace bbstd
+{
+
+class bbstd_EXPORT ReplaceString
+ : 
+   public bbtk::AtomicBlackBox
+{
+  BBTK_BLACK_BOX_INTERFACE(ReplaceString,bbtk::AtomicBlackBox);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+//  BBTK_DECLARE_INPUT(In,std::string);
+  BBTK_DECLARE_INPUT(In,std::vector<std::string>);
+  BBTK_DECLARE_INPUT(Search,std::string);
+  BBTK_DECLARE_INPUT(Replace,std::string);
+//  BBTK_DECLARE_OUTPUT(Out,std::string);
+  BBTK_DECLARE_OUTPUT(Out,std::vector<std::string>);
+  BBTK_PROCESS(Process);
+  void Process();
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+};
+
+BBTK_BEGIN_DESCRIBE_BLACK_BOX(ReplaceString,bbtk::AtomicBlackBox);
+  BBTK_NAME("ReplaceString");
+  BBTK_AUTHOR("InfoDev");
+  BBTK_DESCRIPTION("No Description.");
+  BBTK_CATEGORY("empty");
+//  BBTK_INPUT(ReplaceString,In,"Input string",std::string,"");
+  BBTK_INPUT(ReplaceString,In,"Input vector of string",std::vector<std::string>,"");
+  BBTK_INPUT(ReplaceString,Search,"Searche sub string ",std::string,"");
+  BBTK_INPUT(ReplaceString,Replace,"Replace new string",std::string,"");
+//  BBTK_OUTPUT(ReplaceString,Out,"Output string",std::string,"");
+  BBTK_OUTPUT(ReplaceString,Out,"Output vector string",std::vector< std::string >,"");
+BBTK_END_DESCRIBE_BLACK_BOX(ReplaceString);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+}
+// EO namespace bbstd
+
+#endif // __bbstdReplaceString_h_INCLUDED__
+
diff --git a/packages/std/src/bbstdSplitFilePathVector.cxx b/packages/std/src/bbstdSplitFilePathVector.cxx
new file mode 100644 (file)
index 0000000..1885c11
--- /dev/null
@@ -0,0 +1,104 @@
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+#include "bbstdSplitFilePathVector.h"
+#include "bbstdPackage.h"
+namespace bbstd
+{
+
+BBTK_ADD_BLACK_BOX_TO_PACKAGE(std,SplitFilePathVector)
+BBTK_BLACK_BOX_IMPLEMENTATION(SplitFilePathVector,bbtk::AtomicBlackBox);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void SplitFilePathVector::Process()
+{
+
+// THE MAIN PROCESSING METHOD BODY
+//   Here we simply set the input 'In' value to the output 'Out'
+//   And print out the output value
+// INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
+//    void bbSet{Input|Output}NAME(const TYPE&)
+//    const TYPE& bbGet{Input|Output}NAME() const 
+//    Where :
+//    * NAME is the name of the input/output
+//      (the one provided in the attribute 'name' of the tag 'input')
+//    * TYPE is the C++ type of the input/output
+//      (the one provided in the attribute 'type' of the tag 'input')
+
+//    bbSetOutputOut( bbGetInputIn() );nt
+//    std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
+  
+       std::size_t found;
+       std::string filename;
+       
+       std::vector<std::string> LstPath;
+       std::vector<std::string> LstFileName;
+       std::vector<std::string> LstBaseName;
+       std::vector<std::string> LstExtention;
+
+       unsigned int i, size=bbGetInputIn().size();
+       for (i=0;i<size;i++)
+       {
+               found                                   =       bbGetInputIn()[i].find_last_of("/\\");
+               LstPath.push_back( bbGetInputIn()[i].substr(0,found+1) );
+               filename                                = bbGetInputIn()[i].substr(found+1);
+               LstFileName.push_back( filename );
+               found                                   =       filename.find_last_of(".");
+               LstBaseName.push_back( filename.substr(0,found) );
+               LstExtention.push_back( filename.substr(found+1) );
+       }
+
+       bbSetOutputPath( LstPath );
+       bbSetOutputBaseName( LstBaseName );
+       bbSetOutputExt( LstExtention );
+       bbSetOutputFileName( LstFileName );
+
+#ifdef _WIN32
+               bbSetOutputSlash("\\");
+#else
+               bbSetOutputSlash("/");
+#endif
+
+       
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void SplitFilePathVector::bbUserSetDefaultValues()
+{
+
+//  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
+//    Here we initialize the input 'In' to 0
+//   bbSetInputIn(0);
+  
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void SplitFilePathVector::bbUserInitializeProcessing()
+{
+
+//  THE INITIALIZATION METHOD BODY :
+//    Here does nothing 
+//    but this is where you should allocate the internal/output pointers 
+//    if any 
+
+  
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void SplitFilePathVector::bbUserFinalizeProcessing()
+{
+
+//  THE FINALIZATION METHOD BODY :
+//    Here does nothing 
+//    but this is where you should desallocate the internal/output pointers 
+//    if any
+  
+}
+}
+// EO namespace bbstd
+
+
diff --git a/packages/std/src/bbstdSplitFilePathVector.h b/packages/std/src/bbstdSplitFilePathVector.h
new file mode 100644 (file)
index 0000000..8e71238
--- /dev/null
@@ -0,0 +1,56 @@
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+#ifndef __bbstdSplitFilePathVector_h_INCLUDED__
+#define __bbstdSplitFilePathVector_h_INCLUDED__
+#include "bbstd_EXPORT.h"
+#include "bbtkAtomicBlackBox.h"
+#include "iostream"
+
+namespace bbstd
+{
+
+class bbstd_EXPORT SplitFilePathVector
+ : 
+   public bbtk::AtomicBlackBox
+{
+  BBTK_BLACK_BOX_INTERFACE(SplitFilePathVector,bbtk::AtomicBlackBox);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+  BBTK_DECLARE_INPUT(In,std::vector<std::string>);
+  BBTK_DECLARE_OUTPUT(Path,std::vector<std::string>);
+  BBTK_DECLARE_OUTPUT(BaseName,std::vector<std::string>);
+  BBTK_DECLARE_OUTPUT(Ext,std::vector<std::string>);
+  BBTK_DECLARE_OUTPUT(FileName,std::vector<std::string>);
+  BBTK_DECLARE_OUTPUT(Slash,std::string);
+  BBTK_PROCESS(Process);
+  void Process();
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+};
+
+BBTK_BEGIN_DESCRIBE_BLACK_BOX(SplitFilePathVector,bbtk::AtomicBlackBox);
+  BBTK_NAME("SplitFilePathVector");
+  BBTK_AUTHOR("Info-Dev");
+  BBTK_DESCRIPTION("No Description.");
+  BBTK_CATEGORY("empty");
+
+  BBTK_INPUT(SplitFilePathVector,In,"PathFileName",std::vector<std::string>,"");
+
+  BBTK_OUTPUT(SplitFilePathVector,Path,"Path",std::vector<std::string>,"");
+  BBTK_OUTPUT(SplitFilePathVector,BaseName,"Base Name",std::vector<std::string>,"");
+  BBTK_OUTPUT(SplitFilePathVector,Ext,"Extention",std::vector<std::string>,"");
+  BBTK_OUTPUT(SplitFilePathVector,FileName,"File Name",std::vector<std::string>,"");
+  BBTK_OUTPUT(SplitFilePathVector,Slash,"Slash Linux   or   Back slash Windows",std::string,"");
+
+BBTK_END_DESCRIBE_BLACK_BOX(SplitFilePathVector);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+}
+// EO namespace bbstd
+
+#endif // __bbstdSplitFilePathVector_h_INCLUDED__
+
index ebaaf7edc3d6b2ed3121d1a9d6496fe9f64c3aea..84eb35b2ed4c856c271f2603caff77965c07a381 100644 (file)
@@ -47,16 +47,16 @@ void StringWriter::Process()
                FILE *ff = fopen(bbGetInputFileName().c_str(),"w");
                if (ff!=NULL)
                {
-                       fprintf(ff,"%s \n",bbGetInputIn0().c_str());
-                       fprintf(ff,"%s \n",bbGetInputIn1().c_str());
-                       fprintf(ff,"%s \n",bbGetInputIn2().c_str());
-                       fprintf(ff,"%s \n",bbGetInputIn3().c_str());
-                       fprintf(ff,"%s \n",bbGetInputIn4().c_str());
-                       fprintf(ff,"%s \n",bbGetInputIn5().c_str());
-                       fprintf(ff,"%s \n",bbGetInputIn6().c_str());
-                       fprintf(ff,"%s \n",bbGetInputIn7().c_str());
-                       fprintf(ff,"%s \n",bbGetInputIn8().c_str());
-                       fprintf(ff,"%s \n",bbGetInputIn9().c_str());
+                       if (bbGetInputIn0()!="") { fprintf(ff,"%s\n",bbGetInputIn0().c_str()); }
+                       if (bbGetInputIn1()!="") { fprintf(ff,"%s\n",bbGetInputIn1().c_str()); }
+                       if (bbGetInputIn2()!="") { fprintf(ff,"%s\n",bbGetInputIn2().c_str()); }
+                       if (bbGetInputIn3()!="") { fprintf(ff,"%s\n",bbGetInputIn3().c_str()); }
+                       if (bbGetInputIn4()!="") { fprintf(ff,"%s\n",bbGetInputIn4().c_str()); }
+                       if (bbGetInputIn5()!="") { fprintf(ff,"%s\n",bbGetInputIn5().c_str()); }
+                       if (bbGetInputIn6()!="") { fprintf(ff,"%s\n",bbGetInputIn6().c_str()); }
+                       if (bbGetInputIn7()!="") { fprintf(ff,"%s\n",bbGetInputIn7().c_str()); }
+                       if (bbGetInputIn8()!="") { fprintf(ff,"%s\n",bbGetInputIn8().c_str()); }
+                       if (bbGetInputIn9()!="") { fprintf(ff,"%s\n",bbGetInputIn9().c_str()); }
                        fclose(ff);
                }
        }
diff --git a/packages/std/src/bbstdTransposeVectors.cxx b/packages/std/src/bbstdTransposeVectors.cxx
new file mode 100644 (file)
index 0000000..c126f00
--- /dev/null
@@ -0,0 +1,21 @@
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+#include "bbstdTransposeVectors.h"
+#include "bbstdPackage.h"
+namespace bbstd
+{
+
+BBTK_BLACK_BOX_TEMPLATE_IMPLEMENTATION(TransposeVectors,bbtk::AtomicBlackBox);
+
+BBTK_ADD_TEMPLATE_BLACK_BOX_TO_PACKAGE(std,TransposeVectors,int);
+BBTK_ADD_TEMPLATE_BLACK_BOX_TO_PACKAGE(std,TransposeVectors,float);
+BBTK_ADD_TEMPLATE_BLACK_BOX_TO_PACKAGE(std,TransposeVectors,double);
+typedef std::string string;
+BBTK_ADD_TEMPLATE_BLACK_BOX_TO_PACKAGE(std,TransposeVectors,string);
+
+
+}
+// EO namespace bbstd
+
+
diff --git a/packages/std/src/bbstdTransposeVectors.h b/packages/std/src/bbstdTransposeVectors.h
new file mode 100644 (file)
index 0000000..3ebc049
--- /dev/null
@@ -0,0 +1,196 @@
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+#ifndef __bbstdTransposeVectors_h_INCLUDED__
+#define __bbstdTransposeVectors_h_INCLUDED__
+#include "bbstd_EXPORT.h"
+#include "bbtkAtomicBlackBox.h"
+#include "iostream"
+
+namespace bbstd
+{
+template <class T>
+class bbstd_EXPORT TransposeVectors
+ : 
+   public bbtk::AtomicBlackBox
+{
+  BBTK_TEMPLATE_BLACK_BOX_INTERFACE(TransposeVectors,bbtk::AtomicBlackBox,T);
+
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+  BBTK_DECLARE_INPUT(In0,std::vector<T>);
+  BBTK_DECLARE_INPUT(In1,std::vector<T>);
+  BBTK_DECLARE_INPUT(In2,std::vector<T>);
+  BBTK_DECLARE_INPUT(In3,std::vector<T>);
+  BBTK_DECLARE_INPUT(In4,std::vector<T>);
+  BBTK_DECLARE_INPUT(In5,std::vector<T>);
+  BBTK_DECLARE_INPUT(In6,std::vector<T>);
+  BBTK_DECLARE_INPUT(In7,std::vector<T>);
+  BBTK_DECLARE_INPUT(In8,std::vector<T>);
+  BBTK_DECLARE_INPUT(In9,std::vector<T>);
+  BBTK_DECLARE_OUTPUT(Out0,std::vector<T>);
+  BBTK_DECLARE_OUTPUT(Out1,std::vector<T>);
+  BBTK_DECLARE_OUTPUT(Out2,std::vector<T>);
+  BBTK_DECLARE_OUTPUT(Out3,std::vector<T>);
+  BBTK_DECLARE_OUTPUT(Out4,std::vector<T>);
+  BBTK_DECLARE_OUTPUT(Out5,std::vector<T>);
+  BBTK_DECLARE_OUTPUT(Out6,std::vector<T>);
+  BBTK_DECLARE_OUTPUT(Out7,std::vector<T>);
+  BBTK_DECLARE_OUTPUT(Out8,std::vector<T>);
+  BBTK_DECLARE_OUTPUT(Out9,std::vector<T>);
+  BBTK_PROCESS(DoIt);
+  void DoIt();
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+};
+BBTK_BEGIN_DESCRIBE_TEMPLATE_BLACK_BOX(TransposeVectors,bbtk::AtomicBlackBox);
+  BBTK_NAME("TransposeVector"+bbtk::HumanTypeName<std::vector<T> >());
+  BBTK_AUTHOR("Info-Dev");
+  BBTK_DESCRIPTION("No Description.");
+  BBTK_CATEGORY("empty");
+
+
+  typedef std::vector<T> Tvector;      
+  BBTK_TEMPLATE_INPUT(TransposeVectors,In0,"Vector input",Tvector);
+  BBTK_TEMPLATE_INPUT(TransposeVectors,In1,"Vector input",Tvector);
+  BBTK_TEMPLATE_INPUT(TransposeVectors,In2,"Vector input",Tvector);
+  BBTK_TEMPLATE_INPUT(TransposeVectors,In3,"Vector input",Tvector);
+  BBTK_TEMPLATE_INPUT(TransposeVectors,In4,"Vector input",Tvector);
+  BBTK_TEMPLATE_INPUT(TransposeVectors,In5,"Vector input",Tvector);
+  BBTK_TEMPLATE_INPUT(TransposeVectors,In6,"Vector input",Tvector);
+  BBTK_TEMPLATE_INPUT(TransposeVectors,In7,"Vector input",Tvector);
+  BBTK_TEMPLATE_INPUT(TransposeVectors,In8,"Vector input",Tvector);
+  BBTK_TEMPLATE_INPUT(TransposeVectors,In9,"Vector input",Tvector);
+
+  BBTK_TEMPLATE_OUTPUT(TransposeVectors,Out0,"Vector output",Tvector);
+  BBTK_TEMPLATE_OUTPUT(TransposeVectors,Out1,"Vector output",Tvector);
+  BBTK_TEMPLATE_OUTPUT(TransposeVectors,Out2,"Vector output",Tvector);
+  BBTK_TEMPLATE_OUTPUT(TransposeVectors,Out3,"Vector output",Tvector);
+  BBTK_TEMPLATE_OUTPUT(TransposeVectors,Out4,"Vector output",Tvector);
+  BBTK_TEMPLATE_OUTPUT(TransposeVectors,Out5,"Vector output",Tvector);
+  BBTK_TEMPLATE_OUTPUT(TransposeVectors,Out6,"Vector output",Tvector);
+  BBTK_TEMPLATE_OUTPUT(TransposeVectors,Out7,"Vector output",Tvector);
+  BBTK_TEMPLATE_OUTPUT(TransposeVectors,Out8,"Vector output",Tvector);
+  BBTK_TEMPLATE_OUTPUT(TransposeVectors,Out9,"Vector output",Tvector);
+
+BBTK_END_DESCRIBE_TEMPLATE_BLACK_BOX(TransposeVectors);
+
+
+ //=================================================================
+  template <class T>
+  void TransposeVectors<T>::DoIt()
+  {
+       unsigned int i,j;
+       std::vector<T> tmpVec;
+       
+       std::vector<T> out0;
+       std::vector<T> out1;
+       std::vector<T> out2;
+       std::vector<T> out3;
+       std::vector<T> out4;
+       std::vector<T> out5;
+       std::vector<T> out6;
+       std::vector<T> out7;
+       std::vector<T> out8;
+       std::vector<T> out9;
+
+       unsigned int jSize=0;
+
+       unsigned int s0 = bbGetInputIn0().size();
+       unsigned int s1 = bbGetInputIn1().size();
+       unsigned int s2 = bbGetInputIn2().size();
+       unsigned int s3 = bbGetInputIn3().size();
+       unsigned int s4 = bbGetInputIn4().size();
+       unsigned int s5 = bbGetInputIn5().size();
+       unsigned int s6 = bbGetInputIn6().size();
+       unsigned int s7 = bbGetInputIn7().size();
+       unsigned int s8 = bbGetInputIn8().size();
+       unsigned int s9 = bbGetInputIn9().size();
+
+
+       if (s0>0)       {               jSize++;        }
+       if (s1>0)       {               jSize++;        }
+       if (s2>0)       {               jSize++;        }
+       if (s3>0)       {               jSize++;        }
+       if (s4>0)       {               jSize++;        }
+       if (s5>0)       {               jSize++;        }
+       if (s6>0)       {               jSize++;        }
+       if (s7>0)       {               jSize++;        }
+       if (s8>0)       {               jSize++;        }
+       if (s9>0)       {               jSize++;        }
+
+
+       for (j=0;j<jSize;j++)
+       {
+
+           if (j==0){ tmpVec = bbGetInputIn0(); }
+           if (j==1){ tmpVec = bbGetInputIn1(); }
+           if (j==2){ tmpVec = bbGetInputIn2(); }
+           if (j==3){ tmpVec = bbGetInputIn3(); }
+           if (j==4){ tmpVec = bbGetInputIn4(); }
+           if (j==5){ tmpVec = bbGetInputIn5(); }
+           if (j==6){ tmpVec = bbGetInputIn6(); }
+           if (j==7){ tmpVec = bbGetInputIn7(); }
+           if (j==8){ tmpVec = bbGetInputIn8(); }
+           if (j==9){ tmpVec = bbGetInputIn9(); }
+               for (i=0;i<s0;i++)
+               {
+                       if (tmpVec.size()<=s0 )
+                       {
+                               if (i==0){ out0.push_back( tmpVec[i] ); }  
+                               if (i==1){ out1.push_back( tmpVec[i] ); }  
+                               if (i==2){ out2.push_back( tmpVec[i] ); }  
+                               if (i==3){ out3.push_back( tmpVec[i] ); }  
+                               if (i==4){ out4.push_back( tmpVec[i] ); }  
+                               if (i==5){ out5.push_back( tmpVec[i] ); }  
+                               if (i==6){ out6.push_back( tmpVec[i] ); }  
+                               if (i==7){ out7.push_back( tmpVec[i] ); }  
+                               if (i==8){ out8.push_back( tmpVec[i] ); }  
+                               if (i==9){ out9.push_back( tmpVec[i] ); }  
+                       } // if //tmpVec size
+               }// for i
+       } // for j
+       bbSetOutputOut0(out0);
+       bbSetOutputOut1(out1);
+       bbSetOutputOut2(out2);
+       bbSetOutputOut3(out3);
+       bbSetOutputOut4(out4);
+       bbSetOutputOut5(out5);
+       bbSetOutputOut6(out6);
+       bbSetOutputOut7(out7);
+       bbSetOutputOut8(out8);
+       bbSetOutputOut9(out9);
+  }
+  //=================================================================
+
+  //=================================================================  
+  template <class T>
+  void TransposeVectors<T>::bbUserSetDefaultValues()
+  {
+  }
+  //=================================================================
+  template <class T>
+  void TransposeVectors<T>::bbUserInitializeProcessing() 
+  { 
+  }
+  //=================================================================
+  template <class T>
+  void TransposeVectors<T>::bbUserFinalizeProcessing() 
+  {
+  }
+  //=================================================================
+
+
+
+
+
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+}
+// EO namespace bbstd
+
+#endif // __bbstdTransposeVectors_h_INCLUDED__
+
diff --git a/packages/std/src/bbstdVectorFilterDouble.cxx b/packages/std/src/bbstdVectorFilterDouble.cxx
new file mode 100644 (file)
index 0000000..9a948a8
--- /dev/null
@@ -0,0 +1,274 @@
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+#include "bbstdVectorFilterDouble.h"
+#include "bbstdPackage.h"
+namespace bbstd
+{
+
+BBTK_ADD_BLACK_BOX_TO_PACKAGE(std,VectorFilterDouble)
+BBTK_BLACK_BOX_IMPLEMENTATION(VectorFilterDouble,bbtk::AtomicBlackBox);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void VectorFilterDouble::Process()
+{
+
+// THE MAIN PROCESSING METHOD BODY
+//   Here we simply set the input 'In' value to the output 'Out'
+//   And print out the output value
+// INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
+//    void bbSet{Input|Output}NAME(const TYPE&)
+//    const TYPE& bbGet{Input|Output}NAME() const 
+//    Where :
+//    * NAME is the name of the input/output
+//      (the one provided in the attribute 'name' of the tag 'input')
+//    * TYPE is the C++ type of the input/output
+//      (the one provided in the attribute 'type' of the tag 'input')
+
+       std::vector< std::vector<double> * >  pLstVec;  
+       std::vector< std::vector<double> * >  pLstVecOut;  
+       std::vector<double> In0 = bbGetInputIn0();
+       std::vector<double> In1 = bbGetInputIn1();
+       std::vector<double> In2 = bbGetInputIn2();
+       std::vector<double> In3 = bbGetInputIn3();
+       std::vector<double> In4 = bbGetInputIn4();
+       std::vector<double> In5 = bbGetInputIn5();
+       std::vector<double> In6 = bbGetInputIn6();
+       std::vector<double> In7 = bbGetInputIn7();
+       std::vector<double> In8 = bbGetInputIn8();
+       std::vector<double> In9 = bbGetInputIn9();
+
+       if (bbGetInputIn0().size()!=0) { pLstVec.push_back( &In0 ); }
+       if (bbGetInputIn1().size()!=0) { pLstVec.push_back( &In1 ); }
+       if (bbGetInputIn2().size()!=0) { pLstVec.push_back( &In2 ); }
+       if (bbGetInputIn3().size()!=0) { pLstVec.push_back( &In3 ); }
+       if (bbGetInputIn4().size()!=0) { pLstVec.push_back( &In4 ); }
+       if (bbGetInputIn5().size()!=0) { pLstVec.push_back( &In5 ); }
+       if (bbGetInputIn6().size()!=0) { pLstVec.push_back( &In6 ); }
+       if (bbGetInputIn7().size()!=0) { pLstVec.push_back( &In7 ); }
+       if (bbGetInputIn8().size()!=0) { pLstVec.push_back( &In8 ); }
+       if (bbGetInputIn9().size()!=0) { pLstVec.push_back( &In9 ); }
+
+       std::vector<double> Out0;
+       std::vector<double> Out1;
+       std::vector<double> Out2;
+       std::vector<double> Out3;
+       std::vector<double> Out4;
+       std::vector<double> Out5;
+       std::vector<double> Out6;
+       std::vector<double> Out7;
+       std::vector<double> Out8;
+       std::vector<double> Out9;
+
+       pLstVecOut.push_back( &Out0 );
+       pLstVecOut.push_back( &Out1 );
+       pLstVecOut.push_back( &Out2 );
+       pLstVecOut.push_back( &Out3 );
+       pLstVecOut.push_back( &Out4 );
+       pLstVecOut.push_back( &Out5 );
+       pLstVecOut.push_back( &Out6 );
+       pLstVecOut.push_back( &Out7 );
+       pLstVecOut.push_back( &Out8 );
+       pLstVecOut.push_back( &Out9 );
+
+
+       if (bbGetInputType()==0)  // Erase duplicate lines
+       {
+               bool okSizeVec=true;
+               int ipLstvec; 
+               for (ipLstvec=1;ipLstvec<pLstVec.size();ipLstvec++)
+               {
+                       if ( (*pLstVec[ipLstvec]).size()!=(*pLstVec[0]).size() )  { okSizeVec=false; }
+               }
+               if ( okSizeVec==false)
+               {
+                       printf("EED VectorFilterDouble::Process WARNING! vectors are not of the same size.\n");
+               } else {
+                       int iLine;
+                       int ipLstvec2; 
+                       bool okLine;
+                       for (iLine=0 ; iLine < (*pLstVec[0]).size() ; iLine++ ) 
+                       {
+                               okLine=false;
+                               for ( ipLstvec2=0 ; ipLstvec2<pLstVec.size() ; ipLstvec2++)
+                               {
+                                       if ( (*pLstVec[ipLstvec2])[iLine]!=(*pLstVec[ipLstvec2])[iLine-1] )  { okLine=true; }
+                               } // for ipLstVec2
+                                               
+                               if ( (okLine==true) || (iLine==0) ) 
+                               {
+                                       for (ipLstvec2=0 ; ipLstvec2<pLstVec.size() ; ipLstvec2++)
+                                       {
+                                               (*pLstVecOut[ipLstvec2]).push_back( (*pLstVec[ipLstvec2])[iLine] );
+                                       } // for
+                               } // if okLine
+                       } // for iLine
+               } // if okSizeVec
+       } // Type==0
+
+
+       if (bbGetInputType()==1) // Resize vector
+       {
+               int             ipLstvec2;
+               double  iLine;
+               int     sizeLines       = (*pLstVec[0]).size();
+               double  step            = (double)sizeLines/(double)bbGetInputk1();
+               for (iLine=0 ; iLine<sizeLines ; iLine=iLine+step)
+               {
+                       for (ipLstvec2=0 ; ipLstvec2<pLstVec.size() ; ipLstvec2++)
+                       {
+                               (*pLstVecOut[ipLstvec2]).push_back( (*pLstVec[ipLstvec2])[(int)iLine] );
+                       } // for                        
+               } // for ipLstVec
+       } // Type==1
+
+       if (bbGetInputType()==2) // Insert intermediate points
+       {
+               int             ipLstvec;
+               int     i;
+               int     size;
+               double  result;
+               for (ipLstvec=0 ; ipLstvec<pLstVec.size() ; ipLstvec++)
+               {
+                       size=(*pLstVec[ipLstvec]).size();
+                       if (size>=2)
+                       {
+                               for (i=0;i<size-1;i++)
+                               {
+                                       (*pLstVecOut[ipLstvec]).push_back( (*pLstVec[ipLstvec])[i] );   // First item                   
+                                       result=((*pLstVec[ipLstvec])[i] + (*pLstVec[ipLstvec])[i+1]  ) / 2;
+                                       (*pLstVecOut[ipLstvec]).push_back( result );                            
+                               }// for size
+                               (*pLstVecOut[ipLstvec]).push_back( (*pLstVec[ipLstvec])[size-1] );      // Last item            
+                       } // if size>=2
+               } // for pLstVec                
+       } // Type==2
+
+
+       if (bbGetInputType()==3) // Addition  k1
+       {
+               int             ipLstvec;
+               int     i;
+               int     size;
+               double  result;
+               for (ipLstvec=0 ; ipLstvec<pLstVec.size() ; ipLstvec++)
+               {
+                       size=(*pLstVec[ipLstvec]).size();
+                       for (i=0;i<size;i++)
+                       {
+                               result= (*pLstVec[ipLstvec])[i] + bbGetInputk1() ;
+                               (*pLstVecOut[ipLstvec]).push_back( result );                            
+                       }// for size
+               } // for pLstVec                
+       } // Type==3
+
+       if (bbGetInputType()==4) // Substraction  k1
+       {
+               int             ipLstvec;
+               int     i;
+               int     size;
+               double  result;
+               for (ipLstvec=0 ; ipLstvec<pLstVec.size() ; ipLstvec++)
+               {
+                       size=(*pLstVec[ipLstvec]).size();
+                       for (i=0;i<size;i++)
+                       {
+                               result= (*pLstVec[ipLstvec])[i] - bbGetInputk1() ;
+                               (*pLstVecOut[ipLstvec]).push_back( result );                            
+                       }// for size
+               } // for pLstVec                
+       } // Type==4
+
+       if (bbGetInputType()==5) // Multiplication  k1
+       {
+               int     ipLstvec;
+               int     i;
+               int     size;
+               double  result;
+               for (ipLstvec=0 ; ipLstvec<pLstVec.size() ; ipLstvec++)
+               {
+                       size=(*pLstVec[ipLstvec]).size();
+                       for (i=0;i<size;i++)
+                       {
+                               result= (*pLstVec[ipLstvec])[i] * bbGetInputk1() ;
+                               (*pLstVecOut[ipLstvec]).push_back( result );                            
+                       }// for size
+               } // for pLstVec                
+       } // Type==5
+
+       if (bbGetInputType()==6) // Division  k1
+       {
+               int     ipLstvec;
+               int     i;
+               int     size;
+               double  result;
+               for (ipLstvec=0 ; ipLstvec<pLstVec.size() ; ipLstvec++)
+               {
+                       size=(*pLstVec[ipLstvec]).size();
+                       for (i=0;i<size;i++)
+                       {
+                               if (bbGetInputk1()!=0)
+                               {
+                                       result= (*pLstVec[ipLstvec])[i] / bbGetInputk1() ;
+                                       (*pLstVecOut[ipLstvec]).push_back( result );                            
+                               } else {
+                                       printf("EED VectorFilterDouble::Process  Warning!! Div by 0 in Type 6 \n");
+                                       (*pLstVecOut[ipLstvec]).push_back( -1 );                                
+                               }
+                       }// for size
+               } // for pLstVec                
+       } // Type==6
+
+       bbSetOutputOut0( Out0 );
+       bbSetOutputOut1( Out1 );
+       bbSetOutputOut2( Out2 );
+       bbSetOutputOut3( Out3 );
+       bbSetOutputOut4( Out4 );
+       bbSetOutputOut5( Out5 );
+       bbSetOutputOut6( Out6 );
+       bbSetOutputOut7( Out7 );
+       bbSetOutputOut8( Out8 );
+       bbSetOutputOut9( Out9 );
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void VectorFilterDouble::bbUserSetDefaultValues()
+{
+
+//  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
+//    Here we initialize the input 'In' to 0
+   bbSetInputType(0);
+   bbSetInputk1(0);
+  
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void VectorFilterDouble::bbUserInitializeProcessing()
+{
+
+//  THE INITIALIZATION METHOD BODY :
+//    Here does nothing 
+//    but this is where you should allocate the internal/output pointers 
+//    if any 
+
+  
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void VectorFilterDouble::bbUserFinalizeProcessing()
+{
+
+//  THE FINALIZATION METHOD BODY :
+//    Here does nothing 
+//    but this is where you should desallocate the internal/output pointers 
+//    if any
+  
+}
+}
+// EO namespace bbstd
+
+
diff --git a/packages/std/src/bbstdVectorFilterDouble.h b/packages/std/src/bbstdVectorFilterDouble.h
new file mode 100644 (file)
index 0000000..f3612ef
--- /dev/null
@@ -0,0 +1,85 @@
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+#ifndef __bbstdVectorFilterDouble_h_INCLUDED__
+#define __bbstdVectorFilterDouble_h_INCLUDED__
+#include "bbstd_EXPORT.h"
+#include "bbtkAtomicBlackBox.h"
+#include "iostream"
+
+namespace bbstd
+{
+
+class bbstd_EXPORT VectorFilterDouble
+ : 
+   public bbtk::AtomicBlackBox
+{
+  BBTK_BLACK_BOX_INTERFACE(VectorFilterDouble,bbtk::AtomicBlackBox);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+  BBTK_DECLARE_INPUT(Type,int);
+  BBTK_DECLARE_INPUT(k1,double);
+  BBTK_DECLARE_INPUT(In0,std::vector<double>);
+  BBTK_DECLARE_INPUT(In1,std::vector<double>);
+  BBTK_DECLARE_INPUT(In2,std::vector<double>);
+  BBTK_DECLARE_INPUT(In3,std::vector<double>);
+  BBTK_DECLARE_INPUT(In4,std::vector<double>);
+  BBTK_DECLARE_INPUT(In5,std::vector<double>);
+  BBTK_DECLARE_INPUT(In6,std::vector<double>);
+  BBTK_DECLARE_INPUT(In7,std::vector<double>);
+  BBTK_DECLARE_INPUT(In8,std::vector<double>);
+  BBTK_DECLARE_INPUT(In9,std::vector<double>);
+  BBTK_DECLARE_OUTPUT(Out0,std::vector<double>);
+  BBTK_DECLARE_OUTPUT(Out1,std::vector<double>);
+  BBTK_DECLARE_OUTPUT(Out2,std::vector<double>);
+  BBTK_DECLARE_OUTPUT(Out3,std::vector<double>);
+  BBTK_DECLARE_OUTPUT(Out4,std::vector<double>);
+  BBTK_DECLARE_OUTPUT(Out5,std::vector<double>);
+  BBTK_DECLARE_OUTPUT(Out6,std::vector<double>);
+  BBTK_DECLARE_OUTPUT(Out7,std::vector<double>);
+  BBTK_DECLARE_OUTPUT(Out8,std::vector<double>);
+  BBTK_DECLARE_OUTPUT(Out9,std::vector<double>);
+  BBTK_PROCESS(Process);
+  void Process();
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+};
+
+BBTK_BEGIN_DESCRIBE_BLACK_BOX(VectorFilterDouble,bbtk::AtomicBlackBox);
+  BBTK_NAME("VectorFilterDouble");
+  BBTK_AUTHOR("InfoDev");
+  BBTK_DESCRIPTION("No Description.");
+  BBTK_CATEGORY("empty");
+  BBTK_INPUT(VectorFilterDouble,Type,"default (0)  0=Erase duplicated lines, 1=Redimention Vectors, 2=Insert intermediat points,3=Adition, 4=Substraction, 5=Multilication, 6=Division ",int,"");
+  BBTK_INPUT(VectorFilterDouble,k1,"default (0)  nothing (Type0), k1=new size vectors (Type 1) , nothing (Type2), k1 = Addition const. (Type 3), k1 = Substraction const. (Type 4), k1 = Multiplication const. (Type 5) , k1 = Division const. (Type 6) ,  ",double,"");
+  BBTK_INPUT(VectorFilterDouble,In0,"Input vector",std::vector<double>,"");
+  BBTK_INPUT(VectorFilterDouble,In1,"Input vector",std::vector<double>,"");
+  BBTK_INPUT(VectorFilterDouble,In2,"Input vector",std::vector<double>,"");
+  BBTK_INPUT(VectorFilterDouble,In3,"Input vector",std::vector<double>,"");
+  BBTK_INPUT(VectorFilterDouble,In4,"Input vector",std::vector<double>,"");
+  BBTK_INPUT(VectorFilterDouble,In5,"Input vector",std::vector<double>,"");
+  BBTK_INPUT(VectorFilterDouble,In6,"Input vector",std::vector<double>,"");
+  BBTK_INPUT(VectorFilterDouble,In7,"Input vector",std::vector<double>,"");
+  BBTK_INPUT(VectorFilterDouble,In8,"Input vector",std::vector<double>,"");
+  BBTK_INPUT(VectorFilterDouble,In9,"Input vector",std::vector<double>,"");
+  BBTK_OUTPUT(VectorFilterDouble,Out0,"Output vector",std::vector<double>,"");
+  BBTK_OUTPUT(VectorFilterDouble,Out1,"Output vector",std::vector<double>,"");
+  BBTK_OUTPUT(VectorFilterDouble,Out2,"Output vector",std::vector<double>,"");
+  BBTK_OUTPUT(VectorFilterDouble,Out3,"Output vector",std::vector<double>,"");
+  BBTK_OUTPUT(VectorFilterDouble,Out4,"Output vector",std::vector<double>,"");
+  BBTK_OUTPUT(VectorFilterDouble,Out5,"Output vector",std::vector<double>,"");
+  BBTK_OUTPUT(VectorFilterDouble,Out6,"Output vector",std::vector<double>,"");
+  BBTK_OUTPUT(VectorFilterDouble,Out7,"Output vector",std::vector<double>,"");
+  BBTK_OUTPUT(VectorFilterDouble,Out8,"Output vector",std::vector<double>,"");
+  BBTK_OUTPUT(VectorFilterDouble,Out9,"Output vector",std::vector<double>,"");
+BBTK_END_DESCRIBE_BLACK_BOX(VectorFilterDouble);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+}
+// EO namespace bbstd
+
+#endif // __bbstdVectorFilterDouble_h_INCLUDED__
+
diff --git a/packages/std/src/bbstdWriteColumnsString.cxx b/packages/std/src/bbstdWriteColumnsString.cxx
new file mode 100644 (file)
index 0000000..229601c
--- /dev/null
@@ -0,0 +1,118 @@
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+#include "bbstdWriteColumnsString.h"
+#include "bbstdPackage.h"
+namespace bbstd
+{
+
+BBTK_ADD_BLACK_BOX_TO_PACKAGE(std,WriteColumnsString)
+BBTK_BLACK_BOX_IMPLEMENTATION(WriteColumnsString,bbtk::AtomicBlackBox);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void WriteColumnsString::Process()
+{
+       std::ofstream write_fi;
+       write_fi.open(bbGetInputFileName().c_str());    
+       std::vector<std::string> headers = bbGetInputHeaders(); //Headers Input
+       bool onHeaders = bbGetInputOnHeaders();
+       std::vector<std::vector<std::string> > values;
+       values.push_back(bbGetInputlstData1());
+       values.push_back(bbGetInputlstData2());
+       values.push_back(bbGetInputlstData3());
+       values.push_back(bbGetInputlstData4());
+       values.push_back(bbGetInputlstData5());
+       values.push_back(bbGetInputlstData6());
+       values.push_back(bbGetInputlstData7());
+       values.push_back(bbGetInputlstData8());
+       values.push_back(bbGetInputlstData9());
+       std::vector<std::vector<std::string> >::iterator it;
+       for(it = values.begin() ; it != values.end() ; )
+       {
+               if((*it).empty())
+               {
+                       it = values.erase(it);
+               }else
+               {
+                       it++;
+               }
+       }
+       if(write_fi.is_open())
+       {       
+               if(onHeaders == true) // If onHeaders is true, the file is write with Headers.
+               {
+                       //Add each header input write to file
+                       for(unsigned int i=0 ;i< headers.size(); i++ )
+                       {
+                               if(i==(headers.size()-1))
+                               {
+                                       write_fi << headers[i] << "\n";
+                               }else{
+                                       write_fi << headers[i] << "\t";
+                               }
+
+                       }//for headersSize
+               }
+               unsigned int colSize = values[0].size();
+               for(unsigned int j=0;j<colSize;j++)
+               {
+                       for(unsigned int i=0;i<values.size();i++)
+                       {
+                               if(i==(values.size()-1))
+                               {
+                                       write_fi << values[i][j] << "\n";
+                               }else{
+                                       write_fi << values[i][j] << "\t";
+                               }
+                       }
+               }
+       }// if write_fi.is_open()
+       else
+       {
+               std::cout<<"No es posible abrir"<<std::endl;
+       }//else
+       write_fi.close();
+       bbSetOutputOutFileName(bbGetInputFileName().c_str());  
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void WriteColumnsString::bbUserSetDefaultValues()
+{
+
+//  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
+//    Here we initialize the input 'In' to 0
+   bbSetInputFileName("");     
+   bbSetInputFileName("true");
+  
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void WriteColumnsString::bbUserInitializeProcessing()
+{
+
+//  THE INITIALIZATION METHOD BODY :
+//    Here does nothing 
+//    but this is where you should allocate the internal/output pointers 
+//    if any 
+
+  
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void WriteColumnsString::bbUserFinalizeProcessing()
+{
+
+//  THE FINALIZATION METHOD BODY :
+//    Here does nothing 
+//    but this is where you should desallocate the internal/output pointers 
+//    if any
+  
+}
+}
+// EO namespace bbstd
+
+
diff --git a/packages/std/src/bbstdWriteColumnsString.h b/packages/std/src/bbstdWriteColumnsString.h
new file mode 100644 (file)
index 0000000..08e54bf
--- /dev/null
@@ -0,0 +1,72 @@
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+#ifndef __bbstdWriteColumnsString_h_INCLUDED__
+#define __bbstdWriteColumnsString_h_INCLUDED__
+#include "bbstd_EXPORT.h"
+#include "bbtkAtomicBlackBox.h"
+#include "iostream"
+
+namespace bbstd
+{
+
+class bbstd_EXPORT WriteColumnsString :
+   public bbtk::AtomicBlackBox
+{
+  BBTK_BLACK_BOX_INTERFACE(WriteColumnsString,bbtk::AtomicBlackBox);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+  BBTK_DECLARE_INPUT(FileName,std::string);
+  BBTK_DECLARE_INPUT(Headers,std::vector<std::string>);
+  BBTK_DECLARE_INPUT(OnHeaders,bool);
+
+
+  BBTK_DECLARE_INPUT(lstData1,std::vector<std::string> );
+  BBTK_DECLARE_INPUT(lstData2,std::vector<std::string> );
+  BBTK_DECLARE_INPUT(lstData3,std::vector<std::string> );
+  BBTK_DECLARE_INPUT(lstData4,std::vector<std::string> );
+  BBTK_DECLARE_INPUT(lstData5,std::vector<std::string> );
+  BBTK_DECLARE_INPUT(lstData6,std::vector<std::string> );
+  BBTK_DECLARE_INPUT(lstData7,std::vector<std::string> );
+  BBTK_DECLARE_INPUT(lstData8,std::vector<std::string> );
+  BBTK_DECLARE_INPUT(lstData9,std::vector<std::string> );
+
+  BBTK_DECLARE_OUTPUT(OutFileName,std::string);
+  BBTK_PROCESS(Process);
+  void Process();
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+};
+
+BBTK_BEGIN_DESCRIBE_BLACK_BOX(WriteColumnsString,bbtk::AtomicBlackBox);
+BBTK_NAME("WriteColumnsString");
+BBTK_AUTHOR("Monica ESPINOSA");
+BBTK_DESCRIPTION("Write Columns to file");
+BBTK_CATEGORY("read/write");
+
+BBTK_INPUT(WriteColumnsString,FileName,"File name",std::string,"");
+BBTK_INPUT(WriteColumnsString,Headers,"Headers of Columns",std::vector<std::string>,"");
+BBTK_INPUT(WriteColumnsString,OnHeaders,"On Headers / Off Headers",bool,"");
+
+BBTK_INPUT(WriteColumnsString,lstData1,"vector of data",std::vector<std::string>,"");
+BBTK_INPUT(WriteColumnsString,lstData2,"vector of data",std::vector<std::string>,"");
+BBTK_INPUT(WriteColumnsString,lstData3,"vector of data",std::vector<std::string>,"");
+BBTK_INPUT(WriteColumnsString,lstData4,"vector of data",std::vector<std::string>,"");
+BBTK_INPUT(WriteColumnsString,lstData5,"vector of data",std::vector<std::string>,"");
+BBTK_INPUT(WriteColumnsString,lstData6,"vector of data",std::vector<std::string>,"");
+BBTK_INPUT(WriteColumnsString,lstData7,"vector of data",std::vector<std::string>,"");
+BBTK_INPUT(WriteColumnsString,lstData8,"vector of data",std::vector<std::string>,"");
+BBTK_INPUT(WriteColumnsString,lstData9,"vector of data",std::vector<std::string>,"");
+
+BBTK_OUTPUT(WriteColumnsString,OutFileName,"File Name",std::string,"");
+BBTK_END_DESCRIBE_BLACK_BOX(WriteColumnsString);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+}
+// EO namespace bbstd
+
+#endif // __bbstdWriteColumnsString_h_INCLUDED__
+
diff --git a/packages/toolsbbtk/bbs/boxes/ApplyMaskWithTransparence.bbg b/packages/toolsbbtk/bbs/boxes/ApplyMaskWithTransparence.bbg
new file mode 100644 (file)
index 0000000..ff0b9ce
--- /dev/null
@@ -0,0 +1,170 @@
+# ----------------------------------
+# - BBTKGEditor v 1.4 BBG BlackBox Diagram file
+# - ApplyMaskWithTransparence.bbg
+# ----------------------------------
+
+APP_START
+CATEGORY:<VOID>
+DESCRIPTION:Description ??
+AUTHOR:Author ??
+COMPLEXBOX:TRUE
+COMPLEXBOXNAME:ApplyMaskWithTransparence
+PACKAGENAME:toolsbbtk
+COMPLEXOUTPUTS:1
+COMPLEX_PORT
+OutImage
+-71.833968:-77.907690:-900.000000
+FIN_COMPLEX_PORT
+COMPLEXINPUTS:2
+COMPLEX_PORT
+maskImage
+-155.945750:140.976519:-900.000000
+FIN_COMPLEX_PORT
+COMPLEX_PORT
+Image
+-52.261663:144.599262:-900.000000
+FIN_COMPLEX_PORT
+BOXES:12
+BOX
+vtk:BinaryOperations:Box06
+ISEXEC:FALSE
+-21.965422:21.398218:-900.000000
+23.609578:11.398218:-900.000000
+PORT
+Operation:"2"
+FIN_BOX
+BOX
+vtk:ImageVtkProperties:Box16
+ISEXEC:FALSE
+-89.759228:16.979477:-900.000000
+-44.184228:6.979477:-900.000000
+FIN_BOX
+BOX
+vtk:BinaryOperations:Box20
+ISEXEC:FALSE
+-74.625874:-54.714389:-900.000000
+-29.050874:-64.714389:-900.000000
+FIN_BOX
+BOX
+std:GetVectorFloatElement:Box22
+ISEXEC:FALSE
+-112.217901:-2.482812:-900.000000
+-41.042901:-12.482812:-900.000000
+PORT
+I:"0"
+FIN_BOX
+BOX
+vtk:RescaleSlopeIntercept:Box23
+ISEXEC:FALSE
+-177.610123:18.460663:-900.000000
+-106.435123:8.460663:-900.000000
+PORT
+OutputFormat:"VTK_DOUBLE"
+PORT
+Type:"1"
+FIN_BOX
+BOX
+vtk:UnaryOperations:Box24
+ISEXEC:FALSE
+-142.749404:-25.417995:-900.000000
+-97.174404:-35.417995:-900.000000
+PORT
+InConstant:"1"
+PORT
+Operation:"11"
+FIN_BOX
+BOX
+vtk:vtkImageDataPointerRelay:Box18
+ISEXEC:FALSE
+-171.782936:117.774432:-900.000000
+-100.607936:107.774432:-900.000000
+FIN_BOX
+BOX
+vtk:vtkImageDataPointerRelay:Box19
+ISEXEC:FALSE
+-53.355388:100.244903:-900.000000
+17.819612:90.244903:-900.000000
+FIN_BOX
+BOX
+vtk:UnaryOperations:Box09
+ISEXEC:FALSE
+-157.853849:61.413786:-900.000000
+-112.278849:51.413786:-900.000000
+PORT
+Operation:"3"
+FIN_BOX
+BOX
+vtk:ImageVtkProperties:Box10
+ISEXEC:FALSE
+-152.556320:102.747202:-900.000000
+-106.981320:92.747202:-900.000000
+FIN_BOX
+BOX
+std:GetVectorFloatElement:Box11
+ISEXEC:FALSE
+-149.145811:85.700627:-900.000000
+-77.970811:75.700627:-900.000000
+PORT
+I:"1"
+FIN_BOX
+BOX
+vtk:RescaleSlopeIntercept:Box12
+ISEXEC:FALSE
+-160.936834:45.783197:-900.000000
+-89.761834:35.783197:-900.000000
+PORT
+OutputFormat:"VTK_DOUBLE"
+FIN_BOX
+CONNECTIONS:17
+CONNECTION
+Box16:MinMax:Box22:In
+NumberOfControlPoints:0
+CONNECTION
+Box23:Out:Box24:In1
+NumberOfControlPoints:0
+CONNECTION
+Box22:Out:Box24:NewValue
+NumberOfControlPoints:0
+CONNECTION
+Box06:Out:Box20:In2
+NumberOfControlPoints:0
+CONNECTION
+Box24:Out:Box20:In1
+NumberOfControlPoints:0
+CONNECTION
+maskImage:maskImage:Box18:In
+NumberOfControlPoints:0
+CONNECTION
+Image:Image:Box19:In
+NumberOfControlPoints:0
+CONNECTION
+Box19:Out:Box16:In
+NumberOfControlPoints:0
+CONNECTION
+Box19:Out:Box06:In2
+NumberOfControlPoints:0
+CONNECTION
+Box20:Out:OutImage:OutImage
+NumberOfControlPoints:0
+CONNECTION
+Box18:Out:Box10:In
+NumberOfControlPoints:0
+CONNECTION
+Box18:Out:Box09:In1
+NumberOfControlPoints:0
+CONNECTION
+Box10:MinMax:Box11:In
+NumberOfControlPoints:0
+CONNECTION
+Box11:Out:Box09:InConstant
+NumberOfControlPoints:0
+CONNECTION
+Box09:Out:Box12:In
+NumberOfControlPoints:0
+CONNECTION
+Box12:Out:Box23:In
+NumberOfControlPoints:0
+CONNECTION
+Box12:Out:Box06:In1
+NumberOfControlPoints:0
+APP_END
diff --git a/packages/toolsbbtk/bbs/boxes/ApplyMaskWithTransparence.bbs b/packages/toolsbbtk/bbs/boxes/ApplyMaskWithTransparence.bbs
new file mode 100644 (file)
index 0000000..802f204
--- /dev/null
@@ -0,0 +1,75 @@
+# ----------------------------------
+# - BBTKGEditor v 1.4 BBS BlackBox Script (Complex Box)
+# - ApplyMaskWithTransparence.bbs
+# ----------------------------------
+
+include std
+include itkvtk
+include vtk
+include std
+
+define ApplyMaskWithTransparence toolsbbtk
+
+author "Author ??"
+description "Description ??"
+
+category "<VOID>"
+
+new vtk:BinaryOperations Box06
+  set Box06.Operation "2"
+
+new vtk:ImageVtkProperties Box16
+
+new vtk:BinaryOperations Box20
+
+new std:GetVectorFloatElement Box22
+  set Box22.I "0"
+
+new vtk:RescaleSlopeIntercept Box23
+  set Box23.OutputFormat "VTK_DOUBLE"
+  set Box23.Type "1"
+
+new vtk:UnaryOperations Box24
+  set Box24.InConstant "1"
+  set Box24.Operation "11"
+
+new vtk:vtkImageDataPointerRelay Box18
+
+new vtk:vtkImageDataPointerRelay Box19
+
+new vtk:UnaryOperations Box09
+  set Box09.Operation "3"
+
+new vtk:ImageVtkProperties Box10
+
+new std:GetVectorFloatElement Box11
+  set Box11.I "1"
+
+new vtk:RescaleSlopeIntercept Box12
+  set Box12.OutputFormat "VTK_DOUBLE"
+
+
+connect Box16.MinMax Box22.In
+connect Box23.Out Box24.In1
+connect Box22.Out Box24.NewValue
+connect Box06.Out Box20.In2
+connect Box24.Out Box20.In1
+connect Box19.Out Box16.In
+connect Box19.Out Box06.In2
+connect Box18.Out Box10.In
+connect Box18.Out Box09.In1
+connect Box10.MinMax Box11.In
+connect Box11.Out Box09.InConstant
+connect Box09.Out Box12.In
+connect Box12.Out Box23.In
+connect Box12.Out Box06.In1
+
+# Complex input ports
+input maskImage Box18.In " "
+input Image Box19.In " "
+
+# Complex output ports
+output OutImage Box20.Out " "
+
+
+endefine
diff --git a/packages/toolsbbtk/bbs/boxes/BaseViewerInfo.bbg b/packages/toolsbbtk/bbs/boxes/BaseViewerInfo.bbg
new file mode 100644 (file)
index 0000000..f83efe1
--- /dev/null
@@ -0,0 +1,188 @@
+# ----------------------------------
+# - BBTKGEditor v 1.4 BBG BlackBox Diagram file
+# - BaseViewerInfo.bbg
+# ----------------------------------
+
+APP_START
+CATEGORY:<VOID>
+DESCRIPTION:Description ??
+AUTHOR:Author ??
+COMPLEXBOX:TRUE
+COMPLEXBOXNAME:BaseViewerInfo
+PACKAGENAME:toolsbbtk
+COMPLEXOUTPUTS:1
+COMPLEX_PORT
+widget
+-30.819051:-136.510392:-900.000000
+FIN_COMPLEX_PORT
+COMPLEXINPUTS:5
+COMPLEX_PORT
+Image
+-82.600387:87.016452:-900.000000
+FIN_COMPLEX_PORT
+COMPLEX_PORT
+TitleAtribute
+36.935335:85.180898:-900.000000
+FIN_COMPLEX_PORT
+COMPLEX_PORT
+wxvtkbaseview_01
+77.704467:82.456466:-900.000000
+FIN_COMPLEX_PORT
+COMPLEX_PORT
+wxvtkbaseview_02
+95.863555:82.024107:-900.000000
+FIN_COMPLEX_PORT
+COMPLEX_PORT
+wxvtkbaseview_03
+113.157923:82.024107:-900.000000
+FIN_COMPLEX_PORT
+BOXES:11
+BOX
+toolsbbtk:SaveMHD-Button:Box00
+ISEXEC:FALSE
+-106.048862:0.749501:-900.000000
+-60.473862:-9.250499:-900.000000
+FIN_BOX
+BOX
+creaMaracasVisu:ViewerNV:Box02
+ISEXEC:FALSE
+-54.569378:0.907343:-900.000000
+-8.994378:-9.092657:-900.000000
+FIN_BOX
+BOX
+wx:LayoutTab:Box03
+ISEXEC:FALSE
+-14.879280:-104.285815:-900.000000
+30.695720:-114.285815:-900.000000
+FIN_BOX
+BOX
+vtk:vtkImageDataPointerRelay:Box09
+ISEXEC:FALSE
+-91.353292:33.000764:-900.000000
+-20.178292:23.000764:-900.000000
+FIN_BOX
+BOX
+toolsbbtk:ImageVtkPropertiesWidget:Box10
+ISEXEC:FALSE
+-180.333327:2.041412:-900.000000
+-109.158327:-7.958588:-900.000000
+FIN_BOX
+BOX
+wx:LayoutLine:Box07
+ISEXEC:FALSE
+-112.069068:-52.859982:-900.000000
+-66.494068:-62.859982:-900.000000
+PORT
+Orientation:"H"
+PORT
+WinTitle:"Info"
+FIN_BOX
+BOX
+vtk:RescaleSlopeIntercept:Box08
+ISEXEC:FALSE
+43.060657:-5.917956:-900.000000
+114.235657:-15.917956:-900.000000
+PORT
+A:"0"
+PORT
+B:"90"
+PORT
+OutputFormat:"VTK_UNSIGNED_SHORT"
+PORT
+Type:"2"
+FIN_BOX
+BOX
+creaMaracasVisu:ImageChangeInformation:Box11
+ISEXEC:FALSE
+52.887003:-25.570647:-900.000000
+124.062003:-35.570647:-900.000000
+PORT
+NewSpacing:"1 1 1"
+FIN_BOX
+BOX
+creaMaracasVisu:ColorLayerImageView:Box12
+ISEXEC:FALSE
+48.468147:-45.369167:-900.000000
+119.643147:-55.369167:-900.000000
+PORT
+Active:"false"
+PORT
+lstBaseColor:"0 0 1   0 1 1     1 1 0   1 0 0"
+FIN_BOX
+BOX
+wx:LayoutLine:Box13
+ISEXEC:FALSE
+53.203629:-68.313438:-900.000000
+98.778629:-78.313438:-900.000000
+PORT
+WinTitle:"Color Layer"
+FIN_BOX
+BOX
+wx:LayoutLine:Box14
+ISEXEC:FALSE
+-44.314991:-50.436135:-900.000000
+1.260009:-60.436135:-900.000000
+PORT
+Orientation:"H"
+PORT
+WinTitle:"View"
+FIN_BOX
+CONNECTIONS:19
+CONNECTION
+Image:Image:Box09:In
+NumberOfControlPoints:0
+CONNECTION
+Box09:Out:Box00:In
+NumberOfControlPoints:0
+CONNECTION
+Box09:Out:Box10:in
+NumberOfControlPoints:0
+CONNECTION
+Box09:Out:Box02:In
+NumberOfControlPoints:0
+CONNECTION
+Box00:Widget:Box07:Widget2
+NumberOfControlPoints:0
+CONNECTION
+Box10:widget:Box07:Widget1
+NumberOfControlPoints:0
+CONNECTION
+Box03:Widget:widget:widget
+NumberOfControlPoints:0
+CONNECTION
+TitleAtribute:TitleAtribute:Box03:WinTitle
+NumberOfControlPoints:0
+CONNECTION
+Box09:Out:Box08:In
+NumberOfControlPoints:0
+CONNECTION
+Box08:Out:Box11:In
+NumberOfControlPoints:0
+CONNECTION
+Box11:Out:Box12:In
+NumberOfControlPoints:0
+CONNECTION
+wxvtkbaseview_03:wxvtkbaseview_03:Box12:WxVtkBaseView2
+NumberOfControlPoints:0
+CONNECTION
+Box12:Widget:Box13:Widget1
+NumberOfControlPoints:0
+CONNECTION
+Box07:Widget:Box03:Widget3
+NumberOfControlPoints:0
+CONNECTION
+Box02:Widget:Box14:Widget1
+NumberOfControlPoints:0
+CONNECTION
+wxvtkbaseview_02:wxvtkbaseview_02:Box12:WxVtkBaseView1
+NumberOfControlPoints:0
+CONNECTION
+wxvtkbaseview_01:wxvtkbaseview_01:Box12:WxVtkBaseView
+NumberOfControlPoints:0
+CONNECTION
+Box13:Widget:Box03:Widget1
+NumberOfControlPoints:0
+CONNECTION
+Box14:Widget:Box03:Widget2
+NumberOfControlPoints:0
+APP_END
diff --git a/packages/toolsbbtk/bbs/boxes/BaseViewerInfo.bbs b/packages/toolsbbtk/bbs/boxes/BaseViewerInfo.bbs
new file mode 100644 (file)
index 0000000..29f0647
--- /dev/null
@@ -0,0 +1,80 @@
+# ----------------------------------
+# - BBTKGEditor v 1.4 BBS BlackBox Script (Complex Box)
+# - BaseViewerInfo.bbs
+# ----------------------------------
+
+include std
+include itkvtk
+include toolsbbtk
+include creaMaracasVisu
+include wx
+include vtk
+
+define BaseViewerInfo toolsbbtk
+
+author "Author ??"
+description "Description ??"
+
+category "<VOID>"
+
+new toolsbbtk:SaveMHD-Button Box00
+
+new creaMaracasVisu:ViewerNV Box02
+
+new wx:LayoutTab Box03
+
+new vtk:vtkImageDataPointerRelay Box09
+
+new toolsbbtk:ImageVtkPropertiesWidget Box10
+
+new wx:LayoutLine Box07
+  set Box07.Orientation "H"
+  set Box07.WinTitle "Info"
+
+new vtk:RescaleSlopeIntercept Box08
+  set Box08.A "0"
+  set Box08.B "90"
+  set Box08.OutputFormat "VTK_UNSIGNED_SHORT"
+  set Box08.Type "2"
+
+new creaMaracasVisu:ImageChangeInformation Box11
+  set Box11.NewSpacing "1 1 1"
+
+new creaMaracasVisu:ColorLayerImageView Box12
+  set Box12.Active "false"
+  set Box12.lstBaseColor "0 0 1   0 1 1     1 1 0   1 0 0"
+
+new wx:LayoutLine Box13
+  set Box13.WinTitle "Color Layer"
+
+new wx:LayoutLine Box14
+  set Box14.Orientation "H"
+  set Box14.WinTitle "View"
+
+
+connect Box09.Out Box00.In
+connect Box09.Out Box10.in
+connect Box09.Out Box02.In
+connect Box00.Widget Box07.Widget2
+connect Box10.widget Box07.Widget1
+connect Box09.Out Box08.In
+connect Box08.Out Box11.In
+connect Box11.Out Box12.In
+connect Box12.Widget Box13.Widget1
+connect Box07.Widget Box03.Widget3
+connect Box02.Widget Box14.Widget1
+connect Box13.Widget Box03.Widget1
+connect Box14.Widget Box03.Widget2
+
+# Complex input ports
+input Image Box09.In " "
+input TitleAtribute Box03.WinTitle " "
+input wxvtkbaseview_03 Box12.WxVtkBaseView2 " "
+input wxvtkbaseview_02 Box12.WxVtkBaseView1 " "
+input wxvtkbaseview_01 Box12.WxVtkBaseView " "
+
+# Complex output ports
+output widget Box03.Widget " "
+
+
+endefine
diff --git a/packages/toolsbbtk/bbs/boxes/Crop_Widget.bbg b/packages/toolsbbtk/bbs/boxes/Crop_Widget.bbg
new file mode 100644 (file)
index 0000000..8801c43
--- /dev/null
@@ -0,0 +1,202 @@
+# ----------------------------------
+# - BBTKGEditor v 1.4 BBG BlackBox Diagram file
+# - /home/davila/Creatis/creaTools/creatools_source/bbtk/packages/toolsbbtk/bbs/boxes/Crop_Widget.bbg
+# ----------------------------------
+
+APP_START
+CATEGORY:<VOID>
+DESCRIPTION:Description ??
+AUTHOR:Author ??
+COMPLEXBOX:TRUE
+COMPLEXBOXNAME:Crop_Widget
+PACKAGENAME:toolsbbtk
+COMPLEXOUTPUTS:2
+COMPLEX_PORT
+Widget_Out
+30.876207:-144.819734:-900.000000
+FIN_COMPLEX_PORT
+COMPLEX_PORT
+Image_Out
+84.381059:-151.004812:-900.000000
+FIN_COMPLEX_PORT
+COMPLEXINPUTS:1
+COMPLEX_PORT
+Image
+183.793384:187.565034:-900.000000
+FIN_COMPLEX_PORT
+BOXES:13
+BOX
+creaMaracasVisu:ViewerNV:Box03
+ISEXEC:FALSE
+-40.613543:116.651836:-900.000000
+20.026457:106.651836:-900.000000
+PORT
+nTypeView:"-1"
+FIN_BOX
+BOX
+creaMaracasVisu:ContourVOI:Box05
+ISEXEC:FALSE
+178.678745:91.171084:-900.000000
+224.253745:81.171084:-900.000000
+FIN_BOX
+BOX
+wx:LayoutSplit:Box06
+ISEXEC:FALSE
+27.904814:-109.326892:-900.000000
+73.479814:-119.326892:-900.000000
+PORT
+Proportion:"35"
+FIN_BOX
+BOX
+wx:LayoutLine:Box07
+ISEXEC:FALSE
+-56.158854:15.953735:-900.000000
+1.401146:5.953735:-900.000000
+PORT
+WinTitle:"Crop"
+FIN_BOX
+BOX
+wx:CommandButton:Box08
+ISEXEC:FALSE
+58.225519:165.043527:-900.000000
+103.800519:155.043527:-900.000000
+PORT
+Label:"Run Crop"
+FIN_BOX
+BOX
+creaMaracasVisu:ImageChangeInformation:Box10
+ISEXEC:FALSE
+67.701745:49.306194:-900.000000
+138.876745:39.306194:-900.000000
+FIN_BOX
+BOX
+wx:OutputText:Box14
+ISEXEC:FALSE
+250.990475:-14.310989:-900.000000
+296.565475:-24.310989:-900.000000
+PORT
+Title:"Index"
+FIN_BOX
+BOX
+wx:OutputText:Box15
+ISEXEC:FALSE
+224.783932:-33.505655:-900.000000
+270.358932:-43.505655:-900.000000
+PORT
+Title:"Size"
+FIN_BOX
+BOX
+wx:LayoutLine:Box16
+ISEXEC:FALSE
+197.554904:-63.324479:-900.000000
+255.114904:-73.324479:-900.000000
+PORT
+WinTitle:"Save"
+FIN_BOX
+BOX
+vtk:ExtractVtkImageFilter:Box25
+ISEXEC:FALSE
+76.212653:83.601063:-900.000000
+147.387653:73.601063:-900.000000
+FIN_BOX
+BOX
+toolsbbtk:SaveMHD_infoCrop-Button:Box26
+ISEXEC:FALSE
+155.157235:18.780767:-900.000000
+226.332235:8.780767:-900.000000
+FIN_BOX
+BOX
+vtk:vtkImageDataPointerRelay:Box19
+ISEXEC:FALSE
+203.411015:164.651483:-900.000000
+274.586015:154.651483:-900.000000
+FIN_BOX
+BOX
+wx:LayoutTab:Box20
+ISEXEC:FALSE
+149.234786:-83.267653:-900.000000
+206.794786:-93.267653:-900.000000
+FIN_BOX
+CONNECTIONS:27
+CONNECTION
+Box03:Widget:Box06:Widget2
+NumberOfControlPoints:0
+CONNECTION
+Box05:Widget:Box07:Widget1
+NumberOfControlPoints:0
+CONNECTION
+Box08:Widget:Box07:Widget2
+NumberOfControlPoints:0
+CONNECTION
+Box08:BoxChange:Box05:BoxExecute
+NumberOfControlPoints:0
+CONNECTION
+Box05:Index:Box14:In
+NumberOfControlPoints:0
+CONNECTION
+Box05:Size:Box15:In
+NumberOfControlPoints:0
+CONNECTION
+Box14:Widget:Box16:Widget1
+NumberOfControlPoints:0
+CONNECTION
+Box15:Widget:Box16:Widget2
+NumberOfControlPoints:0
+CONNECTION
+Box05:Index:Box25:Index
+NumberOfControlPoints:0
+CONNECTION
+Box05:Size:Box25:Size
+NumberOfControlPoints:0
+CONNECTION
+Box25:Out:Box10:In
+NumberOfControlPoints:0
+CONNECTION
+Box08:BoxChange:Box25:BoxExecute
+NumberOfControlPoints:0
+CONNECTION
+Box10:Out:Box26:In
+NumberOfControlPoints:0
+CONNECTION
+Box05:Size:Box26:Size
+NumberOfControlPoints:0
+CONNECTION
+Box05:Index:Box26:Index
+NumberOfControlPoints:0
+CONNECTION
+Box26:Widget:Box16:Widget3
+NumberOfControlPoints:0
+CONNECTION
+Image:Image:Box19:In
+NumberOfControlPoints:0
+CONNECTION
+Box19:Out:Box05:In
+NumberOfControlPoints:0
+CONNECTION
+Box19:Out:Box25:In
+NumberOfControlPoints:0
+CONNECTION
+Box19:Out:Box03:In
+NumberOfControlPoints:0
+CONNECTION
+Box06:Widget:Widget_Out:Widget_Out
+NumberOfControlPoints:0
+CONNECTION
+Box10:Out:Image_Out:Image_Out
+NumberOfControlPoints:0
+CONNECTION
+Box03:wxVtkBaseView1:Box05:wxVtkBaseView
+NumberOfControlPoints:0
+CONNECTION
+Box16:Widget:Box20:Widget2
+NumberOfControlPoints:0
+CONNECTION
+Box07:Widget:Box20:Widget1
+NumberOfControlPoints:0
+CONNECTION
+Box20:Widget:Box06:Widget1
+NumberOfControlPoints:0
+CONNECTION
+Box08:BoxChange:Box16:BoxExecute
+NumberOfControlPoints:0
+APP_END
diff --git a/packages/toolsbbtk/bbs/boxes/Crop_Widget.bbs b/packages/toolsbbtk/bbs/boxes/Crop_Widget.bbs
new file mode 100644 (file)
index 0000000..758fa0e
--- /dev/null
@@ -0,0 +1,87 @@
+# ----------------------------------
+# - BBTKGEditor v 1.4 BBS BlackBox Script (Complex Box)
+# - /home/davila/Creatis/creaTools/creatools_source/bbtk/packages/toolsbbtk/bbs/boxes/Crop_Widget.bbs
+# ----------------------------------
+
+include std
+include itkvtk
+include creaMaracasVisu
+include wx
+include vtk
+include toolsbbtk
+
+define Crop_Widget toolsbbtk
+
+author "Author ??"
+description "Description ??"
+
+category "<VOID>"
+
+new ViewerNV Box03
+  set Box03.nTypeView "-1"
+
+new ContourVOI Box05
+
+new LayoutSplit Box06
+  set Box06.Proportion "35"
+
+new LayoutLine Box07
+  set Box07.WinTitle "Crop"
+
+new CommandButton Box08
+  set Box08.Label "Run Crop"
+
+new ImageChangeInformation Box10
+
+new OutputText Box14
+  set Box14.Title "Index"
+
+new OutputText Box15
+  set Box15.Title "Size"
+
+new LayoutLine Box16
+  set Box16.WinTitle "Save"
+
+new ExtractVtkImageFilter Box25
+
+new SaveMHD_infoCrop-Button Box26
+
+new vtkImageDataPointerRelay Box19
+
+new LayoutTab Box20
+
+
+connect Box03.Widget Box06.Widget2
+connect Box05.Widget Box07.Widget1
+connect Box08.Widget Box07.Widget2
+connect Box08.BoxChange Box05.BoxExecute
+connect Box05.Index Box14.In
+connect Box05.Size Box15.In
+connect Box14.Widget Box16.Widget1
+connect Box15.Widget Box16.Widget2
+connect Box05.Index Box25.Index
+connect Box05.Size Box25.Size
+connect Box25.Out Box10.In
+connect Box08.BoxChange Box25.BoxExecute
+connect Box10.Out Box26.In
+connect Box05.Size Box26.Size
+connect Box05.Index Box26.Index
+connect Box26.Widget Box16.Widget3
+connect Box19.Out Box05.In
+connect Box19.Out Box25.In
+connect Box19.Out Box03.In
+connect Box03.wxVtkBaseView1 Box05.wxVtkBaseView
+connect Box16.Widget Box20.Widget2
+connect Box07.Widget Box20.Widget1
+connect Box20.Widget Box06.Widget1
+connect Box08.BoxChange Box16.BoxExecute
+
+# Complex input ports
+input Image Box19.In " "
+
+# Complex output ports
+output Widget_Out Box06.Widget " "
+output Image_Out Box10.Out " "
+
+
+endefine
index 25707a313e2bdc21a6981645ee4c0b9c294a5c21..9666d1c03c8f0dae9aef2fa0b34d74d925063e82 100644 (file)
@@ -1,32 +1,6 @@
-# ---------------------------------------------------------------------
-#
-# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
-#                        pour la SantÈ)
-# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
-# Previous Authors : Laurent Guigues, Jean-Pierre Roux
-# CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
-#
-#  This software is governed by the CeCILL-B license under French law and
-#  abiding by the rules of distribution of free software. You can  use,
-#  modify and/ or redistribute the software under the terms of the CeCILL-B
-#  license as circulated by CEA, CNRS and INRIA at the following URL
-#  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
-#  or in the file LICENSE.txt.
-#
-#  As a counterpart to the access to the source code and  rights to copy,
-#  modify and redistribute granted by the license, users are provided only
-#  with a limited warranty  and the software's author,  the holder of the
-#  economic rights,  and the successive licensors  have only  limited
-#  liability.
-#
-#  The fact that you are presently reading this means that you have had
-#  knowledge of the CeCILL-B license and that you accept its terms.
-# ------------------------------------------------------------------------ */
-
-
 # ----------------------------------
-# - BBTKGEditor v 1.2 BBG BlackBox Diagram file
-# - /Users/davila/Creatis/All3/creatools_source/bbtk/packages/toolsbbtk/bbs/boxes/imageVtkPropertiesWidget.bbg
+# - BBTKGEditor v 1.4 BBG BlackBox Diagram file
+# - imageVtkPropertiesWidget.bbg
 # ----------------------------------
 
 APP_START
@@ -36,100 +10,122 @@ AUTHOR:Author ??
 COMPLEXBOX:TRUE
 COMPLEXBOXNAME:ImageVtkPropertiesWidget
 PACKAGENAME:toolsbbtk
-COMPLEXINPUTS:1
-COMPLEX_PORT
-in
-34.967521:145.605564:900.000000
-FIN_COMPLEX_PORT
 COMPLEXOUTPUTS:6
 COMPLEX_PORT
 widget
-3.333144:-72.520645:900.000000
+3.333144:-72.520645:-900.000000
 FIN_COMPLEX_PORT
 COMPLEX_PORT
 Dimensions
-21.417324:-71.448913:900.000000
+21.417324:-71.448913:-900.000000
 FIN_COMPLEX_PORT
 COMPLEX_PORT
 MinMax
-53.672901:-69.172114:900.000000
+53.672901:-69.172114:-900.000000
 FIN_COMPLEX_PORT
 COMPLEX_PORT
 Size
-64.566781:-70.774155:900.000000
+64.566781:-70.774155:-900.000000
 FIN_COMPLEX_PORT
 COMPLEX_PORT
 Spacing
-76.101477:-70.453747:900.000000
+76.101477:-70.453747:-900.000000
 FIN_COMPLEX_PORT
 COMPLEX_PORT
 TypeName
-88.917806:-71.094563:900.000000
+88.917806:-71.094563:-900.000000
 FIN_COMPLEX_PORT
-BOXES:8
+COMPLEXINPUTS:3
+COMPLEX_PORT
+in
+20.217710:145.236819:-900.000000
+FIN_COMPLEX_PORT
+COMPLEX_PORT
+FileName
+105.100511:147.914278:-900.000000
+FIN_COMPLEX_PORT
+COMPLEX_PORT
+boxExecute
+-92.186317:150.079323:-900.000000
+FIN_COMPLEX_PORT
+BOXES:10
 BOX
 wx:OutputText:Box02
 ISEXEC:FALSE
--173.282353:46.940241:900.000000
--127.707353:36.940241:900.000000
+-173.282353:46.940241:-900.000000
+-127.707353:36.940241:-900.000000
 PORT
 Title:"Dimensions"
 FIN_BOX
 BOX
 wx:OutputText:Box17
 ISEXEC:FALSE
--80.770416:34.681383:900.000000
--35.195416:24.681383:900.000000
+-81.960343:34.681383:-900.000000
+-36.385343:24.681383:-900.000000
 PORT
 Title:"Size"
 FIN_BOX
 BOX
 wx:OutputText:Box20
 ISEXEC:FALSE
--52.452230:20.761380:900.000000
--6.877230:10.761380:900.000000
+-52.452230:20.761380:-900.000000
+-6.877230:10.761380:-900.000000
 PORT
 Title:"Spacing"
 FIN_BOX
 BOX
 wx:OutputText:Box22
 ISEXEC:FALSE
--35.332320:1.230494:900.000000
-10.242680:-8.769506:900.000000
+-33.844911:1.230494:-900.000000
+11.730089:-8.769506:-900.000000
 PORT
 Title:"TypeName"
 FIN_BOX
 BOX
 wx:OutputText:Box26
 ISEXEC:FALSE
--131.615626:26.628991:900.000000
--86.040626:16.628991:900.000000
+-128.670557:28.919600:-900.000000
+-83.095557:18.919600:-900.000000
 PORT
 Title:"Min Max"
 FIN_BOX
 BOX
 vtk:ImageVtkProperties:Box09
 ISEXEC:FALSE
-33.571051:113.198814:900.000000
-79.146051:103.198814:900.000000
+14.396297:109.880107:-900.000000
+59.971297:99.880107:-900.000000
 FIN_BOX
 BOX
 wx:OutputText:Box10
 ISEXEC:FALSE
--196.439793:65.504307:900.000000
--150.864793:55.504307:900.000000
+-196.439793:65.504307:-900.000000
+-150.584398:55.504307:-900.000000
 PORT
 Title:"Components"
 FIN_BOX
 BOX
 wx:LayoutLine:Box11
 ISEXEC:FALSE
--146.679789:-23.669575:900.000000
--89.119789:-33.669575:900.000000
+-69.746079:-39.358124:-900.000000
+-12.186079:-49.358124:-900.000000
 PORT
 WinTitle:"Image properties"
 FIN_BOX
-CONNECTIONS:19
+BOX
+wx:OutputText:Box13
+ISEXEC:FALSE
+-27.886899:-16.541426:-900.000000
+17.688101:-26.541426:-900.000000
+PORT
+Title:"Name"
+FIN_BOX
+BOX
+std:MagicBox:Box14
+ISEXEC:FALSE
+-98.823731:125.742136:-900.000000
+-53.248731:115.742136:-900.000000
+FIN_BOX
+CONNECTIONS:30
 CONNECTION
 Box09:Components:Box10:In
 NumberOfControlPoints:0
@@ -187,4 +183,37 @@ NumberOfControlPoints:0
 CONNECTION
 Box09:Dimension:Box02:In
 NumberOfControlPoints:0
+CONNECTION
+FileName:FileName:Box13:In
+NumberOfControlPoints:0
+CONNECTION
+Box13:Widget:Box11:Widget7
+NumberOfControlPoints:0
+CONNECTION
+boxExecute:boxExecute:Box14:In
+NumberOfControlPoints:0
+CONNECTION
+Box14:Out:Box10:BoxExecute
+NumberOfControlPoints:0
+CONNECTION
+Box14:Out:Box02:BoxExecute
+NumberOfControlPoints:0
+CONNECTION
+Box14:Out:Box17:BoxExecute
+NumberOfControlPoints:0
+CONNECTION
+Box14:Out:Box20:BoxExecute
+NumberOfControlPoints:0
+CONNECTION
+Box14:Out:Box22:BoxExecute
+NumberOfControlPoints:0
+CONNECTION
+Box14:Out:Box13:BoxExecute
+NumberOfControlPoints:0
+CONNECTION
+Box14:BoxChange:Box09:BoxExecute
+NumberOfControlPoints:0
+CONNECTION
+Box14:Out:Box26:BoxExecute
+NumberOfControlPoints:0
 APP_END
index 5688245cfc550b9a14d4f727aed68e940e83aba0..d4e082047b818fbecd57fd41ceb20d78ec3e7c5b 100644 (file)
@@ -1,38 +1,13 @@
-# ---------------------------------------------------------------------
-#
-# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
-#                        pour la SantÈ)
-# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
-# Previous Authors : Laurent Guigues, Jean-Pierre Roux
-# CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
-#
-#  This software is governed by the CeCILL-B license under French law and
-#  abiding by the rules of distribution of free software. You can  use,
-#  modify and/ or redistribute the software under the terms of the CeCILL-B
-#  license as circulated by CEA, CNRS and INRIA at the following URL
-#  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
-#  or in the file LICENSE.txt.
-#
-#  As a counterpart to the access to the source code and  rights to copy,
-#  modify and redistribute granted by the license, users are provided only
-#  with a limited warranty  and the software's author,  the holder of the
-#  economic rights,  and the successive licensors  have only  limited
-#  liability.
-#
-#  The fact that you are presently reading this means that you have had
-#  knowledge of the CeCILL-B license and that you accept its terms.
-# ------------------------------------------------------------------------ */
-
-
 # ----------------------------------
-# - BBTKGEditor v 1.2 BBS BlackBox Script (Complex Box)
-# - /Users/davila/Creatis/All3/creatools_source/bbtk/packages/toolsbbtk/bbs/boxes/imageVtkPropertiesWidget.bbs
+# - BBTKGEditor v 1.4 BBS BlackBox Script (Complex Box)
+# - imageVtkPropertiesWidget.bbs
 # ----------------------------------
 
 include std
 include itkvtk
 include wx
 include vtk
+include std
 
 define ImageVtkPropertiesWidget toolsbbtk
 
@@ -41,29 +16,34 @@ description "Description ??"
 
 category "<VOID>"
 
-new OutputText Box02
+new wx:OutputText Box02
   set Box02.Title "Dimensions"
 
-new OutputText Box17
+new wx:OutputText Box17
   set Box17.Title "Size"
 
-new OutputText Box20
+new wx:OutputText Box20
   set Box20.Title "Spacing"
 
-new OutputText Box22
+new wx:OutputText Box22
   set Box22.Title "TypeName"
 
-new OutputText Box26
+new wx:OutputText Box26
   set Box26.Title "Min Max"
 
-new ImageVtkProperties Box09
+new vtk:ImageVtkProperties Box09
 
-new OutputText Box10
+new wx:OutputText Box10
   set Box10.Title "Components"
 
-new LayoutLine Box11
+new wx:LayoutLine Box11
   set Box11.WinTitle "Image properties"
 
+new wx:OutputText Box13
+  set Box13.Title "Name"
+
+new std:MagicBox Box14
+
 
 connect Box09.Components Box10.In
 connect Box09.MinMax Box26.In
@@ -77,10 +57,20 @@ connect Box20.Widget Box11.Widget4
 connect Box22.Widget Box11.Widget5
 connect Box26.Widget Box11.Widget6
 connect Box09.Dimension Box02.In
-
+connect Box13.Widget Box11.Widget7
+connect Box14.Out Box10.BoxExecute
+connect Box14.Out Box02.BoxExecute
+connect Box14.Out Box17.BoxExecute
+connect Box14.Out Box20.BoxExecute
+connect Box14.Out Box22.BoxExecute
+connect Box14.Out Box13.BoxExecute
+connect Box14.BoxChange Box09.BoxExecute
+connect Box14.Out Box26.BoxExecute
 
 # Complex input ports
 input in Box09.In " "
+input FileName Box13.In " "
+input boxExecute Box14.In " "
 
 # Complex output ports
 output widget Box11.Widget " "
@@ -90,4 +80,5 @@ output Size Box09.Size " "
 output Spacing Box09.Spacing " "
 output TypeName Box09.TypeName " "
 
+
 endefine
index f1ac03bffac9d5ed599e5a584d9944ef9ae9af20..6a7e5f2d964ae12f764483d80d947adc20bdd68e 100644 (file)
@@ -1,6 +1,6 @@
 # ----------------------------------
 # - BBTKGEditor v 1.4 BBG BlackBox Diagram file
-# - /home/corredor/Software/CreaTools/All_Dec2012/creatools_source/bbtk/packages/vtk/bbs/appli/exampleMeasureLength.bbg
+# - /home/davila/Creatis/creaTools/creatools_source/bbtk/packages/vtk/bbs/appli/exampleMeasureLength.bbg
 # ----------------------------------
 
 APP_START
@@ -9,12 +9,12 @@ DESCRIPTION:Evaluates the sum of the Euclidean distances among the points in the
 AUTHOR:Ricardo A Corredor
 COMPLEXBOX:FALSE
 COMPLEXINPUTS:0
-BOXES:8
+BOXES:20
 BOX
 creaMaracasVisu:ShowNPoints:Box00
-ISEXEC:TRUE
--51.309471:11.810349:-900.000000
--2.989471:1.810349:-900.000000
+ISEXEC:FALSE
+-20.575067:-1.900823:-900.000000
+27.744933:-11.900823:-900.000000
 PORT
 WinTitle:"Points Widget"
 PORT
@@ -22,17 +22,17 @@ WinWidth:"200"
 FIN_BOX
 BOX
 creaMaracasVisu:ViewerNV:Box02
-ISEXEC:TRUE
--26.721828:47.483487:-900.000000
-33.918172:37.483487:-900.000000
+ISEXEC:FALSE
+32.451487:18.015162:-900.000000
+93.091487:8.015162:-900.000000
 PORT
 WinTitle:"Image Viewer"
 FIN_BOX
 BOX
 wx:CommandButton:Box03
-ISEXEC:TRUE
--128.980270:47.281481:-900.000000
--83.405270:37.281481:-900.000000
+ISEXEC:FALSE
+-124.217922:-25.806219:-900.000000
+-78.642922:-35.806219:-900.000000
 PORT
 Label:"Evaluate length..."
 PORT
@@ -45,38 +45,114 @@ FIN_BOX
 BOX
 vtk:MeasureLength:Box04
 ISEXEC:FALSE
--112.956474:-50.441103:-900.000000
--67.381474:-60.441103:-900.000000
+-83.249723:-44.698142:-900.000000
+-37.674723:-54.698142:-900.000000
 FIN_BOX
 BOX
 vtk:PointsXYZtoVTKPoints:Box05
 ISEXEC:FALSE
--54.277786:-36.674180:-900.000000
-16.897214:-46.674180:-900.000000
+-68.713790:-27.331519:-900.000000
+2.461210:-37.331519:-900.000000
 FIN_BOX
 BOX
 wx:OutputText:Box06
 ISEXEC:FALSE
--113.407849:-80.683196:-900.000000
--67.832849:-90.683196:-900.000000
+-106.948982:-66.573864:-900.000000
+-61.373982:-76.573864:-900.000000
+FIN_BOX
+BOX
+creaMaracasVisu:DrawAxe3D:Box09
+ISEXEC:FALSE
+-6.044096:-121.459131:-900.000000
+39.530904:-131.459131:-900.000000
+FIN_BOX
+BOX
+std:ConcatStrings:Box10
+ISEXEC:FALSE
+82.578614:-47.313269:-900.000000
+128.153614:-57.313269:-900.000000
+FIN_BOX
+BOX
+std:ConcatStrings:Box11
+ISEXEC:FALSE
+100.248722:-68.607816:-900.000000
+145.823722:-78.607816:-900.000000
+FIN_BOX
+BOX
+std:ConcatStrings:Box12
+ISEXEC:FALSE
+89.242836:-94.110903:-900.000000
+134.817836:-104.110903:-900.000000
+FIN_BOX
+BOX
+vtk:ImageVtkProperties:Box13
+ISEXEC:FALSE
+-27.999351:-41.893546:-900.000000
+17.575649:-51.893546:-900.000000
+FIN_BOX
+BOX
+vtk:LoadHola:Box14
+ISEXEC:FALSE
+-86.746462:92.889408:-900.000000
+-41.171462:82.889408:-900.000000
+FIN_BOX
+BOX
+vtk:Transform:Box15
+ISEXEC:FALSE
+-29.422707:-79.221243:-900.000000
+16.152293:-89.221243:-900.000000
+FIN_BOX
+BOX
+std:ConcatStrings:Box16
+ISEXEC:FALSE
+-17.642995:-61.028922:-900.000000
+27.932005:-71.028922:-900.000000
+FIN_BOX
+BOX
+vtk:vtkImageDataPointerRelay:Box17
+ISEXEC:FALSE
+-73.510553:44.615154:-900.000000
+-2.335553:34.615154:-900.000000
 FIN_BOX
 BOX
-vtk:MetaImageReader:Box07
+creaImageIO:ImagesChooserDialogBox:Box18
 ISEXEC:FALSE
--58.531222:83.907503:-900.000000
--12.956222:73.907503:-900.000000
+-34.396302:72.707317:-900.000000
+36.778698:62.707317:-900.000000
 FIN_BOX
 BOX
-wx:FileSelector:Box08
+wx:LayoutSplit:Box19
+ISEXEC:TRUE
+29.399279:-160.598681:-900.000000
+74.974279:-170.598681:-900.000000
+PORT
+Orientation:"H"
+PORT
+Proportion:"30"
+FIN_BOX
+BOX
+vtk:UpdateRender:Box20
 ISEXEC:FALSE
--57.766108:111.196570:-900.000000
--12.191108:101.196570:-900.000000
+-55.505058:-104.393331:-900.000000
+-9.930058:-114.393331:-900.000000
 PORT
-Message:"Select an image ..."
+Active:"true"
+FIN_BOX
+BOX
+wx:LayoutSplit:Box21
+ISEXEC:FALSE
+-102.220830:-112.698357:-900.000000
+-56.645830:-122.698357:-900.000000
 PORT
-Title:"Select an image ..."
+Proportion:"25"
+FIN_BOX
+BOX
+wx:LayoutLine:Box22
+ISEXEC:FALSE
+-121.648659:-82.889246:-900.000000
+-64.088659:-92.889246:-900.000000
 FIN_BOX
-CONNECTIONS:13
+CONNECTIONS:33
 CONNECTION
 Box02:Renderer1:Box00:Renderer
 NumberOfControlPoints:0
@@ -99,21 +175,81 @@ CONNECTION
 Box05:Points:Box04:Points
 NumberOfControlPoints:0
 CONNECTION
-Box03:BoxChange:Box06:BoxExecute
+Box04:Length:Box06:In
 NumberOfControlPoints:0
 CONNECTION
-Box04:Length:Box06:In
+Box02:Renderer1:Box09:Renderer
+NumberOfControlPoints:0
+CONNECTION
+Box00:lstPointsX:Box10:In1
+NumberOfControlPoints:0
+CONNECTION
+Box00:lstPointsY:Box11:In1
+NumberOfControlPoints:0
+CONNECTION
+Box11:Out:Box09:lstPointY
+NumberOfControlPoints:0
+CONNECTION
+Box10:Out:Box09:lstPointX
+NumberOfControlPoints:0
+CONNECTION
+Box00:lstPointsZ:Box12:In1
+NumberOfControlPoints:0
+CONNECTION
+Box12:Out:Box09:lstPointZ
+NumberOfControlPoints:0
+CONNECTION
+Box15:Out:Box09:Transform
+NumberOfControlPoints:0
+CONNECTION
+Box13:Spacing:Box16:In1
+NumberOfControlPoints:0
+CONNECTION
+Box17:Out:Box02:In
+NumberOfControlPoints:0
+CONNECTION
+Box17:Out:Box00:Image
+NumberOfControlPoints:0
+CONNECTION
+Box17:Out:Box04:ImageData
+NumberOfControlPoints:0
+CONNECTION
+Box17:Out:Box13:In
+NumberOfControlPoints:0
+CONNECTION
+Box02:Widget:Box19:Widget2
+NumberOfControlPoints:0
+CONNECTION
+Box16:Out:Box15:Scale
+NumberOfControlPoints:0
+CONNECTION
+Box00:BoxChange:Box09:BoxExecute
 NumberOfControlPoints:0
 CONNECTION
-Box07:Out:Box02:In
+Box02:Renderer1:Box20:Renderer
+NumberOfControlPoints:0
+CONNECTION
+Box00:BoxChange:Box20:BoxExecute
+NumberOfControlPoints:0
+CONNECTION
+Box03:Widget:Box22:Widget1
+NumberOfControlPoints:0
+CONNECTION
+Box06:Widget:Box22:Widget2
+NumberOfControlPoints:0
+CONNECTION
+Box21:Widget:Box19:Widget1
+NumberOfControlPoints:0
+CONNECTION
+Box03:BoxChange:Box06:BoxExecute
 NumberOfControlPoints:0
 CONNECTION
-Box07:Out:Box04:ImageData
+Box22:Widget:Box21:Widget1
 NumberOfControlPoints:0
 CONNECTION
-Box07:Out:Box00:Image
+Box00:Widget:Box21:Widget2
 NumberOfControlPoints:0
 CONNECTION
-Box08:Out:Box07:In
+Box18:Out:Box17:In
 NumberOfControlPoints:0
 APP_END
index 4ffc5a7c40277b276ac073020fb5027b11f8bb3c..fe9bdc092f83bf5d6752103cb1988271aec67fac 100644 (file)
@@ -1,6 +1,6 @@
 # ----------------------------------
 # - BBTKGEditor v 1.4 BBS BlackBox Script
-# - /home/corredor/Software/CreaTools/All_Dec2012/creatools_source/bbtk/packages/vtk/bbs/appli/exampleMeasureLength.bbs
+# - /home/davila/Creatis/creaTools/creatools_source/bbtk/packages/vtk/bbs/appli/exampleMeasureLength.bbs
 # ----------------------------------
 
 # BBTK GEditor Script
@@ -11,6 +11,8 @@ include itkvtk
 include creaMaracasVisu
 include wx
 include vtk
+include std
+include creaImageIO
 
 author "Ricardo A Corredor"
 description "Evaluates the sum of the Euclidean distances among the points in the list following their order. Put some points in the image using the Points Widget and the click on Evaluate Length button. "
@@ -35,11 +37,37 @@ new PointsXYZtoVTKPoints Box05
 
 new OutputText Box06
 
-new MetaImageReader Box07
+new DrawAxe3D Box09
+
+new ConcatStrings Box10
+
+new ConcatStrings Box11
+
+new ConcatStrings Box12
+
+new ImageVtkProperties Box13
+
+new LoadHola Box14
+
+new Transform Box15
+
+new ConcatStrings Box16
+
+new vtkImageDataPointerRelay Box17
+
+new ImagesChooserDialogBox Box18
 
-new FileSelector Box08
-  set Box08.Message "Select an image ..."
-  set Box08.Title "Select an image ..."
+new LayoutSplit Box19
+  set Box19.Orientation "H"
+  set Box19.Proportion "30"
+
+new UpdateRender Box20
+  set Box20.Active "true"
+
+new LayoutSplit Box21
+  set Box21.Proportion "25"
+
+new LayoutLine Box22
 
 
 connect Box02.Renderer1 Box00.Renderer
@@ -56,21 +84,59 @@ connect Box00.lstPointsZ Box05.LstPointsZ
 
 connect Box05.Points Box04.Points
 
-connect Box03.BoxChange Box06.BoxExecute
-
 connect Box04.Length Box06.In
 
-connect Box07.Out Box02.In
+connect Box02.Renderer1 Box09.Renderer
+
+connect Box00.lstPointsX Box10.In1
+
+connect Box00.lstPointsY Box11.In1
+
+connect Box11.Out Box09.lstPointY
+
+connect Box10.Out Box09.lstPointX
+
+connect Box00.lstPointsZ Box12.In1
+
+connect Box12.Out Box09.lstPointZ
+
+connect Box15.Out Box09.Transform
+
+connect Box13.Spacing Box16.In1
+
+connect Box17.Out Box02.In
+
+connect Box17.Out Box00.Image
+
+connect Box17.Out Box04.ImageData
+
+connect Box17.Out Box13.In
+
+connect Box02.Widget Box19.Widget2
+
+connect Box16.Out Box15.Scale
+
+connect Box00.BoxChange Box09.BoxExecute
+
+connect Box02.Renderer1 Box20.Renderer
+
+connect Box00.BoxChange Box20.BoxExecute
+
+connect Box03.Widget Box22.Widget1
+
+connect Box06.Widget Box22.Widget2
+
+connect Box21.Widget Box19.Widget1
+
+connect Box03.BoxChange Box06.BoxExecute
 
-connect Box07.Out Box04.ImageData
+connect Box22.Widget Box21.Widget1
 
-connect Box07.Out Box00.Image
+connect Box00.Widget Box21.Widget2
 
-connect Box08.Out Box07.In
+connect Box18.Out Box17.In
 
 
 
 # Complex input ports
-exec Box00
-exec Box02
-exec Box03
+exec Box19
diff --git a/packages/vtk/bbs/appli/exampleSurfaceTexture.bbg b/packages/vtk/bbs/appli/exampleSurfaceTexture.bbg
new file mode 100644 (file)
index 0000000..386d750
--- /dev/null
@@ -0,0 +1,106 @@
+# ----------------------------------
+# - BBTKGEditor v 1.4 BBG BlackBox Diagram file
+# - /home/davila/Creatis/creaTools/creatools_source/bbtk/packages/vtk/bbs/appli/exampleSurfaceTexture.bbg
+# ----------------------------------
+
+APP_START
+CATEGORY:<VOID>
+DESCRIPTION:Description ??
+AUTHOR:Author ??
+COMPLEXBOX:FALSE
+COMPLEXINPUTS:0
+BOXES:7
+BOX
+vtk:SurfaceTexture:Box01
+ISEXEC:FALSE
+-83.571927:-32.471585:-900.000000
+-37.996927:-42.471585:-900.000000
+PORT
+ColorLevel:"1000"
+PORT
+ColorWindow:"500"
+FIN_BOX
+BOX
+vtk:LoadHola:Box02
+ISEXEC:FALSE
+-81.986263:79.866467:-900.000000
+-36.411263:69.866467:-900.000000
+FIN_BOX
+BOX
+creaMaracasVisu:ViewerNV:Box03
+ISEXEC:TRUE
+-3.543686:35.691723:-900.000000
+57.096314:25.691723:-900.000000
+FIN_BOX
+BOX
+vtk:SphereSource:Box04
+ISEXEC:FALSE
+-60.814089:18.138095:-900.000000
+-15.239089:8.138095:-900.000000
+PORT
+PhiResolution:"140"
+PORT
+Radius:"1"
+PORT
+ThetaResolution:"140"
+FIN_BOX
+BOX
+vtk:PolyDataToActor:Box05
+ISEXEC:FALSE
+-5.906143:-56.792065:-900.000000
+39.668857:-66.792065:-900.000000
+PORT
+Colour:"1 1 0"
+PORT
+Opacity:"1"
+PORT
+ScalarVisibility:"true"
+FIN_BOX
+BOX
+vtk:Transform:Box06
+ISEXEC:FALSE
+27.020605:-1.181229:-900.000000
+72.595605:-11.181229:-900.000000
+PORT
+Scale:"45 45 45"
+FIN_BOX
+BOX
+vtk:Transform:Box07
+ISEXEC:FALSE
+47.020605:18.818771:-900.000000
+92.595605:8.818771:-900.000000
+PORT
+Translate:"45  45 45"
+FIN_BOX
+CONNECTIONS:10
+CONNECTION
+Box02:Out:Box01:Image
+NumberOfControlPoints:0
+CONNECTION
+Box02:Out:Box03:In
+NumberOfControlPoints:0
+CONNECTION
+Box03:Renderer1:Box05:Renderer
+NumberOfControlPoints:0
+CONNECTION
+Box03:BoxChange:Box01:BoxExecute
+NumberOfControlPoints:0
+CONNECTION
+Box03:BoxChange:Box05:BoxExecute
+NumberOfControlPoints:0
+CONNECTION
+Box06:Out:Box05:Transform
+NumberOfControlPoints:0
+CONNECTION
+Box06:Out:Box01:Transform
+NumberOfControlPoints:0
+CONNECTION
+Box07:Out:Box06:In
+NumberOfControlPoints:0
+CONNECTION
+Box04:Out:Box05:In
+NumberOfControlPoints:0
+CONNECTION
+Box04:Out:Box01:Mesh
+NumberOfControlPoints:0
+APP_END
diff --git a/packages/vtk/bbs/appli/exampleSurfaceTexture.bbs b/packages/vtk/bbs/appli/exampleSurfaceTexture.bbs
new file mode 100644 (file)
index 0000000..4e2da53
--- /dev/null
@@ -0,0 +1,67 @@
+# ----------------------------------
+# - BBTKGEditor v 1.4 BBS BlackBox Script
+# - /home/davila/Creatis/creaTools/creatools_source/bbtk/packages/vtk/bbs/appli/exampleSurfaceTexture.bbs
+# ----------------------------------
+
+# BBTK GEditor Script
+# ----------------------
+
+include std
+include itkvtk
+include vtk
+include creaMaracasVisu
+
+author "Author ??"
+description "Description ??"
+category "<VOID>"
+
+new SurfaceTexture Box01
+  set Box01.ColorLevel "1000"
+  set Box01.ColorWindow "500"
+
+new LoadHola Box02
+
+new ViewerNV Box03
+
+new SphereSource Box04
+  set Box04.PhiResolution "140"
+  set Box04.Radius "1"
+  set Box04.ThetaResolution "140"
+
+new PolyDataToActor Box05
+  set Box05.Colour "1 1 0"
+  set Box05.Opacity "1"
+  set Box05.ScalarVisibility "true"
+
+new Transform Box06
+  set Box06.Scale "45 45 45"
+
+new Transform Box07
+  set Box07.Translate "45  45 45"
+
+
+connect Box02.Out Box01.Image
+
+connect Box02.Out Box03.In
+
+connect Box03.Renderer1 Box05.Renderer
+
+connect Box03.BoxChange Box01.BoxExecute
+
+connect Box03.BoxChange Box05.BoxExecute
+
+connect Box06.Out Box05.Transform
+
+connect Box06.Out Box01.Transform
+
+connect Box07.Out Box06.In
+
+connect Box04.Out Box05.In
+
+connect Box04.Out Box01.Mesh
+
+
+
+# Complex input ports
+message    
+exec Box03
diff --git a/packages/vtk/bbs/appli/exampleText2D.bbg b/packages/vtk/bbs/appli/exampleText2D.bbg
new file mode 100644 (file)
index 0000000..8927761
--- /dev/null
@@ -0,0 +1,82 @@
+# ----------------------------------
+# - BBTKGEditor v 1.4 BBG BlackBox Diagram file
+# - /home/davila/Creatis/All-Vtk_5-10-1/creatools_source/bbtk/packages/vtk/bbs/appli/exampleText2D.bbg
+# ----------------------------------
+
+APP_START
+CATEGORY:<VOID>
+DESCRIPTION:Description ??
+AUTHOR:Author ??
+COMPLEXBOX:FALSE
+COMPLEXINPUTS:0
+BOXES:6
+BOX
+vtk:LoadHola:Box00
+ISEXEC:FALSE
+-28.489648:74.163529:-900.000000
+17.085352:64.163529:-900.000000
+FIN_BOX
+BOX
+creaMaracasVisu:ViewerNV:Box01
+ISEXEC:TRUE
+-37.232503:52.758608:-900.000000
+23.407497:42.758608:-900.000000
+FIN_BOX
+BOX
+vtk:Text2D:Box02
+ISEXEC:TRUE
+-47.181269:-18.390143:-900.000000
+-14.406269:-28.390143:-900.000000
+PORT
+In:"hola"
+FIN_BOX
+BOX
+std:ConcatStrings:Box03
+ISEXEC:FALSE
+-83.358600:22.610832:-900.000000
+-37.783600:12.610832:-900.000000
+FIN_BOX
+BOX
+vtk:ImageVtkProperties:Box04
+ISEXEC:FALSE
+37.232503:38.890631:-900.000000
+82.807503:28.890631:-900.000000
+FIN_BOX
+BOX
+std:ConcatStrings:Box05
+ISEXEC:FALSE
+26.680782:8.139900:-900.000000
+72.255782:-1.860100:-900.000000
+FIN_BOX
+CONNECTIONS:10
+CONNECTION
+Box00:Out:Box01:In
+NumberOfControlPoints:0
+CONNECTION
+Box01:Renderer4:Box02:Renderer
+NumberOfControlPoints:0
+CONNECTION
+Box01:Point:Box03:In1
+NumberOfControlPoints:0
+CONNECTION
+Box03:Out:Box02:Point
+NumberOfControlPoints:0
+CONNECTION
+Box01:BoxChange:Box03:BoxExecute
+NumberOfControlPoints:0
+CONNECTION
+Box01:BoxChange:Box02:BoxExecute
+NumberOfControlPoints:0
+CONNECTION
+Box00:Out:Box04:In
+NumberOfControlPoints:0
+CONNECTION
+Box04:Spacing:Box05:In1
+NumberOfControlPoints:0
+CONNECTION
+Box05:Out:Box02:Spacing
+NumberOfControlPoints:0
+CONNECTION
+Box01:Point:Box02:In
+NumberOfControlPoints:0
+APP_END
diff --git a/packages/vtk/bbs/appli/exampleText2D.bbs b/packages/vtk/bbs/appli/exampleText2D.bbs
new file mode 100644 (file)
index 0000000..dcc98a4
--- /dev/null
@@ -0,0 +1,57 @@
+# ----------------------------------
+# - BBTKGEditor v 1.4 BBS BlackBox Script
+# - /home/davila/Creatis/All-Vtk_5-10-1/creatools_source/bbtk/packages/vtk/bbs/appli/exampleText2D.bbs
+# ----------------------------------
+
+# BBTK GEditor Script
+# ----------------------
+
+include std
+include itkvtk
+include vtk
+include creaMaracasVisu
+include std
+
+author "Author ??"
+description "Description ??"
+category "<VOID>"
+
+new LoadHola Box00
+
+new ViewerNV Box01
+
+new Text2D Box02
+  set Box02.In "hola"
+
+new ConcatStrings Box03
+
+new ImageVtkProperties Box04
+
+new ConcatStrings Box05
+
+
+connect Box00.Out Box01.In
+
+connect Box01.Renderer4 Box02.Renderer
+
+connect Box01.Point Box03.In1
+
+connect Box03.Out Box02.Point
+
+connect Box01.BoxChange Box03.BoxExecute
+
+connect Box01.BoxChange Box02.BoxExecute
+
+connect Box00.Out Box04.In
+
+connect Box04.Spacing Box05.In1
+
+connect Box05.Out Box02.Spacing
+
+connect Box01.Point Box02.In
+
+
+
+# Complex input ports
+exec Box01
+exec Box02
diff --git a/packages/vtk/bbs/boxes/MaskPoints_Interface.bbg b/packages/vtk/bbs/boxes/MaskPoints_Interface.bbg
new file mode 100644 (file)
index 0000000..76982b7
--- /dev/null
@@ -0,0 +1,76 @@
+# ----------------------------------
+# - BBTKGEditor v 1.4 BBG BlackBox Diagram file
+# - /home/davila/Creatis/All/creatools_source/bbtk/packages/vtk/bbs/boxes/MaskPoints_Interface.bbg
+# ----------------------------------
+
+APP_START
+CATEGORY:<VOID>
+DESCRIPTION:Description ??
+AUTHOR:Author ??
+COMPLEXBOX:TRUE
+COMPLEXBOXNAME:MaskPoints_Interface
+PACKAGENAME:vtk
+COMPLEXOUTPUTS:3
+COMPLEX_PORT
+Ratio
+-57.416280:-31.995332:-900.000000
+FIN_COMPLEX_PORT
+COMPLEX_PORT
+widget
+-33.623274:-32.997143:-900.000000
+FIN_COMPLEX_PORT
+COMPLEX_PORT
+boxChange
+-76.951591:-32.120558:-900.000000
+FIN_COMPLEX_PORT
+COMPLEXINPUTS:0
+BOXES:3
+BOX
+wx:Slider:Box00
+ISEXEC:FALSE
+-46.396362:50.779284:-900.000000
+5.003638:40.779284:-900.000000
+PORT
+In:"100"
+PORT
+Label:"true"
+PORT
+Max:"5000"
+PORT
+Min:"1"
+PORT
+ReactiveOnTrack:"true"
+PORT
+Title:"Ratio"
+FIN_BOX
+BOX
+wx:LayoutLine:Box01
+ISEXEC:FALSE
+-37.004386:28.113315:-900.000000
+20.555614:18.113315:-900.000000
+PORT
+WinTitle:"MaskPoint controls"
+FIN_BOX
+BOX
+wx:LayoutTab:Box02
+ISEXEC:FALSE
+-37.129612:3.944630:-900.000000
+20.430388:-6.055370:-900.000000
+FIN_BOX
+CONNECTIONS:5
+CONNECTION
+Box01:Widget:Box02:Widget1
+NumberOfControlPoints:0
+CONNECTION
+Box00:Out:Ratio:Ratio
+NumberOfControlPoints:0
+CONNECTION
+Box02:Widget:widget:widget
+NumberOfControlPoints:0
+CONNECTION
+Box00:BoxChange:boxChange:boxChange
+NumberOfControlPoints:0
+CONNECTION
+Box00:Widget:Box01:Widget1
+NumberOfControlPoints:0
+APP_END
diff --git a/packages/vtk/bbs/boxes/MaskPoints_Interface.bbs b/packages/vtk/bbs/boxes/MaskPoints_Interface.bbs
new file mode 100644 (file)
index 0000000..9669445
--- /dev/null
@@ -0,0 +1,42 @@
+# ----------------------------------
+# - BBTKGEditor v 1.4 BBS BlackBox Script (Complex Box)
+# - /home/davila/Creatis/All/creatools_source/bbtk/packages/vtk/bbs/boxes/MaskPoints_Interface.bbs
+# ----------------------------------
+
+include std
+include itkvtk
+include wx
+
+define MaskPoints_Interface vtk
+
+author "Author ??"
+description "Description ??"
+
+category "<VOID>"
+
+new Slider Box00
+  set Box00.In "100"
+  set Box00.Label "true"
+  set Box00.Max "5000"
+  set Box00.Min "1"
+  set Box00.ReactiveOnTrack "true"
+  set Box00.Title "Ratio"
+
+new LayoutLine Box01
+  set Box01.WinTitle "MaskPoint controls"
+
+new LayoutTab Box02
+
+
+connect Box01.Widget Box02.Widget1
+connect Box00.Widget Box01.Widget1
+
+# Complex input ports
+
+# Complex output ports
+output Ratio Box00.Out " "
+output widget Box02.Widget " "
+output boxChange Box00.BoxChange " "
+
+
+endefine
diff --git a/packages/vtk/bbs/boxes/RescaleSlopeIntercept_Interface.bbg b/packages/vtk/bbs/boxes/RescaleSlopeIntercept_Interface.bbg
new file mode 100644 (file)
index 0000000..44343c0
--- /dev/null
@@ -0,0 +1,110 @@
+# ----------------------------------
+# - BBTKGEditor v 1.4 BBG BlackBox Diagram file
+# - RescaleSlopeIntercept_Interface.bbg
+# ----------------------------------
+
+APP_START
+CATEGORY:<VOID>
+DESCRIPTION:Description ??
+AUTHOR:Author ??
+COMPLEXBOX:TRUE
+COMPLEXBOXNAME:RescaleReslopeIntercept_Interface
+PACKAGENAME:vtk
+COMPLEXOUTPUTS:5
+COMPLEX_PORT
+A
+-42.146166:-76.342714:-900.000000
+FIN_COMPLEX_PORT
+COMPLEX_PORT
+B
+-21.782479:-75.022817:-900.000000
+FIN_COMPLEX_PORT
+COMPLEX_PORT
+Type
+-2.253170:-76.872872:-900.000000
+FIN_COMPLEX_PORT
+COMPLEX_PORT
+Format
+16.832508:-76.342714:-900.000000
+FIN_COMPLEX_PORT
+COMPLEX_PORT
+widget
+39.510006:-76.104144:-900.000000
+FIN_COMPLEX_PORT
+COMPLEXINPUTS:0
+BOXES:5
+BOX
+wx:InputText:Box00
+ISEXEC:FALSE
+-31.986641:71.126864:-900.000000
+13.588359:61.126864:-900.000000
+PORT
+In:"1"
+PORT
+Title:"A"
+FIN_BOX
+BOX
+wx:InputText:Box01
+ISEXEC:FALSE
+10.391818:55.855422:-900.000000
+55.966818:45.855422:-900.000000
+PORT
+In:"0"
+PORT
+Title:"B"
+FIN_BOX
+BOX
+wx:LayoutLine:Box06
+ISEXEC:TRUE
+39.929176:-34.289764:-900.000000
+85.504176:-44.289764:-900.000000
+FIN_BOX
+BOX
+wx:ComboBox:Box07
+ISEXEC:FALSE
+38.031405:33.336268:-900.000000
+83.606405:23.336268:-900.000000
+PORT
+In:"SlopeIntercept(np=A*p+B) Invert Redimension(A=newMin_B=newMax)  InvertRedimension(A=newMin_B=newMax)"
+PORT
+Title:"Type"
+FIN_BOX
+BOX
+wx:ComboBox:Box08
+ISEXEC:FALSE
+61.438112:15.793867:-900.000000
+107.013112:5.793867:-900.000000
+PORT
+In:"SAME VTK_BIT VTK_CHAR VTK_UNSIGNED_CHAR  VTK_INT VTK_UNSIGNED_INT VTK_SHORT VTK_UNSIGNED_SHORT VTK_LONG VTK_UNSIGNED_LONG VTK_FLOAT VTK_DOUBLE"
+PORT
+Title:"Format"
+FIN_BOX
+CONNECTIONS:9
+CONNECTION
+Box00:Widget:Box06:Widget1
+NumberOfControlPoints:0
+CONNECTION
+Box01:Widget:Box06:Widget2
+NumberOfControlPoints:0
+CONNECTION
+Box07:Widget:Box06:Widget3
+NumberOfControlPoints:0
+CONNECTION
+Box08:Widget:Box06:Widget4
+NumberOfControlPoints:0
+CONNECTION
+Box00:Out:A:A
+NumberOfControlPoints:0
+CONNECTION
+Box01:Out:B:B
+NumberOfControlPoints:0
+CONNECTION
+Box06:Widget:widget:widget
+NumberOfControlPoints:0
+CONNECTION
+Box08:OutString:Format:Format
+NumberOfControlPoints:0
+CONNECTION
+Box07:Out:Type:Type
+NumberOfControlPoints:0
+APP_END
diff --git a/packages/vtk/bbs/boxes/RescaleSlopeIntercept_Interface.bbs b/packages/vtk/bbs/boxes/RescaleSlopeIntercept_Interface.bbs
new file mode 100644 (file)
index 0000000..f2cbefe
--- /dev/null
@@ -0,0 +1,52 @@
+# ----------------------------------
+# - BBTKGEditor v 1.4 BBS BlackBox Script (Complex Box)
+# - RescaleSlopeIntercept_Interface.bbs
+# ----------------------------------
+
+include std
+include itkvtk
+include wx
+
+define RescaleReslopeIntercept_Interface vtk
+
+author "Author ??"
+description "Description ??"
+
+category "<VOID>"
+
+new wx:InputText Box00
+  set Box00.In "1"
+  set Box00.Title "A"
+
+new wx:InputText Box01
+  set Box01.In "0"
+  set Box01.Title "B"
+
+new wx:LayoutLine Box06
+
+new wx:ComboBox Box07
+  set Box07.In "SlopeIntercept(np=A*p+B) Invert Redimension(A=newMin_B=newMax)  InvertRedimension(A=newMin_B=newMax)"
+  set Box07.Title "Type"
+
+new wx:ComboBox Box08
+  set Box08.In "SAME VTK_BIT VTK_CHAR VTK_UNSIGNED_CHAR  VTK_INT VTK_UNSIGNED_INT VTK_SHORT VTK_UNSIGNED_SHORT VTK_LONG VTK_UNSIGNED_LONG VTK_FLOAT VTK_DOUBLE"
+  set Box08.Title "Format"
+
+
+connect Box00.Widget Box06.Widget1
+connect Box01.Widget Box06.Widget2
+connect Box07.Widget Box06.Widget3
+connect Box08.Widget Box06.Widget4
+
+# Complex input ports
+
+# Complex output ports
+output A Box00.Out " "
+output B Box01.Out " "
+output widget Box06.Widget " "
+output Format Box08.OutString " "
+output Type Box07.Out " "
+
+exec Box06
+
+endefine
diff --git a/packages/vtk/bbs/boxes/TransformWidget.bbg b/packages/vtk/bbs/boxes/TransformWidget.bbg
new file mode 100644 (file)
index 0000000..c8f761f
--- /dev/null
@@ -0,0 +1,785 @@
+# ----------------------------------
+# - BBTKGEditor v 1.4 BBG BlackBox Diagram file
+# - TransformWidget.bbg
+# ----------------------------------
+
+APP_START
+CATEGORY:<VOID>
+DESCRIPTION:Description ??
+AUTHOR:Author ??
+COMPLEXBOX:TRUE
+COMPLEXBOXNAME:TransformWidget
+PACKAGENAME:vtk
+COMPLEXOUTPUTS:3
+COMPLEX_PORT
+Transform
+-86.671048:-194.538089:-900.000000
+FIN_COMPLEX_PORT
+COMPLEX_PORT
+Window
+18.379834:-171.995414:-900.000000
+FIN_COMPLEX_PORT
+COMPLEX_PORT
+BoxChange
+-161.933838:-200.282326:-900.000000
+FIN_COMPLEX_PORT
+COMPLEXINPUTS:4
+COMPLEX_PORT
+TitleWindow
+36.138665:171.471207:-900.000000
+FIN_COMPLEX_PORT
+COMPLEX_PORT
+translateXYZ
+68.651996:254.746226:-900.000000
+FIN_COMPLEX_PORT
+COMPLEX_PORT
+rotateXYZ
+441.011999:258.204497:-900.000000
+FIN_COMPLEX_PORT
+COMPLEX_PORT
+scaleXYZ
+248.316029:251.841995:-900.000000
+FIN_COMPLEX_PORT
+BOXES:53
+BOX
+wx:LayoutTab:Box00
+ISEXEC:FALSE
+14.507537:-147.233687:-900.000000
+60.082537:-157.233687:-900.000000
+FIN_BOX
+BOX
+wx:LayoutLine:Box01
+ISEXEC:FALSE
+-41.534584:-108.537426:-900.000000
+4.040416:-118.537426:-900.000000
+PORT
+WinTitle:"Rotation"
+FIN_BOX
+BOX
+wx:Slider:Box03
+ISEXEC:FALSE
+-197.665356:146.434686:-900.000000
+-132.404978:136.434686:-900.000000
+PORT
+ChangeResolution:"true"
+PORT
+Label:"true"
+PORT
+Max:"180"
+PORT
+Min:"-180"
+PORT
+ReactiveOnTrack:"true"
+PORT
+Title:"Rotation X"
+FIN_BOX
+BOX
+wx:Slider:Box04
+ISEXEC:FALSE
+-153.996282:129.813557:-900.000000
+-119.179436:119.813557:-900.000000
+PORT
+ChangeResolution:"true"
+PORT
+Label:"true"
+PORT
+Max:"180"
+PORT
+Min:"-180"
+PORT
+ReactiveOnTrack:"true"
+PORT
+Title:"Rotation Y"
+FIN_BOX
+BOX
+wx:Slider:Box05
+ISEXEC:FALSE
+-68.019168:146.959188:-900.000000
+-35.244168:136.959188:-900.000000
+PORT
+ChangeResolution:"true"
+PORT
+Label:"true"
+PORT
+Max:"180"
+PORT
+Min:"-180"
+PORT
+ReactiveOnTrack:"true"
+PORT
+Title:"Rotation Z"
+FIN_BOX
+BOX
+wx:LayoutLine:Box06
+ISEXEC:FALSE
+23.720064:-108.213700:-900.000000
+69.295064:-118.213700:-900.000000
+PORT
+WinTitle:"Translate"
+FIN_BOX
+BOX
+wx:Slider:Box07
+ISEXEC:FALSE
+-11.514057:86.479654:-900.000000
+21.260943:76.479654:-900.000000
+PORT
+ChangeResolution:"true"
+PORT
+Label:"true"
+PORT
+Max:"1800"
+PORT
+Min:"-1800"
+PORT
+ReactiveOnTrack:"true"
+PORT
+Title:"Translation X"
+FIN_BOX
+BOX
+wx:Slider:Box08
+ISEXEC:FALSE
+6.385006:71.964258:-900.000000
+39.160006:61.964258:-900.000000
+PORT
+ChangeResolution:"true"
+PORT
+Label:"true"
+PORT
+Max:"1800"
+PORT
+Min:"-1800"
+PORT
+ReactiveOnTrack:"true"
+PORT
+Title:"Translation Y"
+FIN_BOX
+BOX
+wx:Slider:Box09
+ISEXEC:FALSE
+28.124282:58.249919:-900.000000
+60.899282:48.249919:-900.000000
+PORT
+ChangeResolution:"true"
+PORT
+Label:"true"
+PORT
+Max:"1800"
+PORT
+Min:"-1800"
+PORT
+ReactiveOnTrack:"true"
+PORT
+Title:"Translation Z"
+FIN_BOX
+BOX
+wx:LayoutLine:Box10
+ISEXEC:FALSE
+101.086854:-111.014230:-900.000000
+146.661854:-121.014230:-900.000000
+PORT
+WinTitle:"Scale"
+FIN_BOX
+BOX
+wx:Slider:Box11
+ISEXEC:FALSE
+70.956408:111.372736:-900.000000
+103.731408:101.372736:-900.000000
+PORT
+ChangeResolution:"true"
+PORT
+In:"100"
+PORT
+Label:"true"
+PORT
+Max:"500"
+PORT
+Min:"0"
+PORT
+ReactiveOnTrack:"true"
+PORT
+Title:"Scale X"
+FIN_BOX
+BOX
+wx:Slider:Box12
+ISEXEC:FALSE
+88.855471:96.857340:-900.000000
+121.630471:86.857340:-900.000000
+PORT
+ChangeResolution:"true"
+PORT
+In:"100"
+PORT
+Label:"true"
+PORT
+Max:"500"
+PORT
+Min:"0"
+PORT
+ReactiveOnTrack:"true"
+PORT
+Title:"Scale Y"
+FIN_BOX
+BOX
+wx:Slider:Box13
+ISEXEC:FALSE
+102.852794:83.842614:-900.000000
+135.627794:73.842614:-900.000000
+PORT
+ChangeResolution:"true"
+PORT
+In:"100"
+PORT
+Label:"true"
+PORT
+Max:"500"
+PORT
+Min:"0"
+PORT
+ReactiveOnTrack:"true"
+PORT
+Title:"Scale Z"
+FIN_BOX
+BOX
+vtk:Transform:Box14
+ISEXEC:FALSE
+-185.285891:-60.198977:-900.000000
+-139.710891:-70.198977:-900.000000
+FIN_BOX
+BOX
+std:ConcatStrings:Box15
+ISEXEC:FALSE
+-224.132618:19.025896:-900.000000
+-152.840652:9.025896:-900.000000
+PORT
+In2:" "
+PORT
+In3:"1 0 0"
+FIN_BOX
+BOX
+std:ConcatStrings:Box16
+ISEXEC:FALSE
+-17.310626:-17.010438:-900.000000
+28.264374:-27.010438:-900.000000
+PORT
+In2:" "
+PORT
+In4:" "
+FIN_BOX
+BOX
+std:MultipleInputs:Box17
+ISEXEC:FALSE
+-168.208835:-23.486191:-900.000000
+-122.633835:-33.486191:-900.000000
+FIN_BOX
+BOX
+std:MultipleInputs:Box18
+ISEXEC:FALSE
+-27.838379:20.199010:-900.000000
+17.736621:10.199010:-900.000000
+FIN_BOX
+BOX
+std:MultipleInputs:Box19
+ISEXEC:FALSE
+70.610673:4.873998:-900.000000
+116.185673:-5.126002:-900.000000
+FIN_BOX
+BOX
+std:MultipleInputs:Box20
+ISEXEC:FALSE
+-93.740342:-66.389873:-900.000000
+-48.165342:-76.389873:-900.000000
+FIN_BOX
+BOX
+std:Div:Box22
+ISEXEC:FALSE
+65.449748:-31.557751:-900.000000
+98.224748:-41.557751:-900.000000
+PORT
+In2:"100"
+FIN_BOX
+BOX
+std:Div:Box23
+ISEXEC:FALSE
+89.585883:-13.970497:-900.000000
+122.360883:-23.970497:-900.000000
+PORT
+In2:"100"
+FIN_BOX
+BOX
+std:Div:Box24
+ISEXEC:FALSE
+134.402698:-27.748939:-900.000000
+167.177698:-37.748939:-900.000000
+PORT
+In2:"100"
+FIN_BOX
+BOX
+vtk:Transform:Box28
+ISEXEC:FALSE
+-148.880458:-89.700120:-900.000000
+-103.305458:-99.700120:-900.000000
+FIN_BOX
+BOX
+std:ConcatStrings:Box29
+ISEXEC:FALSE
+-148.940720:71.248536:-900.000000
+-103.365720:61.248536:-900.000000
+PORT
+In2:" "
+PORT
+In3:"0 1 0"
+FIN_BOX
+BOX
+vtk:Transform:Box30
+ISEXEC:FALSE
+-123.434950:-110.743279:-900.000000
+-77.859950:-120.743279:-900.000000
+FIN_BOX
+BOX
+std:ConcatStrings:Box31
+ISEXEC:FALSE
+-112.239505:28.109798:-900.000000
+-66.664505:18.109798:-900.000000
+PORT
+In2:" "
+PORT
+In3:"0 0 1"
+FIN_BOX
+BOX
+vtk:Transform:Box32
+ISEXEC:FALSE
+-101.643642:-136.763234:-900.000000
+-56.068642:-146.763234:-900.000000
+FIN_BOX
+BOX
+vtk:Transform:Box33
+ISEXEC:FALSE
+-57.372385:-165.579870:-900.000000
+-11.797385:-175.579870:-900.000000
+FIN_BOX
+BOX
+vtk:Transform:Box34
+ISEXEC:FALSE
+-227.533440:-90.367558:-900.000000
+-169.142393:-100.367558:-900.000000
+FIN_BOX
+BOX
+std:Add:Box35
+ISEXEC:FALSE
+-36.599414:55.930863:-900.000000
+-3.824414:45.930863:-900.000000
+FIN_BOX
+BOX
+std:GetVectorDoubleElement:Box36
+ISEXEC:FALSE
+-10.046444:206.535990:-900.000000
+61.128556:196.535990:-900.000000
+PORT
+ErrorValue:"0"
+PORT
+I:"0"
+FIN_BOX
+BOX
+std:Add:Box40
+ISEXEC:FALSE
+-5.812270:34.856738:-900.000000
+26.962730:24.856738:-900.000000
+FIN_BOX
+BOX
+std:GetVectorDoubleElement:Box41
+ISEXEC:FALSE
+9.953556:190.025656:-900.000000
+81.128556:180.025656:-900.000000
+PORT
+ErrorValue:"0"
+PORT
+I:"1"
+FIN_BOX
+BOX
+std:Add:Box42
+ISEXEC:FALSE
+54.017185:38.261131:-900.000000
+86.792185:28.261131:-900.000000
+FIN_BOX
+BOX
+std:GetVectorDoubleElement:Box43
+ISEXEC:FALSE
+89.282849:193.844940:-900.000000
+160.457849:183.844940:-900.000000
+PORT
+ErrorValue:"0"
+PORT
+I:"2"
+FIN_BOX
+BOX
+std:Add:Box44
+ISEXEC:FALSE
+27.134598:18.846567:-900.000000
+59.909598:8.846567:-900.000000
+FIN_BOX
+BOX
+std:ConcatStrings:Box45
+ISEXEC:FALSE
+173.209228:-127.700838:-900.000000
+218.784228:-137.700838:-900.000000
+PORT
+In2:" "
+PORT
+In4:" "
+FIN_BOX
+BOX
+std:GetVectorDoubleElement:Box47
+ISEXEC:FALSE
+170.930937:214.089285:-900.000000
+242.105937:204.089285:-900.000000
+PORT
+ErrorValue:"1"
+PORT
+I:"0"
+FIN_BOX
+BOX
+std:GetVectorDoubleElement:Box49
+ISEXEC:FALSE
+190.930937:197.578952:-900.000000
+262.105937:187.578952:-900.000000
+PORT
+ErrorValue:"1"
+PORT
+I:"1"
+FIN_BOX
+BOX
+std:GetVectorDoubleElement:Box50
+ISEXEC:FALSE
+269.883057:204.038445:-900.000000
+341.058057:194.038445:-900.000000
+PORT
+ErrorValue:"1"
+PORT
+I:"2"
+FIN_BOX
+BOX
+std:MagicBox:Box52
+ISEXEC:FALSE
+284.940458:225.620937:-900.000000
+330.515458:215.620937:-900.000000
+FIN_BOX
+BOX
+std:MagicBox:Box53
+ISEXEC:FALSE
+68.367796:235.993191:-900.000000
+113.942796:225.993191:-900.000000
+FIN_BOX
+BOX
+std:Add:Box55
+ISEXEC:FALSE
+-246.170786:89.536993:-900.000000
+-184.093423:79.536993:-900.000000
+FIN_BOX
+BOX
+std:GetVectorDoubleElement:Box56
+ISEXEC:FALSE
+352.631646:218.052851:-900.000000
+423.806646:208.052851:-900.000000
+PORT
+ErrorValue:"0"
+PORT
+I:"0"
+FIN_BOX
+BOX
+std:Add:Box57
+ISEXEC:FALSE
+-126.518930:100.460189:-900.000000
+-93.743930:90.460189:-900.000000
+FIN_BOX
+BOX
+std:GetVectorDoubleElement:Box58
+ISEXEC:FALSE
+372.631646:201.542518:-900.000000
+443.806646:191.542518:-900.000000
+PORT
+ErrorValue:"0"
+PORT
+I:"1"
+FIN_BOX
+BOX
+std:GetVectorDoubleElement:Box59
+ISEXEC:FALSE
+451.960938:205.361801:-900.000000
+523.135938:195.361801:-900.000000
+PORT
+ErrorValue:"0"
+PORT
+I:"2"
+FIN_BOX
+BOX
+std:Add:Box60
+ISEXEC:FALSE
+-80.748185:83.318499:-900.000000
+-47.973185:73.318499:-900.000000
+FIN_BOX
+BOX
+std:MagicBox:Box61
+ISEXEC:FALSE
+466.641166:229.584503:-900.000000
+512.216166:219.584503:-900.000000
+FIN_BOX
+BOX
+std:Mul:Box62
+ISEXEC:FALSE
+153.861143:-55.638859:-900.000000
+186.636143:-65.638859:-900.000000
+FIN_BOX
+BOX
+std:Mul:Box63
+ISEXEC:FALSE
+173.106797:-83.539814:-900.000000
+205.881797:-93.539814:-900.000000
+FIN_BOX
+BOX
+std:Mul:Box64
+ISEXEC:FALSE
+198.010045:-103.520138:-900.000000
+230.785045:-113.520138:-900.000000
+FIN_BOX
+CONNECTIONS:80
+CONNECTION
+Box01:Widget:Box00:Widget1
+NumberOfControlPoints:0
+CONNECTION
+Box05:Widget:Box01:Widget3
+NumberOfControlPoints:0
+CONNECTION
+Box04:Widget:Box01:Widget2
+NumberOfControlPoints:0
+CONNECTION
+Box03:Widget:Box01:Widget1
+NumberOfControlPoints:0
+CONNECTION
+Box09:Widget:Box06:Widget3
+NumberOfControlPoints:0
+CONNECTION
+Box08:Widget:Box06:Widget2
+NumberOfControlPoints:0
+CONNECTION
+Box07:Widget:Box06:Widget1
+NumberOfControlPoints:0
+CONNECTION
+Box13:Widget:Box10:Widget3
+NumberOfControlPoints:0
+CONNECTION
+Box12:Widget:Box10:Widget2
+NumberOfControlPoints:0
+CONNECTION
+Box11:Widget:Box10:Widget1
+NumberOfControlPoints:0
+CONNECTION
+Box06:Widget:Box00:Widget2
+NumberOfControlPoints:0
+CONNECTION
+Box10:Widget:Box00:Widget3
+NumberOfControlPoints:0
+CONNECTION
+Box16:Out:Box14:Translate
+NumberOfControlPoints:0
+CONNECTION
+Box03:BoxChange:Box17:In1
+NumberOfControlPoints:0
+CONNECTION
+Box04:BoxChange:Box17:In2
+NumberOfControlPoints:0
+CONNECTION
+Box05:BoxChange:Box17:In3
+NumberOfControlPoints:0
+CONNECTION
+Box07:BoxChange:Box18:In1
+NumberOfControlPoints:0
+CONNECTION
+Box08:BoxChange:Box18:In2
+NumberOfControlPoints:0
+CONNECTION
+Box09:BoxChange:Box18:In3
+NumberOfControlPoints:0
+CONNECTION
+Box11:BoxChange:Box19:In1
+NumberOfControlPoints:0
+CONNECTION
+Box12:BoxChange:Box19:In2
+NumberOfControlPoints:0
+CONNECTION
+Box13:BoxChange:Box19:In3
+NumberOfControlPoints:0
+CONNECTION
+Box17:BoxChange:Box20:In1
+NumberOfControlPoints:0
+CONNECTION
+Box18:BoxChange:Box20:In2
+NumberOfControlPoints:0
+CONNECTION
+Box19:BoxChange:Box20:In3
+NumberOfControlPoints:0
+CONNECTION
+Box00:Widget:Window:Window
+NumberOfControlPoints:0
+CONNECTION
+Box11:Out:Box22:In1
+NumberOfControlPoints:0
+CONNECTION
+Box12:Out:Box23:In1
+NumberOfControlPoints:0
+CONNECTION
+Box13:Out:Box24:In1
+NumberOfControlPoints:0
+CONNECTION
+Box15:Out:Box28:RotateWXYZ
+NumberOfControlPoints:0
+CONNECTION
+Box29:Out:Box30:RotateWXYZ
+NumberOfControlPoints:0
+CONNECTION
+Box31:Out:Box32:RotateWXYZ
+NumberOfControlPoints:0
+CONNECTION
+Box28:Out:Box30:In
+NumberOfControlPoints:0
+CONNECTION
+Box30:Out:Box32:In
+NumberOfControlPoints:0
+CONNECTION
+TitleWindow:TitleWindow:Box00:WinTitle
+NumberOfControlPoints:0
+CONNECTION
+Box14:Out:Box28:In
+NumberOfControlPoints:0
+CONNECTION
+Box20:BoxChange:Box33:BoxExecute
+NumberOfControlPoints:0
+CONNECTION
+Box32:Out:Box33:In
+NumberOfControlPoints:0
+CONNECTION
+Box33:Out:Transform:Transform
+NumberOfControlPoints:0
+CONNECTION
+Box33:BoxChange:BoxChange:BoxChange
+NumberOfControlPoints:0
+CONNECTION
+Box36:Out:Box35:In2
+NumberOfControlPoints:0
+CONNECTION
+Box07:Out:Box35:In1
+NumberOfControlPoints:0
+CONNECTION
+Box35:Out:Box16:In1
+NumberOfControlPoints:0
+CONNECTION
+Box41:Out:Box40:In2
+NumberOfControlPoints:0
+CONNECTION
+Box08:Out:Box40:In1
+NumberOfControlPoints:0
+CONNECTION
+Box40:Out:Box16:In3
+NumberOfControlPoints:0
+CONNECTION
+Box43:Out:Box44:In2
+NumberOfControlPoints:0
+CONNECTION
+Box09:Out:Box44:In1
+NumberOfControlPoints:0
+CONNECTION
+Box44:Out:Box16:In5
+NumberOfControlPoints:0
+CONNECTION
+Box45:Out:Box33:Scale
+NumberOfControlPoints:0
+CONNECTION
+scaleXYZ:scaleXYZ:Box52:In
+NumberOfControlPoints:0
+CONNECTION
+Box52:Out:Box50:In
+NumberOfControlPoints:0
+CONNECTION
+Box52:Out:Box47:In
+NumberOfControlPoints:0
+CONNECTION
+Box52:Out:Box49:In
+NumberOfControlPoints:0
+CONNECTION
+Box53:Out:Box43:In
+NumberOfControlPoints:0
+CONNECTION
+Box53:Out:Box36:In
+NumberOfControlPoints:0
+CONNECTION
+Box53:Out:Box41:In
+NumberOfControlPoints:0
+CONNECTION
+translateXYZ:translateXYZ:Box53:In
+NumberOfControlPoints:0
+CONNECTION
+Box56:Out:Box55:In2
+NumberOfControlPoints:0
+CONNECTION
+Box58:Out:Box57:In2
+NumberOfControlPoints:0
+CONNECTION
+Box59:Out:Box60:In2
+NumberOfControlPoints:0
+CONNECTION
+Box61:Out:Box59:In
+NumberOfControlPoints:0
+CONNECTION
+Box61:Out:Box56:In
+NumberOfControlPoints:0
+CONNECTION
+Box61:Out:Box58:In
+NumberOfControlPoints:0
+CONNECTION
+rotateXYZ:rotateXYZ:Box61:In
+NumberOfControlPoints:0
+CONNECTION
+Box03:Out:Box55:In1
+NumberOfControlPoints:0
+CONNECTION
+Box55:Out:Box15:In1
+NumberOfControlPoints:0
+CONNECTION
+Box04:Out:Box57:In1
+NumberOfControlPoints:0
+CONNECTION
+Box57:Out:Box29:In1
+NumberOfControlPoints:0
+CONNECTION
+Box05:Out:Box60:In1
+NumberOfControlPoints:0
+CONNECTION
+Box60:Out:Box31:In1
+NumberOfControlPoints:0
+CONNECTION
+Box22:Out:Box62:In1
+NumberOfControlPoints:0
+CONNECTION
+Box23:Out:Box63:In1
+NumberOfControlPoints:0
+CONNECTION
+Box24:Out:Box64:In1
+NumberOfControlPoints:0
+CONNECTION
+Box62:Out:Box45:In1
+NumberOfControlPoints:0
+CONNECTION
+Box63:Out:Box45:In3
+NumberOfControlPoints:0
+CONNECTION
+Box64:Out:Box45:In5
+NumberOfControlPoints:0
+CONNECTION
+Box47:Out:Box62:In2
+NumberOfControlPoints:0
+CONNECTION
+Box49:Out:Box63:In2
+NumberOfControlPoints:0
+CONNECTION
+Box50:Out:Box64:In2
+NumberOfControlPoints:0
+APP_END
diff --git a/packages/vtk/bbs/boxes/TransformWidget.bbs b/packages/vtk/bbs/boxes/TransformWidget.bbs
new file mode 100644 (file)
index 0000000..26aff58
--- /dev/null
@@ -0,0 +1,303 @@
+# ----------------------------------
+# - BBTKGEditor v 1.4 BBS BlackBox Script (Complex Box)
+# - TransformWidget.bbs
+# ----------------------------------
+
+include std
+include itkvtk
+include wx
+include vtk
+include std
+
+define TransformWidget vtk
+
+author "Author ??"
+description "Description ??"
+
+category "<VOID>"
+
+new wx:LayoutTab Box00
+
+new wx:LayoutLine Box01
+  set Box01.WinTitle "Rotation"
+
+new wx:Slider Box03
+  set Box03.ChangeResolution "true"
+  set Box03.Label "true"
+  set Box03.Max "180"
+  set Box03.Min "-180"
+  set Box03.ReactiveOnTrack "true"
+  set Box03.Title "Rotation X"
+
+new wx:Slider Box04
+  set Box04.ChangeResolution "true"
+  set Box04.Label "true"
+  set Box04.Max "180"
+  set Box04.Min "-180"
+  set Box04.ReactiveOnTrack "true"
+  set Box04.Title "Rotation Y"
+
+new wx:Slider Box05
+  set Box05.ChangeResolution "true"
+  set Box05.Label "true"
+  set Box05.Max "180"
+  set Box05.Min "-180"
+  set Box05.ReactiveOnTrack "true"
+  set Box05.Title "Rotation Z"
+
+new wx:LayoutLine Box06
+  set Box06.WinTitle "Translate"
+
+new wx:Slider Box07
+  set Box07.ChangeResolution "true"
+  set Box07.Label "true"
+  set Box07.Max "1800"
+  set Box07.Min "-1800"
+  set Box07.ReactiveOnTrack "true"
+  set Box07.Title "Translation X"
+
+new wx:Slider Box08
+  set Box08.ChangeResolution "true"
+  set Box08.Label "true"
+  set Box08.Max "1800"
+  set Box08.Min "-1800"
+  set Box08.ReactiveOnTrack "true"
+  set Box08.Title "Translation Y"
+
+new wx:Slider Box09
+  set Box09.ChangeResolution "true"
+  set Box09.Label "true"
+  set Box09.Max "1800"
+  set Box09.Min "-1800"
+  set Box09.ReactiveOnTrack "true"
+  set Box09.Title "Translation Z"
+
+new wx:LayoutLine Box10
+  set Box10.WinTitle "Scale"
+
+new wx:Slider Box11
+  set Box11.ChangeResolution "true"
+  set Box11.In "100"
+  set Box11.Label "true"
+  set Box11.Max "500"
+  set Box11.Min "0"
+  set Box11.ReactiveOnTrack "true"
+  set Box11.Title "Scale X"
+
+new wx:Slider Box12
+  set Box12.ChangeResolution "true"
+  set Box12.In "100"
+  set Box12.Label "true"
+  set Box12.Max "500"
+  set Box12.Min "0"
+  set Box12.ReactiveOnTrack "true"
+  set Box12.Title "Scale Y"
+
+new wx:Slider Box13
+  set Box13.ChangeResolution "true"
+  set Box13.In "100"
+  set Box13.Label "true"
+  set Box13.Max "500"
+  set Box13.Min "0"
+  set Box13.ReactiveOnTrack "true"
+  set Box13.Title "Scale Z"
+
+new vtk:Transform Box14
+
+new std:ConcatStrings Box15
+  set Box15.In2 " "
+  set Box15.In3 "1 0 0"
+
+new std:ConcatStrings Box16
+  set Box16.In2 " "
+  set Box16.In4 " "
+
+new std:MultipleInputs Box17
+
+new std:MultipleInputs Box18
+
+new std:MultipleInputs Box19
+
+new std:MultipleInputs Box20
+
+new std:Div Box22
+  set Box22.In2 "100"
+
+new std:Div Box23
+  set Box23.In2 "100"
+
+new std:Div Box24
+  set Box24.In2 "100"
+
+new vtk:Transform Box28
+
+new std:ConcatStrings Box29
+  set Box29.In2 " "
+  set Box29.In3 "0 1 0"
+
+new vtk:Transform Box30
+
+new std:ConcatStrings Box31
+  set Box31.In2 " "
+  set Box31.In3 "0 0 1"
+
+new vtk:Transform Box32
+
+new vtk:Transform Box33
+
+new vtk:Transform Box34
+
+new std:Add Box35
+
+new std:GetVectorDoubleElement Box36
+  set Box36.ErrorValue "0"
+  set Box36.I "0"
+
+new std:Add Box40
+
+new std:GetVectorDoubleElement Box41
+  set Box41.ErrorValue "0"
+  set Box41.I "1"
+
+new std:Add Box42
+
+new std:GetVectorDoubleElement Box43
+  set Box43.ErrorValue "0"
+  set Box43.I "2"
+
+new std:Add Box44
+
+new std:ConcatStrings Box45
+  set Box45.In2 " "
+  set Box45.In4 " "
+
+new std:GetVectorDoubleElement Box47
+  set Box47.ErrorValue "1"
+  set Box47.I "0"
+
+new std:GetVectorDoubleElement Box49
+  set Box49.ErrorValue "1"
+  set Box49.I "1"
+
+new std:GetVectorDoubleElement Box50
+  set Box50.ErrorValue "1"
+  set Box50.I "2"
+
+new std:MagicBox Box52
+
+new std:MagicBox Box53
+
+new std:Add Box55
+
+new std:GetVectorDoubleElement Box56
+  set Box56.ErrorValue "0"
+  set Box56.I "0"
+
+new std:Add Box57
+
+new std:GetVectorDoubleElement Box58
+  set Box58.ErrorValue "0"
+  set Box58.I "1"
+
+new std:GetVectorDoubleElement Box59
+  set Box59.ErrorValue "0"
+  set Box59.I "2"
+
+new std:Add Box60
+
+new std:MagicBox Box61
+
+new std:Mul Box62
+
+new std:Mul Box63
+
+new std:Mul Box64
+
+
+connect Box01.Widget Box00.Widget1
+connect Box05.Widget Box01.Widget3
+connect Box04.Widget Box01.Widget2
+connect Box03.Widget Box01.Widget1
+connect Box09.Widget Box06.Widget3
+connect Box08.Widget Box06.Widget2
+connect Box07.Widget Box06.Widget1
+connect Box13.Widget Box10.Widget3
+connect Box12.Widget Box10.Widget2
+connect Box11.Widget Box10.Widget1
+connect Box06.Widget Box00.Widget2
+connect Box10.Widget Box00.Widget3
+connect Box16.Out Box14.Translate
+connect Box03.BoxChange Box17.In1
+connect Box04.BoxChange Box17.In2
+connect Box05.BoxChange Box17.In3
+connect Box07.BoxChange Box18.In1
+connect Box08.BoxChange Box18.In2
+connect Box09.BoxChange Box18.In3
+connect Box11.BoxChange Box19.In1
+connect Box12.BoxChange Box19.In2
+connect Box13.BoxChange Box19.In3
+connect Box17.BoxChange Box20.In1
+connect Box18.BoxChange Box20.In2
+connect Box19.BoxChange Box20.In3
+connect Box11.Out Box22.In1
+connect Box12.Out Box23.In1
+connect Box13.Out Box24.In1
+connect Box15.Out Box28.RotateWXYZ
+connect Box29.Out Box30.RotateWXYZ
+connect Box31.Out Box32.RotateWXYZ
+connect Box28.Out Box30.In
+connect Box30.Out Box32.In
+connect Box14.Out Box28.In
+connect Box20.BoxChange Box33.BoxExecute
+connect Box32.Out Box33.In
+connect Box36.Out Box35.In2
+connect Box07.Out Box35.In1
+connect Box35.Out Box16.In1
+connect Box41.Out Box40.In2
+connect Box08.Out Box40.In1
+connect Box40.Out Box16.In3
+connect Box43.Out Box44.In2
+connect Box09.Out Box44.In1
+connect Box44.Out Box16.In5
+connect Box45.Out Box33.Scale
+connect Box52.Out Box50.In
+connect Box52.Out Box47.In
+connect Box52.Out Box49.In
+connect Box53.Out Box43.In
+connect Box53.Out Box36.In
+connect Box53.Out Box41.In
+connect Box56.Out Box55.In2
+connect Box58.Out Box57.In2
+connect Box59.Out Box60.In2
+connect Box61.Out Box59.In
+connect Box61.Out Box56.In
+connect Box61.Out Box58.In
+connect Box03.Out Box55.In1
+connect Box55.Out Box15.In1
+connect Box04.Out Box57.In1
+connect Box57.Out Box29.In1
+connect Box05.Out Box60.In1
+connect Box60.Out Box31.In1
+connect Box22.Out Box62.In1
+connect Box23.Out Box63.In1
+connect Box24.Out Box64.In1
+connect Box62.Out Box45.In1
+connect Box63.Out Box45.In3
+connect Box64.Out Box45.In5
+connect Box47.Out Box62.In2
+connect Box49.Out Box63.In2
+connect Box50.Out Box64.In2
+
+# Complex input ports
+input TitleWindow Box00.WinTitle " "
+input scaleXYZ Box52.In " "
+input translateXYZ Box53.In " "
+input rotateXYZ Box61.In " "
+
+# Complex output ports
+output Window Box00.Widget " "
+output Transform Box33.Out " "
+output BoxChange Box33.BoxChange " "
+
+
+endefine
diff --git a/packages/vtk/bbs/boxes/bbIsoSurfaceExtractor.bbg b/packages/vtk/bbs/boxes/bbIsoSurfaceExtractor.bbg
new file mode 100644 (file)
index 0000000..ee1590c
--- /dev/null
@@ -0,0 +1,118 @@
+# ----------------------------------
+# - BBTKGEditor v 1.4 BBG BlackBox Diagram file
+# - bbIsoSurfaceExtractor.bbg
+# ----------------------------------
+
+APP_START
+CATEGORY:3D object creator
+DESCRIPTION:Extracts an iso-surface of a 3D image and creates a vtkProp3D object to insert into a 3D scene (e.g. a Viewer3D)
+AUTHOR:j p r at creatis.univ-lyon1.fr
+COMPLEXBOX:TRUE
+COMPLEXBOXNAME:IsoSurfaceExtractor
+PACKAGENAME:vtk
+COMPLEXOUTPUTS:1
+COMPLEX_PORT
+Out
+-106.333698:-24.000230:-900.000000
+FIN_COMPLEX_PORT
+COMPLEXINPUTS:8
+COMPLEX_PORT
+In
+12.336925:94.999712:-900.000000
+FIN_COMPLEX_PORT
+COMPLEX_PORT
+Isovalue
+32.668549:96.666475:-900.000000
+FIN_COMPLEX_PORT
+COMPLEX_PORT
+Opacity
+-114.342801:95.166388:-900.000000
+FIN_COMPLEX_PORT
+COMPLEX_PORT
+Colour
+-130.846632:94.999712:-900.000000
+FIN_COMPLEX_PORT
+COMPLEX_PORT
+Renderer
+-85.180215:96.166446:-900.000000
+FIN_COMPLEX_PORT
+COMPLEX_PORT
+Transform
+-70.515584:95.166388:-900.000000
+FIN_COMPLEX_PORT
+COMPLEX_PORT
+BoxExecute
+-19.682203:95.133203:-900.000000
+FIN_COMPLEX_PORT
+COMPLEX_PORT
+active
+52.180776:96.404365:-900.000000
+FIN_COMPLEX_PORT
+BOXES:4
+BOX
+vtk:MarchingCubes:mc
+ISEXEC:FALSE
+11.855384:37.572248:-900.000000
+57.430384:27.572248:-900.000000
+FIN_BOX
+BOX
+vtk:PolyDataToActor:polydatatoactor
+ISEXEC:FALSE
+-89.255289:4.468457:-900.000000
+-43.680289:-5.531543:-900.000000
+FIN_BOX
+BOX
+std:MultipleInputs:Box03
+ISEXEC:FALSE
+-40.307403:60.149229:-900.000000
+5.267597:50.149229:-900.000000
+PORT
+BoxProcessMode:"reactive"
+FIN_BOX
+BOX
+std:MagicBox:Box04
+ISEXEC:FALSE
+46.365909:66.717942:-900.000000
+91.940909:56.717942:-900.000000
+FIN_BOX
+CONNECTIONS:13
+CONNECTION
+mc:Out:polydatatoactor:In
+NumberOfControlPoints:0
+CONNECTION
+In:In:mc:In
+NumberOfControlPoints:0
+CONNECTION
+Isovalue:Isovalue:mc:Value
+NumberOfControlPoints:0
+CONNECTION
+Opacity:Opacity:polydatatoactor:Opacity
+NumberOfControlPoints:0
+CONNECTION
+Colour:Colour:polydatatoactor:Colour
+NumberOfControlPoints:0
+CONNECTION
+Renderer:Renderer:polydatatoactor:Renderer
+NumberOfControlPoints:0
+CONNECTION
+Transform:Transform:polydatatoactor:Transform
+NumberOfControlPoints:0
+CONNECTION
+polydatatoactor:Out:Out:Out
+NumberOfControlPoints:0
+CONNECTION
+BoxExecute:BoxExecute:Box03:In1
+NumberOfControlPoints:0
+CONNECTION
+Box03:BoxChange:polydatatoactor:BoxExecute
+NumberOfControlPoints:0
+CONNECTION
+active:active:Box04:In
+NumberOfControlPoints:0
+CONNECTION
+Box04:Out:mc:Active
+NumberOfControlPoints:0
+CONNECTION
+Box04:Out:polydatatoactor:Active
+NumberOfControlPoints:0
+APP_END
index 5ce07901aa049a7959c594938951777e27009d49..7df6da5398bd5a053796c08dec8b9ba90c37f371 100644 (file)
@@ -1,59 +1,47 @@
-# ---------------------------------------------------------------------
-#
-# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
-#                        pour la SantÈ)
-# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
-# Previous Authors : Laurent Guigues, Jean-Pierre Roux
-# CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
-#
-#  This software is governed by the CeCILL-B license under French law and
-#  abiding by the rules of distribution of free software. You can  use,
-#  modify and/ or redistribute the software under the terms of the CeCILL-B
-#  license as circulated by CEA, CNRS and INRIA at the following URL
-#  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
-#  or in the file LICENSE.txt.
-#
-#  As a counterpart to the access to the source code and  rights to copy,
-#  modify and redistribute granted by the license, users are provided only
-#  with a limited warranty  and the software's author,  the holder of the
-#  economic rights,  and the successive licensors  have only  limited
-#  liability.
-#
-#  The fact that you are presently reading this means that you have had
-#  knowledge of the CeCILL-B license and that you accept its terms.
-# ------------------------------------------------------------------------ */
-
+# ----------------------------------
+# - BBTKGEditor v 1.4 BBS BlackBox Script (Complex Box)
+# - bbIsoSurfaceExtractor.bbs
+# ----------------------------------
 
 include std
+include itkvtk
 include vtk
+include std
 
-# --- Box Description ---
 define IsoSurfaceExtractor vtk
 
-  description "Extracts an iso-surface of a 3D image and creates a vtkProp3D object to insert into a 3D scene (e.g. a Viewer3D)" 
-  author "j p r at creatis.univ-lyon1.fr"
-  category "3D object creator"
-# ---                ---
-
-  new MarchingCubes   mc
-  new PolyDataToActor polydatatoactor   
-    connect mc.Out polydatatoactor.In
-
-  new MagicBox  mb
-   connect mb.BoxChange mc.BoxExecute
-   connect mb.BoxChange polydatatoactor.BoxExecute
-  
-# ---                ---
-
-  input In        mc.In              "vtkImageData"
-  input Isovalue  mc.Value          "Isovalue"
-  input Opacity   polydatatoactor.Opacity   "Opacity"  
-  input Colour    polydatatoactor.Colour    "R G B"
-  input Renderer  polydatatoactor.Renderer  "3D scene in which to insert the surface"
-  input Transform polydatatoactor.Transform "Linear Transform (4x4 homogeneous)"     
-  input BoxExecute mb.BoxExecute "BoxExecute"     
-    
-
-  output Out polydatatoactor.Out "Extracted iso-surface (as a vtkProp3D *)"
+author "j p r at creatis.univ-lyon1.fr"
+description "Extracts an iso-surface of a 3D image and creates a vtkProp3D object to insert into a 3D scene (e.g. a Viewer3D)"
+
+category "3D object creator"
+
+new vtk:MarchingCubes mc
+
+new vtk:PolyDataToActor polydatatoactor
+
+new std:MultipleInputs Box03
+  set Box03.BoxProcessMode "reactive"
+
+new std:MagicBox Box04
+
+
+connect mc.Out polydatatoactor.In
+connect Box03.BoxChange polydatatoactor.BoxExecute
+connect Box04.Out mc.Active
+connect Box04.Out polydatatoactor.Active
+
+# Complex input ports
+input In mc.In " "
+input Isovalue mc.Value " "
+input Opacity polydatatoactor.Opacity " "
+input Colour polydatatoactor.Colour " "
+input Renderer polydatatoactor.Renderer " "
+input Transform polydatatoactor.Transform " "
+input BoxExecute Box03.In1 " "
+input active Box04.In " "
+
+# Complex output ports
+output Out polydatatoactor.Out " "
+
 
 endefine
index 874c35c1b351500470877bd5b47a3be0ebf0e36c..067af425a2743d138bdd84c447aa921d08c5b9b9 100755 (executable)
@@ -366,4 +366,4 @@ class sorts
 
 }
 
-#endif /* _DLL_H_ */
+#endif // _BBTKSIMPLEUTILITIES_H_
index e166919ed9f2b09e368ab4ca7ce63cddc105a2f3..fc1f9af7dd468b35ef8e0356f093ade9510f5bb3 100755 (executable)
 
 #include "bbtkStaticLecture.h"
 
+#include <string>
+
+int bbtkStaticLecture::GetTypeFormat( std::string formatStr , vtkImageData* image )
+{
+       int outputformat = VTK_UNSIGNED_CHAR;
+       if (formatStr=="SAME")
+       {                                               
+               if (image!=NULL) outputformat = image->GetScalarType();
+       }
+       else if (formatStr=="VTK_BIT")                          outputformat = VTK_BIT;                         // 1
+       else if (formatStr=="VTK_CHAR")                         outputformat = VTK_CHAR;                        // 2
+       else if (formatStr=="VTK_SIGNED_CHAR")          outputformat = VTK_SIGNED_CHAR;         // 15
+       else if (formatStr=="VTK_UNSIGNED_CHAR")        outputformat = VTK_UNSIGNED_CHAR;       // 3
+       else if (formatStr=="VTK_SHORT")                        outputformat = VTK_SHORT;                       // 4
+       else if (formatStr=="VTK_UNSIGNED_SHORT")       outputformat = VTK_UNSIGNED_SHORT;      // 5
+       else if (formatStr=="VTK_INT")                          outputformat = VTK_INT;                 // 6
+       else if (formatStr=="VTK_UNSIGNED_INT")         outputformat = VTK_UNSIGNED_INT;        // 7
+       else if (formatStr=="VTK_LONG")                         outputformat = VTK_LONG;                // 8  
+       else if (formatStr=="VTK_UNSIGNED_LONG")        outputformat = VTK_UNSIGNED_LONG;       // 9
+       else if (formatStr=="VTK_FLOAT")                        outputformat = VTK_FLOAT;               // 10
+       else if (formatStr=="VTK_DOUBLE")                       outputformat = VTK_DOUBLE;              // 11 
+       else if (formatStr=="MET_CHAR")                         outputformat = VTK_CHAR;                        // 2
+       else if (formatStr=="MET_UCHAR")                        outputformat = VTK_UNSIGNED_CHAR;       // 3
+       else if (formatStr=="MET_SHORT")                        outputformat = VTK_SHORT;                       // 4
+       else if (formatStr=="MET_USHORT")                       outputformat = VTK_UNSIGNED_SHORT;      // 5
+       else if (formatStr=="MET_SHORT")                        outputformat = VTK_SHORT;               // 4
+       else if (formatStr=="MET_FLOAT")                        outputformat = VTK_FLOAT;               // 10
+       else if (formatStr=="MET_DOUBLE")                       outputformat = VTK_DOUBLE;              // 11  
+
+    return outputformat;
+}
+
+
 
        void bbtkStaticLecture::setPixelValue(int i, int j, int k, vtkImageData* img, double value)
        {
index 9b214e773767df97a1cfa6e7c6b67599d8b86c5a..35b0624ce39624478f11917ca43b8d703eee4bd9 100755 (executable)
@@ -34,8 +34,9 @@
 class bbtkStaticLecture
 {
 public:
-       void setPixelValue(int i, int j, int k, vtkImageData* img, double value);
-       double getPixelValue(int i, int j, int k, vtkImageData* img);
+       static int      GetTypeFormat( std::string formatStr , vtkImageData* image );
+       void    setPixelValue(int i, int j, int k, vtkImageData* img, double value);
+       double  getPixelValue(int i, int j, int k, vtkImageData* img);
 };
 
 #endif
index 25ce22cec908d03e4c456c0dc8e1e55b5e0a2e89..00635e9c4db318a9be60f7af24b44f693e53b223 100644 (file)
@@ -41,8 +41,6 @@ BBTK_BLACK_BOX_IMPLEMENTATION(AutoCrop,bbtk::AtomicBlackBox);
 void AutoCrop::Process()
 {
 
-       printf("EED  AutoCrop::Process Start\n");               
-
 // THE MAIN PROCESSING METHOD BODY
 //   Here we simply set the input 'In' value to the output 'Out'
 //   And print out the output value
index 4689f75c0800e441308ac1510a341e3c1a98f880..f58c6ecd642af8bb16c110e4717fcb350b54d98a 100644 (file)
@@ -84,12 +84,19 @@ void BinaryOperations::Process()
                case 3:
                                ope->SetOperationToDivide();
                break;
+               case 4:
+                               ope->SetOperationToMax();
+               break;
+               case 5:
+                               ope->SetOperationToMin();
+               break;
                default:
                        std::cout << "Invalid Operation" << std::endl;
                        return;
                break;
        }
 
+       ope->Modified();
        ope->Update();
        vtkImageData* salida = ope->GetOutput();
 
index 9e6bd034774f0807f5a07860a6adcb814bfe350c..45602abf10c0a382b62b6bdde63a7169b4dd689b 100644 (file)
@@ -66,14 +66,14 @@ class bbvtk_EXPORT BinaryOperations
 };
 
 BBTK_BEGIN_DESCRIBE_BLACK_BOX(BinaryOperations,bbtk::AtomicBlackBox);
-BBTK_NAME("BinaryOperations");
-BBTK_AUTHOR("Info-Dev");
-BBTK_DESCRIPTION("Arithmetic operations between two images: add, substract, multiply, divide");
-BBTK_CATEGORY("filter");
-BBTK_INPUT(BinaryOperations,In1,"first image to be operated",vtkImageData*,"NULL default");
-BBTK_INPUT(BinaryOperations,In2,"second image to be operated",vtkImageData*,"NULL default");
-BBTK_INPUT(BinaryOperations,Operation,"0:Add (default) , 1:subtract, 2:multiply, 3:divide",int,"");
-BBTK_OUTPUT(BinaryOperations,Out,"",vtkImageData*,"");
+  BBTK_NAME("BinaryOperations");
+  BBTK_AUTHOR("Info-Dev");
+  BBTK_DESCRIPTION("Arithmetic operations between two images");
+  BBTK_CATEGORY("filter");
+  BBTK_INPUT(BinaryOperations,In1,"first image to be operated",vtkImageData*,"NULL default");
+  BBTK_INPUT(BinaryOperations,In2,"second image to be operated",vtkImageData*,"NULL default");
+  BBTK_INPUT(BinaryOperations,Operation,"0:Add (default) , 1:subtract, 2:multiply, 3:divide, 4=Max, 5=Min",int,"");
+  BBTK_OUTPUT(BinaryOperations,Out,"",vtkImageData*,"");
 BBTK_END_DESCRIBE_BLACK_BOX(BinaryOperations);
 }
 // EO namespace bbSimpleProcessing
index c7306d06451dfd0727445ada6899869c7cabf409..618f2b0eace65dc9d16e913cdda2f6ecde7c0f1c 100644 (file)
@@ -35,30 +35,16 @@ namespace bbvtk
 
 BBTK_ADD_BLACK_BOX_TO_PACKAGE(vtk,CleanExternalPlane)
 BBTK_BLACK_BOX_IMPLEMENTATION(CleanExternalPlane,bbtk::AtomicBlackBox);
-//===== 
-// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
-//===== 
-void CleanExternalPlane::Process()
-{
-
-// THE MAIN PROCESSING METHOD BODY
-//   Here we simply set the input 'In' value to the output 'Out'
-//   And print out the output value
-// INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
-//    void bbSet{Input|Output}NAME(const TYPE&)
-//    const TYPE& bbGet{Input|Output}NAME() const 
-//    Where :
-//    * NAME is the name of the input/output
-//      (the one provided in the attribute 'name' of the tag 'input')
-//    * TYPE is the C++ type of the input/output
-//      (the one provided in the attribute 'type' of the tag 'input')
 
+//----------------------------------------------------------------------
+void CleanExternalPlane::CleanTypeA(vtkImageData* image)
+{
        if ( bbGetInputIn()!=NULL )
        {
                int i,j;
                int ext[6];
                int dim[3];
-               bbGetInputIn()->GetWholeExtent(ext);
+               image->GetWholeExtent(ext);
                
                dim[0]=ext[1]-ext[0]+1;
                dim[1]=ext[3]-ext[2]+1;
@@ -69,36 +55,112 @@ void CleanExternalPlane::Process()
                {
                        for (j=0 ; j<dim[1] ; j++)
                        {
-                               bbGetInputIn()->SetScalarComponentFromDouble (i, j, 0           , 0, 0.0);
-                               bbGetInputIn()->SetScalarComponentFromDouble (i, j, dim[2]-1, 0, 0.0);
-                       }
-               }
+                               image->SetScalarComponentFromDouble (ext[0]+i, ext[2]+j, ext[4]+0       , 0, 0.0);
+                               image->SetScalarComponentFromDouble (ext[0]+i, ext[2]+j, ext[4]+dim[2]-1, 0, 0.0);
+                       } // for j
+               }// for i
                
                // YZ plane
                for (i=0 ; i<dim[1] ; i++)
                {
                        for (j=0 ; j<dim[2] ; j++)
                        {
-                               bbGetInputIn()->SetScalarComponentFromDouble (0                 , i, j, 0, 0.0);
-                               bbGetInputIn()->SetScalarComponentFromDouble (dim[0]-1  , i, j, 0, 0.0);
-                       }
-               }
+                               image->SetScalarComponentFromDouble (ext[0]+0           , ext[2]+i, ext[4]+j, 0, 0.0);
+                               image->SetScalarComponentFromDouble (ext[0]+dim[0]-1    , ext[2]+i, ext[4]+j, 0, 0.0);
+                       } // for j
+               } // for i
                
                // YZ plane
                for (i=0 ; i<dim[0] ; i++)
                {
                        for (j=0 ; j<dim[2] ; j++)
                        {
-                               bbGetInputIn()->SetScalarComponentFromDouble (i, 0                      , j, 0, 0.0);
-                               bbGetInputIn()->SetScalarComponentFromDouble (i, dim[1]-1       , j, 0, 0.0);
-                       }
-               }
+                               image->SetScalarComponentFromDouble (ext[0]+i, ext[2]+0         , ext[4]+j, 0, 0.0);
+                               image->SetScalarComponentFromDouble (ext[0]+i, ext[2]+dim[1]-1  , ext[4]+j, 0, 0.0);
+                       } // for j
+               }// for i
+       } // if In
+}
+
+//----------------------------------------------------------------------
+void CleanExternalPlane::CleanTypeB()
+{
+
+       int             ext[6]; 
+       int             dimA[3];        
+       int             dimB[3];        
+       bbGetInputIn()->GetWholeExtent(ext);
+
+       dimA[0] =       ext[1]-ext[0]+1;
+       dimA[1] =       ext[3]-ext[2]+1;
+       dimA[2] =       ext[5]-ext[4]+1;
+
+       dimB[0] =       dimA[0] + 2;
+       dimB[1] =       dimA[1] + 2;
+       dimB[2] =       dimA[2] + 2;
+
        
-               
-       }
-    
+       imageoutput->Initialize();
+       imageoutput->SetScalarType( bbGetInputIn()->GetScalarType() );  
+       imageoutput->SetSpacing( bbGetInputIn()->GetSpacing() );
+       imageoutput->SetDimensions(  dimB[0], dimB[1], dimB[2] );
+       imageoutput->AllocateScalars();
        
-       bbSetOutputOut( bbGetInputIn() );
+
+       int j,k;
+       long sizeBlock= dimA[0] * bbGetInputIn()->GetScalarSize();
+
+       for (j=0;j<dimA[1];j++)
+       {
+               for (k=0;k<dimA[2];k++)
+               {
+                       memcpy(   imageoutput->GetScalarPointer(1,j+1,k+1) , bbGetInputIn()->GetScalarPointer(0,j,k) , sizeBlock );
+               }
+       }
+       imageoutput->Update();
+       imageoutput->Modified();
+}
+
+
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void CleanExternalPlane::Process()
+{
+
+// THE MAIN PROCESSING METHOD BODY
+//   Here we simply set the input 'In' value to the output 'Out'
+//   And print out the output value
+// INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
+//    void bbSet{Input|Output}NAME(const TYPE&)
+//    const TYPE& bbGet{Input|Output}NAME() const 
+//    Where :
+//    * NAME is the name of the input/output
+//      (the one provided in the attribute 'name' of the tag 'input')
+//    * TYPE is the C++ type of the input/output
+//      (the one provided in the attribute 'type' of the tag 'input')
+
+// Nothing to do
+       if (bbGetInputType()==-1)
+       {
+               bbSetOutputOut( bbGetInputIn() );
+       }
+
+// Clean external planes
+       if (bbGetInputType()==0)
+       {
+               CleanTypeA( bbGetInputIn() );
+               bbSetOutputOut( bbGetInputIn() );
+       }
+
+// Add new faces and clean the external planes
+       if (bbGetInputType()==1)
+       {
+               CleanTypeB();
+               CleanTypeA(imageoutput);
+               bbSetOutputOut( imageoutput );
+       }
+
 
        
        
@@ -111,7 +173,8 @@ void CleanExternalPlane::bbUserSetDefaultValues()
 
 //  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
 //    Here we initialize the input 'In' to 0
-   bbSetInputIn(0);
+   bbSetInputIn(NULL);
+   bbSetInputType(0);
   
 }
 //===== 
@@ -125,6 +188,7 @@ void CleanExternalPlane::bbUserInitializeProcessing()
 //    but this is where you should allocate the internal/output pointers 
 //    if any 
 
+       imageoutput = vtkImageData::New();
   
 }
 //===== 
@@ -137,9 +201,9 @@ void CleanExternalPlane::bbUserFinalizeProcessing()
 //    Here does nothing 
 //    but this is where you should desallocate the internal/output pointers 
 //    if any
-  
+       imageoutput->Delete();
 }
-}
-// EO namespace bbvtk
+
+// EO namespace bbvtk
 
 
index 864cb7750738e23213867fbba37ccd04822f7749..7dd5eb1e381113f094b29f3bce177061c771357c 100644 (file)
@@ -48,8 +48,14 @@ class bbvtk_EXPORT CleanExternalPlane
 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
 //===== 
   BBTK_DECLARE_INPUT(In,vtkImageData*);
+  BBTK_DECLARE_INPUT(Type,int);
   BBTK_DECLARE_OUTPUT(Out,vtkImageData*);
   BBTK_PROCESS(Process);
+
+  vtkImageData* imageoutput;
+  void CleanTypeA(vtkImageData*);
+  void CleanTypeB();
+
   void Process();
 //===== 
 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
@@ -62,6 +68,7 @@ BBTK_BEGIN_DESCRIBE_BLACK_BOX(CleanExternalPlane,bbtk::AtomicBlackBox);
   BBTK_DESCRIPTION("change the gray level of the externals planes of the image to 0 value.");
   BBTK_CATEGORY("filter");
   BBTK_INPUT(CleanExternalPlane,In,"Input image",vtkImageData*,"");
+  BBTK_INPUT(CleanExternalPlane,Type,"-1= nothing to do, 0 = (default) not modifie Dimention. 1 = Add outside plane (Dimension of image change)",int,"");
   BBTK_OUTPUT(CleanExternalPlane,Out,"Output image",vtkImageData*,"");
 BBTK_END_DESCRIBE_BLACK_BOX(CleanExternalPlane);
 //===== 
index 35f76059abc2985e37c2569c2e20f4e606cce55f..1367ec761bf1ad6fa23e6274539ac27d1cfde41c 100644 (file)
@@ -92,25 +92,25 @@ namespace bbvtk
    void ConcatImages::Process()
    {
         int dim[3];
+        int curDim[3];
        int nbComponents;
        int scalarType;
        int nb = (unsigned int)bbGetInputIn().size();
-       int consistentNb(nb);
+//     int consistentNb(nb);
+       int newSizeZ;
 
         if (nb == 0) {
           // ??? JPR
        } 
        
        bbGetInputIn()[0]->GetDimensions(dim);
-       if (dim[2] > 1  || nb == 1) // dim[2] > 1 : Hopeless for vtk : the first file contains already a 3D object
+       if ( nb == 1) // dim[2] > 1 : Hopeless for vtk : the first file contains already a 3D object
                                    // nb == 1 : only one image, nothing to do.
        {
           mConcat->Delete();
           mConcat = bbGetInputIn()[0];
           //mConcat->PrintSelf(std::cout, vtkIndent(2));
-       }
-       else
-       {
+       } else {
           // We suppose *all* the images within the directory are consistent (same sizeS, same pixel Type?...)
           vtkImageData * firstImage = bbGetInputIn()[0];
           
@@ -126,41 +126,73 @@ namespace bbvtk
           
           mConcat->SetSpacing(firstImage->GetSpacing());
           
-          firstImage->GetDimensions(dim);         
+          firstImage->GetDimensions(dim);
+          newSizeZ=0;
           // brute way to perform an ultra-mini consistency check :
           // First image is supposed to be the reference image,
           // any unconsistent image is just discarted...
           for(int i=0; i<nb; i++)
           {
-             if ( !CheckConsistency(firstImage, dim, nbComponents, scalarType))
-               consistentNb--;
-          }    
 
-          dim[2]=consistentNb;
+//EED 2013 oct 29 
+//EED        if ( !CheckConsistency(firstImage, dim, nbComponents, scalarType))
+//EED          consistentNb--;
+
+             if ( CheckConsistency(bbGetInputIn()[i], dim, nbComponents, scalarType))
+               {
+                       bbGetInputIn()[i]->GetDimensions(curDim);
+                       newSizeZ = newSizeZ + curDim[2];
+               } // if
+               
+          }    // for
+
+          dim[2]=newSizeZ;
+
+
           mConcat->SetDimensions(dim);
           mConcat->SetExtent(0, dim[0]-1, 0, dim[1]-1, 0, dim[2]-1);
                   
           mConcat->AllocateScalars();
           mConcat->Update();      
                     
-          int index_image, index_lignes, index_colonnes, index_components;
-          
+          int index_image;
+
+          int blocksize;
+          int scalarSize=bbGetInputIn()[0]->GetScalarSize();
+          char *pImage = (char*)mConcat->GetScalarPointer();
+          char *sourcePointer;
+
+//EED     int index_lignes, index_colonnes, index_components;
+       
+   
           for(index_image=0; index_image<nb; index_image++)
           {
              if (!CheckConsistency(bbGetInputIn()[index_image], dim, nbComponents, scalarType))
-                continue;  // discard unconsistent image !
-             for(index_lignes=0; index_lignes<dim[0];index_lignes++)
-             {
-                for(index_colonnes=0; index_colonnes<dim[1];index_colonnes++)
-                {
-                   for(index_components=0; index_components<nbComponents;index_components++)
-                   { 
-                     mConcat->SetScalarComponentFromDouble(index_lignes, index_colonnes, index_image, index_components,(bbGetInputIn()[index_image])->GetScalarComponentAsDouble(index_colonnes,index_lignes,0,index_components));
-                   }
-                }
-             }
-          }
-       }
+               {
+                        continue;  // discard unconsistent image !
+               }
+             bbGetInputIn()[index_image]->GetDimensions(curDim);
+             blocksize = curDim[0]*curDim[1]*curDim[2]*nbComponents*scalarSize;
+          sourcePointer = (char*)bbGetInputIn()[index_image]->GetScalarPointer();
+             memcpy(pImage, sourcePointer,blocksize);
+          pImage = pImage+blocksize;
+
+//EED 2013 oct 29 
+//EED        for(index_lignes=0; index_lignes<dim[0];index_lignes++)
+//EED        {
+//EED           for(index_colonnes=0; index_colonnes<dim[1];index_colonnes++)
+//EED           {
+//EED              for(index_components=0; index_components<nbComponents;index_components++)
+//EED              { 
+//EED                mConcat->SetScalarComponentFromDouble(index_lignes, index_colonnes, index_image, index_components,(bbGetInputIn()[index_image])->GetScalarComponentAsDouble(index_colonnes,index_lignes,0,index_components));
+//EED              } // components
+//EED           } // colonnes
+//EED        } // lignes
+
+
+          } // if CheckConsistency
+       } /// for index_image
+
    // Devrait etre dans bbUserFinalizeProcessing() ? On n'y entre jamais // JPR        
    bbSetOutputOut(mConcat);    
    }              
@@ -170,15 +202,21 @@ bool ConcatImages::CheckConsistency( vtkImageData *curImage, int dim[], int nbCo
    assert (curImage);
    
    if (scalarType != curImage->GetScalarType( ) )
+   {
       return false;
-      
+   }      
+
    if (nbComponents != curImage->GetNumberOfScalarComponents() )
+   {
       return false;
-      
+   }
+     
    int curDim[3];
    curImage->GetDimensions(curDim);
    if ( (curDim[0] =! dim[0]) || (curDim[1] =! dim[1]) )
+   {
       return false;
+   }
 
    return true;   
 }
index 9aa9a467c413ea15e34ad2f2c5dd5814904d5768..074e9de8a37d013d7a1f10b8ae6963035ab529ff 100644 (file)
@@ -54,22 +54,37 @@ void CreateImage::Process()
 //      (the one provided in the attribute 'type' of the tag 'input')
 
        
+
        double  spc[6];
        int             dim[3]; 
        int             outputformat = VTK_UNSIGNED_SHORT;
        
-       if (bbGetInputOutputFormat()=="VTK_BIT")                                        outputformat = VTK_BIT;
-       else if (bbGetInputOutputFormat()=="VTK_CHAR")                          outputformat = VTK_CHAR;
-       else if (bbGetInputOutputFormat()=="VTK_SIGNED_CHAR")           outputformat = VTK_SIGNED_CHAR;
-       else if (bbGetInputOutputFormat()=="VTK_UNSIGNED_CHAR")         outputformat = VTK_UNSIGNED_CHAR;
-       else if (bbGetInputOutputFormat()=="VTK_UNSIGNED_SHORT")        outputformat = VTK_UNSIGNED_SHORT;
-       else if (bbGetInputOutputFormat()=="VTK_INT")                           outputformat = VTK_INT;
-       else if (bbGetInputOutputFormat()=="VTK_UNSIGNED_INT")          outputformat = VTK_UNSIGNED_INT;
-       else if (bbGetInputOutputFormat()=="VTK_LONG")                          outputformat = VTK_LONG;
-       else if (bbGetInputOutputFormat()=="VTK_UNSIGNED_LONG")         outputformat = VTK_UNSIGNED_LONG;
-       else if (bbGetInputOutputFormat()=="VTK_FLOAT")                         outputformat = VTK_FLOAT;
-       else if (bbGetInputOutputFormat()=="VTK_DOUBLE")                        outputformat = VTK_DOUBLE;
-               
+
+       if (bbGetInputOutputFormat()=="VTK_BIT")                                        outputformat = VTK_BIT;                 // 1
+       else if (bbGetInputOutputFormat()=="VTK_CHAR")                          outputformat = VTK_CHAR;                                // 2
+       else if (bbGetInputOutputFormat()=="MET_CHAR")                          outputformat = VTK_CHAR;                                // 2
+       else if (bbGetInputOutputFormat()=="VTK_SIGNED_CHAR")           outputformat = VTK_SIGNED_CHAR;         // 15
+       else if (bbGetInputOutputFormat()=="MET_UCHAR")                         outputformat = VTK_UNSIGNED_CHAR;       // 3
+       else if (bbGetInputOutputFormat()=="VTK_UNSIGNED_CHAR")         outputformat = VTK_UNSIGNED_CHAR;       // 3
+       else if (bbGetInputOutputFormat()=="VTK_SHORT")                         outputformat = VTK_SHORT;               // 4
+       else if (bbGetInputOutputFormat()=="MET_SHORT")                         outputformat = VTK_SHORT;               // 4
+       else if (bbGetInputOutputFormat()=="VTK_UNSIGNED_SHORT")        outputformat = VTK_UNSIGNED_SHORT;      // 5
+       else if (bbGetInputOutputFormat()=="MET_USHORT")                        outputformat = VTK_UNSIGNED_SHORT;      // 5
+       else if (bbGetInputOutputFormat()=="VTK_INT")                           outputformat = VTK_INT;                 // 6
+       else if (bbGetInputOutputFormat()=="MET_INT")                           outputformat = VTK_INT;                 // 6
+       else if (bbGetInputOutputFormat()=="VTK_UNSIGNED_INT")          outputformat = VTK_UNSIGNED_INT;        // 7 
+       else if (bbGetInputOutputFormat()=="MEY_UINT")                          outputformat = VTK_UNSIGNED_INT;        // 7 
+       else if (bbGetInputOutputFormat()=="VTK_LONG")                          outputformat = VTK_LONG;                // 8
+       else if (bbGetInputOutputFormat()=="MET_LONG")                          outputformat = VTK_LONG;                // 8
+       else if (bbGetInputOutputFormat()=="VTK_UNSIGNED_LONG")         outputformat = VTK_UNSIGNED_LONG;       // 9
+       else if (bbGetInputOutputFormat()=="MET_ULONG")                         outputformat = VTK_UNSIGNED_LONG;       // 9
+       else if (bbGetInputOutputFormat()=="VTK_FLOAT")                         outputformat = VTK_FLOAT;               // 10
+       else if (bbGetInputOutputFormat()=="MET_FLOAT")                         outputformat = VTK_FLOAT;               // 10
+       else if (bbGetInputOutputFormat()=="VTK_DOUBLE")                        outputformat = VTK_DOUBLE;              // 11           
+       else if (bbGetInputOutputFormat()=="MET_DOUBLE")                        outputformat = VTK_DOUBLE;              // 11  
+
+
+
        spc[0] = bbGetInputSpacing()[0];
        spc[1] = bbGetInputSpacing()[1];
        spc[2] = bbGetInputSpacing()[2];
@@ -84,21 +99,32 @@ void CreateImage::Process()
        imageoutput->SetDimensions(  dim[0], dim[1], dim[2] );
        imageoutput->AllocateScalars();
        
-               
+
                int i,j,k;
+               long sizeBlock; 
+
                for (i=0; i<dim[0]; i++)
                {
-                       for (j=0; j<dim[1]; j++)
-                       {
-                               for (k=0; k<dim[2]; k++)
-                               {
-                                       imageoutput->SetScalarComponentFromDouble(i,j,k, 0, bbGetInputInitialValue() );
-                               } // for k
-                       } // for j
-               } // for i
+                       imageoutput->SetScalarComponentFromDouble(i,0,0, 0, bbGetInputInitialValue() );
+               }
                
+               sizeBlock= dim[0] * imageoutput->GetScalarSize();
+                for (j=1; j<dim[1]; j++)
+               {
+                       memcpy(  imageoutput->GetScalarPointer(0,j,0), imageoutput->GetScalarPointer()  , sizeBlock );
+               }               
+
+               sizeBlock= dim[0] * dim[1] * imageoutput->GetScalarSize();
+               for (k=0; k<dim[2]; k++)
+               {
+                       memcpy(  imageoutput->GetScalarPointer(0,0,k) ,imageoutput->GetScalarPointer()  , sizeBlock );
+               } // for k
+
+               imageoutput->Update();
+               imageoutput->Modified();
                bbSetOutputOut(imageoutput);
 
+
 }      
        
 //===== 
@@ -114,9 +140,9 @@ void CreateImage::bbUserSetDefaultValues()
        dim.push_back(250);
        dim.push_back(250);
        std::vector<double> spc;
-       dim.push_back(1.0);
-       dim.push_back(1.0);
-       dim.push_back(1.0);
+       spc.push_back(1.0);
+       spc.push_back(1.0);
+       spc.push_back(1.0);
        
        bbSetInputDimensions(dim);
        bbSetInputSpacing(spc);
@@ -150,9 +176,8 @@ void CreateImage::bbUserFinalizeProcessing()
 //    but this is where you should desallocate the internal/output pointers 
 //    if any
        imageoutput->Delete();
-
 }
-}
-// EO namespace bbvtk
+
+}// EO namespace bbvtk
 
 
index 7e72e8b2b092034afe09e674b165a7a9e051b705..5d43aee0507e9e2a4374ca88bac45c375275538f 100644 (file)
@@ -75,7 +75,7 @@ BBTK_BEGIN_DESCRIBE_BLACK_BOX(CreateImage,bbtk::AtomicBlackBox);
        
        BBTK_INPUT(CreateImage,Dimensions,"[SizeX SizeY SizeZ] of the image ([250 250 250] default)",std::vector<int>,"");
        BBTK_INPUT(CreateImage,Spacing,"[SpcX SpcY SpcZ] of the image ([1 1 1] default)",std::vector<double>,"");
-       BBTK_INPUT(CreateImage,OutputFormat,"Image output format:  VTK_BIT, VTK_CHAR, VTK_SIGNED_CHAR, VTK_UNSIGNED_CHAR, VTK_SHORT VTK_UNSIGNED_SHORT (default), VTK_INT, VTK_UNSIGNED_INT, VTK_LONG, VTK_UNSIGNED_LONG, VTK_FLOAT, VTK_DOUBLE",std::string,"");
+       BBTK_INPUT(CreateImage,OutputFormat,"Image output format:  VTK_BIT, VTK_CHAR, VTK_SIGNED_CHAR, VTK_UNSIGNED_CHAR, VTK_SHORT, VTK_UNSIGNED_SHORT (default), VTK_INT, VTK_UNSIGNED_INT, VTK_LONG, VTK_UNSIGNED_LONG, VTK_FLOAT, VTK_DOUBLE",std::string,"");
        BBTK_INPUT(CreateImage,InitialValue,"Initial value inside the image (0 default)",double,"");
 
        BBTK_OUTPUT(CreateImage,Out,"Output vtkImageData",vtkImageData*,"");
index 50f8618e48ad20c9f3fad645891478626303d94e..efbbe227e7eb91a17ed86c540eda84e5d8d409dc 100644 (file)
@@ -52,6 +52,7 @@ void ExtractVtkImageFilter::Process()
        _extract->SetInput( bbGetInputIn() );
        _extract->SetVOI(voi);  
        _extract->UpdateWholeExtent();
+       _extract->Modified();
        _extract->Update();
        bbSetOutputOut(_extract->GetOutput());
 }
diff --git a/packages/vtk/src/bbvtkExtractVtkImageFilter.cxx~ b/packages/vtk/src/bbvtkExtractVtkImageFilter.cxx~
new file mode 100644 (file)
index 0000000..efbbe22
--- /dev/null
@@ -0,0 +1,117 @@
+/*
+ # ---------------------------------------------------------------------
+ #
+ # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
+ #                        pour la SantÈ)
+ # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
+ # Previous Authors : Laurent Guigues, Jean-Pierre Roux
+ # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
+ #
+ #  This software is governed by the CeCILL-B license under French law and
+ #  abiding by the rules of distribution of free software. You can  use,
+ #  modify and/ or redistribute the software under the terms of the CeCILL-B
+ #  license as circulated by CEA, CNRS and INRIA at the following URL
+ #  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+ #  or in the file LICENSE.txt.
+ #
+ #  As a counterpart to the access to the source code and  rights to copy,
+ #  modify and redistribute granted by the license, users are provided only
+ #  with a limited warranty  and the software's author,  the holder of the
+ #  economic rights,  and the successive licensors  have only  limited
+ #  liability.
+ #
+ #  The fact that you are presently reading this means that you have had
+ #  knowledge of the CeCILL-B license and that you accept its terms.
+ # ------------------------------------------------------------------------ */
+
+
+//=====
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+#include "bbvtkExtractVtkImageFilter.h"
+#include "bbvtkPackage.h"
+namespace bbvtk
+{
+
+BBTK_ADD_BLACK_BOX_TO_PACKAGE(vtk,ExtractVtkImageFilter)
+BBTK_BLACK_BOX_IMPLEMENTATION(ExtractVtkImageFilter,bbtk::AtomicBlackBox);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void ExtractVtkImageFilter::Process()
+{
+       int voi[6];
+
+       voi[0] = bbGetInputIndex()[0];
+       voi[1] = bbGetInputIndex()[0]+bbGetInputSize()[0]-1;
+       voi[2] = bbGetInputIndex()[1];
+       voi[3] = bbGetInputIndex()[1]+bbGetInputSize()[1]-1;
+       voi[4] = bbGetInputIndex()[2];
+       voi[5] = bbGetInputIndex()[2]+bbGetInputSize()[2]-1;
+       
+       _extract->SetInput( bbGetInputIn() );
+       _extract->SetVOI(voi);  
+       _extract->UpdateWholeExtent();
+       _extract->Modified();
+       _extract->Update();
+       bbSetOutputOut(_extract->GetOutput());
+}
+       
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void ExtractVtkImageFilter::bbUserSetDefaultValues()
+{
+
+//  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
+//    Here we initialize the input 'In' to 0
+       
+       _extract =NULL;
+
+   bbSetInputIn(0);
+       
+       std::vector<int> tmpIndex;
+       tmpIndex.push_back(0);
+       tmpIndex.push_back(0);
+       tmpIndex.push_back(0);
+       std::vector<int> tmpSize;
+       tmpSize.push_back(1);
+       tmpSize.push_back(1);
+       tmpSize.push_back(1);
+       bbSetInputIndex(tmpIndex);
+       bbSetInputSize(tmpSize);
+       
+       bbSetOutputOut(0);
+  
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void ExtractVtkImageFilter::bbUserInitializeProcessing()
+{
+
+//  THE INITIALIZATION METHOD BODY :
+//    Here does nothing 
+//    but this is where you should allocate the internal/output pointers 
+//    if any 
+       _extract = vtkExtractVOI::New();
+
+  
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void ExtractVtkImageFilter::bbUserFinalizeProcessing()
+{
+
+//  THE FINALIZATION METHOD BODY :
+//    Here does nothing 
+//    but this is where you should desallocate the internal/output pointers 
+//    if any
+
+       _extract->Delete();
+}
+}
+// EO namespace bbvtk
+
+
index 1a65c9d3ead709b4a022a7feecc882ed02a5ef2b..a252888c5a04d9bffdaddef6a76f19e3dab1f7b8 100644 (file)
@@ -54,6 +54,7 @@ namespace bbvtk
       //std::cout << "-------- entree ds Flip::bbUserSetDefaultValues()\n" << std::endl;
       
       bbSetInputIn(NULL); 
+      bbSetInputAxis("Y"); 
       mImageOut = NULL;
       bbSetOutputOut(NULL);
    }
@@ -113,6 +114,7 @@ void Flip::Process()
                int scalarSize  = bbGetInputIn()->GetScalarSize();
                int lineSize    = inputdims[0]*scalarSize*nbScalComp;      
                int planeSize   = inputdims[1]*lineSize;
+                int volumeSize  = inputdims[2]*planeSize;
                char *pixelsIn  = (char *)bbGetInputIn()->GetScalarPointer();
                char *pixelsOut = (char *)mImageOut->GetScalarPointer();
        
@@ -120,19 +122,60 @@ void Flip::Process()
                char *lineOut;
                char *debPlanIn;
                char *debPlanOut;
-               int j,k;
-               for(k=0; k<inputdims[2]; k++)  // iterate on planes
+               int i,j,k;
+               
+               if ( (bbGetInputAxis()=="O") || (bbGetInputAxis()=="o") )
                {  
-                       debPlanIn       = pixelsIn+k*planeSize;
-                       debPlanOut      = pixelsOut+k*planeSize;
-                       for(j=0; j<inputdims[1]; j++)  // iterates on rows
-                       { 
-                               lineIn = debPlanIn+j*lineSize;
-                               lineOut = debPlanOut+(inputdims[1]-1-j)*lineSize;
-                               memcpy(lineOut,  lineIn, lineSize);
-                       }       // for j
-               } // for k
-       
+                       pixelsIn = (char *)bbGetInputIn()->GetScalarPointer(0,0,0);
+                       pixelsOut = (char *)mImageOut->GetScalarPointer(0,0,0);
+                       memcpy(pixelsOut,  pixelsIn, volumeSize );
+               } else if ( (bbGetInputAxis()=="X") || (bbGetInputAxis()=="x") )
+               {  
+
+                       for(k=0; k<inputdims[2]; k++)  // iterate  planes
+                       {  
+                               for(j=0; j<inputdims[1]; j++)  // iterates  rows
+                               { 
+                                       for(i=0; i<inputdims[0]; i++)  // iterates  columns
+                                       { 
+                                               pixelsIn = (char *)bbGetInputIn()->GetScalarPointer(i,j,k);
+                                               pixelsOut = (char *)mImageOut->GetScalarPointer(inputdims[0]-1-i,j,k);
+                                               memcpy(pixelsOut,  pixelsIn, scalarSize );
+                                       }       // for i
+                               }       // for j
+                       } // for k
+
+               } else if ( (bbGetInputAxis()=="Z") || (bbGetInputAxis()=="z") )  {  
+
+                       for(k=0; k<inputdims[2]; k++)  // iterate  planes
+                       {  
+                               for(j=0; j<inputdims[1]; j++)  // iterates  rows
+                               { 
+                                       for(i=0; i<inputdims[0]; i++)  // iterates  columns
+                                       { 
+                                               pixelsIn = (char *)bbGetInputIn()->GetScalarPointer(i,j,k);
+                                               pixelsOut = (char *)mImageOut->GetScalarPointer(i,j,inputdims[2]-1-k);
+                                               memcpy(pixelsOut,  pixelsIn, scalarSize );
+                                       }       // for i
+                               }       // for j
+                       } // for k
+
+               } else {  
+
+                       for(k=0; k<inputdims[2]; k++)  // iterate  planes
+                       {  
+                               debPlanIn       = pixelsIn+k*planeSize;
+                               debPlanOut      = pixelsOut+k*planeSize;
+                               for(j=0; j<inputdims[1]; j++)  // iterates  rows
+                               { 
+                                       lineIn = debPlanIn+j*lineSize;
+                                       lineOut = debPlanOut+(inputdims[1]-1-j)*lineSize;
+                                       memcpy(lineOut,  lineIn, lineSize);
+                               }       // for j
+                       } // for k
+
+               } //if
+               mImageOut->Modified();
                bbSetOutputOut( mImageOut  );           
        } // bbGetInputIn
 
index 09a91650d0c0059a8b0ff526c2eb0efefb60c159..48dcfd14c3a7813ced5c105e8e12ac56d2a1d6cc 100644 (file)
@@ -64,7 +64,8 @@ namespace bbvtk
   { 
   public:
     BBTK_BLACK_BOX_INTERFACE(Flip, bbtk::AtomicBlackBox);
-    BBTK_DECLARE_INPUT (In,vtkImageData *);  
+    BBTK_DECLARE_INPUT(In,vtkImageData *);  
+    BBTK_DECLARE_INPUT(Axis,std::string);  
     BBTK_DECLARE_OUTPUT(Out, vtkImageData*);    
     BBTK_PROCESS(Process);
     void Process();
@@ -85,6 +86,7 @@ namespace bbvtk
   BBTK_DESCRIPTION("flips a <vtkImageData*>");
   BBTK_CATEGORY("application, image");
   BBTK_INPUT(Flip, In, "image", vtkImageData *, "");
+  BBTK_INPUT(Flip, Axis, "Axe (default Y)  X Y Z O(original)", std::string, "");
   BBTK_OUTPUT(Flip, Out, "fliped image", vtkImageData *, "");
   BBTK_END_DESCRIBE_BLACK_BOX(Flip);   
   //=================================================================
index 48e269002eb83e14d0d8cb27238611cd7cf6a8e2..818e5e756745ea9b5c241c52a2637e84be50e0f0 100644 (file)
@@ -37,7 +37,7 @@
 #include "bbvtkGetVectorElement.h"
 #include "bbvtkPackage.h"
 
-#include "vtkImageData.h"
+
 
 namespace bbvtk
 {
@@ -49,8 +49,8 @@ namespace bbvtk
 //====================================================================
 // Add the specialized boxes to the package
 
-typedef vtkImageData * ptrvtkImageData;
 BBTK_ADD_TEMPLATE_BLACK_BOX_TO_PACKAGE(vtk,GetVectorElement,ptrvtkImageData);
+BBTK_ADD_TEMPLATE_BLACK_BOX_TO_PACKAGE(vtk,GetVectorElement,ptrvtkPolyData);
 
 //====================================================================
 
index e73c571bdf3521c57d9b0d1ab5fa811b71e2745e..94903be9d375be680da86cf6c8a063ea333e6844 100644 (file)
@@ -39,6 +39,9 @@
 #include "bbtkAtomicBlackBox.h"
 #include "bbvtk_EXPORT.h"
 
+#include "vtkImageData.h"
+#include "vtkPolyData.h"
+
 namespace bbvtk
 {
   //=================================================================
@@ -56,11 +59,30 @@ namespace bbvtk
   };
   //=================================================================
 
+
+  typedef vtkImageData* ptrvtkImageData;
+  typedef vtkPolyData* ptrvtkPolyData;
+
+//  BBTK_DEFINE_HUMAN_READABLE_TYPE_NAME( ptrvtkImageData ,"PtrvtkImageData");
+//  BBTK_DEFINE_HUMAN_READABLE_TYPE_NAME( ptrvtkPolyData ,"PtrvtkPolyData");
+//  BBTK_DEFINE_HUMAN_READABLE_VECTOR_TYPE_NAME(ptrvtkImageData);
+//  BBTK_DEFINE_HUMAN_READABLE_VECTOR_TYPE_NAME(ptrvtkPolyData);
+
   //=================================================================
   // BlackBox description
   BBTK_BEGIN_DESCRIBE_TEMPLATE_BLACK_BOX(GetVectorElement,bbtk::AtomicBlackBox);
+
+  std::string humantypename;
+  if (bbtk::HumanTypeName<T>()==bbtk::HumanTypeName<vtkPolyData*>()) { humantypename="VtkPolyData"; }
+  if (bbtk::HumanTypeName<T>()==bbtk::HumanTypeName<vtkImageData*>()) { humantypename="VtkImageData"; }
+  
+  BBTK_NAME("GetVector"+humantypename+"Element");
+
+//  BBTK_NAME("GetVector"+bbtk::HumanTypeName<T>()+"Element");
+
 //  BBTK_NAME("Get"+bbtk::HumanTypeName<std::vector<T> >()+"Element");
-   BBTK_NAME("GetVectorVtkImageDataElement");
+//  BBTK_NAME("GetVector"+"T"+"Element");
+//   BBTK_NAME("GetVectorVtkImageDataElement");
   BBTK_AUTHOR("info-dev@creatis.insa-lyon.fr");
  // BBTK_DEFAULT_ADAPTOR();
   BBTK_DESCRIPTION("Gets the i-th element from the input vector ("+bbtk::TypeName<std::vector<T> >());
diff --git a/packages/vtk/src/bbvtkGetVtkImageVectorSize.cxx b/packages/vtk/src/bbvtkGetVtkImageVectorSize.cxx
new file mode 100644 (file)
index 0000000..73b6aa9
--- /dev/null
@@ -0,0 +1,73 @@
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+#include "bbvtkGetVtkImageVectorSize.h"
+#include "bbvtkPackage.h"
+
+namespace bbvtk
+{
+
+BBTK_ADD_BLACK_BOX_TO_PACKAGE(vtk,GetVtkImageVectorSize)
+BBTK_BLACK_BOX_IMPLEMENTATION(GetVtkImageVectorSize,bbtk::AtomicBlackBox);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void GetVtkImageVectorSize::Process()
+{
+
+// THE MAIN PROCESSING METHOD BODY
+//   Here we simply set the input 'In' value to the output 'Out'
+//   And print out the output value
+// INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
+//    void bbSet{Input|Output}NAME(const TYPE&)
+//    const TYPE& bbGet{Input|Output}NAME() const 
+//    Where :
+//    * NAME is the name of the input/output
+//      (the one provided in the attribute 'name' of the tag 'input')
+//    * TYPE is the C++ type of the input/output
+//      (the one provided in the attribute 'type' of the tag 'input')
+
+    bbSetOutputVectorSize( bbGetInputIn().size() );
+  
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void GetVtkImageVectorSize::bbUserSetDefaultValues()
+{
+
+//  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
+//    Here we initialize the input 'In' to 0
+
+//   bbSetInputIn(0);
+  
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void GetVtkImageVectorSize::bbUserInitializeProcessing()
+{
+
+//  THE INITIALIZATION METHOD BODY :
+//    Here does nothing 
+//    but this is where you should allocate the internal/output pointers 
+//    if any 
+
+  
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void GetVtkImageVectorSize::bbUserFinalizeProcessing()
+{
+
+//  THE FINALIZATION METHOD BODY :
+//    Here does nothing 
+//    but this is where you should desallocate the internal/output pointers 
+//    if any
+  
+}
+}
+// EO namespace bbvtk
+
+
diff --git a/packages/vtk/src/bbvtkGetVtkImageVectorSize.h b/packages/vtk/src/bbvtkGetVtkImageVectorSize.h
new file mode 100644 (file)
index 0000000..a48df64
--- /dev/null
@@ -0,0 +1,50 @@
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+#ifndef __bbvtkGetVtkImageVectorSize_h_INCLUDED__
+#define __bbvtkGetVtkImageVectorSize_h_INCLUDED__
+#include "bbvtk_EXPORT.h"
+#include "bbtkAtomicBlackBox.h"
+#include "iostream"
+
+#include "vtkImageData.h"
+
+namespace bbvtk
+{
+
+class bbvtk_EXPORT GetVtkImageVectorSize
+ : 
+   public bbtk::AtomicBlackBox
+{
+  BBTK_BLACK_BOX_INTERFACE(GetVtkImageVectorSize,bbtk::AtomicBlackBox);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+  BBTK_DECLARE_INPUT(In,std::vector<vtkImageData*>);
+  BBTK_DECLARE_OUTPUT(VectorSize,int);
+  BBTK_PROCESS(Process);
+  void Process();
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+};
+
+BBTK_BEGIN_DESCRIBE_BLACK_BOX(GetVtkImageVectorSize,bbtk::AtomicBlackBox);
+BBTK_NAME("GetVtkImageVectorSize");
+BBTK_AUTHOR("Eduardo DAVILA");
+BBTK_DESCRIPTION("eduardo.davila@creatis.insa-lyon.fr -");
+BBTK_CATEGORY("std");
+
+  BBTK_INPUT(GetVtkImageVectorSize,In,"vtkImageData std::vector",std::vector<vtkImageData*>,"");
+
+  BBTK_OUTPUT(GetVtkImageVectorSize,VectorSize,"Size of the vtkImageData vector",int,"");
+
+BBTK_END_DESCRIBE_BLACK_BOX(GetVtkImageVectorSize);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+}
+// EO namespace bbvtk
+
+#endif // __bbvtkGetVtkImageVectorSize_h_INCLUDED__
+
index 96fd828b982ceeef049c7bb4edeb6e319bcae523..7c24a5dabd9e0e04b595e805773cf7ce5af140b0 100644 (file)
@@ -65,7 +65,7 @@ class bbvtk_EXPORT ImageBoundaries
 BBTK_BEGIN_DESCRIBE_BLACK_BOX(ImageBoundaries,bbtk::AtomicBlackBox);
        BBTK_NAME("ImageBoundaries");
        BBTK_AUTHOR("Info-Dev");
-       BBTK_DESCRIPTION("Get gray level boundaries of an vtkImageData");
+       BBTK_DESCRIPTION("Get gray level boundaries of an vtkImageData (for AutoCrop)");
        BBTK_CATEGORY("filter");
        BBTK_INPUT(ImageBoundaries,In,"Input image",vtkImageData*,"");
        BBTK_INPUT(ImageBoundaries,LowerValue,"0 default. Lower gray level",double,"");
index 8e60e7ef2bca13cce733d43157974dc789d0d72d..6543e0620e721bbb2e5a3ada7b9177460b4d4b04 100644 (file)
@@ -50,6 +50,7 @@ void ImageCastToUShort::Process()
        vtkImageData* img = bbGetInputIn();     
        cast->SetInput(img);
        cast->SetOutputScalarTypeToUnsignedShort();
+       cast->Modified();
        cast->Update();
     bbSetOutputOut(cast->GetOutput() );   
 }
index a07648630721bd422041b18c698929d3e5870dca..31a11c37a8a851fa390f9923f7faa9ab61d1084b 100644 (file)
@@ -22,6 +22,7 @@
 bbGetVtkObject()->SetKernelSize(bbGetInputKernelSizeX(), 
               bbGetInputKernelSizeY(), 
               bbGetInputKernelSizeZ());
+bbGetVtkObject()->Modified();
 bbGetVtkObject()->Update();
 </PRE>
 </process>
index 07a98d066a5cfe264b6965089c4ec157fd89448b..f1326061150b288492a41d43ec3e2e4abed28676 100644 (file)
@@ -22,6 +22,7 @@
 bbGetVtkObject()->SetKernelSize(bbGetInputKernelSizeX(), 
               bbGetInputKernelSizeY(), 
               bbGetInputKernelSizeZ());
+bbGetVtkObject()->Modified();
 bbGetVtkObject()->Update();
 </PRE>
 </process>
index 352d4366adaff4c066e9ef4dc4df45fc212dba0d..2f7c2e20c7b0f44073681f816d5d486806787ff2 100644 (file)
@@ -24,6 +24,7 @@
 bbGetVtkObject()->SetKernelSize(bbGetInputKernelSizeX(), 
               bbGetInputKernelSizeY(), 
               bbGetInputKernelSizeZ());
+bbGetVtkObject()->Modified();
 bbGetVtkObject()->Update();
 </PRE>
 </process>
index b7450d2a12bb5a92fac8572651377bfab99d59d1..f93a09ffae45b268de631fec5183e6bf8c5d0043 100644 (file)
 
 <process>
 <PRE>
-    printf("EED ImageGaussianSmooth::Process start \n");
     bbGetVtkObject()->SetStandardDeviation(bbGetInputStdDevX(), 
                                        bbGetInputStdDevY(), 
                                        bbGetInputStdDevZ());
+    bbGetVtkObject()->Modified();
     bbGetVtkObject()->Update();
-    printf("EED ImageGaussianSmooth::Process end \n");
 </PRE>
 
 </process>
index 0a2d06d09323dd9d0d638d21b35cf09d7b0e8681..f9d8b7d1c958362386a3b0471ae5ed9537e621a1 100644 (file)
@@ -50,7 +50,9 @@ void ImageVtkProperties::Process()
        std::vector<float> vspacing;
        std::vector<float> vrange;
 
-       if ( bbGetInputIn() ){
+       if ( bbGetInputIn() )
+       {
+               bbGetInputIn()->Modified();
                bbGetInputIn()->Update();
                
                bbGetInputIn()->GetWholeExtent(ext);
@@ -68,21 +70,25 @@ void ImageVtkProperties::Process()
        
                bbGetInputIn()->GetSpacing(spc);
                for (unsigned int i=0;i<dim;++i) 
+               {
                        vspacing.push_back((float)spc[i]);
+               }
 
                vrange.push_back((float)range[0]);
                vrange.push_back((float)range[1]);
-       
-               if (bbGetInputIn()->GetScalarType()==VTK_BIT)                           nametype="VTK_BIT";
-               if (bbGetInputIn()->GetScalarType()==VTK_CHAR)                          nametype="VTK_CHAR";
-               if (bbGetInputIn()->GetScalarType()==VTK_SIGNED_CHAR)           nametype="VTK_SIGNED_CHAR";
-               if (bbGetInputIn()->GetScalarType()==VTK_UNSIGNED_CHAR)         nametype="VTK_UNSIGNED_CHAR";
-               if (bbGetInputIn()->GetScalarType()==VTK_UNSIGNED_SHORT)        nametype="VTK_UNSIGNED_SHORT";
-               if (bbGetInputIn()->GetScalarType()==VTK_UNSIGNED_INT)          nametype="VTK_UNSIGNED_INT";
-               if (bbGetInputIn()->GetScalarType()==VTK_LONG)                          nametype="VTK_LONG";
-               if (bbGetInputIn()->GetScalarType()==VTK_UNSIGNED_LONG)         nametype="VTK_UNSIGNED_LONG";
-               if (bbGetInputIn()->GetScalarType()==VTK_FLOAT)                         nametype="VTK_FLOAT";
-               if (bbGetInputIn()->GetScalarType()==VTK_DOUBLE)                        nametype="VTK_DOUBLE";
+
+               if (bbGetInputIn()->GetScalarType()==VTK_BIT)                           nametype="VTK_BIT";                     // 1
+               if (bbGetInputIn()->GetScalarType()==VTK_CHAR)                          nametype="VTK_CHAR";                    // 2
+               if (bbGetInputIn()->GetScalarType()==VTK_SIGNED_CHAR)           nametype="VTK_SIGNED_CHAR";     // 15
+               if (bbGetInputIn()->GetScalarType()==VTK_UNSIGNED_CHAR)         nametype="VTK_UNSIGNED_CHAR";   // 3
+               if (bbGetInputIn()->GetScalarType()==VTK_SHORT)                         nametype="VTK_SHORT";                   // 4
+               if (bbGetInputIn()->GetScalarType()==VTK_UNSIGNED_SHORT)        nametype="VTK_UNSIGNED_SHORT";  // 5
+               if (bbGetInputIn()->GetScalarType()==VTK_INT)                           nametype="VTK_INT";             // 6
+               if (bbGetInputIn()->GetScalarType()==VTK_UNSIGNED_INT)          nametype="VTK_UNSIGNED_INT";    // 7
+               if (bbGetInputIn()->GetScalarType()==VTK_LONG)                          nametype="VTK_LONG";            // 8  
+               if (bbGetInputIn()->GetScalarType()==VTK_UNSIGNED_LONG)         nametype="VTK_UNSIGNED_LONG";   // 9
+               if (bbGetInputIn()->GetScalarType()==VTK_FLOAT)                         nametype="VTK_FLOAT";           // 10
+               if (bbGetInputIn()->GetScalarType()==VTK_DOUBLE)                        nametype="VTK_DOUBLE";          // 11
        } else {        
                dim                                     = 0;            
                numberoOfComponents     = 0;
diff --git a/packages/vtk/src/bbvtkInversCrop.cxx b/packages/vtk/src/bbvtkInversCrop.cxx
new file mode 100644 (file)
index 0000000..97963bc
--- /dev/null
@@ -0,0 +1,160 @@
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+#include "bbvtkInversCrop.h"
+#include "bbvtkPackage.h"
+namespace bbvtk
+{
+
+BBTK_ADD_BLACK_BOX_TO_PACKAGE(vtk,InversCrop)
+BBTK_BLACK_BOX_IMPLEMENTATION(InversCrop,bbtk::AtomicBlackBox);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void InversCrop::Process()
+{
+
+// THE MAIN PROCESSING METHOD BODY
+//   Here we simply set the input 'In' value to the output 'Out'
+//   And print out the output value
+// INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
+//    void bbSet{Input|Output}NAME(const TYPE&)
+//    const TYPE& bbGet{Input|Output}NAME() const 
+//    Where :
+//    * NAME is the name of the input/output
+//      (the one provided in the attribute 'name' of the tag 'input')
+//    * TYPE is the C++ type of the input/output
+//      (the one provided in the attribute 'type' of the tag 'input')
+
+    if ((bbGetInputImageFix()!=NULL) && (bbGetInputImageMove()!=NULL) )
+    {
+     if ( bbGetInputImageFix()->GetScalarType()==bbGetInputImageMove()->GetScalarType() ) 
+     {
+        // Creating Image
+       int dim[3];
+       int ext[6];
+       
+       bbGetInputImageFix()->GetWholeExtent(ext);
+       dim[0]= ext[1]-ext[0]+1;
+       dim[1]= ext[3]-ext[2]+1;
+       dim[2]= ext[5]-ext[4]+1;
+
+       if (bbGetInputType()==0)
+       {
+               _imageoutput = vtkImageData::New();
+               _imageoutput->Initialize();
+               _imageoutput->SetScalarType( bbGetInputImageFix()->GetScalarType() );
+               _imageoutput->SetSpacing( bbGetInputImageFix()->GetSpacing() );
+               _imageoutput->SetDimensions(  dim[0], dim[1], dim[2] );
+               _imageoutput->AllocateScalars();
+       }
+       if (bbGetInputType()==1)
+       {
+               _imageoutput=bbGetInputImageFix();
+       }
+
+
+        // Duplicating Fix Image
+       long sizeimage = dim[0]*dim[1]*dim[2]*bbGetInputImageFix()->GetScalarSize();    
+       memcpy( _imageoutput->GetScalarPointer() , bbGetInputImageFix()->GetScalarPointer() , sizeimage);
+
+       // Copy the Move Image
+       int j,k; 
+       int px,py,pz;
+
+       bbGetInputImageMove()->GetWholeExtent(ext);
+       int dimMoveX = ext[1]-ext[0]+1;
+       int dimMoveY = ext[3]-ext[2]+1;
+       int dimMoveZ = ext[5]-ext[4]+1;
+
+        int spxM=0;  // start px MoveImage
+        int sizeXM=0;  // sizeX MoveImage
+
+       px=bbGetInputOrigin()[0];
+        spxM=0;
+        if (px<=0)
+       { 
+          spxM=px*(-1);
+          px=0;
+       }
+       sizeXM = dimMoveX-spxM;
+       if (px+sizeXM>=dim[0]) sizeXM=dim[0]-px;
+
+       sizeXM=sizeXM*bbGetInputImageFix()->GetScalarSize();
+       for (k=0; k<dimMoveZ; k++)
+       {
+          for (j=0; j<dimMoveY; j++)
+          {
+                py=j+bbGetInputOrigin()[1];
+               pz=k+bbGetInputOrigin()[2];
+               
+               if ( (py<dim[1]) && (pz<dim[2]) &&
+                    (py>=0)    && (pz>=0)      &&
+                    (sizeXM>0) ) 
+               {
+                       memcpy( _imageoutput->GetScalarPointer(px,py,pz) , bbGetInputImageMove()->GetScalarPointer(spxM,j,k) , sizeXM );
+               }
+
+          } // for j
+       } // for k
+        _imageoutput->Modified();
+      } // If Image Fixe Move the same GetScalarType
+        else {
+           printf ("ERROR: InversCrop  both ImageFixe and ImageMove need the same format.\n");
+      }  
+    } // If Image Fixe Move != NULL
+     else {
+        printf ("ERROR: InversCrop  need ImageFixe and ImageMove to run.\n");
+    } 
+    bbSetOutputOut(_imageoutput);
+}
+
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void InversCrop::bbUserSetDefaultValues()
+{
+
+//  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
+//    Here we initialize the input 'In' to 0
+   bbSetInputType(0);
+   bbSetInputImageFix(NULL);
+   bbSetInputImageMove(NULL);
+
+   std::vector<int> origin;
+   origin.push_back(0);
+   origin.push_back(0);
+   origin.push_back(0);
+   bbSetInputOrigin(origin);
+   
+   _imageoutput=NULL;
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void InversCrop::bbUserInitializeProcessing()
+{
+
+//  THE INITIALIZATION METHOD BODY :
+//    Here does nothing 
+//    but this is where you should allocate the internal/output pointers 
+//    if any 
+
+  
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void InversCrop::bbUserFinalizeProcessing()
+{
+
+//  THE FINALIZATION METHOD BODY :
+//    Here does nothing 
+//    but this is where you should desallocate the internal/output pointers 
+//    if any
+  
+}
+}
+// EO namespace bbvtk
+
+
diff --git a/packages/vtk/src/bbvtkInversCrop.h b/packages/vtk/src/bbvtkInversCrop.h
new file mode 100644 (file)
index 0000000..59d90dc
--- /dev/null
@@ -0,0 +1,59 @@
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+#ifndef __bbvtkInversCrop_h_INCLUDED__
+#define __bbvtkInversCrop_h_INCLUDED__
+#include "bbvtk_EXPORT.h"
+#include "bbtkAtomicBlackBox.h"
+#include "iostream"
+
+
+#include "vtkImageData.h"
+
+namespace bbvtk
+{
+
+class bbvtk_EXPORT InversCrop
+ : 
+   public bbtk::AtomicBlackBox
+{
+  BBTK_BLACK_BOX_INTERFACE(InversCrop,bbtk::AtomicBlackBox);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+  BBTK_DECLARE_INPUT(Type,int);
+  BBTK_DECLARE_INPUT(ImageFix,vtkImageData*);
+  BBTK_DECLARE_INPUT(ImageMove,vtkImageData*);
+  BBTK_DECLARE_INPUT(Origin,std::vector<int>);
+  BBTK_DECLARE_OUTPUT(Out,vtkImageData*);
+  BBTK_PROCESS(Process);
+  void Process();
+
+  vtkImageData *_imageoutput;
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+};
+BBTK_BEGIN_DESCRIBE_BLACK_BOX(InversCrop,bbtk::AtomicBlackBox);
+  BBTK_NAME("InversCrop");
+  BBTK_AUTHOR("InfoDev");
+  BBTK_DESCRIPTION("Invers Crop, Both images had to have the same format");
+  BBTK_CATEGORY("");
+
+  BBTK_INPUT(InversCrop,Type,"(default 0) 0=Create image for the result FixImage+MoveImage, 1=Use the FixImage as output",int,"");
+  BBTK_INPUT(InversCrop,ImageFix,"Fix Image (necesary). Need same format of ImageMove",vtkImageData*,"");
+  BBTK_INPUT(InversCrop,ImageMove,"Move Image (necesary). Need same format of ImageFix",vtkImageData*,"");
+  BBTK_INPUT(InversCrop,Origin,"Position to be put de Move Image (default 0,0,0 )",std::vector<int>,"");
+
+  BBTK_OUTPUT(InversCrop,Out,"First output",vtkImageData*,"");
+
+BBTK_END_DESCRIBE_BLACK_BOX(InversCrop);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+}
+// EO namespace bbvtk
+
+#endif // __bbvtkInversCrop_h_INCLUDED__
+
index 972c72f5d696c03abccfd0a0af810c98c9fa12a7..83f9b4d0eec2a8a3614255c86df2adde1c059270 100644 (file)
@@ -53,23 +53,33 @@ namespace bbvtk
 
        void MarchingCubes::Process()
        {
-               bbGetVtkObject()->SetValue(0, bbGetInputValue() );
-               if(bbGetInputComputeNormalsOn())
-                       bbGetVtkObject()->ComputeNormalsOn();
-               else
-                       bbGetVtkObject()->ComputeNormalsOff();
-
-               if(bbGetInputComputeScalarsOn())
-                       bbGetVtkObject()->ComputeScalarsOn();
-               else
-                       bbGetVtkObject()->ComputeScalarsOff();
-               bbGetVtkObject()->Update();             
+               if (bbGetInputActive()==true)
+               {
+                       bbGetVtkObject()->SetValue(0, bbGetInputValue() );
+
+                       if(bbGetInputComputeNormalsOn()) 
+                       {
+                               bbGetVtkObject()->ComputeNormalsOn();
+                       }else {
+                               bbGetVtkObject()->ComputeNormalsOff();
+                       }
+
+                       if(bbGetInputComputeScalarsOn())
+                       {
+                               bbGetVtkObject()->ComputeScalarsOn();
+                       }else{
+                               bbGetVtkObject()->ComputeScalarsOff();
+                       }
+
+                       bbGetVtkObject()->Update();             
+               }
        }
        
        //-----------------------------------------------------------------     
        void MarchingCubes::bbUserSetDefaultValues()
        {
                 BBTK_VTK_SET_DEFAULT_VALUES();
+               bbSetInputActive(true);
                bbSetInputValue(400);
                bbSetInputComputeNormalsOn(true);
                bbSetInputComputeScalarsOn(true);
index 6198ee99860b78b363f20af51fc3af8d1e9b1e2c..6d4245604785f670c79d4a92763bb4eb3b767e0a 100644 (file)
@@ -73,6 +73,7 @@ namespace bbvtk
                                 bbtk::AtomicBlackBox,
                                 vtkMarchingCubes);
 
+       BBTK_DECLARE_INPUT(Active,bool);
     BBTK_DECLARE_VTK_INPUT(In,vtkImageData *);
        BBTK_DECLARE_INPUT(Value,double);
        BBTK_DECLARE_INPUT(ComputeNormalsOn,bool);
@@ -112,6 +113,7 @@ namespace bbvtk
   BBTK_DESCRIPTION("Extracts an iso-surface of an image using the marching cubes algorithm (bbfication of vtkMarchingCubes)");
   BBTK_CATEGORY("image;mesh");
 
+  BBTK_INPUT(MarchingCubes,Active,"Active true/false (default true)",bool,"");
   BBTK_INPUT(MarchingCubes,In,"Image",vtkImageData*,"");
   BBTK_INPUT(MarchingCubes,Value,"Value of the iso-surface",double,"");
   BBTK_INPUT(MarchingCubes,ComputeNormalsOn,"Set the computation of normals",bool,"");
diff --git a/packages/vtk/src/bbvtkMaskPoint.cxx b/packages/vtk/src/bbvtkMaskPoint.cxx
new file mode 100644 (file)
index 0000000..c192648
--- /dev/null
@@ -0,0 +1,80 @@
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+#include "bbvtkMaskPoint.h"
+#include "bbvtkPackage.h"
+namespace bbvtk
+{
+
+BBTK_ADD_BLACK_BOX_TO_PACKAGE(vtk,MaskPoint)
+BBTK_BLACK_BOX_IMPLEMENTATION(MaskPoint,bbtk::AtomicBlackBox);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void MaskPoint::Process()
+{
+
+// THE MAIN PROCESSING METHOD BODY
+//   Here we simply set the input 'In' value to the output 'Out'
+//   And print out the output value
+// INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
+//    void bbSet{Input|Output}NAME(const TYPE&)
+//    const TYPE& bbGet{Input|Output}NAME() const 
+//    Where :
+//    * NAME is the name of the input/output
+//      (the one provided in the attribute 'name' of the tag 'input')
+//    * TYPE is the C++ type of the input/output
+//      (the one provided in the attribute 'type' of the tag 'input')
+
+printf("EED MaskPoint::Process Start\n");
+       maskpoints->SetInput( bbGetInputIn() );  
+       maskpoints->SetOnRatio( bbGetInputRatio() );
+       maskpoints->RandomModeOn();     
+       maskpoints->SetMaximumNumberOfPoints(5000);     
+       maskpoints->Update();
+       bbSetOutputOut( maskpoints->GetOutput() );
+printf("EED MaskPoint::Process End\n");
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void MaskPoint::bbUserSetDefaultValues()
+{
+
+//  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
+//    Here we initialize the input 'In' to 0
+   bbSetInputIn(NULL);
+   bbSetOutputOut(NULL);
+  
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void MaskPoint::bbUserInitializeProcessing()
+{
+
+//  THE INITIALIZATION METHOD BODY :
+//    Here does nothing 
+//    but this is where you should allocate the internal/output pointers 
+//    if any 
+
+   maskpoints = vtkMaskPoints::New();
+  
+
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void MaskPoint::bbUserFinalizeProcessing()
+{
+
+//  THE FINALIZATION METHOD BODY :
+//    Here does nothing 
+//    but this is where you should desallocate the internal/output pointers 
+//    if any
+     maskpoints->Delete();
+}
+
+}  // EO namespace bbvtk
+
+
diff --git a/packages/vtk/src/bbvtkMaskPoint.h b/packages/vtk/src/bbvtkMaskPoint.h
new file mode 100644 (file)
index 0000000..6e0d094
--- /dev/null
@@ -0,0 +1,56 @@
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+#ifndef __bbvtkMaskPoint_h_INCLUDED__
+#define __bbvtkMaskPoint_h_INCLUDED__
+#include "bbvtk_EXPORT.h"
+#include "bbtkAtomicBlackBox.h"
+#include "iostream"
+
+#include "vtkImageData.h"
+#include "vtkMaskPoints.h"
+#include "vtkPolyData.h"
+
+
+namespace bbvtk
+{
+
+class bbvtk_EXPORT MaskPoint
+ : 
+   public bbtk::AtomicBlackBox
+{
+  BBTK_BLACK_BOX_INTERFACE(MaskPoint,bbtk::AtomicBlackBox);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+  BBTK_DECLARE_INPUT(In,vtkImageData*);
+  BBTK_DECLARE_INPUT(Ratio,int);
+  BBTK_DECLARE_OUTPUT(Out,vtkPolyData*);
+  BBTK_PROCESS(Process);
+  void Process();
+
+  private:
+   vtkMaskPoints *maskpoints;
+
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+};
+
+BBTK_BEGIN_DESCRIBE_BLACK_BOX(MaskPoint,bbtk::AtomicBlackBox);
+BBTK_NAME("MaskPoint");
+BBTK_AUTHOR("ED at InfoDev Creatis");
+BBTK_DESCRIPTION("vtkMaskPoint");
+BBTK_CATEGORY("empty");
+  BBTK_INPUT(MaskPoint,In,"vtkImageData",vtkImageData*,"");
+  BBTK_INPUT(MaskPoint,Ratio,"Ratio",int,"");
+  BBTK_OUTPUT(MaskPoint,Out,"vtkPolyData",vtkPolyData*,"");
+BBTK_END_DESCRIBE_BLACK_BOX(MaskPoint);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+}
+// EO namespace bbvtk
+
+#endif // __bbvtkMaskPoint_h_INCLUDED__
+
index 1b2a64551cf1b2b1c8fa7aec5b2563eb1aa7256c..8cd7e4a037fa69d2f033cbd95514bfd8bd65f659 100644 (file)
@@ -13,32 +13,33 @@ BBTK_BLACK_BOX_IMPLEMENTATION(MeasureLength,bbtk::AtomicBlackBox);
 //===== 
 void MeasureLength::Process()
 {
-       //std::cout << "RaC MeasureLength::Process START"<< std::endl;
-
        _points = bbGetInputPoints();
-       _image = bbGetInputImageData();
-
-       double sumLength =0;
+       _image  = bbGetInputImageData();
+       double sumLength                = 0 ;
+       double sumLengthVoxels  = 0 ;
        if(_image != NULL && _points->GetNumberOfPoints()>1)
        {
 
                double spc[3];
                double origin[3];
 
+               double XFactor;
+               double YFactor;
+               double ZFactor;
+
                _image->GetSpacing(spc);
                _image->GetOrigin(origin);
 
                double* first;
-               first = _points->GetPoint(0);
-
                double firstWorld[3];
+               int i;
+
+//--Length
+               first = _points->GetPoint(0);
                firstWorld[0] = first[0]*spc[0] + origin[0];
                firstWorld[1] = first[1]*spc[1] + origin[1];
                firstWorld[2] = first[2]*spc[2] + origin[2];
-
-
-
-               for(int i = 1; i<_points->GetNumberOfPoints();i++)
+               for(i = 1; i<_points->GetNumberOfPoints();i++)
                {
                        double* second;
                        second = _points->GetPoint(i);
@@ -47,21 +48,43 @@ void MeasureLength::Process()
                        secondWorld[1] = second[1]*spc[1] + origin[1];
                        secondWorld[2] = second[2]*spc[2] + origin[2];
 
-                       double XFactor = secondWorld[0]-firstWorld[0];
-                       double YFactor = secondWorld[1]-firstWorld[1];
-                       double ZFactor = secondWorld[2]-firstWorld[2];
+                       XFactor = secondWorld[0]-firstWorld[0];
+                       YFactor = secondWorld[1]-firstWorld[1];
+                       ZFactor = secondWorld[2]-firstWorld[2];
                        sumLength += XFactor*XFactor + YFactor*YFactor + ZFactor*ZFactor;
 
                        firstWorld[0] = secondWorld[0];
                        firstWorld[1] = secondWorld[1];
                        firstWorld[2] = secondWorld[2];
+               } // for
 
-               }
-       }
+//--Length Voxels
+               first = _points->GetPoint(0);
+               firstWorld[0] = first[0];
+               firstWorld[1] = first[1];
+               firstWorld[2] = first[2];
+               for(i = 1; i<_points->GetNumberOfPoints();i++)
+               {
+                       double* second;
+                       second = _points->GetPoint(i);
+                       double secondWorld[3];
+                       secondWorld[0] = second[0];
+                       secondWorld[1] = second[1];
+                       secondWorld[2] = second[2];
 
-       bbSetOutputLength(sumLength);
+                       XFactor = secondWorld[0]-firstWorld[0];
+                       YFactor = secondWorld[1]-firstWorld[1];
+                       ZFactor = secondWorld[2]-firstWorld[2];
+                       sumLengthVoxels += XFactor*XFactor + YFactor*YFactor + ZFactor*ZFactor;
+
+                       firstWorld[0] = secondWorld[0];
+                       firstWorld[1] = secondWorld[1];
+                       firstWorld[2] = secondWorld[2];
+               } // for
 
-       //std::cout << "RaC MeasureLength::Process END"<< std::endl;
+       } // if
+       bbSetOutputLength( sqrt(sumLength) );
+       bbSetOutputLengthVoxels( sqrt(sumLengthVoxels) );
 }
 //===== 
 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
index d7110e96693ed06f85877ae7f23b16427a69aa17..4c42f852815a853ce9c039e650176a537c3e7287 100644 (file)
@@ -28,6 +28,7 @@ class bbvtk_EXPORT MeasureLength
   BBTK_DECLARE_INPUT(Points,vtkPoints*);
   BBTK_DECLARE_INPUT(ImageData,vtkImageData*);
   BBTK_DECLARE_OUTPUT(Length,double);
+  BBTK_DECLARE_OUTPUT(LengthVoxels,double);
   BBTK_PROCESS(Process);
   void Process();
 private:
@@ -46,6 +47,7 @@ BBTK_CATEGORY("");
 BBTK_INPUT(MeasureLength,Points,"List of points",vtkPoints*,"");
 BBTK_INPUT(MeasureLength,ImageData,"Set an image if you want real lentgh (usually in mm)",vtkImageData*,"");
 BBTK_OUTPUT(MeasureLength,Length,"Sum of the Euclidean distances among the points",double,"");
+BBTK_OUTPUT(MeasureLength,LengthVoxels,"Sum of the Euclidean distances among the points (Voxels)",double,"");
 BBTK_END_DESCRIBE_BLACK_BOX(MeasureLength);
 //===== 
 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
diff --git a/packages/vtk/src/bbvtkMetaImageReader.cxx b/packages/vtk/src/bbvtkMetaImageReader.cxx
new file mode 100644 (file)
index 0000000..f092643
--- /dev/null
@@ -0,0 +1,86 @@
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+#include "bbvtkMetaImageReader.h"
+#include "bbvtkPackage.h"
+
+#include "vtkMetaImageReader.h"
+
+namespace bbvtk
+{
+
+BBTK_ADD_BLACK_BOX_TO_PACKAGE(vtk,MetaImageReader)
+BBTK_BLACK_BOX_IMPLEMENTATION(MetaImageReader,bbtk::AtomicBlackBox);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void MetaImageReader::Process()
+{
+
+// THE MAIN PROCESSING METHOD BODY
+//   Here we simply set the input 'In' value to the output 'Out'
+//   And print out the output value
+// INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
+//    void bbSet{Input|Output}NAME(const TYPE&)
+//    const TYPE& bbGet{Input|Output}NAME() const 
+//    Where :
+//    * NAME is the name of the input/output
+//      (the one provided in the attribute 'name' of the tag 'input')
+//    * TYPE is the C++ type of the input/output
+//      (the one provided in the attribute 'type' of the tag 'input')
+
+//    bbSetOutputOut( bbGetInputIn() );
+//    std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
+
+       FILE *ff=fopen(bbGetInputIn().c_str(),"r");
+       if (ff)
+       {
+               fclose(ff);
+               vtkMetaImageReader *reader = vtkMetaImageReader::New();
+               reader->SetFileName(bbGetInputIn().c_str());
+               reader->Update();
+               bbSetOutputOut(reader->GetOutput());
+       } else {
+                       bbSetOutputOut(NULL);
+       }
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void MetaImageReader::bbUserSetDefaultValues()
+{
+
+//  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
+//    Here we initialize the input 'In' to 0
+   bbSetInputIn("");
+  
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void MetaImageReader::bbUserInitializeProcessing()
+{
+
+//  THE INITIALIZATION METHOD BODY :
+//    Here does nothing 
+//    but this is where you should allocate the internal/output pointers 
+//    if any 
+
+  
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void MetaImageReader::bbUserFinalizeProcessing()
+{
+
+//  THE FINALIZATION METHOD BODY :
+//    Here does nothing 
+//    but this is where you should desallocate the internal/output pointers 
+//    if any
+  
+}
+}
+// EO namespace bbvtk
+
+
diff --git a/packages/vtk/src/bbvtkMetaImageReader.h b/packages/vtk/src/bbvtkMetaImageReader.h
new file mode 100644 (file)
index 0000000..25d749d
--- /dev/null
@@ -0,0 +1,50 @@
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+#ifndef __bbvtkMetaImageReader_h_INCLUDED__
+#define __bbvtkMetaImageReader_h_INCLUDED__
+#include "bbvtk_EXPORT.h"
+#include "bbtkAtomicBlackBox.h"
+#include "iostream"
+
+#include "vtkImageData.h"
+
+namespace bbvtk
+{
+
+class bbvtk_EXPORT MetaImageReader
+ : 
+   public bbtk::AtomicBlackBox
+{
+  BBTK_BLACK_BOX_INTERFACE(MetaImageReader,bbtk::AtomicBlackBox);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+  BBTK_DECLARE_INPUT(In,std::string);
+  BBTK_DECLARE_OUTPUT(Out,vtkImageData*);
+  BBTK_PROCESS(Process);
+  void Process();
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+};
+
+BBTK_BEGIN_DESCRIBE_BLACK_BOX(MetaImageReader,bbtk::AtomicBlackBox);
+  BBTK_NAME("MetaImageReader");
+  BBTK_AUTHOR("Info-Dev");
+  BBTK_DESCRIPTION("No Description.");
+  BBTK_CATEGORY("empty");
+
+  BBTK_INPUT(MetaImageReader,In,"File Name",std::string,"");
+
+  BBTK_OUTPUT(MetaImageReader,Out,"out image",vtkImageData*,"");
+
+BBTK_END_DESCRIBE_BLACK_BOX(MetaImageReader);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+}
+// EO namespace bbvtk
+
+#endif // __bbvtkMetaImageReader_h_INCLUDED__
+
diff --git a/packages/vtk/src/bbvtkMetaImageReader.xml b/packages/vtk/src/bbvtkMetaImageReader.xml
deleted file mode 100644 (file)
index 4575665..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-
-<blackbox name="MetaImageReader" type="VTK_ImageAlgorithm">
-
-<author>laurent.guigues at creatis.insa-lyon.fr</author>
-<description><PRE>Reads .mhd / .mhd image formats (bbfication of vtkMetaImageReader)</PRE></description>
-<category>image;read/write</category>
-
-<include>vtkMetaImageReader.h</include> 
-<include>vtkImageData.h</include> 
-<vtkobject>vtkMetaImageReader</vtkobject>
-
-<input  name="In"  type="std::string"   nature="file name"   description="Name of the file to read"/>  
-<output name="Out" type="vtkImageData*" special="vtk output" description="Output image" />
- <process><PRE>
-   bbGetVtkObject()->SetFileName(bbGetInputIn().c_str());
-   bbGetVtkObject()->Update();
- </PRE></process>
-
-</blackbox>  
-
index 24789f33dc5aab7077885b3d0bf3f34871236516..0a09e3c92715a20f4a470c6441cc713a7ef1fa8c 100644 (file)
@@ -12,6 +12,7 @@
 
 <input name="Filename"  type="std::string"   nature="file name"   description="Name of the file to write"/>  
 <input name="In" type="vtkImageData*" description="Input image" />
+<input name="Compression" type="bool" description="default(false)   true/false" />
  
  <process><PRE>
    vtkMetaImageWriter* w = vtkMetaImageWriter::New();
 */
 
 
-   w->SetInput(bbGetInputIn());
-   w->SetCompression(false);  // JPR
-   w->SetFileDimensionality(bbGetInputIn()->GetDataDimension()); // NTU
-   std::string userGivenName = bbGetInputFilename();
-   if (userGivenName.substr(userGivenName.size()-4) != ".mhd") //JPR
-      userGivenName += ".mhd";
-    w->SetFileName(userGivenName.c_str());  
-   //w->SetFileName(bbGetInputFilename().c_str());  // JPR
-   w->Update(); // Fred  
-   w->Write();
+  if (bbGetInputIn()!=NULL)
+  {
+     w->SetInput(bbGetInputIn());
+     w->SetCompression(bbGetInputCompression());  
+     w->SetFileDimensionality(bbGetInputIn()->GetDataDimension()); // NTU
+     std::string userGivenName = bbGetInputFilename();
+     if (userGivenName.substr(userGivenName.size()-4) != ".mhd")  //JPR
+     { 
+        userGivenName += ".mhd";
+     }
+     w->SetFileName(userGivenName.c_str());  
+     //w->SetFileName(bbGetInputFilename().c_str());  // JPR
+//EEDJuly22-2014     w->Update(); // Fred  
+     w->Write();
+   } // bbGetInputIn()!=NULL
+
    w->Delete();
  </PRE></process>
+
+ <defaultValues>
+  <PRE>
+    bbSetInputCompression(false);
+  </PRE>
+  </defaultValues>
+
+
 </blackbox>  
  
 
index 0a825a2ecfbb565c54b2bdb8435a57ab04744884..154d8fe511df470530c4afe0e552d6e4e944eae2 100644 (file)
@@ -13,38 +13,34 @@ BBTK_BLACK_BOX_IMPLEMENTATION(PointsXYZtoVTKPoints,bbtk::AtomicBlackBox);
 //===== 
 void PointsXYZtoVTKPoints::Process()
 {
-
-       //std::cout << "RaC PointsXYZtoVTKPoints::Process START"<< std::endl;
        std::vector<int> lstPointsX = bbGetInputLstPointsX();
        std::vector<int> lstPointsY = bbGetInputLstPointsY();
        std::vector<int> lstPointsZ = bbGetInputLstPointsZ();
-
        if(_points==NULL)
+       {
                _points=vtkPoints::New();
-       else
+       } else {
                _points->Reset();//CLEAR
-
+       }
+       double point[3];
+       point[0]=0;
+       point[1]=0;
+       point[2]=0;
        for (int i =0; i < lstPointsX.size(); ++i)
        {
-               double point[3];
                point[0]=lstPointsX[i];
-               point[1]=lstPointsY[i];
-               point[2]=lstPointsZ[i];
+               if (lstPointsY.size()>i) { point[1]=lstPointsY[i]; }
+               if (lstPointsZ.size()>i) { point[2]=lstPointsZ[i]; }
                _points->InsertPoint(i,point);
        }
        bbSetOutputPoints(_points);
-
-       //std::cout << "RaC PointsXYZtoVTKPoints::Process END"<< std::endl;
-  
 }
 //===== 
 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
 //===== 
 void PointsXYZtoVTKPoints::bbUserSetDefaultValues()
 {
-
-
-  
+  _points=NULL;
 }
 //===== 
 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
index cfcc86c87d45a7aa6c3de3b6b491ed6eaf263441..d5241d90266a514c8e5192472953514e70acb1b6 100644 (file)
  
  <process><PRE>
    bbGetVtkObject()->SetFileName(bbGetInputIn().c_str());
+   bbGetVtkObject()->ReadAllScalarsOn();
+   bbGetVtkObject()->ReadAllVectorsOn();
+   bbGetVtkObject()->ReadAllNormalsOn();
+   bbGetVtkObject()->ReadAllTensorsOn();
+   bbGetVtkObject()->ReadAllColorScalarsOn ();
+   bbGetVtkObject()->ReadAllTCoordsOn();
+   bbGetVtkObject()->ReadAllFieldsOn();
    bbGetVtkObject()->Update();
  </PRE></process>
 
index 21aef0d8226b25781bb0908a1d70bbb5ba2e719b..58852e83ed9df71d7b01f60835d83c4e7aff505b 100644 (file)
@@ -54,19 +54,21 @@ namespace bbvtk
 
    void PolyDataToActor::bbUserSetDefaultValues() 
    { 
-          firsttime=true;
+          actorAdded=false;
           std::vector<double> colour;
           colour.push_back(1.0);
           colour.push_back(1.0);
           colour.push_back(0.5);
           bbSetInputColour(colour);
 
+          bbSetInputActive(true);
           bbSetInputIn(NULL);
           bbSetInputRenderer(NULL);
           bbSetInputTransform(NULL);
           bbSetInputOpacity(1);
           bbSetInputRepresentation(2);
           bbSetInputLineWidth(1);
+          bbSetInputScalarVisibility(false);
 
           polydatamapper = NULL;
           vtkactor       = NULL;
@@ -82,7 +84,6 @@ namespace bbvtk
 //     polydatamapper->SetInput(marchingcubes->GetOutput());
      vtkactor->SetMapper(polydatamapper);
 
-     polydatamapper->ScalarVisibilityOff();
      polydatamapper->ImmediateModeRenderingOn();
    }
 
@@ -104,33 +105,53 @@ namespace bbvtk
        
 //---------------------------------------------------------------------
 
-   void PolyDataToActor::DoProcess()
-   {      
-     polydatamapper->SetInput( bbGetInputIn() );
-     
-        vtkactor->GetProperty()->SetRepresentation( bbGetInputRepresentation() );
-        vtkactor->GetProperty()->SetLineWidth( bbGetInputLineWidth() );
-          
-     vtkactor->GetProperty()->SetColor( bbGetInputColour()[0],  
-                                       bbGetInputColour()[1], 
-                                       bbGetInputColour()[2] );
-          
-     vtkactor->GetProperty()->SetOpacity( bbGetInputOpacity() );
-     
-     if ( bbGetInputTransform()!=NULL )
-     {
-        vtkactor->SetUserTransform( bbGetInputTransform() );
-     }
-
-     bbSetOutputOut( vtkactor );
-
-     // Interface Update
-     if ((firsttime==true) && (bbGetInputRenderer()!=NULL ))
-     {
-       firsttime=false;
-       bbGetInputRenderer()->AddActor( vtkactor );
-     } 
-   }
+       void PolyDataToActor::DoProcess()
+       {
+
+               if (bbGetInputActive()==true)
+               {
+                        polydatamapper->SetInput( bbGetInputIn() );
+                        vtkactor->GetProperty()->SetRepresentation( bbGetInputRepresentation() );
+                        vtkactor->GetProperty()->SetLineWidth( bbGetInputLineWidth() );
+                          
+                        vtkactor->GetProperty()->SetColor( bbGetInputColour()[0],  
+                                                       bbGetInputColour()[1], 
+                                                       bbGetInputColour()[2] );
+                                 
+                        vtkactor->GetProperty()->SetOpacity( bbGetInputOpacity() );
+                        
+                        if ( bbGetInputTransform()!=NULL )
+                        {
+                               vtkactor->SetUserTransform( bbGetInputTransform() );
+                        }
+
+                        bbSetOutputOut( vtkactor );
+
+                        // Interface Update
+                        if ((actorAdded==false) && (bbGetInputRenderer()!=NULL ))
+                        {
+                          actorAdded=true;
+                          bbGetInputRenderer()->AddActor( vtkactor );
+                        }  // actorAdded
+
+                        if (bbGetInputScalarVisibility()==true )
+                        {
+                                polydatamapper->ScalarVisibilityOn();
+                        } else {
+                                polydatamapper->ScalarVisibilityOff();
+                        } // ScalarVisibility
+               } else {
+                        // Interface Update
+                        if ((actorAdded==true) && (bbGetInputRenderer()!=NULL ))
+                        {
+                          actorAdded=false;
+                          bbGetInputRenderer()->RemoveActor( vtkactor );
+                        }  // actorAdded
+               } // Active
+       }
+
+
+
 } // EO namespace bbtk
 
 #endif //_USE_VTK_
index 035dc643e1016693ec570e7661aee4c3ca5d98d6..9dd2790b872f7dc6482bc71b99900e635aac147c 100644 (file)
@@ -72,20 +72,22 @@ namespace bbvtk
     : 
     public bbtk::AtomicBlackBox
   {
-    bool              firsttime;
+    bool              actorAdded;
     vtkPolyDataMapper *polydatamapper;
     vtkActor          *vtkactor; 
     
     
     BBTK_BLACK_BOX_INTERFACE(PolyDataToActor,bbtk::AtomicBlackBox);
     
+    BBTK_DECLARE_INPUT(Active,bool);
     BBTK_DECLARE_INPUT(In,vtkPolyData *);
     BBTK_DECLARE_INPUT(Opacity,double);
     BBTK_DECLARE_INPUT(Colour,std::vector<double>);
     BBTK_DECLARE_INPUT(Renderer,vtkRenderer *);
     BBTK_DECLARE_INPUT(Transform, vtkLinearTransform *);
-       BBTK_DECLARE_INPUT(Representation, int);
-       BBTK_DECLARE_INPUT(LineWidth, double);
+    BBTK_DECLARE_INPUT(Representation, int);
+    BBTK_DECLARE_INPUT(LineWidth, double);
+    BBTK_DECLARE_INPUT(ScalarVisibility, bool);
     BBTK_DECLARE_OUTPUT(Out,vtkProp3D *);
     
     BBTK_PROCESS(DoProcess);
@@ -102,12 +104,14 @@ namespace bbvtk
   BBTK_CATEGORY("3D object creator");
   BBTK_INPUT(PolyDataToActor,In,"Input image",vtkPolyData*,"");
 
+  BBTK_INPUT(PolyDataToActor,Active,"Active true/false (default true)",bool,"");
   BBTK_INPUT(PolyDataToActor,Opacity,"Opacity",double,"");
   BBTK_INPUT(PolyDataToActor,Colour,"r g b",vectorcolour,"colour");
   BBTK_INPUT(PolyDataToActor,Renderer,"3D scene in which to insert the surface",vtkRenderer*,"");
   BBTK_INPUT(PolyDataToActor,Transform,"Linear Transform (4x4 homogeneous)",vtkLinearTransform*,"");
   BBTK_INPUT(PolyDataToActor,Representation,"0 points,1 wireframe, 2(default) surface",int,"");
   BBTK_INPUT(PolyDataToActor,LineWidth,"Width of the wireframe (1 default)",double,"");
+  BBTK_INPUT(PolyDataToActor,ScalarVisibility,"Scalar Visibility (false default)",bool,"");
   BBTK_OUTPUT(PolyDataToActor,Out,"Extracted iso-surface",vtkProp3D *,"");
   
   BBTK_END_DESCRIBE_BLACK_BOX(PolyDataToActor);
index 71e0a5d686a118276c6723aa24ba4a2ccd2472c5..a2a583cd97cf7236334917fd7d5105d26d209792 100644 (file)
 
 <input  name="Filename"  type="std::string"   nature="file name"   description="Name of the file to write"/>  
 <input name="In" type="vtkPolyData*" description="Input mesh" />
+<input name="FileType" type="int" description="0=Ascii (default), 1=Binary" />
  
  <process><PRE>
+
+     printf("EED PolyDataWriter::Process() %s\n", bbGetInputFilename().c_str());
+
    vtkPolyDataWriter* w = vtkPolyDataWriter::New();
+   if (bbGetInputFileType()==0) 
+       {
+               w->SetFileTypeToASCII();
+       } else {
+               w->SetFileTypeToBinary();
+       }
    bbGetInputIn()->Update();
    w->SetInput(bbGetInputIn());
    w->SetFileName(bbGetInputFilename().c_str());
    w->Write();
    w->Delete();
  </PRE></process>
+
+ <!--========================================================================
+    CONSTRUCTORS / DESTRUCTORS (OPTIONAL)  -->
+  <defaultValues><PRE>
+       bbSetInputFileType(0);
+  </PRE></defaultValues>    
+  
+  <initializeProcessing><PRE>
+  </PRE></initializeProcessing>    
+  
+  <finalizeProcessing><PRE>
+  </PRE></finalizeProcessing>    
+  <!--=====================================================================-->
+
+
 </blackbox>  
  
 
index 5181d61aa705ca6895498b606af0bf4d36f76cff..bca2a1cd037694130ae608e99478bf6a796f67ce 100755 (executable)
@@ -120,7 +120,6 @@ void PolyDataWriterPlus::Process()
                writer->Delete();
        }
 
-
        std::cout << "Saving Ok!" << std::endl;
 
        InvokeEvent(OBS_POST_WRITER_1);
diff --git a/packages/vtk/src/bbvtkPolyDataWriterPlus.cxx~ b/packages/vtk/src/bbvtkPolyDataWriterPlus.cxx~
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/packages/vtk/src/bbvtkPolyDataWriterPlus.h~ b/packages/vtk/src/bbvtkPolyDataWriterPlus.h~
deleted file mode 100644 (file)
index 26466bf..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
-# ---------------------------------------------------------------------
-#
-# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
-#                        pour la SantÈ)
-# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
-# Previous Authors : Laurent Guigues, Jean-Pierre Roux
-# CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
-#
-#  This software is governed by the CeCILL-B license under French law and
-#  abiding by the rules of distribution of free software. You can  use,
-#  modify and/ or redistribute the software under the terms of the CeCILL-B
-#  license as circulated by CEA, CNRS and INRIA at the following URL
-#  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
-#  or in the file LICENSE.txt.
-#
-#  As a counterpart to the access to the source code and  rights to copy,
-#  modify and redistribute granted by the license, users are provided only
-#  with a limited warranty  and the software's author,  the holder of the
-#  economic rights,  and the successive licensors  have only  limited
-#  liability.
-#
-#  The fact that you are presently reading this means that you have had
-#  knowledge of the CeCILL-B license and that you accept its terms.
-# ------------------------------------------------------------------------ */
-
-
-#ifndef __bbPersistenceVTKReader_h_INCLUDED__
-#define __bbPersistenceVTKReader_h_INCLUDED__
-#include "bbPersistence_EXPORT.h"
-#include "bbtkAtomicBlackBox.h"
-#include "iostream"
-
-#include <vtkGenericDataObjectReader.h>
-#include <vtkUnstructuredGridReader.h>
-#include <vtkXMLPolyDataReader.h>
-#include <vtkProperty.h>
-#include <vtkObject.h>
-#include <vtkCommand.h>
-#include <vtkPolyData.h>
-#include <vtkPolyDataMapper.h>
-#include <vtkPolyDataReader.h>
-#include <vtkActor.h>
-#include <vtkProp3D.h>
-#include "names.h"
-
-namespace bbPersistence
-{
-
-#define OBS_POST_READER_1 1401
-
-class bbPersistence_EXPORT VTKReader
- : 
-   public bbtk::AtomicBlackBox,
-   public vtkObject
-{
-  BBTK_BLACK_BOX_INTERFACE(VTKReader,bbtk::AtomicBlackBox);
-  BBTK_DECLARE_INPUT(InPath, std::string);
-  BBTK_DECLARE_INPUT(InOpacity, double);
-  BBTK_DECLARE_INPUT(InColor, std::vector<double>);
-  BBTK_DECLARE_INPUT(InPostReadObs1, vtkCommand*);
-  BBTK_DECLARE_OUTPUT(Out,vtkPolyData*);
-  BBTK_DECLARE_OUTPUT(OutActor,vtkProp3D*);
-  BBTK_PROCESS(Process);
-  void Process();
-
-  vtkPolyData* informacion;
-
-  bool readed;
-};
-
-BBTK_BEGIN_DESCRIBE_BLACK_BOX(VTKReader,bbtk::AtomicBlackBox);
-BBTK_NAME("VTKReader");
-BBTK_AUTHOR("_author_");
-BBTK_DESCRIPTION("_description_");
-BBTK_CATEGORY("__CATEGORY__");
-BBTK_INPUT(VTKReader,InPath,"Path to the file to be readed",std::string,"");
-BBTK_INPUT(VTKReader,InOpacity,"",double,"");
-BBTK_INPUT(VTKReader,InColor,"",std::vector<double>,"");
-BBTK_INPUT(VTKReader,InPostReadObs1,"Who will be notified after persist", vtkCommand*,"");
-BBTK_OUTPUT(VTKReader,Out,"Information readed", vtkPolyData*,"");
-BBTK_OUTPUT(VTKReader,OutActor,"Information as an actor", vtkProp3D*,"");
-BBTK_END_DESCRIBE_BLACK_BOX(VTKReader);
-}
-// EO namespace bbPersistence
-
-#endif // __bbPersistenceVTKReader_h_INCLUDED__
-
-
diff --git a/packages/vtk/src/bbvtkProbeFilter.cxx b/packages/vtk/src/bbvtkProbeFilter.cxx
new file mode 100644 (file)
index 0000000..4007cfb
--- /dev/null
@@ -0,0 +1,84 @@
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+#include "bbvtkProbeFilter.h"
+#include "bbvtkPackage.h"
+namespace bbvtk
+{
+
+BBTK_ADD_BLACK_BOX_TO_PACKAGE(vtk,ProbeFilter)
+BBTK_BLACK_BOX_IMPLEMENTATION(ProbeFilter,bbtk::AtomicBlackBox);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void ProbeFilter::Process()
+{
+
+// THE MAIN PROCESSING METHOD BODY
+//   Here we simply set the input 'In' value to the output 'Out'
+//   And print out the output value
+// INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
+//    void bbSet{Input|Output}NAME(const TYPE&)
+//    const TYPE& bbGet{Input|Output}NAME() const 
+//    Where :
+//    * NAME is the name of the input/output
+//      (the one provided in the attribute 'name' of the tag 'input')
+//    * TYPE is the C++ type of the input/output
+//      (the one provided in the attribute 'type' of the tag 'input')
+
+printf("EED ProbeFilter::Process() Start\n");
+
+
+      _probefilter->SetSource( bbGetInputSource() ); 
+      _probefilter->SetInput( bbGetInputInput() ); 
+      _probefilter->Update();
+      bbSetOutputOut( _probefilter->GetOutput() );
+
+printf("EED ProbeFilter::Process() End\n");
+
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void ProbeFilter::bbUserSetDefaultValues()
+{
+//  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
+//    Here we initialize the input 'In' to 0
+
+//   bbSetInputInput(NULL);
+//   bbSetInputSource(NULL);
+//   bbSetOutputOut(NULL);
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void ProbeFilter::bbUserInitializeProcessing()
+{
+
+//  THE INITIALIZATION METHOD BODY :
+//    Here does nothing 
+//    but this is where you should allocate the internal/output pointers 
+//    if any 
+
+    _probefilter = vtkProbeFilter::New();
+  
+
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void ProbeFilter::bbUserFinalizeProcessing()
+{
+
+//  THE FINALIZATION METHOD BODY :
+//    Here does nothing 
+//    but this is where you should desallocate the internal/output pointers 
+//    if any
+  
+   _probefilter->Delete();
+
+}
+}
+// EO namespace bbvtk
+
+
diff --git a/packages/vtk/src/bbvtkProbeFilter.h b/packages/vtk/src/bbvtkProbeFilter.h
new file mode 100644 (file)
index 0000000..53f1861
--- /dev/null
@@ -0,0 +1,54 @@
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+#ifndef __bbvtkProbeFilter_h_INCLUDED__
+#define __bbvtkProbeFilter_h_INCLUDED__
+#include "bbvtk_EXPORT.h"
+#include "bbtkAtomicBlackBox.h"
+#include "iostream"
+
+#include "vtkDataObject.h"
+#include "vtkDataSet.h"
+#include "vtkProbeFilter.h"
+
+namespace bbvtk
+{
+
+class bbvtk_EXPORT ProbeFilter
+ : 
+   public bbtk::AtomicBlackBox
+{
+  BBTK_BLACK_BOX_INTERFACE(ProbeFilter,bbtk::AtomicBlackBox);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+  BBTK_DECLARE_INPUT(Input,vtkDataObject*);
+  BBTK_DECLARE_INPUT(Source,vtkDataObject*);
+  BBTK_DECLARE_OUTPUT(Out,vtkDataSet*);
+  BBTK_PROCESS(Process);
+  void Process();
+
+  private:
+    vtkProbeFilter *_probefilter;
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+};
+
+BBTK_BEGIN_DESCRIBE_BLACK_BOX(ProbeFilter,bbtk::AtomicBlackBox);
+BBTK_NAME("ProbeFilter");
+BBTK_AUTHOR("ED at InfoDev Creatis");
+BBTK_DESCRIPTION("vtkProbeFilter");
+BBTK_CATEGORY("empty");
+  BBTK_INPUT(ProbeFilter,Input,"Input  (example:vtkPolyData The BBTK_adaptor vtkPolyData to vtkDataObject exists.)",vtkDataObject*,"");
+  BBTK_INPUT(ProbeFilter,Source,"Source (example:vtkPolyData The BBTK_adaptor vtkPolyData to vtkDataObject exists.)",vtkDataObject*,"");
+  BBTK_OUTPUT(ProbeFilter,Out,"First output",vtkDataSet*,"");
+BBTK_END_DESCRIBE_BLACK_BOX(ProbeFilter);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+}
+// EO namespace bbvtk
+
+#endif // __bbvtkProbeFilter_h_INCLUDED__
+
index 639fd2a036b2a7d4ac36d79a9702596a5ed301f9..117b97931a3c68e7634a99f9cb074b2d4e5ceb6b 100644 (file)
@@ -31,6 +31,7 @@
 #include "bbvtkRescaleSlopeIntercept.h"
 #include "bbvtkPackage.h"
 
+#include "bbtkStaticLecture.h"
 
 namespace bbvtk
 {
@@ -65,18 +66,9 @@ void RescaleSlopeIntercept::Process()
        
        if (bbGetInputIn()!=0)
        {
-               if (bbGetInputOutputFormat()=="SAME")                                   outputformat = bbGetInputIn()->GetScalarType();
-               else if (bbGetInputOutputFormat()=="VTK_BIT")                   outputformat = VTK_BIT;
-               else if (bbGetInputOutputFormat()=="VTK_CHAR")                  outputformat = VTK_CHAR;
-               else if (bbGetInputOutputFormat()=="VTK_SIGNED_CHAR")   outputformat = VTK_SIGNED_CHAR;
-               else if (bbGetInputOutputFormat()=="VTK_UNSIGNED_CHAR") outputformat = VTK_UNSIGNED_CHAR;
-               else if (bbGetInputOutputFormat()=="VTK_UNSIGNED_SHORT") outputformat = VTK_UNSIGNED_SHORT;
-               else if (bbGetInputOutputFormat()=="VTK_INT")                   outputformat = VTK_INT;
-               else if (bbGetInputOutputFormat()=="VTK_UNSIGNED_INT")  outputformat = VTK_UNSIGNED_INT;
-               else if (bbGetInputOutputFormat()=="VTK_LONG")                  outputformat = VTK_LONG;
-               else if (bbGetInputOutputFormat()=="VTK_UNSIGNED_LONG") outputformat = VTK_UNSIGNED_LONG;
-               else if (bbGetInputOutputFormat()=="VTK_FLOAT")                 outputformat = VTK_FLOAT;
-               else if (bbGetInputOutputFormat()=="VTK_DOUBLE")                outputformat = VTK_DOUBLE;
+
+
+               int outputformat = bbtkStaticLecture::GetTypeFormat( bbGetInputOutputFormat() , bbGetInputIn() );
                
                
                bbGetInputIn()->GetScalarRange(range);
index 49b151b367d52b3a16228351d2c1787cd1ee6555..10d67b9db4a2146b9d5557a92a80caeeffe91ac0 100644 (file)
@@ -59,8 +59,7 @@ class bbvtk_EXPORT RescaleSlopeIntercept
   BBTK_DECLARE_OUTPUT(Out,vtkImageData*);
   BBTK_PROCESS(Process);
   void Process();
-       
-       int                                                     outputformat;
+
        vtkImageShiftScale                      *filter1;
        vtkImageShiftScale                      *filter2;
        vtkImageChangeInformation       *mchange;
@@ -79,7 +78,7 @@ BBTK_INPUT(RescaleSlopeIntercept,In,"Image input",vtkImageData*,"");
 BBTK_INPUT(RescaleSlopeIntercept,Type,"type of operation: 0 (default) SlopeIntercept np=p*A+B, 1 Invert, 2 Redimension A=newMin B=newMax, 3 InvertRedimension A=newMin B=newMax",int,"");
 BBTK_INPUT(RescaleSlopeIntercept,A,"(1 default) see Type description",double,"");
 BBTK_INPUT(RescaleSlopeIntercept,B,"(0 default) see Type description",double,"");
-BBTK_INPUT(RescaleSlopeIntercept,OutputFormat,"Image output format:  SAME (default), VTK_BIT, VTK_CHAR, VTK_SIGNED_CHAR, VTK_UNSIGNED_CHAR, VTK_SHORT VTK_UNSIGNED_SHORT, VTK_INT, VTK_UNSIGNED_INT, VTK_LONG, VTK_UNSIGNED_LONG, VTK_FLOAT, VTK_DOUBLE",std::string,"");
+BBTK_INPUT(RescaleSlopeIntercept,OutputFormat,"Image output format:  SAME (default), VTK_BIT, VTK_CHAR, VTK_SIGNED_CHAR, VTK_UNSIGNED_CHAR, VTK_SHORT, VTK_UNSIGNED_SHORT, VTK_INT, VTK_UNSIGNED_INT, VTK_LONG, VTK_UNSIGNED_LONG, VTK_FLOAT, VTK_DOUBLE",std::string,"");
 BBTK_OUTPUT(RescaleSlopeIntercept,Out,"Image output",vtkImageData*,"");
 BBTK_END_DESCRIBE_BLACK_BOX(RescaleSlopeIntercept);
 //===== 
index 6ec480d58c641086a2ad5a9f1c0ecfe2cc9f8c8a..3b28389b314c7ba907561d6707610220205a9f43 100644 (file)
@@ -43,6 +43,8 @@
 #include "bbvtkSegmentationConnectivity.h"
 #include "bbvtkPackage.h"
 
+#include "bbtkStaticLecture.h"
+
 namespace bbvtk
 {
   BBTK_ADD_BLACK_BOX_TO_PACKAGE(vtk,SegmentationConnectivity);
@@ -54,7 +56,7 @@ namespace bbvtk
   void SegmentationConnectivity::bbUserSetDefaultValues() 
   { 
          thresh2       = NULL;
-         cast2         = NULL;
+//       cast2         = NULL;
          connect2      = NULL;
          cast4         = NULL;
                
@@ -69,12 +71,32 @@ namespace bbvtk
          threshold.push_back(0);
          bbSetInputThresholdMinMax(threshold);
          bbSetOutputOut(NULL);
+
+         bbSetInputOutputFormat("SAME");
+         bbSetInputValue(255);
+
+
   }
 
 // --------------------------------------------------------------
                
        void SegmentationConnectivity::bbUserInitializeProcessing()
        {
+
+               thresh2 = vtkImageThreshold::New();
+                       thresh2->SetInValue(255);
+                       thresh2->SetOutputScalarTypeToUnsignedChar();
+               connect2 = vtkImageSeedConnectivity::New();
+                       connect2->SetInput(thresh2->GetOutput());
+                       connect2->SetInputConnectValue(255);
+                       connect2->SetOutputConnectedValue( 255 );
+                       connect2->SetOutputUnconnectedValue(0);
+               cast4 = vtkImageCast::New();
+                       cast4->SetInput(connect2->GetOutput());
+
+// EED 2016 06 15
+
+/*
                thresh2 = vtkImageThreshold::New();
                        thresh2->SetInValue(255);
                        thresh2->SetOutputScalarTypeToUnsignedShort();
@@ -90,6 +112,8 @@ namespace bbvtk
                cast4 = vtkImageCast::New();
                        cast4->SetInput(connect2->GetOutput());
                        cast4->SetOutputScalarTypeToUnsignedShort();
+*/
+
        }
 
 // --------------------------------------------------------------
@@ -101,11 +125,11 @@ namespace bbvtk
                  thresh2->Delete();
                  thresh2=NULL;
          }
-         if (cast2!=NULL)
-         {
-                 cast2->Delete();
-                 cast2=NULL;
-         }
+//       if (cast2!=NULL)
+//       {
+//               cast2->Delete();
+//               cast2=NULL;
+//       }
          if (connect2!=NULL)
          {
                  connect2->Delete();
@@ -118,43 +142,63 @@ namespace bbvtk
          }  
   }
 
+
+
+
 // --------------------------------------------------------------
                
   void SegmentationConnectivity::DoProcess()
   {
-    vtkImageData *imagedata = bbGetInputIn();
-    imagedata->UpdateInformation();
-    imagedata->SetUpdateExtent(imagedata->GetWholeExtent());
-    imagedata->Update();
-    thresh2->ThresholdBetween(3000, 3001);
-    thresh2->SetInput(imagedata);
-    thresh2->ThresholdBetween(bbGetInputThresholdMinMax()[0], bbGetInputThresholdMinMax()[1]);
-    thresh2->Update();
-    cast2->Update();
-    connect2->RemoveAllSeeds ();
-         
-       int x = bbGetInputPositionXYZ()[0];
-       int y = bbGetInputPositionXYZ()[1];
-       int z = bbGetInputPositionXYZ()[2];
-
-         int ext[6];
-         imagedata->GetWholeExtent(ext);
-         int maxx = ext[1]-ext[0]+1;
-         int maxy = ext[3]-ext[2]+1;
-         int maxz = ext[5]-ext[4]+1;
-         if ( x<0 ) {  printf("Warnnig bbtk::vtk::SegmentationConnectivity::DoProcess limites of the image out of range x: %d -> 0 \n",x ); x=0; }
-         if ( y<0 ) {  printf("Warnnig bbtk::vtk::SegmentationConnectivity::DoProcess limites of the image out of range y: %d -> 0 \n",y ); y=0;}
-         if ( z<0 ) {  printf("Warnnig bbtk::vtk::SegmentationConnectivity::DoProcess limites of the image out of range z: %d -> 0 \n",z ); z=0;}
-
-         if ( x>=maxx ) {  printf("Warnnig bbtk::vtk::SegmentationConnectivity::DoProcess limites of the image out of range x: %d -> %d \n",x, maxx-1 ); x=maxx-1; }
-         if ( y>=maxy ) {  printf("Warnnig bbtk::vtk::SegmentationConnectivity::DoProcess limites of the image out of range y: %d -> %d \n",y, maxy-1 ); y=maxy-1; }
-         if ( z>=maxz ) {  printf("Warnnig bbtk::vtk::SegmentationConnectivity::DoProcess limites of the image out of range z: %d -> %d \n",y, maxz-1 ); z=maxz-1; }
          
-         connect2->AddSeed( x,y,z );
-         connect2->Update();
-         cast4->Update();                      
-         bbSetOutputOut(cast4->GetOutput() );
-  }
+       int x,y,z;
+       int i,numPoints = bbGetInputPositionXYZ().size()/3;
+       int verif = (bbGetInputPositionXYZ().size()-1) % 3;
+       if (( numPoints>=1) && (verif==2) && (bbGetInputIn()!=NULL)) 
+       {
+               int outputformat = bbtkStaticLecture::GetTypeFormat( bbGetInputOutputFormat() , bbGetInputIn() );
+               vtkImageData *imagedata = bbGetInputIn();
+               imagedata->UpdateInformation();
+               imagedata->SetUpdateExtent(imagedata->GetWholeExtent());
+               imagedata->Update();
+               thresh2->ThresholdBetween(3000, 3001);
+               thresh2->SetInput(imagedata);
+               thresh2->ThresholdBetween(bbGetInputThresholdMinMax()[0], bbGetInputThresholdMinMax()[1]);
+               thresh2->Modified();
+               thresh2->Update();
+               connect2->RemoveAllSeeds ();
+
+               int ext[6];
+               imagedata->GetWholeExtent(ext);
+               int maxX = ext[1]-ext[0]+1;
+               int maxY = ext[3]-ext[2]+1;
+               int maxZ = ext[5]-ext[4]+1;
+
+               for (i=0;i<numPoints;i++)
+               {
+                       x=bbGetInputPositionXYZ()[i*3+0];
+                       y=bbGetInputPositionXYZ()[i*3+1];
+                       z=bbGetInputPositionXYZ()[i*3+2];
+                       if ( (x>=0) || (x<maxX) || (y>=0) || (y<maxY) || (z>=0) || (z<maxZ) )
+                       {
+                               connect2->AddSeed( x,y,z );
+                       } else {
+                               printf("EED WARNNIG! In box: SegmentationConnectivity point out of range \n");
+                       } // if point inside image 
+
+               } // for i
+               connect2->SetOutputConnectedValue( bbGetInputValue() );
+               cast4->SetOutputScalarType( outputformat );
+               connect2->Modified();
+               connect2->Update();
+               cast4->Update();                        
+               bbSetOutputOut(cast4->GetOutput() );
+       }  else {
+               printf("EED WARNNIG! In box: SegmentationConnectivity List of points are not coherent. \n");
+               bbSetOutputOut( NULL );
+       }// if numPoints verif
+
+}
+
   
 }// EO namespace bbvtk
 
index 57399afe3c7a10becf7f968581ee3570e8944aee..bd4b4797159bd120fff6c07d245871da6d904cc5 100644 (file)
@@ -71,6 +71,8 @@ namespace bbvtk
     BBTK_DECLARE_INPUT(In,vtkImageData *);
     BBTK_DECLARE_INPUT(PositionXYZ,std::vector<int>);
     BBTK_DECLARE_INPUT(ThresholdMinMax,std::vector<int>);
+    BBTK_DECLARE_INPUT(Value,unsigned char);
+    BBTK_DECLARE_INPUT( OutputFormat , std::string );
     BBTK_DECLARE_OUTPUT(Out,vtkImageData *);
     BBTK_PROCESS(DoProcess);
     void DoProcess();
@@ -78,7 +80,7 @@ namespace bbvtk
   protected:
 
   private:
-       vtkImageCast             *cast2;
+//     vtkImageCast             *cast2;
        vtkImageCast             *cast4; // binary segmentation result
        vtkImageThreshold        *thresh2;
        vtkImageSeedConnectivity *connect2;
@@ -86,14 +88,19 @@ namespace bbvtk
   };
 
   BBTK_BEGIN_DESCRIBE_BLACK_BOX(SegmentationConnectivity,bbtk::AtomicBlackBox);
-  BBTK_NAME("SegmentationConnectivity");
-  BBTK_AUTHOR("eduardo.davila [at] creatis.insa-lyon.fr");
-  BBTK_DESCRIPTION("Segmentation with min max threshold and connectivity");
-  BBTK_INPUT(SegmentationConnectivity,In,"Input image",vtkImageData *,"");
-  BBTK_INPUT(SegmentationConnectivity,PositionXYZ,"vector with the Position [x y z]" , std::vector<int>,"");
-  BBTK_INPUT(SegmentationConnectivity,ThresholdMinMax,"vector with the Threshold [min max]" , std::vector<int>,"");
-  BBTK_OUTPUT(SegmentationConnectivity,Out,"Result image",vtkImageData *,"");
-  BBTK_END_DESCRIBE_BLACK_BOX(SegmentationConnectivity);
+    BBTK_NAME("SegmentationConnectivity");
+    BBTK_AUTHOR("eduardo.davila [at] creatis.insa-lyon.fr");
+    BBTK_DESCRIPTION("Segmentation with min max threshold and connectivity");
+
+    BBTK_INPUT(SegmentationConnectivity,In,"Input image",vtkImageData *,"");
+    BBTK_INPUT(SegmentationConnectivity,PositionXYZ,"vector with the Position [x y z]" , std::vector<int>,"");
+    BBTK_INPUT(SegmentationConnectivity,ThresholdMinMax,"vector with the Threshold [min max]" , std::vector<int>,"");
+    BBTK_INPUT(SegmentationConnectivity,Value,"(255 default) [0..255] Gey level of output image" , unsigned char,"");
+    BBTK_INPUT(SegmentationConnectivity,OutputFormat,"Image output format:  SAME (default), VTK_BIT, VTK_CHAR, VTK_SIGNED_CHAR, VTK_UNSIGNED_CHAR, VTK_SHORT, VTK_UNSIGNED_SHORT, VTK_INT, VTK_UNSIGNED_INT, VTK_LONG, VTK_UNSIGNED_LONG, VTK_FLOAT, VTK_DOUBLE",std::string,"");
+
+    BBTK_OUTPUT(SegmentationConnectivity,Out,"Result image",vtkImageData *,"");
+ BBTK_END_DESCRIBE_BLACK_BOX(SegmentationConnectivity);
 
 } // EO namespace bbvtk
 
index 50889bd9dc746a47fba9e79a37a34de6f5f8c0c8..616f088d4b5093246a909ec71b00e15bcad69b65 100644 (file)
@@ -38,130 +38,151 @@ namespace bbvtk
 BBTK_ADD_BLACK_BOX_TO_PACKAGE(vtk,SphereList)
 BBTK_BLACK_BOX_IMPLEMENTATION(SphereList,bbtk::AtomicBlackBox);
 
-void SphereList::Process()
+double SphereList::GetRadio(int i)
 {
+    double radio;
+       if ( bbGetInputlstRadio().size()==0 )
+        {
+            radio = 1.0;
+        } else if ( i<bbGetInputlstRadio().size() )
+       {
+            radio = bbGetInputlstRadio()[i];
+        } else  
+        {
+            radio = bbGetInputlstRadio()[ bbGetInputlstRadio().size() - 1 ];
+        }  
+
+       return radio;
+}
 
-        int iMin, iMax;
-       double px = 0.0;
-       double py = 0.0;
-       double pz = 0.0;
-       double radio;
-       double spc[3];
-       int last_valid_color_index = 0;
 
+void SphereList::GetPoint(int i, double &px,double &py,double &pz)        
+ {
+      double spc[3];
+      if (bbGetInputSpacing().size()==3)
+      {
+               spc[0]=bbGetInputSpacing()[0];
+               spc[1]=bbGetInputSpacing()[1];
+               spc[2]=bbGetInputSpacing()[2];
+      } else {
+               spc[0]=spc[1]=spc[2]=1;
+       }
+
+       px = bbGetInputlstPointX()[i]*spc[0];
+       if (bbGetInputlstPointY().size() == bbGetInputlstPointX().size() )
+       {
+               py = bbGetInputlstPointY()[i]*spc[1];
+       }
+               if (bbGetInputlstPointZ().size() == bbGetInputlstPointX().size() )
+       {                       
+               pz = bbGetInputlstPointZ()[i]*spc[2];
+       }
+}  
 
+                       
+void SphereList::GetColor(int i, double &cr,double &cg,double &cb)        
+ {
+       unsigned int j = 3*i +2;
+       if (j < bbGetInputColour().size() )
+       {
+               cr=bbGetInputColour()[3*i+0];
+               cg=bbGetInputColour()[3*i+1];
+               cb=bbGetInputColour()[3*i+2];
+               
+       } else {
+               int lastValidColorIndex = (bbGetInputColour().size()-1)/3;
+               lastValidColorIndex     = lastValidColorIndex*3;
+               cr=bbGetInputColour()[ lastValidColorIndex+0 ];
+               cg=bbGetInputColour()[ lastValidColorIndex+1 ];
+               cb=bbGetInputColour()[ lastValidColorIndex+2 ];
+       }
+}  
+
+void SphereList::Process()
+{
        if (bbGetInputRenderer()!=NULL)
        {
-                // If it is not the first time Process is executed, the actors have already been created. The only thing to do is to update the opacity. 
-               if (sphereActor.size() != 0)
-                {
-                  for (int i = 0; i < sphereActor.size(); i++)
-                    sphereActor[i] -> GetProperty() -> SetOpacity( bbGetInputOpacity() );
-               }
-                else
-                {
-                    if (bbGetInputSpacing().size()==3)
-                    {
-                       spc[0]=bbGetInputSpacing()[0];
-                       spc[1]=bbGetInputSpacing()[1];
-                       spc[2]=bbGetInputSpacing()[2];
-                    }
-                    else
-                    {
-                       spc[0]=spc[1]=spc[2]=1;
-                    }
-
-                    iMin=0;
-                    iMax=bbGetInputlstPointX().size();
-                    printf("EED SphereList::Process   iMax=%d \n", iMax);
-                    for (int i = 0; i < iMax; i++)
-                      {
-                        std::cout << "CM SphereList::Process i=" <<  i  << " bbGetInputlstPointX()[i]=" << bbGetInputlstPointX()[i] << std::endl;
-                        std::cout << "CM SphereList::Process i=" <<  i  << " bbGetInputlstPointY()[i]=" << bbGetInputlstPointY()[i] << std::endl;
-                        std::cout << "CM SphereList::Process i=" <<  i  << " bbGetInputlstPointZ()[i]=" << bbGetInputlstPointZ()[i] << std::endl;
-                      }
-                    // If the vector Y or respectively the vector Z has a different size from the vector X, the position value py or respectively pz is set to 0.
-                    for ( int i=iMin ; i<iMax; i=i+1 )
-                    {
-                       px = bbGetInputlstPointX()[i]*spc[0];
-                       if (bbGetInputlstPointY().size() == bbGetInputlstPointX().size() )
-                       {
-                           py = bbGetInputlstPointY()[i]*spc[1];
-                       }
-                       if (bbGetInputlstPointZ().size() == bbGetInputlstPointX().size() )
-                       {                       
-                           pz = bbGetInputlstPointZ()[i]*spc[2];
-                       }
-
-                       // If the number of elements in the radio list is different from the number of X coordinates, the radio value is set to 1.
-                       if (bbGetInputlstRadio().size() == bbGetInputlstPointX().size() )
+               int sizeLstX=bbGetInputlstPointX().size();      
+               int sizeLstY=bbGetInputlstPointY().size();
+               int sizeLstZ=bbGetInputlstPointZ().size();
+               int sizeLstActors=sphereActor.size();
+               if ((sizeLstX==sizeLstY) &&(sizeLstX==sizeLstZ))
+               {
+                       if (sizeLstActors>sizeLstX)
                        {
-                           radio = bbGetInputlstRadio()[i];
-                        }
-                       else
+                               int i;
+                               int diff=sizeLstActors-sizeLstX;
+                               for (i=0;i<diff;i++)
+                               {
+                                       bbGetInputRenderer()->RemoveActor( sphereActor[0] );
+                                       vtkspheresourceLst[0]->Delete();
+                                       sphereActor[0]->Delete();
+                                       vtkspheresourceLst.erase( vtkspheresourceLst.begin() );
+                                       sphereActor.erase( sphereActor.begin() );
+                               } // for 
+                       } // if size
+
+                       if (sizeLstActors<sizeLstX)
                        {
-                            if (bbGetInputlstRadio().size()>=1)
-                            {
-                                radio = bbGetInputlstRadio()[ bbGetInputlstRadio().size() - 1 ];
-                            } 
-                            else 
-                            {
-                                radio = 1.0;
-                            }
-                       }
-
-                       // Sphere
-                       vtkSphereSource * newSphere =  vtkSphereSource::New();
-
-                       newSphere -> SetThetaResolution(20);
-                       newSphere -> SetPhiResolution(20);
-                       newSphere -> SetRadius(radio); 
-
-                       vtkPolyDataMapper * newMapper = vtkPolyDataMapper::New();
-                       newMapper -> SetInput( newSphere -> GetOutput() );
-       
-                       vtkActor * newActor = vtkActor::New();
-                       sphereActor.push_back(newActor);
-                       newActor -> SetMapper(newMapper);
-                       newActor -> SetOrigin(0, 0, 0);
-                       
-                       unsigned int j = 3*i +2;
-                       if (j < bbGetInputColour().size() )
-                       {
-                           newActor -> GetProperty() -> SetColor( bbGetInputColour()[3*i] , bbGetInputColour()[3*i + 1] , bbGetInputColour()[3*i + 2] );
-                           last_valid_color_index = 3*i;
-                       }
-                       else
-                         newActor -> GetProperty() -> SetColor( bbGetInputColour()[last_valid_color_index] , bbGetInputColour()[last_valid_color_index + 1] , bbGetInputColour()[last_valid_color_index + 2] );
-
-                       newActor -> GetProperty() -> SetOpacity( bbGetInputOpacity() );
-                       newActor -> SetPosition( px,py,pz );
-       
-                       if ( bbGetInputTransform()!=NULL )
-                       {
-                               newActor->SetUserTransform( bbGetInputTransform() );
-                       }
-       
-
-                       if (bbGetInputRenderer()!=NULL)
-                       {
-                           bbGetInputRenderer() -> AddActor( newActor );
-                       }
-
-                    } // for
+                               int i;
+                               int diff=sizeLstX-sizeLstActors;
+                               for (i=0;i<diff;i++)
+                               {
+                                       // Sphere
+                                       vtkSphereSource * newSphere = vtkSphereSource::New();
+                                       vtkspheresourceLst.push_back(newSphere);
+                                       newSphere -> SetThetaResolution(20);
+                                       newSphere -> SetPhiResolution(20);
+                                       newSphere -> SetRadius( 1 ); 
+                                       vtkPolyDataMapper * newMapper = vtkPolyDataMapper::New();
+                                       newMapper -> SetInput( newSphere -> GetOutput() );      
+                                       vtkActor * newActor = vtkActor::New();
+                                       sphereActor.push_back(newActor);
+                                       newActor -> SetMapper(newMapper);
+                                       newActor -> SetOrigin(0, 0, 0);                         
+                                       if ( bbGetInputTransform()!=NULL )
+                                       {
+                                               newActor->SetUserTransform( bbGetInputTransform() );
+                                       }
+                                       bbGetInputRenderer()->AddActor( newActor );
+                               } // for
+                       } // if size
+
+                       // Refresh data
+               for (int i = 0; i < sphereActor.size() ; i++)
+               {
+                               double px = 0.0;
+                               double py = 0.0;
+                               double pz = 0.0;
+                               double cr = 0.0;
+                               double cg = 0.0;
+                               double cb = 0.0;
+                               GetPoint(i, px,py,pz);
+                               GetColor(i, cr,cg,cb);
+                               sphereActor[i] ->SetPosition( px,py,pz );
+                sphereActor[i] -> GetProperty() -> SetOpacity( bbGetInputOpacity() );
+                sphereActor[i] -> GetProperty() -> SetColor( cr,cg,cb );
+                vtkspheresourceLst[i] -> SetRadius( GetRadio(i) ); 
+               } // for i
+
+               if (sphereActor.size() != 0)
+            {
+               // Sets the output.
+               bbSetOutputActorList(sphereActor);
+               }
+  
+               } else {
+                       printf("EED Warning!  SphereList::Process Lst XYZ are not of the same size.\n");
+               }// if sizeLst
+       } else {
+                       printf("EED Warning!  SphereList::Process Render not assigned.\n");             
+       }// if Renderer
 
-                    if (sphereActor.size() != 0)
-                    {
-                        // Sets the output.
-                        bbSetOutputActorList(sphereActor);
-                    }
-                    
-                } // if (bbGetInputRenderer()!=NULL)
+//====================================================================
 
-        } // if (sphereActor.size() != 0)
 }
 
+
 void SphereList::bbUserSetDefaultValues()
 {
  
index ac45d5ed087e0ff95a789996cebe5ab60bca89e1..fdc775afc1868d6dff5a855c158d9ef56e858db8 100644 (file)
@@ -62,7 +62,12 @@ class bbvtk_EXPORT SphereList
   void Process();
 
   std::vector<vtkActor *> sphereActor;
+  std::vector<vtkSphereSource *> vtkspheresourceLst;
 
+private:
+   double GetRadio(int);
+   void GetPoint(int i, double &px,double &py,double &pz);   
+   void GetColor(int i, double &cr,double &cg,double &cb);
 };
 
 BBTK_BEGIN_DESCRIBE_BLACK_BOX(SphereList,bbtk::AtomicBlackBox);
index 967cd2d1c9ad28d6637699dd9ef8ec99ca006c5f..463fca033660643d7873fc5932cd6c315c2c7aaa 100644 (file)
 <vtkobject>vtkSphereSource</vtkobject>
 
 <output name="Out" type="vtkPolyData*" description="Output Sphere" special="vtk output"/>
+<input name="Active" type="bool" description="Active True/False (default True)"/>
 <input name="CenterX" type="double" description="Center X coord"/>
 <input name="CenterY" type="double" description="Center Y coord"/>
 <input name="CenterZ" type="double" description="Center Z coord"/>
-<input name="PhiResolution" type="int" description="Sphere PhiResolution" special="vtk parameter"/>
-<input name="Radius" type="double" description="Sphere Radius" special="vtk parameter"/>
-<input name="ThetaResolution" type="int" description="Sphere ThetaResolution"special="vtk parameter"/>
+<input name="PhiResolution" type="int" description="Sphere PhiResolution" special="vtk parameter" />
+<input name="Radius" type="double" description="Sphere Radius" special="vtk parameter" />
+<input name="ThetaResolution" type="int" description="Sphere ThetaResolution" special="vtk parameter" />
 
 <process>
 <PRE>
-bbGetVtkObject()->SetCenter(bbGetInputCenterX(), 
-          bbGetInputCenterY(), 
-          bbGetInputCenterZ());
-bbGetVtkObject()->Update();
+if (bbGetInputActive()==true)
+{
+
+       bbGetVtkObject()->SetCenter(bbGetInputCenterX(), bbGetInputCenterY(), bbGetInputCenterZ());
+   //bbGetVtkObject()->SetPhiResolution(bbGetInputPhiResolution());
+   //bbGetVtkObject()->SetThetaResolution(bbGetInputThetaResolution());
+   //bbGetVtkObject()->SetRadius(bbGetInputRadius());
+   //printf("EED box vtk:SphereSource theta=%d  phi=%d\n", bbGetInputThetaResolution() , bbGetInputPhiResolution());
+       bbGetVtkObject()->Update();
+}
+
 </PRE>
 </process>
 
 
+<defaultValues><PRE>
+  bbSetInputActive(true);
+</PRE></defaultValues>
+
 </blackbox>
 
 
diff --git a/packages/vtk/src/bbvtkSurfaceTexture.cxx b/packages/vtk/src/bbvtkSurfaceTexture.cxx
new file mode 100644 (file)
index 0000000..3e0f81a
--- /dev/null
@@ -0,0 +1,177 @@
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+#include "bbvtkSurfaceTexture.h"
+#include "bbvtkPackage.h"
+
+#include <vtkPointData.h>
+
+
+namespace bbvtk
+{
+
+BBTK_ADD_BLACK_BOX_TO_PACKAGE(vtk,SurfaceTexture)
+BBTK_BLACK_BOX_IMPLEMENTATION(SurfaceTexture,bbtk::AtomicBlackBox);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void SurfaceTexture::Process()
+{
+
+// THE MAIN PROCESSING METHOD BODY
+//   Here we simply set the input 'In' value to the output 'Out'
+//   And print out the output value
+// INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
+//    void bbSet{Input|Output}NAME(const TYPE&)
+//    const TYPE& bbGet{Input|Output}NAME() const 
+//    Where :
+//    * NAME is the name of the input/output
+//      (the one provided in the attribute 'name' of the tag 'input')
+//    * TYPE is the C++ type of the input/output
+//      (the one provided in the attribute 'type' of the tag 'input')
+
+//    bbSetOutputOut( bbGetInputIn() );
+//    std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
+  
+printf("EED SurfaceTexture::Process Start\n");
+
+       int i;
+       double spc[3];
+       double range[2];
+       int ext[6];
+       bbGetInputImage()->GetSpacing(spc);
+       bbGetInputImage()->GetScalarRange(range);
+       bbGetInputImage()->GetWholeExtent(ext);
+       int maxX = ext[1]-ext[0]+1;
+       int maxY = ext[3]-ext[2]+1;
+       int maxZ = ext[5]-ext[4]+1;
+       
+       if (firsttime==true)
+       {
+               firsttime=false;
+               // Generate the colors for each point based on the color map
+               colors = vtkUnsignedCharArray::New(); 
+               colors->SetNumberOfComponents(3);
+               colors->SetName("Colors");
+               
+               // Create the color map
+               if (bbGetInputColorType()==1)
+               {
+                       colorLookupTableWL      = vtkWindowLevelLookupTable::New();
+                       colorLookupTableWL->InverseVideoOn();
+                       colorLookupTable        = colorLookupTableWL;
+               } else {
+                       colorLookupTable = vtkLookupTable::New();
+               }
+               colorLookupTable->SetTableRange(range[0],range[1]);
+               colorLookupTable->Build();
+               double rgba1[4];
+               double rgba2[4];
+               for (int iLookTable = 0; iLookTable<128; iLookTable++)
+               {
+                 colorLookupTable->GetTableValue(      iLookTable, rgba1);
+                 colorLookupTable->GetTableValue(256-1-iLookTable, rgba2);
+
+                 colorLookupTable->SetTableValue(256-1-iLookTable , rgba1[0],rgba1[1],rgba1[2],rgba1[3]);
+                 colorLookupTable->SetTableValue(      iLookTable , rgba2[0],rgba2[1],rgba2[2],rgba2[3]);
+               } // for iLookTable
+
+       }
+
+       bbGetInputMesh()->GetPointData()->SetScalars(colors);
+
+       if (bbGetInputColorType()==1)
+       {
+               colorLookupTableWL->SetLevel( bbGetInputColorLevel() );
+               colorLookupTableWL->SetWindow( bbGetInputColorWindow() );
+       }       
+               
+    int missingpoints = bbGetInputMesh()->GetNumberOfPoints() - colors->GetDataSize()/colors->GetNumberOfComponents();
+       for(i = 0; i < missingpoints; i++)
+    {
+               colors->InsertNextTuple3(0,0,0);
+       }       
+
+       if (bbGetInputTransform()!=NULL)
+       {
+               bbGetInputTransform()->Update();
+       }
+       
+       double gl; 
+       double p1[3];
+       double p2[3];
+       double dcolor[3];
+       for(i = 0; i < bbGetInputMesh()->GetNumberOfPoints(); i++)
+    {
+               if (bbGetInputTransform()!=NULL)
+               {
+                       bbGetInputMesh()->GetPoint(i,p1);
+                       bbGetInputTransform()->TransformPoint(p1,p2);
+               } else {
+                       bbGetInputMesh()->GetPoint(i,p2);
+               }
+               p2[0] = p2[0]/spc[0];
+               p2[1] = p2[1]/spc[1];
+               p2[2] = p2[2]/spc[2];   
+               
+               if ( (p2[0]>=0) && (p2[0]<maxX) && (p2[1]>=0) && (p2[1]<maxY) &&(p2[2]>=0) && (p2[2]<maxZ)  )
+               {
+                  gl =  bbGetInputImage()->GetScalarComponentAsDouble(p2[0], p2[1], p2[2],0);
+               } else {
+                       gl=0;
+               }
+               colorLookupTable->GetColor(gl, dcolor);
+               colors->SetTuple3(i,255*dcolor[0],255*dcolor[1],255*dcolor[2]);         
+       } // for i
+       bbGetInputMesh()->Modified();   
+
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void SurfaceTexture::bbUserSetDefaultValues()
+{
+
+//  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
+//    Here we initialize the input 'In' to 0
+       bbSetInputMesh(NULL);
+       bbSetInputImage(NULL);
+       bbSetInputColorType(0);
+       bbSetInputColorLevel(500);
+       bbSetInputColorWindow(500);
+       bbSetInputTransform(NULL);
+  
+       firsttime                               = true;
+       colors                                  = NULL;
+       colorLookupTable                = NULL;
+       colorLookupTableWL      = NULL;
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void SurfaceTexture::bbUserInitializeProcessing()
+{
+
+//  THE INITIALIZATION METHOD BODY :
+//    Here does nothing 
+//    but this is where you should allocate the internal/output pointers 
+//    if any 
+
+  
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void SurfaceTexture::bbUserFinalizeProcessing()
+{
+
+//  THE FINALIZATION METHOD BODY :
+//    Here does nothing 
+//    but this is where you should desallocate the internal/output pointers 
+//    if any
+  
+}
+}
+// EO namespace bbvtk
+
+
diff --git a/packages/vtk/src/bbvtkSurfaceTexture.h b/packages/vtk/src/bbvtkSurfaceTexture.h
new file mode 100644 (file)
index 0000000..2ad3062
--- /dev/null
@@ -0,0 +1,69 @@
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+#ifndef __bbvtkSurfaceTexture_h_INCLUDED__
+#define __bbvtkSurfaceTexture_h_INCLUDED__
+#include "bbvtk_EXPORT.h"
+#include "bbtkAtomicBlackBox.h"
+#include "iostream"
+
+#include "vtkPolyData.h"
+#include "vtkImageData.h"
+#include <vtkLookupTable.h>
+#include <vtkWindowLevelLookupTable.h>
+#include <vtkLinearTransform.h>
+
+namespace bbvtk
+{
+
+class bbvtk_EXPORT SurfaceTexture
+ : 
+   public bbtk::AtomicBlackBox
+{
+  BBTK_BLACK_BOX_INTERFACE(SurfaceTexture,bbtk::AtomicBlackBox);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+       BBTK_DECLARE_INPUT(Mesh,vtkPolyData*);
+       BBTK_DECLARE_INPUT(Image,vtkImageData*);
+       BBTK_DECLARE_INPUT(ColorType,int);
+       BBTK_DECLARE_INPUT(ColorLevel,double);
+       BBTK_DECLARE_INPUT(ColorWindow,double);
+       BBTK_DECLARE_INPUT(Transform,vtkLinearTransform*);
+//  BBTK_DECLARE_OUTPUT(Out,double);
+  BBTK_PROCESS(Process);
+  void Process();
+
+
+       bool                            firsttime;
+       vtkUnsignedCharArray            *colors;
+       vtkLookupTable                  *colorLookupTable;
+       vtkWindowLevelLookupTable       *colorLookupTableWL;
+
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+};
+
+BBTK_BEGIN_DESCRIBE_BLACK_BOX(SurfaceTexture,bbtk::AtomicBlackBox);
+BBTK_NAME("SurfaceTexture");
+BBTK_AUTHOR("Info-Dev");
+BBTK_DESCRIPTION("Surface texture");
+BBTK_CATEGORY("");
+       BBTK_INPUT(SurfaceTexture,Mesh,"Mesh topology",vtkPolyData*,"");
+       BBTK_INPUT(SurfaceTexture,Image,"Image Reference",vtkImageData*,"");
+       BBTK_INPUT(SurfaceTexture,ColorType,"Color Type (default 0) 0 Colors(JET), 1 ColorWindowLevel",int,"");
+       BBTK_INPUT(SurfaceTexture,ColorLevel,"Color Level (default 500)",double,"");
+       BBTK_INPUT(SurfaceTexture,ColorWindow,"ColorWindow (default 500)",double,"");
+       BBTK_INPUT(SurfaceTexture,Transform,"vtk Linear Transform (default NULL)",vtkLinearTransform*,"");
+//  BBTK_OUTPUT(SurfaceTexture,Out,"First output",double,"");
+
+BBTK_END_DESCRIBE_BLACK_BOX(SurfaceTexture);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+}
+// EO namespace bbvtk
+
+#endif // __bbvtkSurfaceTexture_h_INCLUDED__
+
diff --git a/packages/vtk/src/bbvtkText2D.cxx b/packages/vtk/src/bbvtkText2D.cxx
new file mode 100644 (file)
index 0000000..5eaa9c2
--- /dev/null
@@ -0,0 +1,158 @@
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+#include "bbvtkText2D.h"
+#include "bbvtkPackage.h"
+
+#include "vtkTextProperty.h"
+
+namespace bbvtk
+{
+
+BBTK_ADD_BLACK_BOX_TO_PACKAGE(vtk,Text2D)
+BBTK_BLACK_BOX_IMPLEMENTATION(Text2D,bbtk::AtomicBlackBox);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void Text2D::Process()
+{
+
+// THE MAIN PROCESSING METHOD BODY
+//   Here we simply set the input 'In' value to the output 'Out'
+//   And print out the output value
+// INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
+//    void bbSet{Input|Output}NAME(const TYPE&)
+//    const TYPE& bbGet{Input|Output}NAME() const 
+//    Where :
+//    * NAME is the name of the input/output
+//      (the one provided in the attribute 'name' of the tag 'input')
+//    * TYPE is the C++ type of the input/output
+//      (the one provided in the attribute 'type' of the tag 'input')
+
+//    bbSetOutputOut( bbGetInputIn() );
+//    std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
+  
+
+ if (_textActor==NULL)
+ { 
+   _textActor = vtkTextActor::New();
+   _textActor->GetPositionCoordinate()->SetCoordinateSystemToWorld();
+
+//   _textActor->GetPositionCoordinate()->SetCoordinateSystemToDisplay ();
+//   _textActor->GetPositionCoordinate()->SetCoordinateSystemToNormalizedDisplay ();
+//   _textActor->GetPositionCoordinate()->SetCoordinateSystemToViewport ();
+//   _textActor->GetPositionCoordinate()->SetCoordinateSystemToNormalizedViewport ();
+//   _textActor->GetPositionCoordinate()->SetCoordinateSystemToView ();
+//   _textActor->GetPositionCoordinate()->SetCoordinateSystemToWorld ();
+
+
+   if (bbGetInputRenderer()!=NULL)
+   {
+      bbGetInputRenderer()->AddActor2D(_textActor);
+   }
+ }
+
+ _textActor->SetInput(bbGetInputIn().c_str());
+
+// textActor->SetTextScaleModeToProp();
+// textActor->SetDisplayPosition(90, 50);
+// textActor->GetPosition2Coordinate()->SetCoordinateSystemToNormalizedViewport();
+
+ double px=0;
+ double py=0;
+ double spx=1;
+ double spy=1;
+ if (bbGetInputPoint().size()>=2)
+ {
+    px=bbGetInputPoint()[0];
+    py=bbGetInputPoint()[1];
+       
+    if (bbGetInputSpacing().size()>=2)
+    {
+       spx=bbGetInputSpacing()[0];
+       spy=bbGetInputSpacing()[1];
+    }    
+
+ }
+// _textActor->SetTextScaleModeToProp();
+ _textActor->SetPosition( px*spx , py*spy );
+
+printf("EED Text2D::Process px=%f  py=%f\n",px,py);
+
+// _textActor->SetPosition( 150,150 );
+// _textActor->GetPosition2Coordinate()->SetCoordinateSystemToNormalizedViewport();
+// _textActor->GetPosition2Coordinate()->SetValue( 0.2 , 0.2 );
+// textActor->GetPosition2Coordinate()->SetValue(0.6, 0.1);
+
+ vtkTextProperty *tprop = _textActor->GetTextProperty();
+ tprop->SetFontSize( bbGetInputFontSize() );
+ tprop->SetFontFamilyToArial();
+ tprop->SetJustificationToCentered();
+// tprop->BoldOn();
+// tprop->ItalicOn();
+// tprop->ShadowOn();
+
+ if (bbGetInputColor().size()>=3)
+ {
+    tprop->SetColor( bbGetInputColor()[0] , bbGetInputColor()[1] , bbGetInputColor()[2] );
+ }
+
+ tprop->SetOpacity( bbGetInputOpacity() );
+  
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void Text2D::bbUserSetDefaultValues()
+{
+
+//  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
+//    Here we initialize the input 'In' to 0
+
+ _textActor=NULL;
+ bbSetInputIn("VOID");  
+ bbSetInputOpacity(1);  
+ bbSetInputFontSize(14);  
+ std::vector<double> spc;
+ spc.push_back(1); 
+ spc.push_back(1); 
+ spc.push_back(1); 
+ bbSetInputSpacing(spc);  
+ std::vector<double> color;
+ color.push_back(0); 
+ color.push_back(0); 
+ color.push_back(1); 
+ bbSetInputColor(color);  
+
+ bbSetInputRenderer(NULL); 
+
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void Text2D::bbUserInitializeProcessing()
+{
+
+//  THE INITIALIZATION METHOD BODY :
+//    Here does nothing 
+//    but this is where you should allocate the internal/output pointers 
+//    if any 
+
+  
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void Text2D::bbUserFinalizeProcessing()
+{
+
+//  THE FINALIZATION METHOD BODY :
+//    Here does nothing 
+//    but this is where you should desallocate the internal/output pointers 
+//    if any
+  
+}
+}
+// EO namespace bbvtk
+
+
diff --git a/packages/vtk/src/bbvtkText2D.h b/packages/vtk/src/bbvtkText2D.h
new file mode 100644 (file)
index 0000000..ff85ca4
--- /dev/null
@@ -0,0 +1,67 @@
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+#ifndef __bbvtkText2D_h_INCLUDED__
+#define __bbvtkText2D_h_INCLUDED__
+#include "bbvtk_EXPORT.h"
+#include "bbtkAtomicBlackBox.h"
+#include "iostream"
+
+#include "vtkProp.h"
+#include "vtkRenderer.h"
+#include "vtkTextActor.h"
+
+namespace bbvtk
+{
+
+class bbvtk_EXPORT Text2D
+ : 
+   public bbtk::AtomicBlackBox
+{
+  BBTK_BLACK_BOX_INTERFACE(Text2D,bbtk::AtomicBlackBox);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+BBTK_DECLARE_INPUT(In,std::string);
+  BBTK_DECLARE_INPUT(Renderer,vtkRenderer*);
+  BBTK_DECLARE_INPUT(Point,std::vector<double>);
+  BBTK_DECLARE_INPUT(Spacing,std::vector<double>);
+  BBTK_DECLARE_INPUT(Opacity,double);
+  BBTK_DECLARE_INPUT(FontSize,int);
+  BBTK_DECLARE_INPUT(Color,std::vector<double>);
+  BBTK_DECLARE_OUTPUT( Out , vtkProp* );
+  BBTK_PROCESS(Process);
+  void Process();
+
+  vtkTextActor *_textActor;
+
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+};
+
+BBTK_BEGIN_DESCRIBE_BLACK_BOX(Text2D,bbtk::AtomicBlackBox);
+  BBTK_NAME("Text2D");
+  BBTK_AUTHOR("Info-Dev");
+  BBTK_DESCRIPTION("No Description.");
+  BBTK_CATEGORY("empty");
+
+  BBTK_INPUT(Text2D,In,"Input text (default = 'VOID')",std::string,"");
+  BBTK_INPUT(Text2D,Point,"Point [x,y,z]",std::vector<double>,"");
+  BBTK_INPUT(Text2D,Spacing,"Spacing [sx,sy,sz] default [1,1,1]",std::vector<double>,"");
+  BBTK_INPUT(Text2D,Opacity,"Pacity (default 1)",double,"");
+  BBTK_INPUT(Text2D,Renderer,"Vtk Rendere ",vtkRenderer*,"");
+  BBTK_INPUT(Text2D,FontSize,"Font size (default 14)",int,"");
+  BBTK_INPUT(Text2D,Color,"vector color [r,g,b] (default [0,0,1])",std::vector<double>,"");
+
+  BBTK_OUTPUT(Text2D,Out,"vtk Prop",vtkProp*,"");
+
+BBTK_END_DESCRIBE_BLACK_BOX(Text2D);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+}
+// EO namespace bbvtk
+
+#endif // __bbvtkText2D_h_INCLUDED__
+
index 776d45e02947a7c8811bc358c602913f36d90a50..077c44f65023bd94df42660caa70b55db5526c0b 100644 (file)
@@ -71,7 +71,8 @@ void Text3D::Process()
   
   _textActor->SetInput( bbGetInputIn().c_str()  );
   _textActor->SetPosition(  bbGetInputX(), bbGetInputY(),bbGetInputZ() );
-       
+  _textActor->GetTextProperty()->SetOpacity( bbGetInputOpacity() );    
+
   if ( bbGetInputTransform()!=NULL )
     {
       _textActor->SetUserTransform( bbGetInputTransform() );
@@ -101,6 +102,7 @@ void Text3D::bbUserSetDefaultValues()
        bbSetInputColour(colour);
        bbSetInputRenderer(NULL);
        bbSetInputTransform(NULL);
+       bbSetInputOpacity(1);
 
        _textActor = NULL;
        _textProp = NULL;
index af788d6910d1d5c2af5ee2588da73c309691c12a..073d427a9424f11fcce2c200889a96ef7b4a56e3 100644 (file)
@@ -56,6 +56,7 @@ class bbvtk_EXPORT Text3D
        BBTK_DECLARE_INPUT(X,int);
        BBTK_DECLARE_INPUT(Y,int);
        BBTK_DECLARE_INPUT(Z,int);
+       BBTK_DECLARE_INPUT(Opacity,double);
        BBTK_DECLARE_INPUT(Colour,std::vector<double>);
        BBTK_DECLARE_INPUT(Renderer,vtkRenderer*);
        BBTK_DECLARE_INPUT(Transform,vtkLinearTransform*);
@@ -81,7 +82,8 @@ BBTK_CATEGORY("");
        BBTK_INPUT(Text3D,X,"position X",int,"");
        BBTK_INPUT(Text3D,Y,"position Y",int,"");
        BBTK_INPUT(Text3D,Z,"position Z",int,"");
-       BBTK_INPUT(Text3D,Colour,"Colour vector RGB",std::vector<double>,"");
+       BBTK_INPUT(Text3D,Opacity,"0..1   (default 1)",double,"");
+       BBTK_INPUT(Text3D,Colour,"Colour vector RGB  < 0..1 , 0..1 , 0..1 >",std::vector<double>,"");
        BBTK_INPUT(Text3D,Renderer,"vtk Renderer",vtkRenderer*,"");
        BBTK_INPUT(Text3D,Transform,"",vtkLinearTransform*,"");
 
index 829cd7e60ec3b100f4eb00aa09d72f5237e7d468..fd0d369cde740fa8a3318d603806dec4422732cf 100644 (file)
@@ -67,6 +67,7 @@ namespace bbvtk
        {
                bbUserFinalizeProcessing();
                result = vtkTransform::New();
+               result->Update();
        }
 
        // --------------------------------------------------------------       
@@ -79,40 +80,33 @@ namespace bbvtk
                }
        }
 
+
        // --------------------------------------------------------------       
   void Transform::Process()
   {
-         printf("EED %p Transform::Process() 1\n", this);
          bbUserInitializeProcessing();
          if (bbGetInputIn()!=NULL)
       {
                  result->Concatenate( bbGetInputIn()->GetMatrix() );
-                 printf("EED %p Transform::Process() 2\n", this);
       }
 
-         if (bbGetInputScale().size()>=3)
-      {
-                 result->Scale(bbGetInputScale()[0], bbGetInputScale()[1], bbGetInputScale()[2]);
-                 printf("EED %p Transform::Process() 3\n", this);
-      }
          if ((bbGetInputTranslate().size()>=3) && (bbGetInputSpacing().size()>=3))
       {
                  double tx = bbGetInputTranslate()[0] * bbGetInputSpacing()[0];
                  double ty = bbGetInputTranslate()[1] * bbGetInputSpacing()[1];
                  double tz = bbGetInputTranslate()[2] * bbGetInputSpacing()[2];
                  result->Translate(tx,ty,tz);
-                 printf("EED %p Transform::Process() 4\n", this);
+      }
+
+         if (bbGetInputScale().size()>=3)
+      {
+                 result->Scale(bbGetInputScale()[0], bbGetInputScale()[1], bbGetInputScale()[2]);
       }
 
          if (bbGetInputRotateWXYZ().size()>=4)
       {
                  result->RotateWXYZ(bbGetInputRotateWXYZ()[0],bbGetInputRotateWXYZ()[1], bbGetInputRotateWXYZ()[2], bbGetInputRotateWXYZ()[3]);
-                 printf("EED %p Transform::Process() 5\n", this);
       }
-
-         result->Update();
-         printf("EED %p Transform::Process() 6\n", this);
  
          bbSetOutputOut(result);
   }
index 9349b7068feac515e6e4d0a8ce6a0905ad9118fe..7bd2dd513440449c49cbf37437c11d345ba9368f 100644 (file)
@@ -57,18 +57,21 @@ namespace bbvtk
     vtkTransform               *result; 
 };
   
-  BBTK_BEGIN_DESCRIBE_BLACK_BOX(Transform,bbtk::AtomicBlackBox);
+BBTK_BEGIN_DESCRIBE_BLACK_BOX(Transform,bbtk::AtomicBlackBox);
   BBTK_NAME("Transform");
   BBTK_AUTHOR("InfoTeam CREATIS-LRMN");
   BBTK_DESCRIPTION("vtkTransform");
   BBTK_CATEGORY("math");
+
   BBTK_INPUT(Transform,In,"vtkTransform to be concatenate",vtkLinearTransform *,"");
   BBTK_INPUT(Transform,Scale,"vector with sx sy sz",std::vector<double>,"");
   BBTK_INPUT(Transform,Translate,"vector with x y z",std::vector<double>,"");
   BBTK_INPUT(Transform,Spacing,"vector with spacingX spacingY spacingZ",std::vector<double>,"");
   BBTK_INPUT(Transform,RotateWXYZ,"vector with Angle Vx Vy Vz",std::vector<double>,"");
+
   BBTK_OUTPUT(Transform,Out,"vtkTransform result",vtkLinearTransform *,"");
-  BBTK_END_DESCRIBE_BLACK_BOX(Transform);
+
+BBTK_END_DESCRIBE_BLACK_BOX(Transform);
 }
 // EO namespace bbvtk
 
index dd9b65a8c6a6d2210179a918b4721c65b75ecfa7..706949fe06a2c00025ac4e0ea0d301489264561e 100644 (file)
@@ -57,66 +57,58 @@ void UnaryOperations::Process()
        ope->SetInput1((vtkDataObject*)bbGetInputIn1());
 
 
-       ope->SetConstantK(bbGetInputInConstant());
-       ope->SetConstantC(bbGetInputInConstant());
-
        switch (bbGetInputOperation())
        {
                case 0:
+                               ope->SetConstantC( bbGetInputInConstant() );
                                ope->SetOperationToAddConstant();
 
                break;
                case 1:
-//EED Borrame                          crearPredeterminado();
-                               ope->SetInput2((vtkDataSet*) constante);
-                               ope->SetOperationToSubtract();
+                               ope->SetConstantC( -1.0 * bbGetInputInConstant() );
+                               ope->SetOperationToAddConstant();
                break;
                case 2:
-                ope->SetInput2((vtkDataSet*) constante);
-                               ope->SetOperationToMultiply();
+                               ope->SetConstantK( bbGetInputInConstant() );
+                               ope->SetOperationToMultiplyByK();
+printf("EED UnaryOperations::Process()  2 \n");
 
                break;
                case 3:
-
-                               ope->SetOperationToDivide();
+                               ope->SetConstantK( 1.0/bbGetInputInConstant() );
+                               ope->SetOperationToMultiplyByK();
+printf("EED UnaryOperations::Process()  3 \n");
                break;
                case 4:
                         ope->SetOperationToInvert();
                break;
-               case 9:
-                        ope->SetOperationToAbsoluteValue();
-               break;
                case 5:
-
                                ope->SetOperationToSin();
                break;
                case 6:
-
                        ope->SetOperationToCos();
 
                break;
                case 7:
-
                                ope->SetOperationToExp();
                break;
                case 8:
-
                                ope->SetOperationToLog();
                break;
-
-                       
-/* EED 21Juin 2011 Borrame
+               case 9:
+                        ope->SetOperationToAbsoluteValue();
+               break;
                case 10:
-                       substractWithMinimum();
-                       bbSetOutputOut(constante);
-                       return;
+                        ope->SetOperationToSquareRoot();
                break;
                case 11:
-                       MultiplyBy();
-                       bbSetOutputOut(constante);
-                       return;
+                        ope->SetConstantC( bbGetInputInConstant() );
+                        ope->SetConstantK( bbGetInputNewValue() );
+                        ope->SetOperationToReplaceCByK();
                break;
-*/  
+
+
+                       
                        
                default:
                        std::cout << "Invalid Operation" << std::endl;
@@ -124,6 +116,7 @@ void UnaryOperations::Process()
                break;
        }
 
+       ope->Modified();
        ope->Update();
        vtkImageData* salida = ope->GetOutput();
 
@@ -132,73 +125,6 @@ void UnaryOperations::Process()
 
 }
 
-/* Borrame Eduardo - Juan Pablo
-void UnaryOperations::crearPredeterminado()
-{
-       int ext[6];
-       vtkImageData* inicial = bbGetInputIn1();
-
-
-       if (constante == NULL)
-       {
-               inicial->GetExtent(ext);
-               constante = vtkImageData::New();
-               constante->SetExtent(ext);
-               constante->SetScalarType(inicial->GetScalarType());
-               constante->AllocateScalars();
-               constante->Update();
-       }
-
-       for (int i=ext[0]; i<=ext[1]; i++)
-       {
-               for (int j=ext[2]; j<=ext[3]; j++)
-               {
-                       for (int k=ext[4]; k<=ext[5]; k++)
-                       {
-                               unsigned short* value = (unsigned short*)constante->GetScalarPointer(i,j,k);
-                               *value = bbGetInputInConstant();
-                       }
-               }
-       }
-}
-*/
-
-
-void UnaryOperations::substractWithMinimum()
-{
-       int ext[6];
-       double spc[3];
-       vtkImageData* inicial = bbGetInputIn1();
-
-
-       if (constante == NULL)
-       {
-               inicial->GetExtent(ext);
-               inicial->GetSpacing(spc);
-               constante = vtkImageData::New();
-               constante->SetExtent(ext);
-               constante->SetSpacing(spc);
-               constante->SetOrigin(inicial->GetOrigin());
-               constante->SetScalarType(inicial->GetScalarType());
-               constante->AllocateScalars();
-               constante->Update();
-       }
-
-       for (int i=ext[0]; i<=ext[1]; i++)
-       {
-               for (int j=ext[2]; j<=ext[3]; j++)
-               {
-                       for (int k=ext[4]; k<=ext[5]; k++)
-                       {
-                               double temp1 = lector.getPixelValue(i,j,k,inicial);
-                               double temp = temp1 - bbGetInputInConstant();
-                               if (temp < 0)
-                                       temp = 0;
-                               lector.setPixelValue(i,j,k,constante,temp);
-                       }
-               }
-       }
-}
 
 
 void UnaryOperations::bbUserSetDefaultValues()
@@ -209,6 +135,7 @@ void UnaryOperations::bbUserSetDefaultValues()
    bbSetInputIn1(NULL);
    bbSetOutputOut(NULL);
    bbSetInputInConstant(0);
+   bbSetInputNewValue(0);
    bbSetInputOperation(0);
    ope = vtkImageMathematics::New();
    constante = NULL;
index c123ae0f4790138c61f3e5b24a3c731f49b366a8..c2fb858275fc3a47baf287d9709e90a036c1ad19 100644 (file)
@@ -53,6 +53,7 @@ class bbvtk_EXPORT UnaryOperations
   BBTK_DECLARE_INPUT(In1,vtkImageData*);
   BBTK_DECLARE_INPUT(Operation,int);
   BBTK_DECLARE_INPUT(InConstant,double);
+  BBTK_DECLARE_INPUT(NewValue,double);
   BBTK_DECLARE_OUTPUT(Out,vtkImageData*);
   BBTK_PROCESS(Process);
   void Process();
@@ -74,7 +75,8 @@ BBTK_BEGIN_DESCRIBE_BLACK_BOX(UnaryOperations,bbtk::AtomicBlackBox);
   BBTK_CATEGORY("filtre");
   BBTK_INPUT(UnaryOperations,In1,"Image to be operated",vtkImageData*,"");
   BBTK_INPUT(UnaryOperations,InConstant,"Constant that will be used in the operations.",double,"0 default");
-  BBTK_INPUT(UnaryOperations,Operation,"0:Add (Default), 1:subtract, 2:multiply, 3:divide, 4:invert, 5:sin, 6:cos, 7:exp, 8:log, 9:abs????",int,"Addition default");
+  BBTK_INPUT(UnaryOperations,NewValue,"InConstant replace by NewValue",double,"0 default");
+  BBTK_INPUT(UnaryOperations,Operation,"0:Add (Default), 1:subtract, 2:multiply, 3:divide, 4:invert, 5:sin, 6:cos, 7:exp, 8:log, 9:abs????, 10:SquareRoot, 11:ReplaceByConstant",int,"Addition default");
   BBTK_OUTPUT(UnaryOperations,Out,"",vtkImageData*,"");
 BBTK_END_DESCRIBE_BLACK_BOX(UnaryOperations);
 }
index d4031bccdc2b558f5ef6894a6dff3d7f7d4e5560..640aada1ef91fa945d5a3c5c0720e2f78a27b0c1 100644 (file)
@@ -33,16 +33,23 @@ namespace bbvtk {
     BBTK_ADD_BLACK_BOX_TO_PACKAGE(vtk, UpdateRender)
     BBTK_BLACK_BOX_IMPLEMENTATION(UpdateRender, bbtk::AtomicBlackBox);
 
-    void UpdateRender::Process() {
-         std::cout << "CM creaInteraction vtkUpdateRender::Process before if" << std::endl;
-         if(bbGetInputActive()){
-         std::cout << "CM creaInteraction vtkUpdateRender::Process within if" << std::endl;
-         bbGetInputRenderer()->GetRenderWindow()->Render();
-       }
+    void UpdateRender::Process() 
+    {
+       if(bbGetInputActive())
+               {
+               if (bbGetInputRenderer()!=NULL)
+               {
+                       bbGetInputRenderer()->GetRenderWindow()->Render();
+//EED 4 nov 2015 Estelle
+//                     bbGetInputRenderer()->GradientBackgroundOff();
+//                     bbGetInputRenderer()->SetBackground( 0 , 0 , 0 );
+               } // Renderer
+               } // Active
     }
 
     void UpdateRender::bbUserSetDefaultValues() {
         bbSetInputActive(false);
+       bbSetInputRenderer(NULL);
     }
 
     void UpdateRender::bbUserInitializeProcessing() {
diff --git a/packages/vtk/src/bbvtkUpdateRender.cxx~ b/packages/vtk/src/bbvtkUpdateRender.cxx~
new file mode 100644 (file)
index 0000000..691f32c
--- /dev/null
@@ -0,0 +1,62 @@
+/*
+ # ---------------------------------------------------------------------
+ #
+ # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
+ #                        pour la SantÈ)
+ # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
+ # Previous Authors : Laurent Guigues, Jean-Pierre Roux
+ # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
+ #
+ #  This software is governed by the CeCILL-B license under French law and
+ #  abiding by the rules of distribution of free software. You can  use,
+ #  modify and/ or redistribute the software under the terms of the CeCILL-B
+ #  license as circulated by CEA, CNRS and INRIA at the following URL
+ #  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+ #  or in the file LICENSE.txt.
+ #
+ #  As a counterpart to the access to the source code and  rights to copy,
+ #  modify and redistribute granted by the license, users are provided only
+ #  with a limited warranty  and the software's author,  the holder of the
+ #  economic rights,  and the successive licensors  have only  limited
+ #  liability.
+ #
+ #  The fact that you are presently reading this means that you have had
+ #  knowledge of the CeCILL-B license and that you accept its terms.
+ # ------------------------------------------------------------------------ */
+
+
+
+#include "bbvtkUpdateRender.h"
+#include "bbvtkPackage.h"
+namespace bbvtk {
+
+    BBTK_ADD_BLACK_BOX_TO_PACKAGE(vtk, UpdateRender)
+    BBTK_BLACK_BOX_IMPLEMENTATION(UpdateRender, bbtk::AtomicBlackBox);
+
+    void UpdateRender::Process() 
+    {
+       if(bbGetInputActive())
+               {
+               if (bbGetInputRenderer()!=NULL)
+               {
+                       bbGetInputRenderer()->GetRenderWindow()->Render();
+               }
+               } // Active
+    }
+
+    void UpdateRender::bbUserSetDefaultValues() {
+        bbSetInputActive(false);
+       bbSetInputRenderer(NULL);
+    }
+
+    void UpdateRender::bbUserInitializeProcessing() {
+
+    }
+
+    void UpdateRender::bbUserFinalizeProcessing() {
+
+    }
+}
+// EO namespace bbvtk
+
+
index a2ccc9a5f9a1eeb8425a5fbffcad9d84881c460d..33af404643cc8de4484d5722c58b5136f4856e9e 100644 (file)
@@ -84,6 +84,7 @@ BBTK_BLACK_BOX_IMPLEMENTATION(VecImageGaussianSmooth,bbtk::AtomicBlackBox);
                        vtkimagegaussiansmooth = vtkImageGaussianSmooth::New();
                        vtkimagegaussiansmooth->SetInput( bbGetInputIn()[i] );
                        vtkimagegaussiansmooth->SetStandardDeviation( stdvX,stdvY, stdvZ ); 
+                       vtkimagegaussiansmooth->Modified();
                        vtkimagegaussiansmooth->Update();
                        VecResult.push_back( vtkimagegaussiansmooth->GetOutput() );
                        VecVtkimagegaussiansmooth.push_back(vtkimagegaussiansmooth);
index dcf9f4c0efce099a0b7e3861baffda3dec4915f5..a804e1507099a2645db27d23fbc40d8e3ff8e59f 100644 (file)
@@ -121,41 +121,43 @@ namespace bbvtk
    }
 //---------------------------------------------------------------------
 
-   void VolumeRenderer::Process()
-   {
-     bool changed = false;
-     if ( bbGetInputStatus("In") != bbtk::UPTODATE )
-       {
-        mMapper->SetInput( bbGetInputIn() );
-        changed = true;
-       }
-
-          if ( ( bbGetInputStatus("ColorFunction") != bbtk::UPTODATE ) &&
+void VolumeRenderer::Process()
+{
+    bool changed = false;
+    if ( bbGetInputStatus("In") != bbtk::UPTODATE )
+       {
+               mMapper->SetInput( bbGetInputIn() );
+               changed = true;
+    }
+
+       if ( ( bbGetInputStatus("ColorFunction") != bbtk::UPTODATE ) &&
          ( bbGetInputColorFunction() != 0 ) )
-       {
-        mVolume->GetProperty()->SetColor( bbGetInputColorFunction() );
-        changed = true;
-       }
+    {
+               mVolume->GetProperty()->SetColor( bbGetInputColorFunction() );
+               changed = true;
+    }
 
      if ( ( bbGetInputStatus("ColorFunction1") != bbtk::UPTODATE ) &&
          ( bbGetInputColorFunction1() != 0 ) )
-       {
-        mVolume->GetProperty()->SetColor( bbGetInputColorFunction1() );
-        changed = true;
-       }
+     {
+               mVolume->GetProperty()->SetColor( bbGetInputColorFunction1() );
+               changed = true;
+     }
 
      if ( ( bbGetInputStatus("OpacityFunction") != bbtk::UPTODATE ) &&
          ( bbGetInputOpacityFunction() != 0 ) )
-       {
-        mVolume->GetProperty()->SetScalarOpacity(bbGetInputOpacityFunction());
-        changed = true;
-       }
-    
-     if (changed) mMapper->Update();
+     {
+               mVolume->GetProperty()->SetScalarOpacity(bbGetInputOpacityFunction());
+               changed = true;
+     }
+
+       if (changed)
+       { 
+               mMapper->Update();
+       }
+       bbSetOutputOut(mVolume); 
+}
 
-        bbSetOutputOut(mVolume);
-          
-   }
 
 }//namespace bbtk
 
diff --git a/packages/vtk/src/bbvtkvtkDataSetTovtkDataObject.cxx b/packages/vtk/src/bbvtkvtkDataSetTovtkDataObject.cxx
new file mode 100644 (file)
index 0000000..4ebd199
--- /dev/null
@@ -0,0 +1,70 @@
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+#include "bbvtkvtkDataSetTovtkDataObject.h"
+#include "bbvtkPackage.h"
+namespace bbvtk
+{
+
+BBTK_ADD_BLACK_BOX_TO_PACKAGE(vtk,vtkDataSetTovtkDataObject)
+BBTK_BLACK_BOX_IMPLEMENTATION(vtkDataSetTovtkDataObject,bbtk::AtomicBlackBox);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void vtkDataSetTovtkDataObject::Process()
+{
+
+// THE MAIN PROCESSING METHOD BODY
+//   Here we simply set the input 'In' value to the output 'Out'
+//   And print out the output value
+// INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
+//    void bbSet{Input|Output}NAME(const TYPE&)
+//    const TYPE& bbGet{Input|Output}NAME() const 
+//    Where :
+//    * NAME is the name of the input/output
+//      (the one provided in the attribute 'name' of the tag 'input')
+//    * TYPE is the C++ type of the input/output
+//      (the one provided in the attribute 'type' of the tag 'input')
+    bbSetOutputOut( bbGetInputIn() );
+  
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void vtkDataSetTovtkDataObject::bbUserSetDefaultValues()
+{
+
+//  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
+//    Here we initialize the input 'In' to 0
+   bbSetInputIn(NULL);
+  
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void vtkDataSetTovtkDataObject::bbUserInitializeProcessing()
+{
+
+//  THE INITIALIZATION METHOD BODY :
+//    Here does nothing 
+//    but this is where you should allocate the internal/output pointers 
+//    if any 
+
+  
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void vtkDataSetTovtkDataObject::bbUserFinalizeProcessing()
+{
+
+//  THE FINALIZATION METHOD BODY :
+//    Here does nothing 
+//    but this is where you should desallocate the internal/output pointers 
+//    if any
+  
+}
+}
+// EO namespace bbvtk
+
+
diff --git a/packages/vtk/src/bbvtkvtkDataSetTovtkDataObject.h b/packages/vtk/src/bbvtkvtkDataSetTovtkDataObject.h
new file mode 100644 (file)
index 0000000..069f765
--- /dev/null
@@ -0,0 +1,52 @@
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+#ifndef __bbvtkvtkDataSetTovtkDataObject_h_INCLUDED__
+#define __bbvtkvtkDataSetTovtkDataObject_h_INCLUDED__
+#include "bbvtk_EXPORT.h"
+#include "bbtkAtomicBlackBox.h"
+#include "iostream"
+
+#include "vtkDataObject.h"
+#include "vtkDataSet.h"
+
+namespace bbvtk
+{
+
+class bbvtk_EXPORT vtkDataSetTovtkDataObject
+ : 
+   public bbtk::AtomicBlackBox
+{
+  BBTK_BLACK_BOX_INTERFACE(vtkDataSetTovtkDataObject,bbtk::AtomicBlackBox);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+  BBTK_DECLARE_INPUT(In,vtkDataSet*);
+  BBTK_DECLARE_OUTPUT(Out,vtkDataObject*);
+  BBTK_PROCESS(Process);
+  void Process();
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+};
+
+BBTK_BEGIN_DESCRIBE_BLACK_BOX(vtkDataSetTovtkDataObject,bbtk::AtomicBlackBox);
+BBTK_NAME("vtkDataSetTovtkDataObject");
+BBTK_AUTHOR("Davila at InfoDev Creatis");
+BBTK_DESCRIPTION("vtk adaptor  (vtk Object herency)");
+BBTK_CATEGORY("adaptor");
+
+  BBTK_DEFAULT_ADAPTOR();
+
+  BBTK_INPUT(vtkDataSetTovtkDataObject,In,"The vtk object vtkDataSet*",vtkDataSet*,"");
+  BBTK_OUTPUT(vtkDataSetTovtkDataObject,Out,"The vtk object vtkDataObject*",vtkDataObject*,"");
+
+BBTK_END_DESCRIBE_BLACK_BOX(vtkDataSetTovtkDataObject);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+}
+// EO namespace bbvtk
+
+#endif // __bbvtkvtkDataSetTovtkDataObject_h_INCLUDED__
+
diff --git a/packages/vtk/src/bbvtkvtkImageDataToVtkDataObject.cxx b/packages/vtk/src/bbvtkvtkImageDataToVtkDataObject.cxx
new file mode 100644 (file)
index 0000000..7ee3dd5
--- /dev/null
@@ -0,0 +1,70 @@
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+#include "bbvtkvtkImageDataToVtkDataObject.h"
+#include "bbvtkPackage.h"
+namespace bbvtk
+{
+
+BBTK_ADD_BLACK_BOX_TO_PACKAGE(vtk,vtkImageDataToVtkDataObject)
+BBTK_BLACK_BOX_IMPLEMENTATION(vtkImageDataToVtkDataObject,bbtk::AtomicBlackBox);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void vtkImageDataToVtkDataObject::Process()
+{
+
+// THE MAIN PROCESSING METHOD BODY
+//   Here we simply set the input 'In' value to the output 'Out'
+//   And print out the output value
+// INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
+//    void bbSet{Input|Output}NAME(const TYPE&)
+//    const TYPE& bbGet{Input|Output}NAME() const 
+//    Where :
+//    * NAME is the name of the input/output
+//      (the one provided in the attribute 'name' of the tag 'input')
+//    * TYPE is the C++ type of the input/output
+//      (the one provided in the attribute 'type' of the tag 'input')
+    bbSetOutputOut( bbGetInputIn() );
+  
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void vtkImageDataToVtkDataObject::bbUserSetDefaultValues()
+{
+
+//  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
+//    Here we initialize the input 'In' to 0
+   bbSetInputIn(NULL);
+  
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void vtkImageDataToVtkDataObject::bbUserInitializeProcessing()
+{
+
+//  THE INITIALIZATION METHOD BODY :
+//    Here does nothing 
+//    but this is where you should allocate the internal/output pointers 
+//    if any 
+
+  
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void vtkImageDataToVtkDataObject::bbUserFinalizeProcessing()
+{
+
+//  THE FINALIZATION METHOD BODY :
+//    Here does nothing 
+//    but this is where you should desallocate the internal/output pointers 
+//    if any
+  
+}
+}
+// EO namespace bbvtk
+
+
diff --git a/packages/vtk/src/bbvtkvtkImageDataToVtkDataObject.h b/packages/vtk/src/bbvtkvtkImageDataToVtkDataObject.h
new file mode 100644 (file)
index 0000000..207218e
--- /dev/null
@@ -0,0 +1,52 @@
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+#ifndef __bbvtkvtkImageDataToVtkDataObject_h_INCLUDED__
+#define __bbvtkvtkImageDataToVtkDataObject_h_INCLUDED__
+#include "bbvtk_EXPORT.h"
+#include "bbtkAtomicBlackBox.h"
+#include "iostream"
+
+#include "vtkDataObject.h"
+#include "vtkImageData.h"
+
+namespace bbvtk
+{
+
+class bbvtk_EXPORT vtkImageDataToVtkDataObject
+ : 
+   public bbtk::AtomicBlackBox
+{
+  BBTK_BLACK_BOX_INTERFACE(vtkImageDataToVtkDataObject,bbtk::AtomicBlackBox);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+  BBTK_DECLARE_INPUT(In,vtkImageData*);
+  BBTK_DECLARE_OUTPUT(Out,vtkDataObject*);
+  BBTK_PROCESS(Process);
+  void Process();
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+};
+
+BBTK_BEGIN_DESCRIBE_BLACK_BOX(vtkImageDataToVtkDataObject,bbtk::AtomicBlackBox);
+BBTK_NAME("vtkImageDataToVtkDataObject");
+BBTK_AUTHOR("Davila at InfoDev Creatis");
+BBTK_DESCRIPTION("vtk adaptor  (vtk Object herency)");
+BBTK_CATEGORY("empty");
+
+  BBTK_DEFAULT_ADAPTOR();
+
+  BBTK_INPUT(vtkImageDataToVtkDataObject,In,"the vtkobject vtkImageData*",vtkImageData*,"");
+  BBTK_OUTPUT(vtkImageDataToVtkDataObject,Out,"the vtk object vtkDataObject*",vtkDataObject*,"");
+
+BBTK_END_DESCRIBE_BLACK_BOX(vtkImageDataToVtkDataObject);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+}
+// EO namespace bbvtk
+
+#endif // __bbvtkvtkImageDataToVtkDataObject_h_INCLUDED__
+
diff --git a/packages/vtk/src/bbvtkvtkPolyDataTovtkDataObject.cxx b/packages/vtk/src/bbvtkvtkPolyDataTovtkDataObject.cxx
new file mode 100644 (file)
index 0000000..ac2579a
--- /dev/null
@@ -0,0 +1,70 @@
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+#include "bbvtkvtkPolyDataTovtkDataObject.h"
+#include "bbvtkPackage.h"
+namespace bbvtk
+{
+
+BBTK_ADD_BLACK_BOX_TO_PACKAGE(vtk,vtkPolyDataTovtkDataObject)
+BBTK_BLACK_BOX_IMPLEMENTATION(vtkPolyDataTovtkDataObject,bbtk::AtomicBlackBox);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void vtkPolyDataTovtkDataObject::Process()
+{
+
+// THE MAIN PROCESSING METHOD BODY
+//   Here we simply set the input 'In' value to the output 'Out'
+//   And print out the output value
+// INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
+//    void bbSet{Input|Output}NAME(const TYPE&)
+//    const TYPE& bbGet{Input|Output}NAME() const 
+//    Where :
+//    * NAME is the name of the input/output
+//      (the one provided in the attribute 'name' of the tag 'input')
+//    * TYPE is the C++ type of the input/output
+//      (the one provided in the attribute 'type' of the tag 'input')
+    bbSetOutputOut( bbGetInputIn() );
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void vtkPolyDataTovtkDataObject::bbUserSetDefaultValues()
+{
+
+//  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
+//    Here we initialize the input 'In' to 0
+   bbSetInputIn(NULL);
+   bbSetOutputOut(NULL);
+  
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void vtkPolyDataTovtkDataObject::bbUserInitializeProcessing()
+{
+
+//  THE INITIALIZATION METHOD BODY :
+//    Here does nothing 
+//    but this is where you should allocate the internal/output pointers 
+//    if any 
+
+  
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void vtkPolyDataTovtkDataObject::bbUserFinalizeProcessing()
+{
+
+//  THE FINALIZATION METHOD BODY :
+//    Here does nothing 
+//    but this is where you should desallocate the internal/output pointers 
+//    if any
+  
+}
+}
+// EO namespace bbvtk
+
+
diff --git a/packages/vtk/src/bbvtkvtkPolyDataTovtkDataObject.h b/packages/vtk/src/bbvtkvtkPolyDataTovtkDataObject.h
new file mode 100644 (file)
index 0000000..1e91d49
--- /dev/null
@@ -0,0 +1,52 @@
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+#ifndef __bbvtkvtkPolyDataTovtkDataObject_h_INCLUDED__
+#define __bbvtkvtkPolyDataTovtkDataObject_h_INCLUDED__
+#include "bbvtk_EXPORT.h"
+#include "bbtkAtomicBlackBox.h"
+#include "iostream"
+
+#include "vtkDataObject.h"
+#include "vtkPolyData.h"
+
+namespace bbvtk
+{
+
+class bbvtk_EXPORT vtkPolyDataTovtkDataObject
+ : 
+   public bbtk::AtomicBlackBox
+{
+  BBTK_BLACK_BOX_INTERFACE(vtkPolyDataTovtkDataObject,bbtk::AtomicBlackBox);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+  BBTK_DECLARE_INPUT(In,vtkPolyData*);
+  BBTK_DECLARE_OUTPUT(Out,vtkDataObject*);
+  BBTK_PROCESS(Process);
+  void Process();
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+};
+
+BBTK_BEGIN_DESCRIBE_BLACK_BOX(vtkPolyDataTovtkDataObject,bbtk::AtomicBlackBox);
+BBTK_NAME("vtkPolyDataTovtkDataObject");
+BBTK_AUTHOR("ED at InfoDev Creatis");
+BBTK_DESCRIPTION("vtkPolydata to vtkDataObject(class parrent)");
+BBTK_CATEGORY("empty");
+
+  BBTK_DEFAULT_ADAPTOR();
+
+  BBTK_INPUT(vtkPolyDataTovtkDataObject,In,"Input",vtkPolyData*,"");
+  BBTK_OUTPUT(vtkPolyDataTovtkDataObject,Out,"Output",vtkDataObject*,"");
+
+BBTK_END_DESCRIBE_BLACK_BOX(vtkPolyDataTovtkDataObject);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+}
+// EO namespace bbvtk
+
+#endif // __bbvtkvtkPolyDataTovtkDataObject_h_INCLUDED__
+
diff --git a/packages/wx/bbs/appli/example_ComboBox.bbg b/packages/wx/bbs/appli/example_ComboBox.bbg
new file mode 100644 (file)
index 0000000..b97fb68
--- /dev/null
@@ -0,0 +1,61 @@
+# ----------------------------------
+# - BBTKGEditor v 1.4 BBG BlackBox Diagram file
+# - /home/davila/Creatis/creaTools/creatools_source/bbtk/packages/wx/bbs/appli/example_ComboBox.bbg
+# ----------------------------------
+
+APP_START
+CATEGORY:<VOID>
+DESCRIPTION:Description ??
+AUTHOR:Author ??
+COMPLEXBOX:FALSE
+COMPLEXINPUTS:0
+BOXES:4
+BOX
+wx:ComboBox:Box00
+ISEXEC:FALSE
+-32.040827:62.309811:-900.000000
+13.534173:52.309811:-900.000000
+PORT
+In:"'uno' 'dos' 'tres' "
+FIN_BOX
+BOX
+wx:OutputText:Box01
+ISEXEC:FALSE
+-83.128966:30.711945:-900.000000
+-37.553966:20.711945:-900.000000
+FIN_BOX
+BOX
+wx:LayoutLine:Box02
+ISEXEC:TRUE
+-40.309428:0.885921:-900.000000
+17.250572:-9.114079:-900.000000
+FIN_BOX
+BOX
+wx:OutputText:Box03
+ISEXEC:FALSE
+-9.678370:32.107594:-900.000000
+35.896630:22.107594:-900.000000
+FIN_BOX
+CONNECTIONS:7
+CONNECTION
+Box00:BoxChange:Box01:BoxExecute
+NumberOfControlPoints:0
+CONNECTION
+Box00:Widget:Box02:Widget1
+NumberOfControlPoints:0
+CONNECTION
+Box01:Widget:Box02:Widget2
+NumberOfControlPoints:0
+CONNECTION
+Box00:OutString:Box03:In
+NumberOfControlPoints:0
+CONNECTION
+Box00:Out:Box01:In
+NumberOfControlPoints:0
+CONNECTION
+Box00:BoxChange:Box03:BoxExecute
+NumberOfControlPoints:0
+CONNECTION
+Box03:Widget:Box02:Widget3
+NumberOfControlPoints:0
+APP_END
diff --git a/packages/wx/bbs/appli/example_ComboBox.bbs b/packages/wx/bbs/appli/example_ComboBox.bbs
new file mode 100644 (file)
index 0000000..3d6c1f1
--- /dev/null
@@ -0,0 +1,45 @@
+# ----------------------------------
+# - BBTKGEditor v 1.4 BBS BlackBox Script
+# - /home/davila/Creatis/creaTools/creatools_source/bbtk/packages/wx/bbs/appli/example_ComboBox.bbs
+# ----------------------------------
+
+# BBTK GEditor Script
+# ----------------------
+
+include std
+include itkvtk
+include wx
+
+author "Author ??"
+description "Description ??"
+category "<VOID>"
+
+new ComboBox Box00
+  set Box00.In "'uno' 'dos' 'tres' "
+
+new OutputText Box01
+
+new LayoutLine Box02
+
+new OutputText Box03
+
+
+connect Box00.BoxChange Box01.BoxExecute
+
+connect Box00.Widget Box02.Widget1
+
+connect Box01.Widget Box02.Widget2
+
+connect Box00.OutString Box03.In
+
+connect Box00.Out Box01.In
+
+connect Box00.BoxChange Box03.BoxExecute
+
+connect Box03.Widget Box02.Widget3
+
+
+
+# Complex input ports
+message    
+exec Box02
index 0b7297e9db95571338e3538e589d0809f08cb907..e681ab8c01fa737e45f38c588c273ca6efff7c0e 100644 (file)
@@ -242,6 +242,7 @@ namespace bbwx
                                        bbGetInputReactiveOnKeystroke()
                                        );
     bbSetOutputWidget( w );
+
   }
   
 
index e66a06a432836e787a2b724a35d94186747d312e..e600f89ef99e174dfddc30d98250bab711a094fe 100644 (file)
@@ -99,7 +99,7 @@ namespace bbwx
     BBTK_BLACK_BOX_INTERFACE(CheckBox,bbtk::WxBlackBox);
     BBTK_DECLARE_INPUT(In,bool);
     BBTK_DECLARE_INPUT(Title,std::string);
-       BBTK_DECLARE_INPUT(ReactiveOnKeystroke,int);
+    BBTK_DECLARE_INPUT(ReactiveOnKeystroke,int);
     BBTK_DECLARE_OUTPUT(Out,bool);
     BBTK_PROCESS(Process);
     BBTK_CREATE_WIDGET(CreateWidget);
index e0c22782e32490e69986645ee7a53ec9220bee25..df4ed6eebca98b56c84bfed73cadb9bb3c9679e3 100644 (file)
@@ -164,6 +164,7 @@ void wxColourPickerCtrlWidget::UpdateBox()
 
   void ColourSelectorButton::Process() 
   { 
+/*
   // The widget may not be created : have to test it before using it
     wxColourPickerCtrlWidget* w = ( wxColourPickerCtrlWidget* )bbGetOutputWidget();
     if (w) 
@@ -176,6 +177,8 @@ void wxColourPickerCtrlWidget::UpdateBox()
       // to the input (which may have changed if the user set it)
        bbSetOutputOut(bbGetInputIn());
       }
+*/
+
   }
 
 
@@ -199,6 +202,7 @@ void wxColourPickerCtrlWidget::UpdateBox()
                                                                cr , cg , cb );    
     
     bbSetOutputWidget( w );
+    bbSetOutputOut(bbGetInputIn());
   }
 
 
diff --git a/packages/wx/src/bbwxComboBox.cxx b/packages/wx/src/bbwxComboBox.cxx
new file mode 100644 (file)
index 0000000..5b8ab45
--- /dev/null
@@ -0,0 +1,232 @@
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+#include "bbwxComboBox.h"
+#include "bbwxPackage.h"
+
+
+#include <vector>
+#include <string>
+
+#include <wx/choice.h>
+#include <wx/control.h>
+#include <wx/listbox.h>
+
+namespace bbwx
+{
+  //--------------------------------------------------------------------------
+  // The widget created by the box 
+  class ComboBoxWidget : public wxPanel
+  {
+  public:
+       ComboBoxWidget( ComboBox* box, wxWindow *parent, 
+                    int iSelection, 
+                    std::string title, 
+                    std::vector< std::string > lstIn, 
+                                       int typeForm );
+       ~ComboBoxWidget();
+       void OnComboBoxSelection(int iSelection);
+       void OnComboBox(wxEvent& event);
+       void FillItems( int iSelection, std::vector< std::string > lstIn);
+
+  private:
+    int                        mTypeForm;
+    ComboBox           *mBox;
+       wxListBox               *wxlistbox;
+       wxChoice                *wxchoice;
+  };
+  
+
+
+  //------------------------------------------------------------------------
+  //------------------------------------------------------------------------
+  //------------------------------------------------------------------------
+
+  //-------------------------------------------------------------------------
+  ComboBoxWidget::ComboBoxWidget( ComboBox* box,
+               wxWindow *parent,
+               int iSelection,
+               std::string title,
+               std::vector< std::string > lstIn,
+                                       int typeForm)
+    :
+    wxPanel( parent, -1) ,
+    mBox(box),
+    mTypeForm(typeForm)
+  {
+       wxPanel         *panel          = this;
+       wxlistbox                               = NULL;
+       wxchoice                                = NULL;
+       int i;
+
+    //---------------------------------------------------------------------
+    // 2) Insertion of the components in the window
+    
+    // We use a FlexGridSizer
+    wxFlexGridSizer *sizer     = new wxFlexGridSizer(1);
+    if (title!="")
+    {
+          sizer->Add( new wxStaticText(panel,-1,  bbtk::std2wx(title) ) ); 
+    }
+    sizer->AddGrowableCol(0);
+    panel->SetSizer(sizer);
+               
+    //---------------------------------------------------------------------
+    // 1) Creation de wxChoise widget
+
+               if (mTypeForm==1)
+               {
+
+                       wxlistbox = new wxListBox ( panel , -1 );                       
+                       Connect( wxlistbox->GetId(), wxEVT_COMMAND_CHOICE_SELECTED, (wxObjectEventFunction) (void (wxPanel::*)(wxEvent&))&ComboBoxWidget::OnComboBox ); 
+               for (i=0;i<lstIn.size(); i++)
+               {
+                               wxlistbox->Append(  bbtk::std2wx( lstIn[i] )  ); 
+                       } // for i
+               wxlistbox->SetSelection(iSelection);
+                  sizer->Add( wxlistbox,1,wxGROW ); 
+
+               } else {
+
+                       wxchoice = new wxChoice ( panel , -1 );
+                       Connect( wxchoice->GetId(), wxEVT_COMMAND_CHOICE_SELECTED, (wxObjectEventFunction) (void (wxPanel::*)(wxEvent&))&ComboBoxWidget::OnComboBox ); 
+               for (i=0;i<lstIn.size(); i++)
+               {
+                               wxchoice->Append(  bbtk::std2wx( lstIn[i] )  ); 
+                       } // for i
+               wxchoice->SetSelection(iSelection);
+                  sizer->Add( wxchoice,1,wxGROW ); 
+               }
+//    panel->SetAutoLayout(true);
+//    panel->Layout();
+  }
+  //-------------------------------------------------------------------------
+  
+  ComboBoxWidget::~ComboBoxWidget()
+  {
+  }
+
+
+  //--------------------------------------------------------------------------
+  void ComboBoxWidget::OnComboBoxSelection(int iSelection)
+  {
+    mBox->bbSetInputSelection( iSelection );
+    mBox->bbSetOutputOut( iSelection );
+    mBox->bbSetOutputOutString(    bbtk::wx2std( wxchoice->GetString(iSelection) )     );
+    mBox->bbSignalOutputModification("Out");
+    mBox->bbSignalOutputModification("OutString");
+  }
+
+  //--------------------------------------------------------------------------
+  void ComboBoxWidget::OnComboBox(wxEvent& event)
+  {
+        int iSelection;
+        if (mTypeForm==1)
+        {
+                iSelection = wxlistbox->GetSelection();
+        } else {
+                iSelection = wxchoice->GetSelection();
+        }
+        OnComboBoxSelection(iSelection);
+  }
+//--------------------------------------------------------------------------
+  void ComboBoxWidget::FillItems(
+               int iSelection,
+               std::vector< std::string > lstIn
+       )
+       {
+               int i;
+               if (mTypeForm==1)
+               {
+                       wxlistbox->Clear();
+
+               for (i=0;i<lstIn.size(); i++)
+               {
+                               wxlistbox->Append(  bbtk::std2wx( lstIn[i] )  ); 
+                       } // for i
+
+               wxlistbox->SetSelection(iSelection);
+               } else {
+                       wxchoice->Clear();
+               for (i=0;i<lstIn.size(); i++)
+               {
+                               wxchoice->Append(  bbtk::std2wx( lstIn[i] )  ); 
+                       } // for i
+               wxchoice->SetSelection(iSelection);
+               } // if
+       } 
+
+BBTK_ADD_BLACK_BOX_TO_PACKAGE(wx,ComboBox)
+BBTK_BLACK_BOX_IMPLEMENTATION(ComboBox,bbtk::WxBlackBox);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void ComboBox::Process()
+{
+       int iSelection = bbGetInputSelection();
+       if (bbGetInputSelection() >= bbGetInputIn().size()) { iSelection=bbGetInputIn().size()-1; }
+       ComboBoxWidget *w = (ComboBoxWidget*)bbGetOutputWidget();
+       w->FillItems( iSelection, bbGetInputIn() );
+    bbSetInputSelection( iSelection );
+    bbSetOutputOut( iSelection );
+
+    int size = bbGetInputIn().size();
+    if         (  (iSelection>0) && ( (size-1)<=iSelection) ) 
+    { 
+       bbSetOutputOutString( bbGetInputIn()[ iSelection ] );
+    }
+//    bbSignalOutputModification("Out");
+//    bbSignalOutputModification("OutString");
+}
+
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void ComboBox::CreateWidget(wxWindow* parent)
+{
+
+//   bbSetOutputWidget( new wxStaticText ( parent , -1 , _T("") ) );
+//   bbSetOutputWidget( new wxComboBox ( parent , -1 , _T("ups") ) );  
+//   bbSetOutputWidget( new wxChoice ( parent , -1 ) );  
+
+    ComboBoxWidget *w = new ComboBoxWidget(
+                               this,
+                                                       parent,
+                               bbGetInputSelection() ,
+                               bbGetInputTitle(),
+                               bbGetInputIn(),
+                               bbGetInputForm() );
+
+   bbSetOutputOut( bbGetInputSelection() );
+   bbSetOutputOutString( bbGetInputIn()[ bbGetInputSelection() ] );
+   bbSetOutputWidget( w );
+
+
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void ComboBox::bbUserSetDefaultValues()
+{
+       bbSetInputSelection(0);
+       bbSetInputTitle("");
+       bbSetInputForm(0);
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void ComboBox::bbUserInitializeProcessing()
+{
+
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void ComboBox::bbUserFinalizeProcessing()
+{
+
+}
+}
+// EO namespace bbwx
+
+
diff --git a/packages/wx/src/bbwxComboBox.h b/packages/wx/src/bbwxComboBox.h
new file mode 100644 (file)
index 0000000..a1182f9
--- /dev/null
@@ -0,0 +1,58 @@
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+#ifdef _USE_WXWIDGETS_
+#ifndef __bbwxComboBox_h_INCLUDED__
+#define __bbwxComboBox_h_INCLUDED__
+#include "bbwx_EXPORT.h"
+#include "bbtkWxBlackBox.h"
+
+namespace bbwx
+{
+
+class bbwx_EXPORT ComboBox
+ : 
+   public bbtk::WxBlackBox
+{
+  BBTK_BLACK_BOX_INTERFACE(ComboBox,bbtk::WxBlackBox);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+  BBTK_DECLARE_INPUT(Title,std::string);
+  BBTK_DECLARE_INPUT(Selection, int );
+  BBTK_DECLARE_INPUT(In,std::vector< std::string >);
+  BBTK_DECLARE_INPUT(Form, int );
+  BBTK_DECLARE_OUTPUT(Out, int );
+  BBTK_DECLARE_OUTPUT(OutString, std::string );
+  BBTK_PROCESS(Process);
+  void Process();
+  BBTK_CREATE_WIDGET(CreateWidget);
+  void CreateWidget(wxWindow*);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+};
+
+BBTK_BEGIN_DESCRIBE_BLACK_BOX(ComboBox,bbtk::WxBlackBox);
+       BBTK_NAME("ComboBox");
+       BBTK_AUTHOR("Info-Dev");
+       BBTK_DESCRIPTION("No Description.");
+       BBTK_CATEGORY("__CategoryBlackBox__");
+       BBTK_INPUT(ComboBox,Title,"Title prepended to the text",std::string,"");
+       BBTK_INPUT(ComboBox,Selection,"i element to be selected (default 0)",int,"");
+       BBTK_INPUT(ComboBox,In,"Vector of strings",std::vector< std::string >,"");
+       BBTK_INPUT(ComboBox,Form,"0 Combobox, 1 List  (default 0)",int,"");
+
+   BBTK_OUTPUT(ComboBox,Out,"i Item selected",int,"");
+   BBTK_OUTPUT(ComboBox,OutString,"string Item selected",std::string,"");
+
+BBTK_END_DESCRIBE_BLACK_BOX(ComboBox);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+}
+// EO namespace bbwx
+
+#endif // __bbwxComboBox_h_INCLUDED__
+#endif // _USE_WXWIDGETS_
+
diff --git a/packages/wx/src/bbwxDropFiles.cxx b/packages/wx/src/bbwxDropFiles.cxx
new file mode 100644 (file)
index 0000000..62585a7
--- /dev/null
@@ -0,0 +1,107 @@
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+#include "bbwxDropFiles.h"
+#include "bbwxPackage.h"
+
+#include "bbtkWx.h"
+#include <wx/dnd.h>
+
+namespace bbwx
+{
+
+
+class WxDropFiles: public wxFileDropTarget
+{
+public:
+       WxDropFiles(DropFiles *box): mbox(box){}
+    bool OnDropFiles(wxCoord x, wxCoord y, const wxArrayString& arrFilenames);
+private:
+       DropFiles *mbox;
+};
+
+bool WxDropFiles::OnDropFiles(wxCoord WXUNUSED(x), wxCoord WXUNUSED(y), const wxArrayString& arrFilenames)
+{
+       std::vector<std::string> tmpLst;
+       int i,sizeArrFilenames=arrFilenames.GetCount();
+       for( i=0 ; i<sizeArrFilenames ; i++ )
+       {
+               std::string ss=bbtk::wx2std( arrFilenames.Item(i) );
+               tmpLst.push_back( bbtk::wx2std( arrFilenames.Item(i) )  );
+       }
+
+       mbox->bbSetOutputLstPaths( tmpLst );
+       mbox->bbSignalOutputModification(  );
+    return true;
+}
+
+
+BBTK_ADD_BLACK_BOX_TO_PACKAGE(wx,DropFiles)
+BBTK_BLACK_BOX_IMPLEMENTATION(DropFiles,bbtk::AtomicBlackBox);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void DropFiles::Process()
+{
+
+// THE MAIN PROCESSING METHOD BODY
+//   Here we simply set the input 'In' value to the output 'Out'
+//   And print out the output value
+// INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
+//    void bbSet{Input|Output}NAME(const TYPE&)
+//    const TYPE& bbGet{Input|Output}NAME() const 
+//    Where :
+//    * NAME is the name of the input/output
+//      (the one provided in the attribute 'name' of the tag 'input')
+//    * TYPE is the C++ type of the input/output
+//      (the one provided in the attribute 'type' of the tag 'input')
+
+//    bbSetOutputOut( bbGetInputIn() );
+//    std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
+
+       if (bbGetInputWidget()!=NULL)
+       { 
+               bbGetInputWidget()->SetDropTarget( new WxDropFiles(this) );
+       }
+  
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void DropFiles::bbUserSetDefaultValues()
+{
+
+//  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
+//    Here we initialize the input 'In' to 0
+   bbSetInputWidget(NULL);
+  
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void DropFiles::bbUserInitializeProcessing()
+{
+
+//  THE INITIALIZATION METHOD BODY :
+//    Here does nothing 
+//    but this is where you should allocate the internal/output pointers 
+//    if any 
+
+  
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void DropFiles::bbUserFinalizeProcessing()
+{
+
+//  THE FINALIZATION METHOD BODY :
+//    Here does nothing 
+//    but this is where you should desallocate the internal/output pointers 
+//    if any
+  
+}
+}
+// EO namespace bbwx
+
+
diff --git a/packages/wx/src/bbwxDropFiles.h b/packages/wx/src/bbwxDropFiles.h
new file mode 100644 (file)
index 0000000..e6a0f43
--- /dev/null
@@ -0,0 +1,52 @@
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+#ifndef __bbwxDropFiles_h_INCLUDED__
+#define __bbwxDropFiles_h_INCLUDED__
+#include "bbwx_EXPORT.h"
+#include "bbtkAtomicBlackBox.h"
+#include "iostream"
+
+#include <wx/wxprec.h>
+#ifndef WX_PRECOMP
+// Include your minimal set of headers here, or wx.h
+#include <wx/wx.h>
+#endif
+#include <wx/window.h>
+
+namespace bbwx
+{
+
+class bbwx_EXPORT DropFiles
+ : 
+   public bbtk::AtomicBlackBox
+{
+  BBTK_BLACK_BOX_INTERFACE(DropFiles,bbtk::AtomicBlackBox);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+  BBTK_DECLARE_INPUT(Widget,wxWindow*);
+  BBTK_DECLARE_OUTPUT(LstPaths,std::vector<std::string>);
+  BBTK_PROCESS(Process);
+  void Process();
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+};
+
+BBTK_BEGIN_DESCRIBE_BLACK_BOX(DropFiles,bbtk::AtomicBlackBox);
+  BBTK_NAME("DropFiles");
+  BBTK_AUTHOR("InfoDev");
+  BBTK_DESCRIPTION("No Description.");
+  BBTK_CATEGORY("empty");
+  BBTK_INPUT(DropFiles,Widget,"wxWidget",wxWindow*,"");
+  BBTK_OUTPUT(DropFiles,LstPaths,"List of paths",std::vector<std::string>,"");
+BBTK_END_DESCRIBE_BLACK_BOX(DropFiles);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+}
+// EO namespace bbwx
+
+#endif // __bbwxDropFiles_h_INCLUDED__
+
index d195b701c281c679a90446ed23b2daa835ad9173..4757485e021b57407f02fbbbf0b32b1fef04b41b 100644 (file)
@@ -111,6 +111,7 @@ namespace bbwx
     if (FD->GetReturnCode()==wxID_OK)
       {
        bbSetOutputOut( bbtk::wx2std (FD->GetPath()) );
+       bbSignalOutputModification(std::string("Out"));
       }
     else
       { 
index 84f9148778312b38cb4c275274ec8c2bbb43ea7b..888bc39dcb74663cfbac4736841737b0983597e8 100644 (file)
@@ -78,9 +78,10 @@ namespace bbwx
        }       
        
        
-  void LayoutLine::Process()
-  {
-  }
+       void LayoutLine::Process()
+       {
+               PutWinTitle();
+       }
   
        
 /*
@@ -113,14 +114,14 @@ namespace bbwx
 
          wxWindow* cw;
        if ((cw=bbCreateWidgetOfInput("Widget1",w)) != 0) sizer->Add(cw, 1, wxEXPAND, 0);
-         if ((cw=bbCreateWidgetOfInput("Widget2",w)) != 0) sizer->Add(cw, 1, wxEXPAND, 0);
-         if ((cw=bbCreateWidgetOfInput("Widget3",w)) != 0) sizer->Add(cw, 1, wxEXPAND, 0);
-         if ((cw=bbCreateWidgetOfInput("Widget4",w)) != 0) sizer->Add(cw, 1, wxEXPAND, 0);
-         if ((cw=bbCreateWidgetOfInput("Widget5",w)) != 0) sizer->Add(cw, 1, wxEXPAND, 0);
-         if ((cw=bbCreateWidgetOfInput("Widget6",w)) != 0) sizer->Add(cw, 1, wxEXPAND, 0);
-         if ((cw=bbCreateWidgetOfInput("Widget7",w)) != 0) sizer->Add(cw, 1, wxEXPAND, 0);
-         if ((cw=bbCreateWidgetOfInput("Widget8",w)) != 0) sizer->Add(cw, 1, wxEXPAND, 0);
-         if ((cw=bbCreateWidgetOfInput("Widget9",w)) != 0) sizer->Add(cw, 1, wxEXPAND, 0);
+       if ((cw=bbCreateWidgetOfInput("Widget2",w)) != 0) sizer->Add(cw, 1, wxEXPAND, 0);
+       if ((cw=bbCreateWidgetOfInput("Widget3",w)) != 0) sizer->Add(cw, 1, wxEXPAND, 0);
+       if ((cw=bbCreateWidgetOfInput("Widget4",w)) != 0) sizer->Add(cw, 1, wxEXPAND, 0);
+       if ((cw=bbCreateWidgetOfInput("Widget5",w)) != 0) sizer->Add(cw, 1, wxEXPAND, 0);
+       if ((cw=bbCreateWidgetOfInput("Widget6",w)) != 0) sizer->Add(cw, 1, wxEXPAND, 0);
+       if ((cw=bbCreateWidgetOfInput("Widget7",w)) != 0) sizer->Add(cw, 1, wxEXPAND, 0);
+       if ((cw=bbCreateWidgetOfInput("Widget8",w)) != 0) sizer->Add(cw, 1, wxEXPAND, 0);
+       if ((cw=bbCreateWidgetOfInput("Widget9",w)) != 0) sizer->Add(cw, 1, wxEXPAND, 0);
          /*
     TryInsertWindow(w,bbGetInputWidget1(),sizer);
     TryInsertWindow(w,bbGetInputWidget2(),sizer);
index 545420241d418e39938c7c96274a7c3924e30849..460dc8697c18fb9cd23e20f5e6153e8f322c6c54 100644 (file)
@@ -70,9 +70,10 @@ namespace bbwx
        {
        }       
        
-  void LayoutSplit::Process()
-  {
-  }
+       void LayoutSplit::Process()
+       {
+               PutWinTitle();
+       }
 
   void LayoutSplit::CreateWidget(wxWindow* parent)
   {
index a5be0dec3e40d220dae7049509a10c4b5d7d2d37..639281af23eb74860925699de05a7eb992397e93 100644 (file)
@@ -45,7 +45,7 @@
 #include "bbwxLayoutTab.h"
 #include "bbwxPackage.h"
 #include "bbtkUtilities.h"
-
+#include "bbtkBlackBoxInputConnector.h"
 
 
 
@@ -81,19 +81,61 @@ namespace bbwx
        {
        }
        
-       
        //-----------------------------------------------------------------     
   void LayoutTab::TryInsertWindow(wxNotebook *book, const std::string& input )
   {
     wxWindow* w = bbCreateWidgetOfInput(input,book); //panel);
     if (w!=NULL)
-      {
-       book->AddPage(w,w->GetName());
-      }
+    {
+               book->AddPage(w,w->GetName());
+    }
+  }
+
+
+  void LayoutTab::SetTitleTabs()
+  {
+
+       std::vector<std::string> vecTitle;
+       std::vector<std::string> vecInputNameWidget;
+       vecInputNameWidget.push_back("Widget1");        
+       vecInputNameWidget.push_back("Widget2");        
+       vecInputNameWidget.push_back("Widget3");        
+       vecInputNameWidget.push_back("Widget4");        
+       vecInputNameWidget.push_back("Widget5");        
+       vecInputNameWidget.push_back("Widget6");        
+       vecInputNameWidget.push_back("Widget7");        
+       vecInputNameWidget.push_back("Widget8");        
+       vecInputNameWidget.push_back("Widget9");        
+       int iWidget,sizeVecInputNameWidget= vecInputNameWidget.size();
+       for (iWidget=0; iWidget<sizeVecInputNameWidget; iWidget++)
+       {
+               bbtk::BlackBoxInputConnector* c = bbGetInputConnectorMap().find( vecInputNameWidget[iWidget] )->second ;
+       if ( c->IsConnected() )
+       {
+                       // Get black box from 
+                       BlackBox::Pointer from = c->GetConnection()->GetBlackBoxFrom();
+                       bbtk::WidgetBlackBox<wxWindow>::Pointer wfrom = boost::dynamic_pointer_cast<bbtk::WidgetBlackBox<wxWindow> >(from);
+                       vecTitle.push_back( wfrom->bbGetInputWinTitle() );
+               } // if c
+       } // for iWidget
+
+
+       wxNotebook* w = (wxNotebook*)bbGetOutputWidget();
+       if (w!=NULL) 
+       {
+               int i,size=vecTitle.size();
+               for (i=0; i<size; i++)
+               {
+                       w->SetPageText(i, wxString( vecTitle[i].c_str(),wxConvUTF8 ) ); 
+               } // for i
+       } //w
   }
 
+
   void LayoutTab::Process() 
   { 
+       PutWinTitle();
+       SetTitleTabs();
   }
   
   
index 93e415a5e5235acb125f0b00c4a858d4a6ec54a8..6ed22cc60705c686acff2a683b31c1dc035cbb0f 100644 (file)
@@ -90,6 +90,7 @@ namespace bbwx
     void OnShowWidget();
 
   protected:
+    void SetTitleTabs();
     void TryInsertWindow(wxNotebook *book, const std::string& input);
 
   };
index 2809ed26a64d386b824291554ecf56a3e86bcaa4..69a8b1f608ee29170f6694b9b98d9c82dfebfcb3 100644 (file)
@@ -23,7 +23,6 @@ namespace bbwx
 //===== 
   void StaticBox::CreateWidget(wxWindow* parent)
   {
-    std::cout << "creating..." << std::endl;
     wxPanel *w=new wxPanel(
       parent, //bbGetWxParent(),
       -1
@@ -56,7 +55,6 @@ namespace bbwx
   {
     bbSetInputBoxTitle("");
     bbSetInputBoxContent(NULL);
-    std::cout << "initialized"<<std::endl;
   }
 //===== 
 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
diff --git a/packages/wxvtk/bbs/boxes/SphereListWidget.bbg b/packages/wxvtk/bbs/boxes/SphereListWidget.bbg
new file mode 100644 (file)
index 0000000..dcbec1c
--- /dev/null
@@ -0,0 +1,199 @@
+# ----------------------------------
+# - BBTKGEditor v 1.4 BBG BlackBox Diagram file
+# - /home/davila/Creatis/All/creatools_source/bbtk/packages/wxvtk/bbs/boxes/SphereListWidget.bbg
+# ----------------------------------
+
+APP_START
+CATEGORY:<VOID>
+DESCRIPTION:Description ??
+AUTHOR:Author ??
+COMPLEXBOX:TRUE
+COMPLEXBOXNAME:SphereListWidget
+PACKAGENAME:wxvtk
+COMPLEXOUTPUTS:1
+COMPLEX_PORT
+Widget
+-85.905274:-92.354431:-900.000000
+FIN_COMPLEX_PORT
+COMPLEXINPUTS:6
+COMPLEX_PORT
+lstPointX
+8.139713:82.586776:-900.000000
+FIN_COMPLEX_PORT
+COMPLEX_PORT
+lstPointY
+24.043459:82.712003:-900.000000
+FIN_COMPLEX_PORT
+COMPLEX_PORT
+lstPointZ
+39.321073:82.461550:-900.000000
+FIN_COMPLEX_PORT
+COMPLEX_PORT
+Renderer
+-24.568408:81.683772:-900.000000
+FIN_COMPLEX_PORT
+COMPLEX_PORT
+spc
+-7.675531:83.753591:-900.000000
+FIN_COMPLEX_PORT
+COMPLEX_PORT
+WinTitle
+-55.788338:78.579533:-900.000000
+FIN_COMPLEX_PORT
+BOXES:9
+BOX
+wx:Slider:Box00
+ISEXEC:FALSE
+-167.678079:54.285621:-900.000000
+-126.609253:44.285621:-900.000000
+PORT
+In:"50"
+PORT
+Label:"true"
+PORT
+Max:"100"
+PORT
+Min:"0"
+PORT
+ReactiveOnTrack:"true"
+PORT
+Title:"Opacity4"
+FIN_BOX
+BOX
+wx:Slider:Box01
+ISEXEC:FALSE
+71.003339:58.793770:-900.000000
+103.778339:48.793770:-900.000000
+PORT
+Label:"true"
+PORT
+Max:"50"
+PORT
+Min:"1"
+PORT
+ReactiveOnTrack:"true"
+PORT
+Title:"Radio"
+FIN_BOX
+BOX
+wx:LayoutLine:Box02
+ISEXEC:FALSE
+-87.908896:-62.675787:-900.000000
+-42.333896:-72.675787:-900.000000
+PORT
+WinTitle:"Center Point"
+FIN_BOX
+BOX
+vtk:SphereList:Box03
+ISEXEC:FALSE
+-3.863333:-42.636949:-900.000000
+41.711667:-52.636949:-900.000000
+PORT
+Colour:"0.32 0.12 0.12"
+PORT
+lstPointX:"10 10"
+PORT
+lstPointY:"10 20"
+PORT
+lstPointZ:"10 30"
+PORT
+lstRadio:"10"
+FIN_BOX
+BOX
+std:Div:Box04
+ISEXEC:FALSE
+-116.710956:22.728582:-900.000000
+-83.935956:12.728582:-900.000000
+PORT
+In2:"100"
+FIN_BOX
+BOX
+std:ConcatStrings:Box05
+ISEXEC:FALSE
+50.279055:8.830270:-900.000000
+95.854055:-1.169730:-900.000000
+FIN_BOX
+BOX
+std:MultipleInputs:Box08
+ISEXEC:FALSE
+-98.614166:-13.546822:-900.000000
+-53.039166:-23.546822:-900.000000
+PORT
+BoxProcessMode:"Reactive"
+FIN_BOX
+BOX
+vtk:UpdateRender:Box07
+ISEXEC:FALSE
+-19.609381:-58.498699:-900.000000
+25.965619:-68.498699:-900.000000
+PORT
+Active:"true"
+FIN_BOX
+BOX
+std:MagicBox:Box09
+ISEXEC:FALSE
+-41.657874:42.759098:-900.000000
+3.917126:32.759098:-900.000000
+FIN_BOX
+CONNECTIONS:20
+CONNECTION
+Box00:Widget:Box02:Widget1
+NumberOfControlPoints:0
+CONNECTION
+Box01:Widget:Box02:Widget2
+NumberOfControlPoints:0
+CONNECTION
+Box02:Widget:Widget:Widget
+NumberOfControlPoints:0
+CONNECTION
+Box04:Out:Box03:Opacity
+NumberOfControlPoints:0
+CONNECTION
+Box00:Out:Box04:In1
+NumberOfControlPoints:0
+CONNECTION
+Box01:Out:Box05:In1
+NumberOfControlPoints:0
+CONNECTION
+Box00:BoxChange:Box08:In1
+NumberOfControlPoints:0
+CONNECTION
+Box08:BoxChange:Box03:BoxExecute
+NumberOfControlPoints:0
+CONNECTION
+Box08:BoxChange:Box07:BoxExecute
+NumberOfControlPoints:0
+CONNECTION
+Renderer:Renderer:Box09:In
+NumberOfControlPoints:0
+CONNECTION
+Box09:Out:Box03:Renderer
+NumberOfControlPoints:0
+CONNECTION
+Box09:Out:Box07:Renderer
+NumberOfControlPoints:0
+CONNECTION
+Box05:Out:Box03:lstRadio
+NumberOfControlPoints:0
+CONNECTION
+Box05:BoxChange:Box08:In2
+NumberOfControlPoints:0
+CONNECTION
+Box01:BoxChange:Box08:In3
+NumberOfControlPoints:0
+CONNECTION
+lstPointX:lstPointX:Box03:lstPointX
+NumberOfControlPoints:0
+CONNECTION
+lstPointY:lstPointY:Box03:lstPointY
+NumberOfControlPoints:0
+CONNECTION
+lstPointZ:lstPointZ:Box03:lstPointZ
+NumberOfControlPoints:0
+CONNECTION
+spc:spc:Box03:Spacing
+NumberOfControlPoints:0
+CONNECTION
+WinTitle:WinTitle:Box02:WinTitle
+NumberOfControlPoints:0
+APP_END
diff --git a/packages/wxvtk/bbs/boxes/SphereListWidget.bbs b/packages/wxvtk/bbs/boxes/SphereListWidget.bbs
new file mode 100644 (file)
index 0000000..584e325
--- /dev/null
@@ -0,0 +1,84 @@
+# ----------------------------------
+# - BBTKGEditor v 1.4 BBS BlackBox Script (Complex Box)
+# - /home/davila/Creatis/All/creatools_source/bbtk/packages/wxvtk/bbs/boxes/SphereListWidget.bbs
+# ----------------------------------
+
+include std
+include itkvtk
+include wx
+include vtk
+include std
+
+define SphereListWidget wxvtk
+
+author "Author ??"
+description "Description ??"
+
+category "<VOID>"
+
+new Slider Box00
+  set Box00.In "50"
+  set Box00.Label "true"
+  set Box00.Max "100"
+  set Box00.Min "0"
+  set Box00.ReactiveOnTrack "true"
+  set Box00.Title "Opacity4"
+
+new Slider Box01
+  set Box01.Label "true"
+  set Box01.Max "50"
+  set Box01.Min "1"
+  set Box01.ReactiveOnTrack "true"
+  set Box01.Title "Radio"
+
+new LayoutLine Box02
+  set Box02.WinTitle "Center Point"
+
+new SphereList Box03
+  set Box03.Colour "0.32 0.12 0.12"
+  set Box03.lstPointX "10 10"
+  set Box03.lstPointY "10 20"
+  set Box03.lstPointZ "10 30"
+  set Box03.lstRadio "10"
+
+new Div Box04
+  set Box04.In2 "100"
+
+new ConcatStrings Box05
+
+new MultipleInputs Box08
+  set Box08.BoxProcessMode "Reactive"
+
+new UpdateRender Box07
+  set Box07.Active "true"
+
+new MagicBox Box09
+
+
+connect Box00.Widget Box02.Widget1
+connect Box01.Widget Box02.Widget2
+connect Box04.Out Box03.Opacity
+connect Box00.Out Box04.In1
+connect Box01.Out Box05.In1
+connect Box00.BoxChange Box08.In1
+connect Box08.BoxChange Box03.BoxExecute
+connect Box08.BoxChange Box07.BoxExecute
+connect Box09.Out Box03.Renderer
+connect Box09.Out Box07.Renderer
+connect Box05.Out Box03.lstRadio
+connect Box05.BoxChange Box08.In2
+connect Box01.BoxChange Box08.In3
+
+# Complex input ports
+input Renderer Box09.In " "
+input lstPointX Box03.lstPointX " "
+input lstPointY Box03.lstPointY " "
+input lstPointZ Box03.lstPointZ " "
+input spc Box03.Spacing " "
+input WinTitle Box02.WinTitle " "
+
+# Complex output ports
+output Widget Box02.Widget " "
+
+
+endefine
index 0135c6f82fb9aac3deac53e031003d09546e5ce4..aeff7d93d25052c834d59038a7d934311b307236 100644 (file)
@@ -1,32 +1,6 @@
- # ---------------------------------------------------------------------
- #
- # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
- #                        pour la SantÈ)
- # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
- # Previous Authors : Laurent Guigues, Jean-Pierre Roux
- # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
- #
- #  This software is governed by the CeCILL-B license under French law and
- #  abiding by the rules of distribution of free software. You can  use,
- #  modify and/ or redistribute the software under the terms of the CeCILL-B
- #  license as circulated by CEA, CNRS and INRIA at the following URL
- #  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
- #  or in the file LICENSE.txt.
- #
- #  As a counterpart to the access to the source code and  rights to copy,
- #  modify and redistribute granted by the license, users are provided only
- #  with a limited warranty  and the software's author,  the holder of the
- #  economic rights,  and the successive licensors  have only  limited
- #  liability.
- #
- #  The fact that you are presently reading this means that you have had
- #  knowledge of the CeCILL-B license and that you accept its terms.
- # ------------------------------------------------------------------------ */
-
-
 # ----------------------------------
-# - BBTKGEditor v 1.2 BBG BlackBox Diagram file
-# - /Users/davila/Creatis/All3/creatools_source/bbtk/packages/wxvtk/bbs/boxes/bbIsoSurfaceWidget.bbg
+# - BBTKGEditor v 1.4 BBG BlackBox Diagram file
+# - bbIsoSurfaceWidget.bbg
 # ----------------------------------
 
 APP_START
@@ -36,92 +10,88 @@ AUTHOR:laurent.guigues@creatis.insa-lyon.fr
 COMPLEXBOX:TRUE
 COMPLEXBOXNAME:IsoSurfaceWidget
 PACKAGENAME:wxvtk
-COMPLEXINPUTS:9
+COMPLEXOUTPUTS:3
 COMPLEX_PORT
-Title
-283.154725:158.660509:900.000000
+Out
+58.302298:-288.767464:-900.000000
 FIN_COMPLEX_PORT
 COMPLEX_PORT
-In
--16.833633:160.323981:900.000000
+Widget
+-21.409188:-290.726543:-900.000000
 FIN_COMPLEX_PORT
 COMPLEX_PORT
-Opacity
-87.996393:158.685822:900.000000
+BoxChange
+-72.512970:-286.784432:-900.000000
 FIN_COMPLEX_PORT
+COMPLEXINPUTS:9
 COMPLEX_PORT
-Isovalue
-16.600142:158.290245:900.000000
+Title
+169.373226:99.285429:-900.000000
 FIN_COMPLEX_PORT
 COMPLEX_PORT
-Colour
-142.520044:157.855637:900.000000
+Opacity
+57.880232:97.499002:-900.000000
 FIN_COMPLEX_PORT
 COMPLEX_PORT
-BoxExecute
-238.065220:158.024186:900.000000
+Isovalue
+102.163666:96.427146:-900.000000
 FIN_COMPLEX_PORT
 COMPLEX_PORT
-Vertical
-256.961835:159.240161:900.000000
+Colour
+26.041925:107.145708:-900.000000
 FIN_COMPLEX_PORT
 COMPLEX_PORT
-vtkRenderer
-70.561849:158.455894:900.000000
+Vertical
+150.000000:100.000000:-900.000000
 FIN_COMPLEX_PORT
 COMPLEX_PORT
-maxIsovalue
-42.085827:158.422433:900.000000
+BoxExecute
+-109.766428:92.854292:-900.000000
 FIN_COMPLEX_PORT
-COMPLEXOUTPUTS:3
 COMPLEX_PORT
-Out
-123.419879:-163.996877:900.000000
+In
+250.000000:100.000000:-900.000000
 FIN_COMPLEX_PORT
 COMPLEX_PORT
-BoxChange
-163.638864:-162.837195:900.000000
+maxIsovalue
+300.000000:100.000000:-900.000000
 FIN_COMPLEX_PORT
 COMPLEX_PORT
-Widget
-200.292101:-163.464554:900.000000
+vtkRenderer
+350.000000:100.000000:-900.000000
 FIN_COMPLEX_PORT
-BOXES:9
+BOXES:10
 BOX
 wx:LayoutLine:controls
 ISEXEC:FALSE
-250.542332:-104.126603:900.000000
-308.102332:-114.126603:900.000000
+97.896195:-54.335314:-900.000000
+143.471195:-64.335314:-900.000000
 PORT
 Orientation:"HORIZONTAL"
 FIN_BOX
 BOX
-wx:LayoutLine:sliders
+vtk:IsoSurfaceExtractor:Asurface
 ISEXEC:FALSE
-182.583206:-67.170661:900.000000
-240.143206:-77.170661:900.000000
-FIN_BOX
-BOX
-vtk:IsoSurfaceExtractor:surface
-ISEXEC:FALSE
-18.126928:-122.910193:900.000000
-89.301928:-132.910193:900.000000
+43.917303:-225.853762:-900.000000
+89.492303:-235.853762:-900.000000
 FIN_BOX
 BOX
 wx:Slider:isovalue
 ISEXEC:FALSE
-10.463291:74.344052:900.000000
-61.863291:64.344052:900.000000
+98.069545:33.134653:-900.000000
+130.844545:23.134653:-900.000000
+PORT
+ChangeResolution:"true"
 PORT
-Max:5000
+Max:"5000"
 PORT
 Title:"Isovalue"
 FIN_BOX
 BOX
 wx:Slider:opacity
 ISEXEC:FALSE
-76.865190:77.834104:900.000000
-128.265190:67.834104:900.000000
+32.910163:-25.716566:-900.000000
+65.685163:-35.716566:-900.000000
 PORT
 In:"100"
 PORT
@@ -129,110 +99,148 @@ Max:"100"
 PORT
 Min:"0"
 PORT
+ReactiveOnTrack:"true"
+PORT
 Title:"Opacity"
 FIN_BOX
 BOX
-wx:LayoutLine:colourFrame
+wx:ColourSelectorButton:colour
+ISEXEC:FALSE
+5.737517:35.117885:-900.000000
+76.912517:25.117885:-900.000000
+FIN_BOX
+BOX
+std:MultipleInputs:refresh
+ISEXEC:FALSE
+-92.618071:-104.029679:-900.000000
+-47.043071:-114.029679:-900.000000
+FIN_BOX
+BOX
+std:Div:Adiv
 ISEXEC:FALSE
-207.052627:1.971466:900.000000
-264.612627:-8.028534:900.000000
+1.523741:-151.750497:-900.000000
+34.298741:-161.750497:-900.000000
 PORT
-WinTitle:"Colour"
+In2:"100"
 FIN_BOX
 BOX
-wx:ColourSelectorButton:colour
+vtk:UpdateRender:Box08
 ISEXEC:FALSE
-138.214333:79.325623:900.000000
-209.389333:69.325623:900.000000
+-38.587305:-230.303310:-900.000000
+6.987695:-240.303310:-900.000000
+PORT
+Active:"true"
 FIN_BOX
 BOX
-std:MultipleInputs:refresh
+std:MagicBox:Box09
 ISEXEC:FALSE
-145.174698:-86.754201:900.000000
-190.749698:-96.754201:900.000000
+170.465036:-148.550905:-900.000000
+216.040036:-158.550905:-900.000000
 FIN_BOX
 BOX
-std:Div:div
+wx:CheckBox:Box10
 ISEXEC:FALSE
-31.270053:4.693506:900.000000
-64.045053:-5.306494:900.000000
+134.946534:-6.270599:-900.000000
+180.521534:-16.270599:-900.000000
 PORT
-In2:"100"
+In:"false"
+PORT
+ReactiveOnKeystroke:"true"
+PORT
+Title:"Active"
 FIN_BOX
-CONNECTIONS:25
+CONNECTIONS:31
 CONNECTION
-sliders:Widget:controls:Widget1
+isovalue:Out:Asurface:Isovalue
 NumberOfControlPoints:0
 CONNECTION
-colourFrame:Widget:controls:Widget2
+opacity:Out:Adiv:In1
 NumberOfControlPoints:0
 CONNECTION
-colour:Widget:colourFrame:Widget1
+Adiv:Out:Asurface:Opacity
 NumberOfControlPoints:0
 CONNECTION
-isovalue:Widget:sliders:Widget1
+colour:Out:Asurface:Colour
 NumberOfControlPoints:0
 CONNECTION
-opacity:Widget:sliders:Widget2
+isovalue:BoxChange:refresh:In1
 NumberOfControlPoints:0
 CONNECTION
-isovalue:Out:surface:Isovalue
+opacity:BoxChange:refresh:In2
 NumberOfControlPoints:0
 CONNECTION
-opacity:Out:div:In1
+Box09:Out:Asurface:Renderer
 NumberOfControlPoints:0
 CONNECTION
-div:Out:surface:Opacity
+Box09:Out:Box08:Renderer
 NumberOfControlPoints:0
 CONNECTION
-colour:Out:surface:Colour
+Title:Title:controls:WinTitle
 NumberOfControlPoints:0
 CONNECTION
-isovalue:BoxChange:refresh:In1
+Opacity:Opacity:opacity:In
 NumberOfControlPoints:0
 CONNECTION
-opacity:BoxChange:refresh:In2
+Isovalue:Isovalue:isovalue:In
 NumberOfControlPoints:0
 CONNECTION
-colour:BoxChange:refresh:In3
+Colour:Colour:colour:In
 NumberOfControlPoints:0
 CONNECTION
-Title:Title:controls:WinTitle
+Vertical:Vertical:controls:Orientation
 NumberOfControlPoints:0
 CONNECTION
-Opacity:Opacity:opacity:In
+BoxExecute:BoxExecute:refresh:In4
 NumberOfControlPoints:0
 CONNECTION
-Isovalue:Isovalue:isovalue:In
+In:In:Asurface:In
 NumberOfControlPoints:0
 CONNECTION
-Colour:Colour:colour:In
+maxIsovalue:maxIsovalue:isovalue:Max
 NumberOfControlPoints:0
 CONNECTION
-Vertical:Vertical:controls:Orientation
+vtkRenderer:vtkRenderer:Box09:In
 NumberOfControlPoints:0
 CONNECTION
-surface:Out:Out:Out
+Asurface:Out:Out:Out
 NumberOfControlPoints:0
 CONNECTION
-refresh:Out:BoxChange:BoxChange
+controls:Widget:Widget:Widget
 NumberOfControlPoints:0
 CONNECTION
-controls:Widget:Widget:Widget
+opacity:BoxChange:refresh:BoxExecute
 NumberOfControlPoints:0
 CONNECTION
-BoxExecute:BoxExecute:refresh:In4
+refresh:BoxChange:BoxChange:BoxChange
 NumberOfControlPoints:0
 CONNECTION
-refresh:Out:surface:BoxExecute
+refresh:BoxChange:Asurface:BoxExecute
 NumberOfControlPoints:0
 CONNECTION
-vtkRenderer:vtkRenderer:surface:Renderer
+refresh:BoxChange:Box08:BoxExecute
 NumberOfControlPoints:0
 CONNECTION
-In:In:surface:In
+refresh:BoxChange:Adiv:BoxExecute
 NumberOfControlPoints:0
 CONNECTION
-maxIsovalue:maxIsovalue:isovalue:Max
+colour:BoxChange:refresh:In3
+NumberOfControlPoints:0
+CONNECTION
+Box10:BoxChange:refresh:In5
+NumberOfControlPoints:0
+CONNECTION
+Box10:Out:Asurface:active
+NumberOfControlPoints:0
+CONNECTION
+colour:Widget:controls:Widget4
+NumberOfControlPoints:0
+CONNECTION
+opacity:Widget:controls:Widget3
+NumberOfControlPoints:0
+CONNECTION
+isovalue:Widget:controls:Widget2
+NumberOfControlPoints:0
+CONNECTION
+Box10:Widget:controls:Widget1
 NumberOfControlPoints:0
 APP_END
index 8a2cfc5267a4580c5c8c9d5a44f0d9326fde311c..5e349f10b60c61c166024d1b772c4078916fbb8b 100644 (file)
@@ -1,32 +1,6 @@
- # ---------------------------------------------------------------------
- #
- # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
- #                        pour la SantÈ)
- # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
- # Previous Authors : Laurent Guigues, Jean-Pierre Roux
- # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
- #
- #  This software is governed by the CeCILL-B license under French law and
- #  abiding by the rules of distribution of free software. You can  use,
- #  modify and/ or redistribute the software under the terms of the CeCILL-B
- #  license as circulated by CEA, CNRS and INRIA at the following URL
- #  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
- #  or in the file LICENSE.txt.
- #
- #  As a counterpart to the access to the source code and  rights to copy,
- #  modify and redistribute granted by the license, users are provided only
- #  with a limited warranty  and the software's author,  the holder of the
- #  economic rights,  and the successive licensors  have only  limited
- #  liability.
- #
- #  The fact that you are presently reading this means that you have had
- #  knowledge of the CeCILL-B license and that you accept its terms.
- # ------------------------------------------------------------------------ */
-
-
 # ----------------------------------
-# - BBTKGEditor v 1.2 BBS BlackBox Script (Complex Box)
-# - /Users/davila/Creatis/All3/creatools_source/bbtk/packages/wxvtk/bbs/boxes/bbIsoSurfaceWidget.bbs
+# - BBTKGEditor v 1.4 BBS BlackBox Script (Complex Box)
+# - bbIsoSurfaceWidget.bbs
 # ----------------------------------
 
 include std
@@ -42,48 +16,60 @@ description "Image iso-surface extractor (vtk"
 
 category "image;mesh;widget;viewer"
 
-new LayoutLine controls
+new wx:LayoutLine controls
   set controls.Orientation "HORIZONTAL"
 
-new LayoutLine sliders
+new vtk:IsoSurfaceExtractor Asurface
 
-new IsoSurfaceExtractor surface
-
-new Slider isovalue
-  set isovalue.Max 5000
+new wx:Slider isovalue
+  set isovalue.ChangeResolution "true"
+  set isovalue.Max "5000"
   set isovalue.Title "Isovalue"
 
-new Slider opacity
+new wx:Slider opacity
   set opacity.In "100"
   set opacity.Max "100"
   set opacity.Min "0"
+  set opacity.ReactiveOnTrack "true"
   set opacity.Title "Opacity"
 
-new LayoutLine colourFrame
-  set colourFrame.WinTitle "Colour"
+new wx:ColourSelectorButton colour
+
+new std:MultipleInputs refresh
 
-new ColourSelectorButton colour
+new std:Div Adiv
+  set Adiv.In2 "100"
 
-new MultipleInputs refresh
+new vtk:UpdateRender Box08
+  set Box08.Active "true"
 
-new Div div
-  set div.In2 "100"
+new std:MagicBox Box09
 
+new wx:CheckBox Box10
+  set Box10.In "false"
+  set Box10.ReactiveOnKeystroke "true"
+  set Box10.Title "Active"
 
-connect sliders.Widget controls.Widget1
-connect colourFrame.Widget controls.Widget2
-connect colour.Widget colourFrame.Widget1
-connect isovalue.Widget sliders.Widget1
-connect opacity.Widget sliders.Widget2
-connect isovalue.Out surface.Isovalue
-connect opacity.Out div.In1
-connect div.Out surface.Opacity
-connect colour.Out surface.Colour
+
+connect isovalue.Out Asurface.Isovalue
+connect opacity.Out Adiv.In1
+connect Adiv.Out Asurface.Opacity
+connect colour.Out Asurface.Colour
 connect isovalue.BoxChange refresh.In1
 connect opacity.BoxChange refresh.In2
+connect Box09.Out Asurface.Renderer
+connect Box09.Out Box08.Renderer
+connect opacity.BoxChange refresh.BoxExecute
+connect refresh.BoxChange Asurface.BoxExecute
+connect refresh.BoxChange Box08.BoxExecute
+connect refresh.BoxChange Adiv.BoxExecute
 connect colour.BoxChange refresh.In3
-connect refresh.Out surface.BoxExecute
-
+connect Box10.BoxChange refresh.In5
+connect Box10.Out Asurface.active
+connect colour.Widget controls.Widget4
+connect opacity.Widget controls.Widget3
+connect isovalue.Widget controls.Widget2
+connect Box10.Widget controls.Widget1
 
 # Complex input ports
 input Title controls.WinTitle " "
@@ -92,13 +78,14 @@ input Isovalue isovalue.In " "
 input Colour colour.In " "
 input Vertical controls.Orientation " "
 input BoxExecute refresh.In4 " "
-input vtkRenderer surface.Renderer " "
-input In surface.In " "
+input In Asurface.In " "
 input maxIsovalue isovalue.Max " "
+input vtkRenderer Box09.In " "
 
 # Complex output ports
-output Out surface.Out " "
-output BoxChange refresh.Out " "
+output Out Asurface.Out " "
 output Widget controls.Widget " "
+output BoxChange refresh.BoxChange " "
+
 
 endefine