]> Creatis software - bbtk.git/commitdiff
Merge remote-tracking branch 'origin/vtk8itk4wx3-mingw64' into vtk8itk5wx3-mingw64
authorEduardo DAVILA <davila@localhost.localdomain>
Mon, 20 Apr 2020 07:28:59 +0000 (09:28 +0200)
committerEduardo DAVILA <davila@localhost.localdomain>
Mon, 20 Apr 2020 07:28:59 +0000 (09:28 +0200)
21 files changed:
kernel/cmake/BBTKConfigurePackage.cmake
kernel/cmake/BBTKConfigurePackage2.cmake
kernel/cmake/PlugPackage.bat.in [new file with mode: 0644]
kernel/src/bbtkBlackBox.cxx
kernel/src/bbtkWt.h
packages/std/src/bbstdFilesFromDirectory.cxx
packages/std/src/bbstdGetVectorElement.h
packages/std/src/bbstdSetElementVector.h
packages/toolsbbtk/bbs/boxes/imageItkPropertiesWidget.bbg
packages/toolsbbtk/bbs/boxes/imageItkPropertiesWidget.bbs
packages/toolsbbtk/bbs/boxes/imageVtkPropertiesWidget.bbg
packages/toolsbbtk/bbs/boxes/imageVtkPropertiesWidget.bbs
packages/vtk/src/bbvtkCreateImage.cxx
packages/vtk/src/bbvtkGetVectorElement.h
packages/vtk/src/bbvtkInversCrop.cxx
packages/wx/src/bbwxComboBox.cxx
packages/wx/src/bbwxComboBox.h
packages/wx/src/bbwxCommandButton.cxx
packages/wx/src/bbwxLayoutLine.cxx
packages/wx/src/bbwxLayoutTab.cxx
packages/wx/src/bbwxLayoutTab.h

index 27fea041200fcfe4e6bd148130024f4c70eccf67..d51f94925ed3cc831e2e5b43a89cc3bd533db5aa 100644 (file)
@@ -75,8 +75,13 @@ IF(NOT BBTK_CORE_PACKAGE)
     @ONLY
     )
   IF (WIN32)
-    INSTALL ( FILES ${${BBTK_PACKAGE_NAME}_BINARY_DIR}/bbtkPackage
-      DESTINATION "." )
+    CONFIGURE_FILE(
+               ${BBTK_CMAKE_DIR}/PlugPackage.bat.in
+               ${${BBTK_PACKAGE_NAME}_BINARY_DIR}/PlugPackage.bat
+               COPYONLY
+    )
+    INSTALL ( FILES ${${BBTK_PACKAGE_NAME}_BINARY_DIR}/bbtkPackage      DESTINATION  "." )
+    INSTALL ( FILES ${${BBTK_PACKAGE_NAME}_BINARY_DIR}/PlugPackage.bat  DESTINATION  "." )
   ENDIF (WIN32)
   #---------------------------------------------------------------------------
 ELSE(NOT BBTK_CORE_PACKAGE)
index 4e68397cf94e7e416f97efbf1bd4b7e13d1b5e00..3e0d4781db9b8aaf0981503ee6016c0a8bacacb8 100644 (file)
@@ -82,8 +82,13 @@ IF(NOT BBTK_CORE_PACKAGE)
     @ONLY
     )
   IF (WIN32)
-    INSTALL ( FILES ${${BBTK_PACKAGE_NAME}_BINARY_DIR}/bbtkPackage
-      DESTINATION "." )
+    CONFIGURE_FILE(
+               ${BBTK_CMAKE_DIR}/PlugPackage.bat.in
+               ${${BBTK_PACKAGE_NAME}_BINARY_DIR}/PlugPackage.bat
+               COPYONLY
+    )
+    INSTALL ( FILES ${${BBTK_PACKAGE_NAME}_BINARY_DIR}/bbtkPackage      DESTINATION  "." )
+    INSTALL ( FILES ${${BBTK_PACKAGE_NAME}_BINARY_DIR}/PlugPackage.bat  DESTINATION  "." )
   ENDIF (WIN32)
   #---------------------------------------------------------------------------
 ELSE(NOT BBTK_CORE_PACKAGE)
diff --git a/kernel/cmake/PlugPackage.bat.in b/kernel/cmake/PlugPackage.bat.in
new file mode 100644 (file)
index 0000000..599df56
--- /dev/null
@@ -0,0 +1,2 @@
+bbPlugPackage  %~dp0
+pause
\ No newline at end of file
index dbab39b7cb736c860741938d46adec180e771bb6..4b000f0e65acf32f76f242175a99c702252436b0 100644 (file)
@@ -183,13 +183,11 @@ namespace bbtk
   std::string BlackBox::bbGetNameWithParent() const
   {
     if (bbmParent.lock()) 
-      {
-       return bbmParent.lock()->bbGetNameWithParent() + ":" + bbmName;
-      }
-    else 
-      {
-       return bbmName;
-      }
+       {
+               return bbmParent.lock()->bbGetNameWithParent() + ":" + bbmName;
+       } else {
+               return bbmName;
+    }
   } 
   //=========================================================================
 
index f1fcd5e39587cadf19dd470dd00b43af77723a04..360260f85e0c96cedff0f004a12d3218e3f7e224 100644 (file)
 // SIGNAL/SLOT MECHANISM 
 // FOR bbtk WINDOWS CREATION/DESTRUCTION OBSERVATION 
 // BBTKWXSIG
-#include <boost/signal.hpp>
+
+//EED 2020-03-17
+//#include <boost/signal.hpp>
+#include <boost/signals2/signal.hpp>
+
 #include <boost/bind.hpp>
 
 //typedef boost::signals::trackable SignalObserver;
@@ -145,8 +149,13 @@ namespace bbtk
     // 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 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 77dc59f1b4ae1b769b85560745fce8364e4956e5..387b5ad77aacfd7a2043b9048daed5491c20cdec 100644 (file)
@@ -54,9 +54,9 @@ void FilesFromDirectory::Process()
                DirName         = bbGetInputIn();
                /*int nbFiles = */ Explore(DirName, bbGetInputRecursive(), bbGetInputRecursiveLevel() );
                CleanFilenames( DirName );
-               bbSetOutputOut(Filenames);   
-               bbSetOutputOutSimple(SimpleFilenames);   
        } // if In
+       bbSetOutputOut(Filenames);   
+       bbSetOutputOutSimple(SimpleFilenames);   
 }
 
 void FilesFromDirectory::bbUserSetDefaultValues()
@@ -293,24 +293,27 @@ if (recursiveLevel>=0){
 void FilesFromDirectory::CleanFilenames( std::string basePath )
 {
        std::string tmpString;
-       int i,ii,sizeFilenames = Filenames.size();
-       int j,sizeFileEnd = bbGetInputFileEnd().size();
-
+       int i,ii,sizeFilenames  = Filenames.size();
+       int j,sizeFileEnd               = bbGetInputFileEnd().size();
        int okEraseElement;
-       
+       int posStr;
 //Selecting just the files in the FileEnd List
        if (bbGetInputFileEnd().size()!=0)
        {
                for (i=sizeFilenames-1; i>=0; i--)
                {
-                       okEraseElement=0;
+                       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 )
+                               posStr=(Filenames[i].length()) - (bbGetInputFileEnd()[j]).length();
+                               if (posStr>=0)
                                {
-                                       okEraseElement++;
-                               } // if FileEnd
+                                       std::string tmp=Filenames[i].substr( posStr ) ;
+                                       if (bbGetInputFileEnd()[j].compare( tmp )==0 )
+                                       {
+                                               okEraseElement++;
+                                       } // if FileEnd
+                               }// if posStr
                        } // for j                                      
 
                        if (okEraseElement==0) 
@@ -319,14 +322,11 @@ void FilesFromDirectory::CleanFilenames( std::string basePath )
                        }
                } // 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)
                {
@@ -338,7 +338,6 @@ void FilesFromDirectory::CleanFilenames( std::string basePath )
                } // if spacePosition
        }
 
-
 // Alphabetical order  
        for (i=0; i<sizeFilenames; i++)
        {
@@ -352,14 +351,12 @@ void FilesFromDirectory::CleanFilenames( std::string basePath )
                } // 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
-
 }
 
 
index a15847032ad6749478ddd2a96441fd4e96e5a0af..8cc11ce50716932ea7b379161acd0ef8b72b1776 100644 (file)
@@ -66,7 +66,7 @@ namespace bbstd
   BBTK_DESCRIPTION("Gets the i-th element from the input vector ("+bbtk::TypeName<std::vector<T> >());
   typedef std::vector<T> Tvector;
   BBTK_TEMPLATE_INPUT(GetVectorElement, In,"Input",Tvector);
-  BBTK_TEMPLATE_INPUT(GetVectorElement, I, "Input",int);  
+  BBTK_TEMPLATE_INPUT(GetVectorElement, I, "iElement (default 0)",int);  
   BBTK_TEMPLATE_INPUT(GetVectorElement, ErrorValue, "ErrorValue",T);
   BBTK_TEMPLATE_OUTPUT(GetVectorElement,Out,"Output",T);
   BBTK_END_DESCRIBE_TEMPLATE_BLACK_BOX(GetVectorElement);
@@ -89,7 +89,7 @@ namespace bbstd
   template <class T>
   void GetVectorElement<T>::bbUserSetDefaultValues()
   {
-
+       bbSetInputI(0);
   }
   //=================================================================
   //=================================================================  
index be232b252047f420e52e572df78ac998414de2d3..48c215c4d9519288cff59bbed6a90cd96f44177b 100644 (file)
@@ -66,7 +66,7 @@ namespace bbstd
   BBTK_DESCRIPTION("Sets the value of the i-element ("+bbtk::TypeName<std::vector<T> >());
   typedef std::vector<T>* pTvector;
   BBTK_TEMPLATE_INPUT(SetElementVector, PVec,"Pointer to Vector",pTvector);
-  BBTK_TEMPLATE_INPUT(SetElementVector, I, "id-element",int);  
+  BBTK_TEMPLATE_INPUT(SetElementVector, I, "id-element (default 0)",int);  
   BBTK_TEMPLATE_INPUT(SetElementVector, Value, "Input Value",T);  
   BBTK_TEMPLATE_OUTPUT(SetElementVector,Vec,"Output Vector",std::vector<T>);
   BBTK_END_DESCRIBE_TEMPLATE_BLACK_BOX(SetElementVector);
@@ -89,7 +89,7 @@ namespace bbstd
   template <class T>
   void SetElementVector<T>::bbUserSetDefaultValues()
   {
-
+       bbSetInputI(0);
   }
   //=================================================================
   //=================================================================  
index b02708aae9300e03cf491a3e187ca3fa64f3cac5..c9b13c73299e70f257f5c40f9eaf03be863735b0 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/imageItkPropertiesWidget.bbg
+# - BBTKGEditor v 1.4 BBG BlackBox Diagram file
+# - /home/davila/Creatis/C10/creatools_source/bbtk/packages/toolsbbtk/bbs/boxes/imageItkPropertiesWidget.bbg
 # ----------------------------------
 
 APP_START
@@ -36,104 +10,162 @@ AUTHOR:Author ??
 COMPLEXBOX:TRUE
 COMPLEXBOXNAME:ImageItkPropertiesWidget
 PACKAGENAME:toolsbbtk
-COMPLEXINPUTS:1
-COMPLEX_PORT
-in
--80.663770:148.604993:900.000000
-FIN_COMPLEX_PORT
-COMPLEXOUTPUTS:7
+COMPLEXOUTPUTS:8
 COMPLEX_PORT
 widget
--142.967861:-58.247376:900.000000
+-142.967861:-58.247376:-900.000000
 FIN_COMPLEX_PORT
 COMPLEX_PORT
 Dimensions
--124.883681:-57.175644:900.000000
+-124.883681:-57.175644:-900.000000
 FIN_COMPLEX_PORT
 COMPLEX_PORT
 Index
--108.940640:-56.720128:900.000000
+-108.940640:-56.720128:-900.000000
 FIN_COMPLEX_PORT
 COMPLEX_PORT
 MinMax
--92.628104:-54.898845:900.000000
+-92.628104:-54.898845:-900.000000
 FIN_COMPLEX_PORT
 COMPLEX_PORT
 Size
--81.734224:-56.500886:900.000000
+-55.578467:-54.074063:-900.000000
 FIN_COMPLEX_PORT
 COMPLEX_PORT
 Spacing
--70.199528:-56.180478:900.000000
+-38.111538:-54.967067:-900.000000
 FIN_COMPLEX_PORT
 COMPLEX_PORT
 TypeName
--57.383199:-56.821294:900.000000
+-25.564856:-54.529295:-900.000000
+FIN_COMPLEX_PORT
+COMPLEX_PORT
+origin
+-75.421485:-52.421824:-900.000000
+FIN_COMPLEX_PORT
+COMPLEXINPUTS:2
+COMPLEX_PORT
+in
+-80.663770:148.604993:-900.000000
+FIN_COMPLEX_PORT
+COMPLEX_PORT
+FileName
+-13.739739:147.116939:-900.000000
 FIN_COMPLEX_PORT
-BOXES:8
+BOXES:14
 BOX
 itk:ImageProperties:Box00
 ISEXEC:FALSE
--86.392715:120.167267:900.000000
--40.817715:110.167267:900.000000
+-86.392715:120.167267:-900.000000
+-44.192715:110.167267:-900.000000
 FIN_BOX
 BOX
 wx:OutputText:Box02
 ISEXEC:FALSE
--348.493528:57.422012:900.000000
--302.918528:47.422012:900.000000
+-348.493528:57.422012:-900.000000
+-311.718528:47.422012:-900.000000
 PORT
 Title:"Dimension"
 FIN_BOX
 BOX
 wx:OutputText:Box14
 ISEXEC:FALSE
--306.197846:44.988878:900.000000
--260.622846:34.988878:900.000000
+-306.197846:44.988878:-900.000000
+-269.422846:34.988878:-900.000000
 PORT
 Title:"Index"
 FIN_BOX
 BOX
 wx:LayoutLine:Box15
 ISEXEC:FALSE
--196.596247:-31.096236:900.000000
--139.036247:-41.096236:900.000000
+-196.596247:-31.096236:-900.000000
+-139.036247:-41.096236:-900.000000
 PORT
 WinTitle:"Image Properties"
 FIN_BOX
 BOX
 wx:OutputText:Box17
 ISEXEC:FALSE
--262.616712:54.641899:900.000000
--217.041712:44.641899:900.000000
+-262.616712:54.641899:-900.000000
+-225.841712:44.641899:-900.000000
 PORT
 Title:"Size"
 FIN_BOX
 BOX
 wx:OutputText:Box20
 ISEXEC:FALSE
--232.876715:39.300084:900.000000
--187.301715:29.300084:900.000000
+-232.876715:39.300084:-900.000000
+-196.101715:29.300084:-900.000000
 PORT
 Title:"Spacing"
 FIN_BOX
 BOX
 wx:OutputText:Box22
 ISEXEC:FALSE
--191.029461:30.782065:900.000000
--145.454461:20.782065:900.000000
+-191.029461:30.782065:-900.000000
+-154.254461:20.782065:-900.000000
 PORT
 Title:"TypeName"
 FIN_BOX
 BOX
 wx:OutputText:Box26
 ISEXEC:FALSE
--166.067448:13.413901:900.000000
--120.492448:3.413901:900.000000
+-154.877098:-1.551506:-900.000000
+-118.102098:-11.551506:-900.000000
 PORT
 Title:"Min Max"
 FIN_BOX
-CONNECTIONS:20
+BOX
+wx:OutputText:Box09
+ISEXEC:FALSE
+-174.515204:12.516260:-900.000000
+-137.740204:2.516260:-900.000000
+PORT
+Title:"Origin"
+FIN_BOX
+BOX
+std:ConcatStrings:Box10
+ISEXEC:FALSE
+-15.155386:29.281210:-900.000000
+24.569614:19.281210:-900.000000
+PORT
+In2:"  "
+PORT
+In4:"  "
+FIN_BOX
+BOX
+std:GetVectorDoubleElement:Box11
+ISEXEC:FALSE
+-11.582563:52.605674:-900.000000
+39.467437:42.605674:-900.000000
+PORT
+I:"0"
+FIN_BOX
+BOX
+std:GetVectorDoubleElement:Box12
+ISEXEC:FALSE
+8.417437:72.605674:-900.000000
+59.467437:62.605674:-900.000000
+PORT
+I:"1"
+FIN_BOX
+BOX
+std:GetVectorDoubleElement:Box13
+ISEXEC:FALSE
+28.417437:92.605674:-900.000000
+79.467437:82.605674:-900.000000
+PORT
+I:"2"
+FIN_BOX
+BOX
+wx:OutputText:Box16
+ISEXEC:FALSE
+-141.887920:-15.796672:-900.000000
+-105.112920:-25.796672:-900.000000
+PORT
+Title:"Name"
+FIN_BOX
+CONNECTIONS:31
 CONNECTION
 Box00:Dimension:Box02:In
 NumberOfControlPoints:0
@@ -174,9 +206,6 @@ CONNECTION
 Box22:Widget:Box15:Widget5
 NumberOfControlPoints:0
 CONNECTION
-Box26:Widget:Box15:Widget6
-NumberOfControlPoints:0
-CONNECTION
 Box00:Dimension:Dimensions:Dimensions
 NumberOfControlPoints:0
 CONNECTION
@@ -194,4 +223,40 @@ NumberOfControlPoints:0
 CONNECTION
 Box00:TypeName:TypeName:TypeName
 NumberOfControlPoints:0
+CONNECTION
+Box00:Origin:origin:origin
+NumberOfControlPoints:0
+CONNECTION
+Box09:Widget:Box15:Widget6
+NumberOfControlPoints:0
+CONNECTION
+Box00:Origin:Box13:In
+NumberOfControlPoints:0
+CONNECTION
+Box00:Origin:Box12:In
+NumberOfControlPoints:0
+CONNECTION
+Box00:Origin:Box11:In
+NumberOfControlPoints:0
+CONNECTION
+Box11:Out:Box10:In1
+NumberOfControlPoints:0
+CONNECTION
+Box12:Out:Box10:In3
+NumberOfControlPoints:0
+CONNECTION
+Box13:Out:Box10:In5
+NumberOfControlPoints:0
+CONNECTION
+Box10:Out:Box09:In
+NumberOfControlPoints:0
+CONNECTION
+Box26:Widget:Box15:Widget7
+NumberOfControlPoints:0
+CONNECTION
+Box16:Widget:Box15:Widget9
+NumberOfControlPoints:0
+CONNECTION
+FileName:FileName:Box16:In
+NumberOfControlPoints:0
 APP_END
index 7650f62d09b0060dac6da454fc927be9ae2f15d0..801c6977daeba17d92ba64bb5bbae6f85bd5931f 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/imageItkPropertiesWidget.bbs
+# - BBTKGEditor v 1.4 BBS BlackBox Script (Complex Box)
+# - /home/davila/Creatis/C10/creatools_source/bbtk/packages/toolsbbtk/bbs/boxes/imageItkPropertiesWidget.bbs
 # ----------------------------------
 
 include std
 include itkvtk
 include itk
 include wx
+include std
 
 define ImageItkPropertiesWidget toolsbbtk
 
@@ -41,29 +16,48 @@ description "Description ??"
 
 category "<VOID>"
 
-new ImageProperties Box00
+new itk:ImageProperties Box00
 
-new OutputText Box02
+new wx:OutputText Box02
   set Box02.Title "Dimension"
 
-new OutputText Box14
+new wx:OutputText Box14
   set Box14.Title "Index"
 
-new LayoutLine Box15
+new wx:LayoutLine Box15
   set Box15.WinTitle "Image Properties"
 
-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 wx:OutputText Box09
+  set Box09.Title "Origin"
+
+new std:ConcatStrings Box10
+  set Box10.In2 "  "
+  set Box10.In4 "  "
+
+new std:GetVectorDoubleElement Box11
+  set Box11.I "0"
+
+new std:GetVectorDoubleElement Box12
+  set Box12.I "1"
+
+new std:GetVectorDoubleElement Box13
+  set Box13.I "2"
+
+new wx:OutputText Box16
+  set Box16.Title "Name"
+
 
 connect Box00.Dimension Box02.In
 connect Box00.Index Box14.In
@@ -76,11 +70,20 @@ connect Box14.Widget Box15.Widget2
 connect Box17.Widget Box15.Widget3
 connect Box20.Widget Box15.Widget4
 connect Box22.Widget Box15.Widget5
-connect Box26.Widget Box15.Widget6
-
+connect Box09.Widget Box15.Widget6
+connect Box00.Origin Box13.In
+connect Box00.Origin Box12.In
+connect Box00.Origin Box11.In
+connect Box11.Out Box10.In1
+connect Box12.Out Box10.In3
+connect Box13.Out Box10.In5
+connect Box10.Out Box09.In
+connect Box26.Widget Box15.Widget7
+connect Box16.Widget Box15.Widget9
 
 # Complex input ports
 input in Box00.In " "
+input FileName Box16.In " "
 
 # Complex output ports
 output widget Box15.Widget " "
@@ -90,5 +93,7 @@ output MinMax Box00.MinMax " "
 output Size Box00.Size " "
 output Spacing Box00.Spacing " "
 output TypeName Box00.TypeName " "
+output origin Box00.Origin " "
+
 
 endefine
index 9666d1c03c8f0dae9aef2fa0b34d74d925063e82..a8242ab9e0ff91b63cf4124c8dda33bf983d7fa6 100644 (file)
@@ -1,6 +1,6 @@
 # ----------------------------------
 # - BBTKGEditor v 1.4 BBG BlackBox Diagram file
-# - imageVtkPropertiesWidget.bbg
+# - /home/davila/Creatis/C10/creatools_source/bbtk/packages/toolsbbtk/bbs/boxes/imageVtkPropertiesWidget.bbg
 # ----------------------------------
 
 APP_START
@@ -10,7 +10,7 @@ AUTHOR:Author ??
 COMPLEXBOX:TRUE
 COMPLEXBOXNAME:ImageVtkPropertiesWidget
 PACKAGENAME:toolsbbtk
-COMPLEXOUTPUTS:6
+COMPLEXOUTPUTS:7
 COMPLEX_PORT
 widget
 3.333144:-72.520645:-900.000000
@@ -25,15 +25,19 @@ MinMax
 FIN_COMPLEX_PORT
 COMPLEX_PORT
 Size
-64.566781:-70.774155:-900.000000
+76.763110:-69.490331:-900.000000
 FIN_COMPLEX_PORT
 COMPLEX_PORT
 Spacing
-76.101477:-70.453747:-900.000000
+87.976850:-69.972313:-900.000000
 FIN_COMPLEX_PORT
 COMPLEX_PORT
 TypeName
-88.917806:-71.094563:-900.000000
+98.867443:-69.650261:-900.000000
+FIN_COMPLEX_PORT
+COMPLEX_PORT
+origin
+65.467976:-67.826409:-900.000000
 FIN_COMPLEX_PORT
 COMPLEXINPUTS:3
 COMPLEX_PORT
@@ -48,12 +52,12 @@ COMPLEX_PORT
 boxExecute
 -92.186317:150.079323:-900.000000
 FIN_COMPLEX_PORT
-BOXES:10
+BOXES:15
 BOX
 wx:OutputText:Box02
 ISEXEC:FALSE
 -173.282353:46.940241:-900.000000
--127.707353:36.940241:-900.000000
+-136.507353:36.940241:-900.000000
 PORT
 Title:"Dimensions"
 FIN_BOX
@@ -61,7 +65,7 @@ BOX
 wx:OutputText:Box17
 ISEXEC:FALSE
 -81.960343:34.681383:-900.000000
--36.385343:24.681383:-900.000000
+-45.185343:24.681383:-900.000000
 PORT
 Title:"Size"
 FIN_BOX
@@ -69,7 +73,7 @@ BOX
 wx:OutputText:Box20
 ISEXEC:FALSE
 -52.452230:20.761380:-900.000000
--6.877230:10.761380:-900.000000
+-15.677230:10.761380:-900.000000
 PORT
 Title:"Spacing"
 FIN_BOX
@@ -77,7 +81,7 @@ BOX
 wx:OutputText:Box22
 ISEXEC:FALSE
 -33.844911:1.230494:-900.000000
-11.730089:-8.769506:-900.000000
+2.930089:-8.769506:-900.000000
 PORT
 Title:"TypeName"
 FIN_BOX
@@ -85,7 +89,7 @@ BOX
 wx:OutputText:Box26
 ISEXEC:FALSE
 -128.670557:28.919600:-900.000000
--83.095557:18.919600:-900.000000
+-91.895557:18.919600:-900.000000
 PORT
 Title:"Min Max"
 FIN_BOX
@@ -93,29 +97,29 @@ BOX
 vtk:ImageVtkProperties:Box09
 ISEXEC:FALSE
 14.396297:109.880107:-900.000000
-59.971297:99.880107:-900.000000
+59.746297:99.880107:-900.000000
 FIN_BOX
 BOX
 wx:OutputText:Box10
 ISEXEC:FALSE
 -196.439793:65.504307:-900.000000
--150.584398:55.504307:-900.000000
+-159.664793:55.504307:-900.000000
 PORT
 Title:"Components"
 FIN_BOX
 BOX
 wx:LayoutLine:Box11
 ISEXEC:FALSE
--69.746079:-39.358124:-900.000000
--12.186079:-49.358124:-900.000000
+-57.992403:-49.764245:-900.000000
+-0.432403:-59.764245:-900.000000
 PORT
 WinTitle:"Image properties"
 FIN_BOX
 BOX
 wx:OutputText:Box13
 ISEXEC:FALSE
--27.886899:-16.541426:-900.000000
-17.688101:-26.541426:-900.000000
+8.178439:-32.145808:-900.000000
+44.953439:-42.145808:-900.000000
 PORT
 Title:"Name"
 FIN_BOX
@@ -123,9 +127,51 @@ BOX
 std:MagicBox:Box14
 ISEXEC:FALSE
 -98.823731:125.742136:-900.000000
--53.248731:115.742136:-900.000000
+-62.748731:115.742136:-900.000000
+FIN_BOX
+BOX
+wx:OutputText:Box15
+ISEXEC:FALSE
+-27.670236:-19.010277:-900.000000
+9.104764:-29.010277:-900.000000
+PORT
+Title:"Origin"
+FIN_BOX
+BOX
+std:ConcatStrings:Box16
+ISEXEC:FALSE
+113.399842:22.194464:-900.000000
+153.124842:12.194464:-900.000000
+PORT
+In2:"  "
+PORT
+In4:"  "
+FIN_BOX
+BOX
+std:GetVectorDoubleElement:Box18
+ISEXEC:FALSE
+77.073454:52.393509:-900.000000
+128.123454:42.393509:-900.000000
+PORT
+I:"0"
+FIN_BOX
+BOX
+std:GetVectorDoubleElement:Box19
+ISEXEC:FALSE
+94.301561:68.016836:-900.000000
+145.351561:58.016836:-900.000000
+PORT
+I:"1"
+FIN_BOX
+BOX
+std:GetVectorDoubleElement:Box21
+ISEXEC:FALSE
+114.301561:88.016836:-900.000000
+165.351561:78.016836:-900.000000
+PORT
+I:"2"
 FIN_BOX
-CONNECTIONS:30
+CONNECTIONS:40
 CONNECTION
 Box09:Components:Box10:In
 NumberOfControlPoints:0
@@ -187,9 +233,6 @@ CONNECTION
 FileName:FileName:Box13:In
 NumberOfControlPoints:0
 CONNECTION
-Box13:Widget:Box11:Widget7
-NumberOfControlPoints:0
-CONNECTION
 boxExecute:boxExecute:Box14:In
 NumberOfControlPoints:0
 CONNECTION
@@ -216,4 +259,37 @@ NumberOfControlPoints:0
 CONNECTION
 Box14:Out:Box26:BoxExecute
 NumberOfControlPoints:0
+CONNECTION
+Box13:Widget:Box11:Widget9
+NumberOfControlPoints:0
+CONNECTION
+Box15:Widget:Box11:Widget7
+NumberOfControlPoints:0
+CONNECTION
+Box14:Out:Box15:BoxExecute
+NumberOfControlPoints:0
+CONNECTION
+Box09:Origin:Box18:In
+NumberOfControlPoints:0
+CONNECTION
+Box09:Origin:Box19:In
+NumberOfControlPoints:0
+CONNECTION
+Box09:Origin:Box21:In
+NumberOfControlPoints:0
+CONNECTION
+Box21:Out:Box16:In5
+NumberOfControlPoints:0
+CONNECTION
+Box18:Out:Box16:In1
+NumberOfControlPoints:0
+CONNECTION
+Box19:Out:Box16:In3
+NumberOfControlPoints:0
+CONNECTION
+Box16:Out:Box15:In
+NumberOfControlPoints:0
+CONNECTION
+Box09:Origin:origin:origin
+NumberOfControlPoints:0
 APP_END
index d4e082047b818fbecd57fd41ceb20d78ec3e7c5b..472e5f774085c2be16e77138a9076240f9f7b48b 100644 (file)
@@ -1,6 +1,6 @@
 # ----------------------------------
 # - BBTKGEditor v 1.4 BBS BlackBox Script (Complex Box)
-# - imageVtkPropertiesWidget.bbs
+# - /home/davila/Creatis/C10/creatools_source/bbtk/packages/toolsbbtk/bbs/boxes/imageVtkPropertiesWidget.bbs
 # ----------------------------------
 
 include std
@@ -44,6 +44,22 @@ new wx:OutputText Box13
 
 new std:MagicBox Box14
 
+new wx:OutputText Box15
+  set Box15.Title "Origin"
+
+new std:ConcatStrings Box16
+  set Box16.In2 "  "
+  set Box16.In4 "  "
+
+new std:GetVectorDoubleElement Box18
+  set Box18.I "0"
+
+new std:GetVectorDoubleElement Box19
+  set Box19.I "1"
+
+new std:GetVectorDoubleElement Box21
+  set Box21.I "2"
+
 
 connect Box09.Components Box10.In
 connect Box09.MinMax Box26.In
@@ -57,7 +73,6 @@ 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
@@ -66,6 +81,16 @@ connect Box14.Out Box22.BoxExecute
 connect Box14.Out Box13.BoxExecute
 connect Box14.BoxChange Box09.BoxExecute
 connect Box14.Out Box26.BoxExecute
+connect Box13.Widget Box11.Widget9
+connect Box15.Widget Box11.Widget7
+connect Box14.Out Box15.BoxExecute
+connect Box09.Origin Box18.In
+connect Box09.Origin Box19.In
+connect Box09.Origin Box21.In
+connect Box21.Out Box16.In5
+connect Box18.Out Box16.In1
+connect Box19.Out Box16.In3
+connect Box16.Out Box15.In
 
 # Complex input ports
 input in Box09.In " "
@@ -79,6 +104,7 @@ output MinMax Box09.MinMax " "
 output Size Box09.Size " "
 output Spacing Box09.Spacing " "
 output TypeName Box09.TypeName " "
+output origin Box09.Origin " "
 
 
 endefine
index c534252a5b3452d7c440b579464a69e342790b80..499d3364e26d89a9613e0af4f9a5be8ffa28b509 100644 (file)
@@ -53,97 +53,104 @@ void CreateImage::Process()
 //    * TYPE is the C++ type of the input/output
 //      (the one provided in the attribute 'type' of the tag 'input')
 
-       double  spc[3];
        int             dim[3]; 
-       int             outputformat = VTK_UNSIGNED_SHORT;
-       
-       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];
-       dim[0] =  bbGetInputDimensions()[0];
-       dim[1] =  bbGetInputDimensions()[1];
-       dim[2] =  bbGetInputDimensions()[2];
-       if ((dim[0]<=0)||(dim[1]<=0)||(dim[2]<=0))
-       {
-               dim[0]=1;
-               dim[1]=1;
-               dim[2]=1;
-       }
-       if ((spc[0]<=0)||(spc[1]<=0)||(spc[2]<=0))
-       {
-               spc[0]=1;
-               spc[1]=1;
-               spc[2]=1;
-       }
-//EED 2017-12-7
-       if (imageoutput!=NULL) {imageoutput->Delete();} 
-       imageoutput = vtkImageData::New();
-       imageoutput->Initialize();
-       imageoutput->SetSpacing( spc );
-       imageoutput->SetDimensions(  dim[0], dim[1], dim[2] );
-
-//EED 2017-01-01 Migration VTK7
-#if (VTK_MAJOR_VERSION <= 5) 
-       imageoutput->SetScalarType( outputformat );     
-       imageoutput->AllocateScalars();
-#endif
-#if (VTK_MAJOR_VERSION >= 6) 
-       imageoutput->AllocateScalars( outputformat,1 );
-#endif
-       
-       int i,j,k;
-       long sizeBlock; 
+       dim[0] = bbGetInputDimensions()[0];
+       dim[1] = bbGetInputDimensions()[1];
+       dim[2] = bbGetInputDimensions()[2];
 
-       for (i=0; i<dim[0]; i++)
+       if (imageoutput!=NULL) 
        {
-               imageoutput->SetScalarComponentFromDouble(i,0,0, 0, bbGetInputInitialValue() );
-       } // for i
-       
-       sizeBlock= dim[0] * imageoutput->GetScalarSize();
-    for (j=1; j<dim[1]; j++)
-       {
-               memcpy(  imageoutput->GetScalarPointer(0,j,0), imageoutput->GetScalarPointer()  , sizeBlock );
-       } // for j              
+               imageoutput->Delete();
+               imageoutput = NULL;
+       } // if imageoutput
 
-       sizeBlock= dim[0] * dim[1] * imageoutput->GetScalarSize();
-       for (k=0; k<dim[2]; k++)
+       if ( !((dim[0]<=0)||(dim[1]<=0)||(dim[2]<=0)) )
        {
-               memcpy(  imageoutput->GetScalarPointer(0,0,k) ,imageoutput->GetScalarPointer()  , sizeBlock );
-       } // for k
-       
-
-//EED 2017-01-01 Migration VTK7
-#if (VTK_MAJOR_VERSION <= 5) 
-       imageoutput->Update();
-#endif
-#if (VTK_MAJOR_VERSION >= 6) 
-       // ..
-#endif
+               double  spc[3];
+               int             outputformat = VTK_UNSIGNED_SHORT;
+               spc[0] = bbGetInputSpacing()[0];
+               spc[1] = bbGetInputSpacing()[1];
+               spc[2] = bbGetInputSpacing()[2];
+               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  
+
+               if ((dim[0]<=0)||(dim[1]<=0)||(dim[2]<=0))
+               {
+                       dim[0]=1;
+                       dim[1]=1;
+                       dim[2]=1;
+               }
+               if ((spc[0]<=0)||(spc[1]<=0)||(spc[2]<=0))
+               {
+                       spc[0]=1;
+                       spc[1]=1;
+                       spc[2]=1;
+               }
+               imageoutput = vtkImageData::New();
+               imageoutput->Initialize();
+               imageoutput->SetSpacing( spc );
+               imageoutput->SetDimensions(  dim[0], dim[1], dim[2] );
+
+       //EED 2017-01-01 Migration VTK7
+       #if (VTK_MAJOR_VERSION <= 5) 
+               imageoutput->SetScalarType( outputformat );     
+               imageoutput->AllocateScalars();
+       #endif
+       #if (VTK_MAJOR_VERSION >= 6) 
+               imageoutput->AllocateScalars( outputformat,1 );
+       #endif
+               
+               int i,j,k;
+               long sizeBlock; 
+
+               for (i=0; i<dim[0]; i++)
+               {
+                       imageoutput->SetScalarComponentFromDouble(i,0,0, 0, bbGetInputInitialValue() );
+               } // for i
+               
+               sizeBlock= dim[0] * imageoutput->GetScalarSize();
+               for (j=1; j<dim[1]; j++)
+               {
+                       memcpy(  imageoutput->GetScalarPointer(0,j,0), imageoutput->GetScalarPointer()  , sizeBlock );
+               } // for j              
+
+               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
+               
+
+       //EED 2017-01-01 Migration VTK7
+       #if (VTK_MAJOR_VERSION <= 5) 
+               imageoutput->Update();
+       #endif
+       #if (VTK_MAJOR_VERSION >= 6) 
+               // ..
+       #endif
+               imageoutput->Modified();
+       } // if dim = 0
 
-       imageoutput->Modified();
        bbSetOutputOut(imageoutput);
 }      
        
index 94903be9d375be680da86cf6c8a063ea333e6844..fd496270478ce45e35e0db4f310df4928fd565bf 100644 (file)
@@ -88,7 +88,7 @@ namespace bbvtk
   BBTK_DESCRIPTION("Gets the i-th element from the input vector ("+bbtk::TypeName<std::vector<T> >());
   typedef std::vector<T> Tvector;
   BBTK_TEMPLATE_INPUT(GetVectorElement, In,"Input",Tvector);
-  BBTK_TEMPLATE_INPUT(GetVectorElement, I, "Input",int);
+  BBTK_TEMPLATE_INPUT(GetVectorElement, I, "iElement (default 0)",int);
   BBTK_TEMPLATE_INPUT(GetVectorElement, ErrorValue, "ErrorValue",T);
   BBTK_TEMPLATE_OUTPUT(GetVectorElement,Out,"Output",T);
   BBTK_END_DESCRIBE_TEMPLATE_BLACK_BOX(GetVectorElement);
@@ -112,7 +112,7 @@ namespace bbvtk
   template <class T>
   void GetVectorElement<T>::bbUserSetDefaultValues()
   {
-
+       bbSetInputI(0);
   }
   //=================================================================
   //=================================================================  
index 9e8c578b470416080901a12985baac01141fae44..b43fa796d68ca05f3d859f3d8a6eaca78aeaab86 100644 (file)
@@ -71,8 +71,6 @@ void InversCrop::Process()
                        _imageoutput=bbGetInputImageFix();
                }
 
-
-
                // Copy the Move Image
                int j,k; 
                int px,py,pz;
@@ -87,26 +85,24 @@ void InversCrop::Process()
                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;
+                  spxM = px*(-1);
+                  px   = 0;
                }
                sizeXM = dimMoveX-spxM;
                if (px+sizeXM>=dim[0]) sizeXM=dim[0]-px;
-               sizeXM=sizeXM*bbGetInputImageFix()->GetScalarSize();
+               sizeXM = sizeXM * bbGetInputImageFix()->GetScalarSize();
                for (k=0; k<dimMoveZ; k++)
                {
                   for (j=0; j<dimMoveY; j++)
                   {
-                       py=j+bbGetInputOrigin()[1];
-                               pz=k+bbGetInputOrigin()[2];
+                       py = j+bbGetInputOrigin()[1];
+                               pz = k+bbGetInputOrigin()[2];
                                if ( (py<dim[1]) && (pz<dim[2]) &&
                                 (py>=0)    && (pz>=0)  &&
                                         (sizeXM>0) ) 
@@ -117,17 +113,15 @@ void InversCrop::Process()
                   } // for j
                } // for k
                _imageoutput->Modified();
-             } // If Image Fixe Move the same GetScalarType
-               else {
+       } else { // If Image Fixe Move the same GetScalarType
                   printf ("ERROR: InversCrop  both ImageFixe and ImageMove need the same format.\n");
                   printf ("       type ImageFix:%d   type ImageMove:%d\n", bbGetInputImageFix()->GetScalarType(), bbGetInputImageMove()->GetScalarType() );
 
              }  
-           } // If Image Fixe Move != NULL   
-            else {
-               printf ("ERROR: InversCrop  need ImageFixe and ImageMove to run.\n");
-           } 
-           bbSetOutputOut(_imageoutput);
+           } else { // If Image Fixe Move != NULL
+                       printf ("ERROR: InversCrop  need ImageFixe and ImageMove to run.\n");
+          } 
+        bbSetOutputOut(_imageoutput);
 
        } // if Active
 
index c075b701deaacff1bc4fd0753ac4fed913966bab..06ec5912e0d115e929e31be9711424aab6d10a51 100644 (file)
@@ -58,10 +58,9 @@ namespace bbwx
     mBox(box),
     mTypeForm(typeForm)
   {
-       wxPanel         *panel          = this;
        itemcontainer                   = NULL;
-       int i;
-
+       wxPanel                 *panel  = this;
+       int                     i;
     //---------------------------------------------------------------------
     // 2) Insertion of the components in the window
     
@@ -83,7 +82,6 @@ namespace bbwx
                wxChoice *wxchoice = new wxChoice ( panel , -1, wxDefaultPosition,wxSize(sizeX,sizeY));
                itemcontainer=wxchoice;
                sizer->Add( wxchoice,1,wxGROW ); 
-
                Connect( wxchoice->GetId(), 
                  wxEVT_COMMAND_CHOICE_SELECTED, (wxObjectEventFunction) (void (wxPanel::*)(wxEvent&))&ComboBoxWidget::OnComboBox ); 
        }
@@ -123,9 +121,7 @@ namespace bbwx
                mBox->bbSetOutputOut( iSelection );
                mBox->bbSetOutputOutString(    bbtk::wx2std( itemcontainer->GetString(iSelection) )     );
                mBox->bbSignalOutputModification();
-
                VerifyDeselect(iSelection);
-
                if (mTypeForm==0) 
                { 
                        wxChoice *wxchoise=(wxChoice *)itemcontainer;
@@ -138,25 +134,27 @@ namespace bbwx
        } // if iSelection
   }
 
-  //--------------------------------------------------------------------------
-  void ComboBoxWidget::OnComboBox(wxEvent& event)
-  {
+//--------------------------------------------------------------------------
+void ComboBoxWidget::OnComboBox(wxEvent& event)
+{
        OnComboBoxSelection( itemcontainer->GetSelection() );
-  }
+}
+
 //--------------------------------------------------------------------------
-  void ComboBoxWidget::FillItems( int iSelection, std::vector< std::string > lstIn )
+void ComboBoxWidget::FillItems( int iSelection, std::vector< std::string > lstIn )
+{
+       int i;
+       itemcontainer->Clear();
+       for (i=0;i<lstIn.size(); i++)
        {
-               int i;
-               itemcontainer->Clear();
-       for (i=0;i<lstIn.size(); i++)
-       {
-                       itemcontainer->Append(  bbtk::std2wx( lstIn[i] )  ); 
-               } // for i
-               if (iSelection>=0) itemcontainer->SetSelection(iSelection);
-       } 
+               itemcontainer->Append(  bbtk::std2wx( lstIn[i] )  ); 
+       } // for i
+       if (iSelection>=0) itemcontainer->SetSelection(iSelection);
+} 
 
 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)
 //===== 
@@ -174,7 +172,6 @@ void ComboBox::Process()
     { 
        bbSetOutputOutString( bbGetInputIn()[ iSelection ] );
     } // if iSelection
-
        w->VerifyDeselect(iSelection);
 }
 //===== 
@@ -191,7 +188,10 @@ void ComboBox::CreateWidget(wxWindow* parent)
                                bbGetInputForm(),
                                                        bbGetInputWinWidth(), bbGetInputWinHeight()  );
    bbSetOutputOut( bbGetInputSelection() );
-   bbSetOutputOutString( bbGetInputIn()[ bbGetInputSelection() ] );
+   if (bbGetInputIn().size()> bbGetInputSelection() )
+   {
+          bbSetOutputOutString( bbGetInputIn()[ bbGetInputSelection() ] );
+   } // if InputIn size
    bbSetOutputWidget( w );
 }
 //===== 
index 1f1578153d02c276e1994ebbd1a841ce0b3faaaf..776a89f6a66bcd9bfdf3077e12004af2f94da249 100644 (file)
@@ -23,8 +23,10 @@ class bbwx_EXPORT ComboBox
   BBTK_DECLARE_INPUT(In,std::vector< std::string >);
   BBTK_DECLARE_INPUT(Form, int );
   BBTK_DECLARE_INPUT(Deselect, bool );
+
   BBTK_DECLARE_OUTPUT(Out, int );
   BBTK_DECLARE_OUTPUT(OutString, std::string );
+
   BBTK_PROCESS(Process);
   void Process();
   BBTK_CREATE_WIDGET(CreateWidget);
index 206d90c4774c8690ceef2572c61fd86231229001..24fccf7ddee40244ce4213aba1eccfe274a6fc64 100644 (file)
@@ -118,9 +118,7 @@ namespace bbwx
            {
              // If no executer : create a totally independant interpreter
              I = bbtk::Interpreter::New();
-           }
-         else 
-           {
+           } else {
              // If executer : create an interpreter using E
              I = bbtk::Interpreter::New(E);
            }
@@ -140,17 +138,15 @@ namespace bbwx
          {
            ok=false;
            ccommand=commandstr.substr(pos1,commandstr.length()-pos1 );
-         } 
-       else 
-         {
+         }  else  {
            ccommand=commandstr.substr(pos1,pos2-pos1);
          }
        for ( i=0 ; i < ccommand.length() ; i++)
          {
            if (ccommand[i]==39) // '
-             {
-               ccommand[i]=34;  // "
-             }
+           {
+                       ccommand[i]=34;  // "
+           }
          }             
        I->InterpretLine( ccommand );
        pos1=pos2+1;
index 38c753e7c7a84688d8c8ab2737e193da24bdeca3..b166737a4dc5fb888b2061759a95ff1554913bfb 100644 (file)
@@ -98,21 +98,22 @@ namespace bbwx
   void LayoutLine::CreateWidget(wxWindow* parent)
   {
     wxBoxSizer *sizer;
-    wxPanel *w=new wxPanel(parent, //bbGetWxParent(),
-                                                  -1);
+    wxPanel *w=new wxPanel(parent, -1, wxDefaultPosition, wxSize(20,20) );
     w->SetName( bbtk::std2wx( bbGetInputWinTitle() ) );
     
     int style=0;
-    if (bbtk::Utilities::loosematch(bbGetInputOrientation(),
-                                   "0|H|HORIZONTAL")==true)  
-      { style=wxHORIZONTAL; }
-    if (bbtk::Utilities::loosematch(bbGetInputOrientation(),
-                                   "1|V|VERTICAL")==true)      
-      { style=wxVERTICAL;   }
+    if (bbtk::Utilities::loosematch(bbGetInputOrientation(), "0|H|HORIZONTAL")==true)  
+    { 
+               style=wxHORIZONTAL; 
+       } // if
+    if (bbtk::Utilities::loosematch(bbGetInputOrientation(), "1|V|VERTICAL")==true)    
+    { 
+               style=wxVERTICAL;   
+       } // if
     
     sizer      = new wxBoxSizer(style);
 
-         wxWindow* cw;
+       wxWindow* cw;
        if ((cw=bbCreateWidgetOfInput("Widget1",w)) != 0) sizer->Add(cw, 1, wxGROW, 0);
        if ((cw=bbCreateWidgetOfInput("Widget2",w)) != 0) sizer->Add(cw, 1, wxGROW, 0);
        if ((cw=bbCreateWidgetOfInput("Widget3",w)) != 0) sizer->Add(cw, 1, wxGROW, 0);
index 639281af23eb74860925699de05a7eb992397e93..3655a772c23dd7c17ce0d47d8c245b300775d623 100644 (file)
 
 namespace bbwx
 {
-  BBTK_ADD_BLACK_BOX_TO_PACKAGE(wx , LayoutTab);
+
+
+   //--------------------------------------------------------------------------
+  class TabWidget : public wxPanel
+  {
+  public:
+    TabWidget(LayoutTab* box, wxWindow *parent, long style);
+    ~TabWidget();
+    void OnTabChange( wxEvent& );
+       wxNotebook*     GetmwxNotebook();       
+  private:
+    LayoutTab  *mBox;
+    wxNotebook *mwxNotebook;
+  }; 
+
+
+  TabWidget::TabWidget(LayoutTab* box,
+                                          wxWindow *parent,long style )
+    : wxPanel( parent, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL),
+      mBox(box)
+  { 
+    wxPanel *panel     = this;
+    mwxNotebook        = new wxNotebook(panel, //bbGetWxParent(),
+                                  -1, 
+                                  wxDefaultPosition,
+                                  wxDefaultSize,
+                                  style );
+    Connect( mwxNotebook->GetId(),   wxEVT_NOTEBOOK_PAGE_CHANGED , 
+            (wxObjectEventFunction) 
+            (void (wxPanel::*)(wxEvent&))
+            &TabWidget::OnTabChange ); 
+    wxBoxSizer *sizer  = new wxBoxSizer(wxHORIZONTAL);
+    sizer -> Add( mwxNotebook,1,wxGROW,0 ); 
+    panel      -> SetSizer(sizer);
+    panel      -> SetAutoLayout(true);
+    panel      -> Layout();
+  }
   
+  TabWidget::~TabWidget()
+  {
+  }
+  
+  void TabWidget::OnTabChange( wxEvent& )
+  {
+       mBox->bbSetOutputSelection( mwxNotebook->GetSelection() );
+    mBox->bbSignalOutputModification();
+  }
 
+wxNotebook*    TabWidget::GetmwxNotebook()
+{
+       return mwxNotebook;
+}
+
+
+
+  BBTK_ADD_BLACK_BOX_TO_PACKAGE(wx , LayoutTab);
   BBTK_BLACK_BOX_IMPLEMENTATION(LayoutTab,bbtk::WxBlackBox);
   
        //-----------------------------------------------------------------     
@@ -84,17 +137,16 @@ namespace bbwx
        //-----------------------------------------------------------------     
   void LayoutTab::TryInsertWindow(wxNotebook *book, const std::string& input )
   {
-    wxWindow* w = bbCreateWidgetOfInput(input,book); //panel);
+    wxWindow* w = bbCreateWidgetOfInput(input,book); 
     if (w!=NULL)
     {
                book->AddPage(w,w->GetName());
-    }
+    } // if w
   }
 
 
-  void LayoutTab::SetTitleTabs()
-  {
-
+void LayoutTab::SetTitleTabs()
+{
        std::vector<std::string> vecTitle;
        std::vector<std::string> vecInputNameWidget;
        vecInputNameWidget.push_back("Widget1");        
@@ -119,26 +171,29 @@ namespace bbwx
                } // if c
        } // for iWidget
 
-
-       wxNotebook* w = (wxNotebook*)bbGetOutputWidget();
-       if (w!=NULL) 
+//EED2020-04-06
+//     wxNotebook* w = (wxNotebook*)bbGetOutputWidget();
+       TabWidget *tabwidget=(TabWidget*)bbGetOutputWidget();
+       if (tabwidget!=NULL)
        {
-               int i,size=vecTitle.size();
-               for (i=0; i<size; i++)
+               wxNotebook *w = tabwidget->GetmwxNotebook();
+               if (w!=NULL) 
                {
-                       w->SetPageText(i, wxString( vecTitle[i].c_str(),wxConvUTF8 ) ); 
-               } // for i
-       } //w
+                       int i,size=vecTitle.size();
+                       for (i=0; i<size; i++)
+                       {
+                               w->SetPageText(i, wxString( vecTitle[i].c_str(),wxConvUTF8 ) ); 
+                       } // for i
+               } //w
+       } // if tabwidget
   }
 
-
   void LayoutTab::Process() 
   { 
        PutWinTitle();
        SetTitleTabs();
   }
-  
-  
+    
   void LayoutTab::CreateWidget(wxWindow* parent) 
   { 
     long style = wxNB_TOP;
@@ -150,13 +205,20 @@ namespace bbwx
       { style=wxNB_BOTTOM; }
     if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"3|L|LEFT")==true)
       { style=wxNB_LEFT; }
-    wxNotebook *w = new wxNotebook(parent, //bbGetWxParent(),
-                                  -1, 
-                                  wxDefaultPosition,
-                                  wxDefaultSize,
-                                  style );
-    w->SetName( bbtk::std2wx( bbGetInputWinTitle() ) );
-    
+
+//EED2020-04-06
+//   wxNotebook *w = new wxNotebook(parent, //bbGetWxParent(),
+//                                -1, 
+//                                wxDefaultPosition,
+//                                wxDefaultSize,
+//                                style );
+//
+       TabWidget *tabwidget = new TabWidget (this, parent, style );
+    tabwidget->SetName( bbtk::std2wx( bbGetInputWinTitle() ) );    
+       wxNotebook *w = tabwidget->GetmwxNotebook();
+
+//EED2020-04-06
+//    w->SetName( bbtk::std2wx( bbGetInputWinTitle() ) );    
     TryInsertWindow(w,"Widget1");
     TryInsertWindow(w,"Widget2");
     TryInsertWindow(w,"Widget3");
@@ -166,27 +228,32 @@ namespace bbwx
     TryInsertWindow(w,"Widget7");
     TryInsertWindow(w,"Widget8");
     TryInsertWindow(w,"Widget9");
-    
-    bbSetOutputWidget( w );
+
+//EED2020-04-06
+//    bbSetOutputWidget( w );
+    bbSetOutputWidget( tabwidget );
   }
   
   
-  // This callback is necessary to get actual processing of the view 
-  // when window is shown
-  void  LayoutTab::OnShowWidget()
-  {
-    wxNotebook* w = (wxNotebook*)bbGetOutputWidget();
-    if (w) 
-      {
-       if (w->GetPageCount()>0)
-         {
-           w->SetSelection(0);
-           for (unsigned int i=0; i<w->GetPageCount(); ++i)  w->AdvanceSelection();
-         }
-      }
-    
-   
-  }
+ // This callback is necessary to get actual processing of the view 
+// when window is shown
+void  LayoutTab::OnShowWidget()
+{
+//EED2020-04-06
+//     wxNotebook* w = (wxNotebook*)bbGetOutputWidget();
+       wxNotebook* w = ((TabWidget*)bbGetOutputWidget())->GetmwxNotebook();
+       if (w) 
+       {
+               if (w->GetPageCount()>0)
+               {
+                       w->SetSelection(0);
+                       for (unsigned int i=0; i<w->GetPageCount(); ++i) 
+                       { 
+                               w->AdvanceSelection(); 
+                       } // for
+               } // if PageCount
+       } // if w    
+}
 
 
 }//namespace bbwx
index 6ed22cc60705c686acff2a683b31c1dc035cbb0f..71dae24da76d1a93878d753ed97500db112d9cfb 100644 (file)
@@ -81,6 +81,9 @@ namespace bbwx
     BBTK_DECLARE_INPUT(Widget8,wxWindow*);
     BBTK_DECLARE_INPUT(Widget9,wxWindow*);
     BBTK_DECLARE_INPUT(Orientation,std::string);
+
+    BBTK_DECLARE_OUTPUT(Selection,int); 
+
     BBTK_PROCESS(Process);
     BBTK_CREATE_WIDGET(CreateWidget);
     BBTK_ON_SHOW_WIDGET(OnShowWidget);
@@ -115,6 +118,8 @@ namespace bbwx
     BBTK_INPUT(LayoutTab,Orientation,
               "Orientation (default T), 0=T=TOP , 1=R=RIGHT , 2=B=BOTTON , 3=L=LEFT " 
               ,std::string,"");
+       BBTK_OUTPUT(LayoutTab,Selection,"Tab selection",int,""); 
+
   BBTK_END_DESCRIBE_BLACK_BOX(LayoutTab);
   //=================================================================