]> Creatis software - bbtk.git/commitdiff
#3536 Bug StringTo vtk9itk5wx3-macos
authoreduardo.davila@creatis.insa-lyon.fr <eduardo.davila@creatis.insa-lyon.fr>
Tue, 17 Jun 2025 13:03:38 +0000 (15:03 +0200)
committereduardo.davila@creatis.insa-lyon.fr <eduardo.davila@creatis.insa-lyon.fr>
Tue, 17 Jun 2025 13:03:38 +0000 (15:03 +0200)
82 files changed:
kernel/appli/bbPlugPackage/bbPlugPackage.cpp
kernel/appli/bbc/bbc.sh.in
kernel/appli/bbi/bbi.cxx
kernel/appli/bbs2cpp/bbs2.cxx
kernel/cmake/BBTKConfigurePackage.cmake
kernel/cmake/BBTKConfigurePackage_src.cmake
kernel/doc/bbtkUsersGuide/bbtkUsersGuide.tex
kernel/src/bbtkAny.h
kernel/src/bbtkBlackBox.cxx
kernel/src/bbtkBlackBox.h
kernel/src/bbtkComplexBlackBox.cxx
kernel/src/bbtkExecuter.cxx
kernel/src/bbtkInterpreterJavaScript.cxx
kernel/src/bbtkInterpreterPython.cxx
kernel/src/bbtkInterpreterVirtual.cxx
kernel/src/bbtkWidgetBlackBox.h
kernel/src/bbtkWidgetBlackBox.txx
kernel/src/bbtkWtBlackBox.cxx
kernel/src/bbtkWxBlackBox.cxx
kernel/src/bbtkWxBlackBox.h
packages/gdcmvtk/src/bbgdcmvtkGetXCoherentInfoGdcmReader.cxx
packages/gdcmvtk/src/bbgdcmvtkGetXCoherentInfoGdcmReader.h
packages/itk/CMakeLists.txt
packages/itk/src/bbitkImageRegion.cxx
packages/itk/src/bbitkImageWriter.cxx
packages/itk/src/bbitkImageWriter.h
packages/itkvtk/CMakeLists.txt
packages/kw/src/bbkwLayoutSplit.h
packages/qt/src/bbqtLayoutLine.cxx
packages/qt/src/bbqtLayoutSplit.cxx
packages/std/bbs/appli/exampleEncrypting.bbg [new file with mode: 0644]
packages/std/bbs/appli/exampleEncrypting.bbs [new file with mode: 0644]
packages/std/src/bbstdAdd.xml
packages/std/src/bbstdDiv.xml
packages/std/src/bbstdEncrypting.cxx [new file with mode: 0644]
packages/std/src/bbstdEncrypting.h [new file with mode: 0644]
packages/std/src/bbstdExecSystemCommand.cxx
packages/std/src/bbstdGetVectorElement.h
packages/std/src/bbstdMagicBox.h
packages/std/src/bbstdMultipleInputs.xml
packages/std/src/bbstdReadColumnsDouble.cxx
packages/std/src/bbstdReadColumnsInt.cxx
packages/std/src/bbstdReadColumnsString.cxx
packages/std/src/bbstdReadLinesString.h
packages/std/src/bbstdReplaceCleanString.h
packages/std/src/bbstdSplitFilePathVector.h
packages/std/src/bbstdStringTo.cxx
packages/std/src/bbstdVectorFilterDouble.cxx
packages/std/src/bbstdVectorFilterDouble.h
packages/std/src/bbstdWriteColumnsString.cxx
packages/toolsbbtk/bbs/boxes/imageVtkPropertiesWidget.bbg
packages/toolsbbtk/bbs/boxes/imageVtkPropertiesWidget.bbs
packages/vtk/CMakeLists.txt
packages/vtk/src/bbvtkBinaryOperations.cxx
packages/vtk/src/bbvtkBinaryOperations.h
packages/vtk/src/bbvtkCreateImage.h
packages/vtk/src/bbvtkGetVectorElement.h
packages/vtk/src/bbvtkImageBoundaries.cxx
packages/vtk/src/bbvtkImageVtkProperties.h
packages/vtk/src/bbvtkMagnitud.h
packages/vtk/src/bbvtkMarchingCubes.cxx
packages/vtk/src/bbvtkPlaneClipPolyData.cxx
packages/vtk/src/bbvtkProbeFilter.cxx
packages/vtk/src/bbvtkRescaleSlopeIntercept.cxx
packages/vtk/src/bbvtkStructuredPointsReader.cxx
packages/vtk/src/bbvtkTransform.cxx
packages/vtk/src/bbvtkTransform.h
packages/vtk/src/bbvtkUpdateRender.cxx
packages/wx/src/bbwxButtonSelectFilesDirectory.cxx
packages/wx/src/bbwxButtonSelectFilesDirectory.h
packages/wx/src/bbwxCheckBox.h
packages/wx/src/bbwxComboBox.h
packages/wx/src/bbwxCommandButton.h
packages/wx/src/bbwxFreeMemoryAlert.cxx
packages/wx/src/bbwxLayoutLine.cxx
packages/wx/src/bbwxLayoutLine.h
packages/wx/src/bbwxLayoutSplit.cxx
packages/wx/src/bbwxLayoutSplit.h
packages/wx/src/bbwxLayoutTab.cxx
packages/wx/src/bbwxLayoutTab.h
packages/wx/src/bbwxOutputText.xml
packages/wx/src/bbwxSlider.h

index ed0d026862dfed5f301a58c785f6649ec4a6f1fe..5d05127ec151cb0f471cbf7a9d778a4915f256ad 100644 (file)
@@ -72,13 +72,14 @@ int main(int argc, char **argv)
   
   std::string command;
     
-#ifdef __APPLE__
-        command = "source ~/.bashrc ; " + command;
-#endif
+//#ifdef __APPLE__
+//        command = "source ~/.bashrc ; " + command;
+//#endif
 
 #if defined(WIN32)
        command = "\"";
 #endif
+  command = "source ~/.bashrc_CreaTools ; " + command;
   command += ConfigurationFile::GetInstance().Get_bin_path();
   command += ConfigurationFile::GetInstance().Get_file_separator();
   command += "bbRegeneratePackageDoc";
@@ -96,13 +97,14 @@ int main(int argc, char **argv)
 
   command = "";
     
-#ifdef __APPLE__
-        command = "source ~/.bashrc ; " + command;
-#endif
+//#ifdef __APPLE__
+//        command = "source ~/.bashrc ; " + command;
+//#endif
 
 #if defined(WIN32)
   command = "\"";
 #endif
+  command = "source ~/.bashrc_CreaTools ; " + command;
   command += ConfigurationFile::GetInstance().Get_bin_path();
   command += ConfigurationFile::GetInstance().Get_file_separator();
   command += "bbRegenerateBoxesLists";
index 8b3528be965aa0a2bbe05b5372aa9e8c4f6d1f75..c994f15c051f87842bb20c8f46b96e93e48cf412 100755 (executable)
@@ -26,7 +26,7 @@
 #!/bin/bash
 # compiles bbs files
 
-source ~/.bashrc
+source ~/.bashrc_CreaTools
 
 if [ $# -lt 1 ]
     then
index c4729fc90b52f4e7fb261368c7f2a2a601a08eb0..388fb27fe1520b6d6cec9c8dc19d1ff3fb35c979 100644 (file)
@@ -219,48 +219,38 @@ bool wxBBIApp::OnInit( )
   //See http://www.wxwindows.org/faqgtk.htm#locale
   setlocale(LC_NUMERIC, "C");
 #endif
-  
   if (cmd.quiet) bbtk::MessageManager::SetMessageLevel("max",0);
   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);
-
-
   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);
-
   std::vector<std::string>::const_iterator i;
   bool error = false;
-
-
-  for (i=cmd.input_file.begin(); i!=cmd.input_file.end(); ++i) 
-    {
+    //EED 2025-01-20 Create sync mechanism windows
+    bbtk::BlackBox::bbGlobalSetInConstruction(true);
+  for (i=cmd.input_file.begin(); i!=cmd.input_file.end(); ++i)
+  {
       error = ! I->InterpretFile(*i);
       if (error) break;
-    }
+  }
+    //EED 2025-01-20 Create sync mechanism windows
+    bbtk::BlackBox::bbGlobalSetInConstruction(false);
   bool show_on_error = error && ! cmd.no_console;
   if (show_on_error) I->Show();
-
   I->SetNoExecMode(false);
-
   if (help_on_script) 
-    {
-      std::string package; 
+  {
+      std::string package;
       I->GetInterpreter()->GetExecuter()->GetFactory()->PrintHelpDescriptor("workspace",package,false);
-    }
-
-
+  }
   /*
   std::cout << "soe="<<show_on_error <<std::endl;
   std::cout << "con="<<console<<std::endl;
@@ -270,16 +260,12 @@ bool wxBBIApp::OnInit( )
     {
       I->Close();
       //      std::cout << "I->Close"<<std::endl;
-    }
-  else 
+    } else
     {
       //      std::cout << "!I->Close"<<std::endl;
     }
-       
   //   std::cout << "EO OnInit"<<std::endl;
-
   return true;
-
 }
 //==========================================================================
 
index 2b881d25ac5bf9d82e1745b3c1fccaf2ede4c15b..e206442f51d5dc3aab7d38077498b1bc8f1310f8 100644 (file)
@@ -120,20 +120,21 @@ int main(int argc, char* argv[])
                I->InterpretFile(argv[1]);
             std::vector<std::string> javascriptBBTK=  ((bbtk::InterpreterJavaScript*)(I.get()))->javascriptBBTK  ;
             FILE *ff=fopen(file.c_str(),"w+");
-            fprintf(ff,"import * as bbtk from './bbtk.js' \n" );
 //clean this code
+//            fprintf(ff,"import * as bbtk from './bbtk.js' \n" );
 //            fprintf(ff,"export  class %s{\n",fileBase.c_str() );
-            fprintf(ff,"    Run(){\n" );
+//            fprintf(ff,"    Run(){\n" );
 //clean this code
 //            fprintf(ff,"        let mCBjs  = new bbtk.ComplexBlackBox('%s')\n",fileBase.c_str());
             int i,size=javascriptBBTK.size();
             for (i=0; i<size;i++)
             {
-                fprintf(ff,"        mCBjs.%s\n", javascriptBBTK[i].c_str() );
+                //              fprintf(ff,"        mCBjs.%s\n", javascriptBBTK[i].c_str() );
+                fprintf(ff,"%s\n", javascriptBBTK[i].c_str() );
             }// for i
-            fprintf(ff,"        mCBjs.Execute()\n" );
-            fprintf(ff,"    } \n" );
-            fprintf(ff,"} \n" );
+//          fprintf(ff,"        mCBjs.Execute()\n" );
+//            fprintf(ff,"    } \n" );
+//            fprintf(ff,"} \n" );
             fclose(ff);
         } catch (bbtk::Exception e) {
             e.Print();
index cf1949eaa4996267ce0fc71231c65f818d499994..7e627cd7fe209188f1dcc64b162bd43123a56c47 100644 (file)
@@ -142,6 +142,16 @@ ENDIF(NOT ${BBTK_PACKAGE_NAME}_IN_DEPS)
 
 #---------------------------------------------------------------------------
 # Package dependencies
+
+IF(${BBTK_PACKAGE_NAME}_USE_OPENMP)
+  SET(USE_OPENMP ON CACHE BOOL "Use OPENMP" FORCE)
+  SET(${BBTK_PACKAGE_NAME}_LIBS
+    ${${BBTK_PACKAGE_NAME}_LIBS}
+    ${OpenMP_libomp_LIBRARY_crea}
+    )
+   LINK_DIRECTORIES( /opt/local/lib/libomp )
+ENDIF(${BBTK_PACKAGE_NAME}_USE_VTK)
+
 IF(${BBTK_PACKAGE_NAME}_USE_VTK)
   SET(USE_VTK ON CACHE BOOL "Use VTK" FORCE)
   SET(${BBTK_PACKAGE_NAME}_LIBS
index 9b9d9bc3b8c315031049ef8e8ea50088c48c6b48..39df9102d61e60be4b4fa4df84c1ab68765e5cda 100644 (file)
@@ -132,7 +132,7 @@ FOREACH(xmlfile ${${BBTK_PACKAGE_NAME}_XML_SOURCES})
     ADD_CUSTOM_COMMAND(
       OUTPUT ${BBFY_CXX_OUT}
       COMMAND
-      export LD_LIBRARY_PATH=${LD_LIBRARY_PATH} && echo $ENV{LD_LIBRARY_PATH} && source ~/.bashrc &&  ${BBTK_BBFY} ${xmlfile} ${BBTK_PACKAGE_NAME} ${CMAKE_CURRENT_BINARY_DIR}/ -q
+      export LD_LIBRARY_PATH=${LD_LIBRARY_PATH} && echo $ENV{LD_LIBRARY_PATH} && source ~/.bashrc_CreaTools &&  ${BBTK_BBFY} ${xmlfile} ${BBTK_PACKAGE_NAME} ${CMAKE_CURRENT_BINARY_DIR}/ -q
       DEPENDS ${xmlfile}
       ${BBTK_BBFY_DEPENDENCY} 
       )
@@ -330,7 +330,7 @@ ADD_CUSTOM_COMMAND(
 ELSE(WIN32)
     SET(LD_LIBRARY_PATH "$ENV{LD_LIBRARY_PATH}:${LIBRARY_OUTPUT_PATH}")
     ADD_CUSTOM_TARGET( bb${BBTK_PACKAGE_NAME}.bbp  ALL
-         COMMAND source ~/.bashrc && ${BBTK_BBPCONFIGURATOR} ${CMAKE_CURRENT_SOURCE_DIR}/../bbs/boxes/  ${BBTK_PACKAGE_NAME}  ${BBTK_BBS_BUILD_PATH}/
+         COMMAND source ~/.bashrc_CreaTools && ${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)
index 05b2c32228a2ae3d179f651f7a313aab07f809c5..2bbf4fbddad9161c6bbc9e27906e908e13c6de2a 100644 (file)
@@ -2108,7 +2108,7 @@ sudo make install
 
 otherwise package documentation will not be generated. \\
 
-Then update your environment variable LD\_LIBRARY\_PATH (in .bashrc if
+Then update your environment variable LD\_LIBRARY\_PATH (in .bashrc_CreaTools if
 you are using bash), to add the path to the shared library
 \texttt{libbb\emph{YourNewPackageName}.so}
 
index 9f161c97f08842ef35765a38323c2988d455fc06..4999fb8413b71214e6c7715abe951c96bdc410c5 100644 (file)
 
 namespace bbtk 
 {
-
-
-
-
-
   //=========================================================
   /// Abstract class used by the any class to store values
   class anyplaceholder
index 88cde1317bcb0f968b3d7a1222d71c5054292d06..6d0afbb20befe58cfa4b2333da35751b44da4442 100644 (file)
@@ -33,8 +33,6 @@
   Version:   $Revision: 1.56 $
 =========================================================================*/
 
-
-
 /**
  *  \file 
  *  \brief Class bbtk::BlackBox : abstract black-box interface. 
 #include "bbtkWxBlackBox.h"
 #include "bbtkWx.h"
 
+#include <chrono>
 #include <fstream>
-//#include <vector>
 
+/*
+// EED: This was tested in MacOs.
+#include <execinfo.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+void print_trace()
+{
+  void *array[10];
+  char **strings;
+  int size, i;
+  size = backtrace (array, 10);
+  strings = backtrace_symbols (array, size);
+  if (strings != NULL)
+  {
+    printf ("Obtained %d stack frames.\n", size);
+    for (i = 0; i < size; i++)
+      printf ("%s\n", strings[i]);
+  }
+  free (strings);
+}
+*/
 
 namespace bbtk
 {
+  static int bbmgInConstruction     = 0;
   static bool bbmgSomeBoxExecuting     = false;
   static bool bbmgFreezeExecution      = false;
   static std::set<BlackBox::WeakPointer> bbmgExecutionList;
@@ -156,7 +178,6 @@ namespace bbtk
   }
   //=========================================================================
 
-
   //=========================================================================
   BlackBox::~BlackBox()
   {
@@ -168,8 +189,6 @@ namespace bbtk
   }
   //=========================================================================
 
-
-
   //=========================================================================
   std::string BlackBox::bbGetFullName() const
   { 
@@ -177,8 +196,6 @@ namespace bbtk
   }
   //=========================================================================
      
-
-
   //=========================================================================
   std::string BlackBox::bbGetNameWithParent() const
   {
@@ -505,24 +522,28 @@ namespace bbtk
                             "=> BlackBox::bbSignalOutputModification("
                             <<reaction<<")"
                             <<"]"<<std::endl);
-
-    OutputConnectorMapType::iterator i;
-    for ( i  = bbGetOutputConnectorMap().begin(); 
-         i != bbGetOutputConnectorMap().end(); ++i) 
-      {
-       //      std::cout << "Stat = "
-       //<<GetIOStatusString(i->second->GetStatus())
-       //                <<std::endl;
-       // LG : CANNOT SIGNAL ONLY WHEN UPTODATE 
-       // See bbtkSampleOutputObserver
-       //      if (i->second->GetStatus()==UPTODATE) 
-       //        {
-           i->second->SignalChange(GetThisPointer<BlackBox>(),i->first); 
-           //    }
-      } // for
-
-    if (reaction) bbGlobalProcessExecutionList();
-
+    if (bbGlobalGetInConstruction()==false)
+    {
+        OutputConnectorMapType::iterator i;
+        for ( i  = bbGetOutputConnectorMap().begin();
+             i != bbGetOutputConnectorMap().end(); ++i)
+        {
+            // std::cout << "Stat = "
+            //<<GetIOStatusString(i->second->GetStatus())
+            //           <<std::endl;
+            // LG : CANNOT SIGNAL ONLY WHEN UPTODATE
+            // See bbtkSampleOutputObserver
+            // if (i->second->GetStatus()==UPTODATE)
+            //   {
+            i->second->SignalChange(GetThisPointer<BlackBox>(),i->first);
+            //   }
+        } // for
+        
+        if (reaction = true) 
+        {
+            bbGlobalProcessExecutionList();
+        } // if reaction
+    } // if bbGlobalGetInConstruction()
     bbtkBlackBoxDebugMessage("change",5,
                             "<= BlackBox::bbSignalOutputModification()"
                             <<std::endl);
@@ -538,75 +559,81 @@ namespace bbtk
                             "=> BlackBox::bbSignalOutputModification("
                             <<output<<","<<reaction<<")"
                             <<std::endl);
-    
-    OutputConnectorMapType::iterator i = 
-      bbGetOutputConnectorMap().find(output);
-
-
-    if ( i == bbGetOutputConnectorMap().end() ) 
-       {
-         bbtkError("BlackBox["<<bbGetFullName()<<"]::bbSignalOutputModification("<<output<<") : unknown output");
-       }
-
-    //    if (i->second->GetStatus()==UPTODATE) 
-    //      {
-       i->second->SignalChange(GetThisPointer<BlackBox>(),i->first); 
-       // Has to notify the output "BoxChange" also
-       if (output != "BoxChange") 
-         {
-           i = bbGetOutputConnectorMap().find("BoxChange");
-           if ( i != bbGetOutputConnectorMap().end() ) 
-             {
-               i->second->SignalChange(GetThisPointer<BlackBox>(),i->first); 
-             }
-         }
-       if (reaction) bbGlobalProcessExecutionList();
-       //      }
-
+      if (bbGlobalGetInConstruction()==false)
+      {
+          OutputConnectorMapType::iterator i =
+          bbGetOutputConnectorMap().find(output);
+          if ( i == bbGetOutputConnectorMap().end() )
+          {
+              bbtkError("BlackBox["<<bbGetFullName()<<"]::bbSignalOutputModification("<<output<<") : unknown output");
+          }
+          //    if (i->second->GetStatus()==UPTODATE)
+          //      {
+          i->second->SignalChange(GetThisPointer<BlackBox>(),i->first);
+          // Has to notify the output "BoxChange" also
+          if (output != "BoxChange")
+          {
+              i = bbGetOutputConnectorMap().find("BoxChange");
+              if ( i != bbGetOutputConnectorMap().end() )
+              {
+                  i->second->SignalChange(GetThisPointer<BlackBox>(),i->first);
+              }
+          }
+          if (reaction=true)
+          {
+              bbGlobalProcessExecutionList();
+          } // if reaction
+          //      }
+      } // if bbGlobalGetInConstruction()
        bbtkBlackBoxDebugMessage("change",5,
                             "<= BlackBox::bbSignalOutputModification("
                             <<output<<")"
                             <<std::endl);
   }  
-  //=========================================================================   
-  //=========================================================================  
+ //=========================================================================
+
+ //=========================================================================
   void BlackBox::bbSignalOutputModification(const std::vector<std::string>& output,
        bool reaction)
   {
     bbtkBlackBoxDebugMessage("change",5,
                        "=> BlackBox::bbSignalOutputModification(vector of outputs)"
 <<std::endl);
-    OutputConnectorMapType::iterator i;
-    std::vector<std::string>::const_iterator o;
-    bool changed = false;
-    for (o=output.begin();o!=output.end();++o) 
+      
+      if (bbGlobalGetInConstruction()==false)
       {
-       // the output "BoxChange" must be signaled **AFTER** all others
-       if (*o == "BoxChange") continue;
-       // Look for the connector
-       i = bbGetOutputConnectorMap().find(*o);
-       if ( i == bbGetOutputConnectorMap().end() ) 
-         {
-           bbtkError("BlackBox["<<bbGetFullName()<<"]::bbSignalOutputModification("<<*o<<") : unknown output");
-         }
-
-       //      if (i->second->GetStatus()==UPTODATE)
-       //        {
-           i->second->SignalChange(GetThisPointer<BlackBox>(),i->first); 
-           changed = true;
-           //  }
-      }
-    // Has to notify the output "BoxChange" also
-    i = bbGetOutputConnectorMap().find("BoxChange");
-    if ( changed && (i != bbGetOutputConnectorMap().end())) 
-      {
-       // if (i->second->GetStatus()==UPTODATE) 
-       //        {
-           i->second->SignalChange(GetThisPointer<BlackBox>(),i->first); 
-           if (reaction) bbGlobalProcessExecutionList();
-           //  }
-      }
-
+          
+          OutputConnectorMapType::iterator i;
+          std::vector<std::string>::const_iterator o;
+          bool changed = false;
+          for (o=output.begin();o!=output.end();++o)
+          {
+              // the output "BoxChange" must be signaled **AFTER** all others
+              if (*o == "BoxChange") continue;
+              // Look for the connector
+              i = bbGetOutputConnectorMap().find(*o);
+              if ( i == bbGetOutputConnectorMap().end() )
+              {
+                  bbtkError("BlackBox["<<bbGetFullName()<<"]::bbSignalOutputModification("<<*o<<") : unknown output");
+              }
+              
+              //       if (i->second->GetStatus()==UPTODATE)
+              //         {
+              i->second->SignalChange(GetThisPointer<BlackBox>(),i->first);
+              changed = true;
+              //  }
+          }
+          // Has to notify the output "BoxChange" also
+          i = bbGetOutputConnectorMap().find("BoxChange");
+          if ( changed && (i != bbGetOutputConnectorMap().end()))
+          {
+              // if (i->second->GetStatus()==UPTODATE)
+              //         {
+              i->second->SignalChange(GetThisPointer<BlackBox>(),i->first);
+              if (reaction) bbGlobalProcessExecutionList();
+              //  }
+          } // if changed
+      } // if inConstruction
     bbtkBlackBoxDebugMessage("change",5,
                             "<= BlackBox::bbSignalOutputModification(vector of outputs)"
                             <<std::endl);
@@ -623,10 +650,11 @@ namespace bbtk
   /// Main processing method of the box.
   void BlackBox::bbExecute(bool force)
   {
+      
     bbtkBlackBoxDebugMessage("process",2,
                             "=> BlackBox::bbExecute("<<(int)force<<")"
                             <<std::endl);
+
     // If already executing : return
     /*
     if (bbGetExecuting()) 
@@ -653,21 +681,20 @@ namespace bbtk
        {
                bbLetRecursiveExecuteManualMode = true;
     }
-         
-         
-    // Calls the main recursive execution method 
-    bbRecursiveExecute(Connection::Pointer());
-
+      
+      // Calls the main recursive execution method
+      bbRecursiveExecute(Connection::Pointer());
          
        if ( bbBoxProcessModeIsManual() ) 
        {
                bbLetRecursiveExecuteManualMode = false;
        }
-         
-         
+
     bbtkBlackBoxDebugMessage("process",2,
                             "<= BlackBox::bbExecute()"
                             <<std::endl);
+      
+      
   }
   //=========================================================================
 
@@ -748,15 +775,15 @@ namespace bbtk
                         )
                        {
 
-//printf("EED BlackBox::bbRecursiveExecute bbProcess start %s \n", bbGetFullName().c_str() );
-
+// printf("EED BlackBox::bbRecursiveExecute bbProcess start %s \n", bbGetFullName().c_str() );
+                
 //auto start = std::chrono::high_resolution_clock::now();
                 this->bbProcess();
 //auto stop       = std::chrono::high_resolution_clock::now();
-//auto duration   = duration_cast<std::chrono::microseconds>(stop - start);
+//auto duration   = std::chrono::duration_cast<std::chrono::microseconds>(stop - start);
 //printf("EED BlackBox::bbRecursiveExecute bbProcess time= %ld  %s \n", duration.count() , bbGetFullName().c_str() );
 
-//printf("EED BlackBox::bbRecursiveExecute bbProcess end %s \n", bbGetFullName().c_str() );
+// printf("EED BlackBox::bbRecursiveExecute bbProcess end %s \n", bbGetFullName().c_str() );
 
                    } // Manual analysis
                  
@@ -787,15 +814,12 @@ namespace bbtk
 
     // Shows the window if the black box has one
     this->bbShowWindow(); 
-
-         
     bbtkBlackBoxDebugMessage("process",3,
             "<= BlackBox::bbRecursiveExecute()"
             <<std::endl);
-
     bbSetExecuting(false);
     bbGlobalSetSomeBoxExecuting(wasExecuting);
-
+      
     return;
   }
   //=========================================================================
@@ -1003,28 +1027,6 @@ namespace bbtk
   } 
   //=========================================================================
  
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
   //=========================================================================
   void BlackBox::bbWriteDotInputOutputName(FILE *ff,bool inputoutput,int detail, int level)
   {
@@ -1526,8 +1528,21 @@ namespace bbtk
   }
   //=========================================================================
 
+//EED 2025-01-20 Create sync mechanism windows
+bool BlackBox::bbGlobalGetInConstruction()
+{
+    if (bbmgInConstruction>0) return true;
+    return false;
+}
 
-
+void BlackBox::bbGlobalSetInConstruction(bool b)
+{
+    if (b==true) {
+        bbmgInConstruction++;
+    } else {
+        bbmgInConstruction--;
+    }
+}
 
 }  // EO namespace bbtk
 
index 6da0d20270400ef2470e83d3d6a605e4927c4a4e..77ebcab00812dd89d5566edd3ba9b8c769bc0c21 100644 (file)
@@ -33,8 +33,6 @@
   Version:   $Revision: 1.34 $
 =========================================================================*/
 
-
-
 /**
  *  \file
  *  \brief Class bbtk::BlackBox : abstract black-box interface.
@@ -59,7 +57,6 @@
 #include <boost/bind.hpp>
 #include <boost/signals2/signal.hpp>
 
-
 #define bbtkBlackBoxMessage(key,level,mess) \
   bbtkMessage(key,level,"["<<bbGetTypeName()<<":"<<bbGetName()<<"] "<<mess)
 #define bbtkBlackBoxDebugMessage(key,level,mess)       \
@@ -77,9 +74,7 @@ namespace bbtk
   {
     BBTK_ABSTRACT_OBJECT_INTERFACE(BlackBox);
 
-
   public:
-
     //==================================================================
     // Types
     //==================================================================
@@ -98,7 +93,6 @@ namespace bbtk
     InputConnectorMapType;
     //==================================================================
 
-
     //==================================================================
     /// @name Pipeline processing methods
     ///  Methods which participate to pipeline processing.
@@ -108,16 +102,11 @@ namespace bbtk
     //@}
     //==================================================================
 
-
-
-
-
     //==================================================================
     /// Returns a pointer on a clone of the box with name <name>
     virtual BlackBox::Pointer bbClone(const std::string& name) = 0;
     //==================================================================
 
-
    //==================================================================
     /// @name General accessors
     ///  Methods which give access to general informations on the box
@@ -130,7 +119,6 @@ namespace bbtk
     const std::string& bbGetTypeName() const
       { return bbGetDescriptor()->GetTypeName(); }
 
-
     /// Returns the name of the BlackBox (instance)
     const std::string& bbGetName() const { return bbmName; }
 
@@ -146,8 +134,6 @@ namespace bbtk
     //@}
     //==================================================================
 
-
-
     //==================================================================
     /// @name Inputs/Outputs related methods
     ///  Methods related to the box inputs and outputs
@@ -165,7 +151,6 @@ namespace bbtk
     ///  Gets the data of the input called <name> as a string using an Adaptor if possible (else returns empty string)
     std::string bbGetInputAsString( const std::string &input);
 
-
    /// Sets the data of the input called <name>.
     /// If update_time is false then does not update ChangeTime of input
     virtual void bbSetInput( const std::string &name, Data data,
@@ -175,7 +160,6 @@ namespace bbtk
                                              void* data,
                                              bool update_time = true) =0;
 
-
     /// Returns true iff the BlackBox has an output of name label
     virtual bool bbHasOutput(const std::string& label) const;
     ///  Gets the output type of a given label
@@ -188,7 +172,6 @@ namespace bbtk
     ///  Sets the data of the output called <name>
     virtual void bbSetOutput( const std::string &name, Data data) = 0;
 
-
     ///  Returns the input connectors map
     InputConnectorMapType&  bbGetInputConnectorMap()
     { return mInputConnectorMap; }
@@ -202,7 +185,6 @@ namespace bbtk
     const BlackBoxInputConnector&  bbGetInputConnector(const std::string& n) const
     { return *(mInputConnectorMap.find(n)->second); }
 
-
     ///  Returns the output connectors map
     OutputConnectorMapType& bbGetOutputConnectorMap()
     { return mOutputConnectorMap; }
@@ -222,8 +204,6 @@ namespace bbtk
     /// Prints the Help on the BlackBox type
     virtual void bbGetHelp(bool full=true) const;
 
-
-
     //==================================================================
     /// @name Output signals / observers related methods
     ///  Methods related to signals emitted by outputs and the
@@ -249,7 +229,6 @@ namespace bbtk
                                OutputChangeCallbackType f);
    //==================================================================
 
-
     //==================================================================
     /// Signals that the BlackBox outputs have been modified
     /// (without marking the box as MODIFIED because its output state is ok : don't care if you understand : use it !).
@@ -284,11 +263,6 @@ namespace bbtk
    //==================================================================
     //@}
 
-
-
-
-
-
     //==================================================================
     /// @name Common inputs / outputs to all boxes
     //@{
@@ -341,7 +315,6 @@ namespace bbtk
                             bool relative_link )
     {}
 
-
     //==================================================================
     /// @name Window related methods
     //@{
@@ -365,9 +338,11 @@ namespace bbtk
 
             //@}
     //JCP 09-06-09
+      
+      static bool bbGlobalGetInConstruction();
+      static void bbGlobalSetInConstruction(bool b);
 
   protected:
-
    //==================================================================
     /// @name User redefinable methods
     ///  Virtual methods which can be redefined by inherited classes
@@ -400,7 +375,6 @@ namespace bbtk
     // @}
     //==================================================================
 
-
     //==================================================================
 
     /// Write Graphviz-dot description in file.
@@ -435,8 +409,6 @@ namespace bbtk
     BlackBox(BlackBox& from, const std::string &name);
     //==================================================================
 
-
-
     //==================================================================
     /// @name Pipeline processing methods
     ///  Methods which participate to pipeline processing.
@@ -455,7 +427,6 @@ namespace bbtk
     IOStatus bbUpdateInputs();
     //==================================================================
 
-
     //==================================================================
     /// Actual CreateWindow method (vitual)
     /// Overloaded in AtomicBlacBox and descendants
@@ -474,7 +445,6 @@ namespace bbtk
     }
     //==================================================================
 
-
    //==================================================================
     /// Actual processing method (vitual)
     /// Overloaded in AtomicBlacBox and descendants
@@ -491,7 +461,6 @@ virtual    void bbComputePostProcessStatus();
     //@}
     //==================================================================
 
-
     //==================================================================
     /// Signals that the input whose connector is c has changed
     /// and propagates the info downward
@@ -500,8 +469,6 @@ virtual    void bbComputePostProcessStatus();
                                         IOStatus s);
     //==================================================================
 
-
-
     //==================================================================
     /// @name Box con(des)struction / initi(fin)alization methods
     //@{
@@ -538,7 +505,6 @@ virtual    void bbComputePostProcessStatus();
     /// (like a constructor does)
     virtual void bbRecursiveInitializeProcessing() {}
 
-
     /// Abstract prototype of the method which
     /// calls bbUserFinalizeProcessing for its own class and then
     /// recursively calls itself for the parent black box.
@@ -588,7 +554,6 @@ virtual    void bbComputePostProcessStatus();
     //==================================================================
   protected:
 
-
      //==================================================================
     /// Black box objects have a special deleter
     /// which must take care of releasing the descriptor
@@ -624,7 +589,6 @@ virtual    void bbComputePostProcessStatus();
                              return 0; }
     //==================================================================
 
-
     //==================================================================
   private:
     //==================================================================
@@ -649,7 +613,6 @@ virtual    void bbComputePostProcessStatus();
     BlackBox::WeakPointer bbmParent;
     //==================================================================
 
-
    //==================================================================
     // ATTRIBUTES
     ///  Map that contains the output connectors of the black box
@@ -658,12 +621,10 @@ virtual    void bbComputePostProcessStatus();
     InputConnectorMapType mInputConnectorMap;
     //==================================================================
          
-         
          bool bbLetRecursiveExecuteManualMode;
  };
   // Class BlackBox
 
-
   /// Convenient macro to create output observer callbacks (freehand functions) from object and method pointer (see samples/SampleOutputObserver)
 #define BBTK_MAKE_OUTPUT_OBSERVER(OBJECT,METHOD) \
     boost::bind( METHOD, OBJECT, _1, _2, _3)
index c07ba9f383b74ef805b56f208243c17ce8aadb51..4d011212f769ec499cdec13337c1466dd0c297f6 100644 (file)
@@ -274,34 +274,27 @@ namespace bbtk
     bbtkBlackBoxDebugMessage("process",2,
                             "**> ComplexBlackBox::bbExecute()"
                             <<std::endl);
-    
-    
     Wx::BusyCursor wait;
-    
     if (mExecutionList.size() != 0) 
       {
-       
         std::vector<std::string>::const_iterator i;
         for (i=mExecutionList.begin(); 
             i!=mExecutionList.end();
             ++i) 
-         {
-           bbtkBlackBoxDebugMessage("process",3," -> Executing '"<<*i<<"'"<<std::endl);
-           mBlackBoxMap[*i]->bbExecute(force);
-         }
-      }
-    else 
-      {
-       std::map<std::string, BlackBox::Pointer>::iterator i;
-       for (i=mBlackBoxMap.begin(); i!=mBlackBoxMap.end(); ++i)
-         {
-           i->second->bbExecute(force);
-         }
-      } 
+        {
+            bbtkBlackBoxDebugMessage("process",3," -> Executing '"<<*i<<"'"<<std::endl);
+            mBlackBoxMap[*i]->bbExecute(force);
+        } // for i
+      } else {
+          std::map<std::string, BlackBox::Pointer>::iterator i;
+          for (i=mBlackBoxMap.begin(); i!=mBlackBoxMap.end(); ++i)
+          {
+              i->second->bbExecute(force);
+          } // for i
+    }
     bbtkBlackBoxDebugMessage("process",2,
                             "<** ComplexBlackBox::bbExecute()"
                             <<std::endl);
-    
   }
   //==================================================================
 
@@ -314,8 +307,6 @@ namespace bbtk
                             <<std::endl);
     
     mExecutionList.push_back( name );
-    
-    
   }
   //==================================================================
 
index 79380c4271072db6ca5671156e5cecdfae5ca706..52c553ffcc81d0ac15a15f2873fc4419089fd303 100644 (file)
@@ -349,9 +349,7 @@ namespace bbtk
         {
            GetCurrentDescriptor()->GetPrototype()->bbGetBlackBox(nodeName)->bbExecute(true);
         }
-     }
-     else 
-     {
+     } else {
         GetCurrentDescriptor()->AddToExecutionList(nodeName) ;
      }
   }
index 1927b2de196d182baad37a9a24ee7a1f30dbf099..eed5a948c1f907f8aac987507305bc60234c8d6c 100644 (file)
@@ -77,9 +77,9 @@ namespace bbtk
   {
       int pos = boxType.find( std::string(":") );
       std::string boxTypeTmp=boxType;
-      boxTypeTmp.replace(pos,1,"_");
+      boxTypeTmp.replace(pos,1,".");
       // ex:   mCB.New( bbtkBlackBox.std_ConcatString("Box10") )
-      std::string  code("New( new bbtk."+boxTypeTmp+"('"+boxName+"') )");
+      std::string  code("       this.New( new bbtk.bb"+boxTypeTmp+"('"+boxName+"') )");
       this->javascriptBBTK.push_back(code);
   }
   //=========================================================================
@@ -93,7 +93,7 @@ namespace bbtk
       const std::string &input)                        // virtual
   {
       //ex: mCB.Connection( "Box10" , "Out", "Box11", "In")
-      std::string  code("Connection('"+boxfrom+"','"+output+"','"+boxto+"','"+input+"')");
+      std::string  code("       this.Connection('"+boxfrom+"','"+output+"','"+boxto+"','"+input+"')");
       this->javascriptBBTK.push_back(code);
   }
   //=========================================================================
@@ -101,12 +101,17 @@ namespace bbtk
   //=========================================================================
   void InterpreterJavaScript::commandInput(const std::string &name,const std::string &box,const std::string &input,const std::string  &help)
   {
+      std::string  code("       this.DECLARE_INPUT('"+name+"','"+box+"."+input+"')");
+      this->javascriptBBTK.push_back(code);
+
   }
   //=========================================================================
 
   //=========================================================================
   void InterpreterJavaScript::commandOutput(const std::string &name,const std::string &box,const std::string &output,const std::string  &help)
   {
+      std::string  code("       this.DECLARE_OUTPUT('"+name+"','"+box+"."+output+"')");
+      this->javascriptBBTK.push_back(code);
   }
   //=========================================================================
 
@@ -116,7 +121,7 @@ namespace bbtk
   void InterpreterJavaScript::commandSet(const std::string &box,const std::string &input,const std::string &value) // virtual
   {
       //ex:     mCB.Set("Box10","In2","/hola.mhd")
-      std::string  code("Set('"+box+"','"+input+"','"+value+"')");
+      std::string  code("       this.Set('"+box+"','"+input+"','"+value+"')");
       this->javascriptBBTK.push_back(code);
   }
   //=========================================================================
@@ -125,6 +130,35 @@ namespace bbtk
   //=========================================================================
   void InterpreterJavaScript::commandDefine(const std::string &name,const std::string &pack,const std::string &scriptfilename) // virtual
   {
+      //            fprintf(ff,"import * as bbtk from './bbtk.js' \n" );
+
+      
+      
+          
+      this->javascriptBBTK.push_back(" ");
+      this->javascriptBBTK.push_back("import * as bbtk from '/bbtk/bbtk.js' ");
+      this->javascriptBBTK.push_back(" ");
+//      this->javascriptBBTK.push_back("export class "+pack+"_"+name+" extends bbtk.bbkernel.ComplexBlackBox {");
+      this->javascriptBBTK.push_back("export class "+name+" extends bbtk.bbkernel.ComplexBlackBox {");
+      this->javascriptBBTK.push_back(" ");
+      this->javascriptBBTK.push_back("    constructor(nameBox) {");
+      this->javascriptBBTK.push_back("        super(nameBox)");
+      this->javascriptBBTK.push_back("        this.Init()");
+      this->javascriptBBTK.push_back("    }");
+      this->javascriptBBTK.push_back(" ");
+      this->javascriptBBTK.push_back("    async Init() {");
+/*
+      this->javascriptBBTK.push_back(" ");
+      this->javascriptBBTK.push_back("from bbtk.bbtkBlackBox import *");
+      this->javascriptBBTK.push_back(" ");
+      this->javascriptBBTK.push_back("class "+pack+"_"+name+"(ComplexBlackBox):");
+      this->javascriptBBTK.push_back(" ");
+      this->javascriptBBTK.push_back("    def __init__(self, nameBox):");
+      this->javascriptBBTK.push_back("        super().__init__(nameBox)");
+      this->javascriptBBTK.push_back("        self.Init()");
+      this->javascriptBBTK.push_back(" ");
+      this->javascriptBBTK.push_back("    def Init(self):");
+*/
   }
   //=========================================================================
 
@@ -132,6 +166,8 @@ namespace bbtk
   //=========================================================================
   void InterpreterJavaScript::commandEndDefine() // virtual
   {
+      this->javascriptBBTK.push_back("    } // Init ");
+      this->javascriptBBTK.push_back("} // class");
   }
   //=========================================================================
 
@@ -140,7 +176,7 @@ namespace bbtk
   void InterpreterJavaScript::commandExec(const std::string &word) // virtual
   {
       //Ex:     mCB.AddToExecutableLst("Box13")
-      std::string  code("AddToExecutableLst('"+word+"')");
+      std::string  code("       this.AddToExecutableLst('"+word+"')");
       this->javascriptBBTK.push_back(code);
   }
   //=========================================================================
index 593b672a1cd68a12a4db83f7a9cbfacba494ef35..d5ce12a44a78278f70d1c0cbf8b85c15d8d729ca 100644 (file)
@@ -73,9 +73,9 @@ namespace bbtk
   {
       int pos = boxType.find( std::string(":") );
       std::string boxTypeTmp=boxType;
-      boxTypeTmp.replace(pos,1,"_");
+      boxTypeTmp.replace(pos,1,".");
       // ex:   mCB.New( bbtkBlackBox.std_ConcatString("Box10") )
-      std::string  code("        self.New( "+boxTypeTmp+"('"+boxName+"') )");
+      std::string  code("        self.New( bbtk.bb"+boxTypeTmp+"('"+boxName+"') )");
       this->pythonBBTK.push_back(code);
   }
   //=========================================================================
@@ -122,18 +122,22 @@ namespace bbtk
   //=========================================================================
   void InterpreterPython::commandDefine(const std::string &name,const std::string &pack,const std::string &scriptfilename) // virtual
   {
-
       this->pythonBBTK.push_back(" ");
-      this->pythonBBTK.push_back("from bbtk.bbtkBlackBox import *");
+      
+//EED2024-07-29
+//      this->pythonBBTK.push_back("from bbtk.bbtkBlackBox import *");
+//      this->pythonBBTK.push_back(" ");
+//      this->pythonBBTK.push_back("class "+pack+"_"+name+"(ComplexBlackBox):");
+      this->pythonBBTK.push_back("import bbtk.bbtk as bbtk");
       this->pythonBBTK.push_back(" ");
-      this->pythonBBTK.push_back("class "+pack+"_"+name+"(ComplexBlackBox):");
+      this->pythonBBTK.push_back("class "+name+"(bbtk.bbkernel.ComplexBlackBox):");
+      
       this->pythonBBTK.push_back(" ");
       this->pythonBBTK.push_back("    def __init__(self, nameBox):");
       this->pythonBBTK.push_back("        super().__init__(nameBox)");
       this->pythonBBTK.push_back("        self.Init()");
       this->pythonBBTK.push_back(" ");
       this->pythonBBTK.push_back("    def Init(self):");
-      
   }
   //=========================================================================
 
index 451ade9e45cabbbfea1285770f41f77aa45bec28..88d05882fadb94e153e2bade7d0a898d9fff8ecc 100644 (file)
@@ -588,8 +588,8 @@ printf("EED InterpreterVirtual::CatchUnknownException End\n");
   {
          bbtkDebugMessage("interpreter",4,"==> InterpreterVirtual::InterpretFile(\""<<filename<<"\")"<<std::endl);
 
-    bool exm = mCommandLine;
-    mCommandLine = false;
+    bool exm        = mCommandLine;
+    mCommandLine    = false;
 
     try 
     {
@@ -646,7 +646,7 @@ printf("EED InterpreterVirtual::CatchUnknownException End\n");
     bbtkDebugMessage("interpreter",4,
                     "==> InterpreterVirtual::InterpretCurrentStreams()"<<std::endl);
 
-    while (mFile.size()>0) 
+    while (mFile.size()>0)
       {
        while (!mFile.back()->eof()) {
          mLine.back()++;
@@ -876,17 +876,13 @@ printf("EED InterpreterVirtual::CatchUnknownException End\n");
          {
                  commandMessage();
 //EED Borrame      mVirtualExecuter->HelpMessages();
-         }
-        else
-         {
+         }  else  {
                commandMessage(words[1],words[2]);
 //EED Borrame          sscanf(words[2].c_str(),"%d",&level);
 //EED Borrame      mVirtualExecuter->SetMessageLevel(words[1],level);
          }
        return;
-      }
-    else 
-      {
+      } else {
        bbtkMessage("echo",2,line<<std::endl);
       }
 
@@ -1993,16 +1989,16 @@ void InterpreterVirtual::SwitchToStream( std::stringstream* stream )
     oter=ter;
     ter.c_lflag &= ~ECHO;
     ter.c_lflag &= ~ICANON;
-    ter.c_cc[VMIN]=1;
-    ter.c_cc[VTIME]=0;
+    ter.c_cc[VMIN]  = 1;
+    ter.c_cc[VTIME] = 0;
     tcsetattr(0,TCSANOW,&ter);
 #endif
 
-    mCommandLine = true;
-    bool again = true;
-    // bool insideComment = false; // for multiline comment  
-    mInsideComment = false;
-    do 
+    mCommandLine    = true;
+    bool again      = true;
+    // bool insideComment = false; // for multiline comment
+    mInsideComment  = false;
+    do
     {
       try
       {
index b0333a6985241a0d1668da493a8067fe469098d1..7e3db1ac619662a5cfdc3aaf21a1096828e049bf 100644 (file)
@@ -82,6 +82,7 @@ namespace bbtk
     BBTK_DECLARE_INPUT(WinWidth,int);
     BBTK_DECLARE_INPUT(WinHeight,int);
     BBTK_DECLARE_INPUT(WinDialog,bool);
+    BBTK_DECLARE_INPUT(WinMaximized,bool);
     BBTK_DECLARE_INPUT(WinHide,Void);
     BBTK_DECLARE_INPUT(WinClose,Void);
     BBTK_DECLARE_OUTPUT(Widget,Widget*);
@@ -107,7 +108,6 @@ namespace bbtk
     bool bbIsShown();
     //==================================================================    
  
-   
     //==================================================================    
     /// User callback for creating the widget associated to the box
     /// ** Must be defined ** in user classes
@@ -117,7 +117,6 @@ namespace bbtk
     }
     //==================================================================    
 
-         
   protected:
     
     void bbSetShown(bool);
@@ -211,32 +210,18 @@ namespace bbtk
   BBTK_NAME("WidgetBlackBox_"+HumanTypeName<T>());
   // BBTK_DESCRIPTION("Widget box. The inputs marked with (*) are only used if the widget is not inserted in another widget.\n");
   BBTK_CATEGORY("widget");
-  BBTK_TEMPLATE_INPUT(WidgetBlackBox,WinTitle,
-            "Title of the window (*)",
-            std::string);
-  BBTK_TEMPLATE_INPUT(WidgetBlackBox,WinWidth,
-            "Width of the window (* : only used if the widget is not connected to a Layout box)",int);
-  BBTK_TEMPLATE_INPUT(WidgetBlackBox,WinHeight,
-            "Height of the window (*)",int);
-  BBTK_TEMPLATE_INPUT(WidgetBlackBox,WinDialog,
-            "Set to 'true' to create a dialog window, i.e. which blocks the pipeline until it is closed (modal) (*)",bool);
-  BBTK_TEMPLATE_INPUT(WidgetBlackBox,WinHide,
-            "Any signal received hides the window (*)",Void);
-  BBTK_TEMPLATE_INPUT(WidgetBlackBox,WinClose,
-            "Any signal received closes the window (*)",Void);
+  BBTK_TEMPLATE_INPUT(WidgetBlackBox,WinTitle,"Title of the window (*)",std::string);
+  BBTK_TEMPLATE_INPUT(WidgetBlackBox,WinWidth,"Width of the window (* : only used if the widget is not connected to a Layout box)",int);
+  BBTK_TEMPLATE_INPUT(WidgetBlackBox,WinHeight,"Height of the window (*)",int);
+  BBTK_TEMPLATE_INPUT(WidgetBlackBox,WinDialog,"Set to 'true' to create a dialog window, i.e. which blocks the pipeline until it is closed (modal) (*)",bool);
+  BBTK_TEMPLATE_INPUT(WidgetBlackBox,WinHide,"Any signal received hides the window (*)",Void);
+  BBTK_TEMPLATE_INPUT(WidgetBlackBox,WinClose,"Any signal received closes the window (*)",Void);
+  BBTK_TEMPLATE_INPUT(WidgetBlackBox,WinMaximized,"Start Application Maximazed",bool);
   typedef typename WidgetBlackBox<T>::WidgetPointer WidgetPointer;
   BBTK_TEMPLATE_OUTPUT(WidgetBlackBox,Widget,"Output widget",WidgetPointer);
   BBTK_END_DESCRIBE_BLACK_BOX(WidgetBlackBox);
   //=================================================================
 
-
-
-
-
-
-
-
-
 } //namespace bbtk
 
 // template code inclusion
index 0c2a7a12f6751428e461385c2f4b4897b52e9d4d..3f1c7b259127ded5a20467675c9a65a9d566ba7e 100644 (file)
   Version:   $Revision: 1.7 $
 =========================================================================*/
 
-
-
 /**
  *  \file 
  *  \brief 
  */
-
-
  
 //#include "bbtkWidgetBlackBoxWindow.h"
 #include "bbtkBlackBoxOutputConnector.h"
 
-
 namespace bbtk
 {
 
@@ -69,6 +64,7 @@ namespace bbtk
     bbSetInputWinTitle(bbGetName());
     bbSetInputWinWidth(800);
     bbSetInputWinHeight(800);
+    bbSetInputWinMaximized(false);
     bbSetInputWinDialog(false);
     bbSetOutputWidget(0);
   }
index a3cb0db75c09fec514311476812fcc3367d60e98..fa8d51e813d818c179e58c21d122da0fad4923a9 100644 (file)
@@ -405,32 +405,26 @@ int argc=2;
 
   //==================================================================
   void WtBlackBox::bbShowWindow()
-  {
-    if ((bbmWindow) && (!bbIsShown()))
+{
+      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);
-         } 
-      }
+          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);
+          }  // if WinDialog
+      } // if bbmWindow && !bbIsShown
   }
-  //==================================================================    
+  //==================================================================
 
   //==================================================================    
   void WtBlackBox::bbDestroyWindow()
index 8bf6f65548908d4d958790acfa8e046dae704bf6..5cff05027b52e328af6b4ef7a5f8ad9e16c447ca 100644 (file)
@@ -33,8 +33,6 @@
   Version:   $Revision: 1.45 $
 =========================================================================*/
 
-
-
 #ifdef _USE_WXWIDGETS_
 
 /**
@@ -68,7 +66,6 @@ namespace bbtk
     ~WxFrame();
     void OnCloseWindow(wxCloseEvent& event);
 
-
     WxBlackBox::WeakPointer mBox;      
     DECLARE_EVENT_TABLE();
     
@@ -94,9 +91,9 @@ namespace bbtk
             wxSYSTEM_MENU  |
             wxCLOSE_BOX |
             wxMAXIMIZE_BOX | 
-            wxMINIMIZE_BOX | 
-            wxCAPTION  
-            ),
+            wxMINIMIZE_BOX |  wxFRAME_FLOAT_ON_PARENT  |
+            wxCAPTION
+        ),
     mBox(b)
   {   
     bbtkDebugMessage("widget",9,"["<<b->bbGetName()<<"] WxFrame()"
@@ -112,12 +109,11 @@ namespace bbtk
     Layout();
   }
   //==================================================================
+
   //==================================================================
   WxFrame::~WxFrame() 
-    { 
-       
-printf("EED WxFrame::~WxFrame\n");     
-       
+    {
+printf("EED WxFrame::~WxFrame\n");
       if (mBox.lock())
          {
                bbtkDebugMessage("widget",9,"["<<mBox.lock()->bbGetName()
@@ -167,8 +163,6 @@ printf("EED WxFrame::~WxFrame\n");
                     wxSize size);
     ~WxDialog();
     void OnCloseWindow(wxCloseEvent& event);
-
-
     WxBlackBox::WeakPointer mBox;      
     DECLARE_EVENT_TABLE();
     
@@ -191,11 +185,11 @@ printf("EED WxFrame::~WxFrame\n");
                wxDefaultPosition,
                size,
                wxRESIZE_BORDER | 
-               wxSYSTEM_MENU  |
+//             wxSYSTEM_MENU  |
                wxCLOSE_BOX |
                wxMAXIMIZE_BOX | 
-               wxMINIMIZE_BOX | 
-               wxCAPTION  
+               wxMINIMIZE_BOX | wxSTAY_ON_TOP |
+               wxCAPTION
              ),
     mBox(b)
   {
@@ -282,9 +276,9 @@ printf("EED WxFrame::~WxFrame\n");
                      std2wx( ConstructWinTitle() ),
                      wxSize( bbGetInputWinWidth() , 
                              bbGetInputWinHeight() ) );
-    w->Show(false);
+     w->Show(false);
     //    w->ShowModal();
-  } 
+  }
   //=========================================================================
 
   //==================================================================    
@@ -304,9 +298,9 @@ printf("EED WxFrame::~WxFrame\n");
                     std2wx( ConstructWinTitle() ),
                     wxSize( bbGetInputWinWidth() , 
                             bbGetInputWinHeight() ) );
-    w->Show();
-
-
+    w->SetFocus();  // focus on my window
+    w->Raise();  // bring window to front      
+    w->Show(true);
    }
 
   //==================================================================    
@@ -327,25 +321,41 @@ printf("EED WxFrame::~WxFrame\n");
   void WxBlackBox::bbShowWindow()
   {
     if ((bbmWindow) && (!bbIsShown()))
-      {
-       bbtkBlackBoxDebugMessage("widget",3,"==> WxBlackBox::bbShowWindow()"
-                        <<std::endl);
-       if (bbGetInputWinDialog()) 
-         {
-           ((WxDialog*)bbmWindow)->ShowModal();
-         }
-       else    
-         {
-           bbGetWindow()->Show();
-           bbSetShown(true);
-         } 
-      } // if
-
-
+    {
+        
+        //Try Maximized Window
+        if (bbGetInputWinMaximized()==true)
+        {
+            wxWindow *ww = bbGetOutputWidget();
+            while (ww->GetParent()!=NULL)
+            {
+                ww = ww->GetParent();
+            } // while
+            wxFrame *f = (wxFrame*)ww;
+    //        f->Iconize(false);
+            f->Maximize(true);
+    //        f->Raise();
+    //        f->Show(true);
+    //        f->SetFocus();
+        }// if WinMaximized
+
+        
+        
+        bbtkBlackBoxDebugMessage("widget",3,"==> WxBlackBox::bbShowWindow()" <<std::endl);
+        if (bbGetInputWinDialog())
+        {
+               ((WxDialog*)bbmWindow)->ShowModal();
+        } else {
+            bbGetWindow()->Show();
+            bbSetShown(true);
+        } // if Dialog
+        
+    } // if Window  shown
   }
   //==================================================================    
 
-  //==================================================================    
+
+  //==================================================================
   void WxBlackBox::bbDestroyWindow()
   {
     bbtkBlackBoxDebugMessage("widget",3,"==> WxBlackBox::bbDestroyWindow("<<bbmWindow<<")"<<std::endl);
index e5e529bdc8afbf4fcdd12822465a3dd6344b4020..a3c12876f765f40176a2230a660d4004ecc8cbbd 100644 (file)
@@ -33,8 +33,6 @@
   Version:   $Revision: 1.33 $
 ========================================================================*/
 
-
-
 /**
  * \brief Short description in one line
  * 
  * \brief 
  */
 
-
 #ifdef USE_WXWIDGETS
 
-
 #ifndef __bbtkWxBlackBox_h__
 #define __bbtkWxBlackBox_h__
 
-
-
 #include "bbtkWidgetBlackBox.h"
 #include "bbtkWx.h"
 
-
 namespace bbtk
 {
 
-
   //==================================================================
   /// Widget black boxes
 //EED 10/06/2009 /*BBTK_EXPORT*/
@@ -76,9 +67,7 @@ namespace bbtk
   public:
     BBTK_BLACK_BOX_INTERFACE(WxBlackBox,bbtk::WidgetBlackBox<wxWindow>);
 
-         
     //  protected:
-    
   public:
   
    //==================================================================    
@@ -93,19 +82,17 @@ namespace bbtk
     virtual void bbCreateFrameWindow();
     //==================================================================    
 
-     
     //==================================================================    
     wxWindow* bbGetWindow() { return bbmWindow; }
     void bbSetWindow(wxWindow*) ;
     bool bbWindowIsCreated() { return (bbGetWindow() != 0); }
     //==================================================================    
 
-
     //==================================================================    
     virtual void bbShowWindow();
     //==================================================================   
-    //==================================================================    
+
+    //==================================================================
     virtual void bbDestroyWindow();
     //==================================================================    
 
@@ -116,13 +103,10 @@ namespace bbtk
        virtual std::string ConstructWinTitle();
 
   private:
-
     wxWindow* bbmWindow;
   };
   //=================================================================
  
-
   //=================================================================
   // WxBlackBoxDescriptor declaration
   class WxBlackBoxDescriptor : public WidgetBlackBoxDescriptor<wxWindow>
@@ -131,7 +115,6 @@ namespace bbtk
   BBTK_END_DESCRIBE_BLACK_BOX(WxBlackBox);
   //=================================================================
 
-
 } //namespace bbtk
 
 #endif  //__bbtkWxBlackBox_h__
index 25700ecdd80ce3d34c415c07e44265ced2a230d2..02a1466a92c1eb53a01cec7015880a7dabc02c5d 100644 (file)
@@ -173,6 +173,7 @@ void GetXCoherentInfoGdcmReader::Process()
             }
         } // for i
         sh = GDCM_NAME_SPACE::SerieHelper::New();
+        sh->SetDropDuplicatePositions( bbGetInputDropDuplicatePositions() );
         l = &lstFiles;
         sh->ImagePositionPatientOrdering( l );
     } else{
@@ -363,6 +364,7 @@ void GetXCoherentInfoGdcmReader::bbUserSetDefaultValues()
    bbSetInputIn(init);  
    bbSetInputReadRaw(true);  
    bbSetInputRespectSerieUID(true);
+   bbSetInputDropDuplicatePositions(true);
    //reader=NULL;   /// \TODO fixme JPR
 }
 
index da22dc0151a897ec2d34e01fd76941ec0e8963fc..4133ac2bf2ece81d04a460cffb359989ca5f8dc2 100644 (file)
@@ -57,18 +57,19 @@ class bbgdcmvtk_EXPORT GetXCoherentInfoGdcmReader
 
   BBTK_BLACK_BOX_INTERFACE(GetXCoherentInfoGdcmReader,bbtk::AtomicBlackBox);
 
-  BBTK_DECLARE_INPUT(In                                , std::vector<std::string>);
-  BBTK_DECLARE_INPUT(IPPSort           , bool);
-  BBTK_DECLARE_INPUT(DicomTags         , std::vector<std::string>);
-  BBTK_DECLARE_INPUT(ReadRaw           , bool);
-  BBTK_DECLARE_INPUT(RespectSerieUID, bool);
-
-  BBTK_DECLARE_OUTPUT(Out                      , vtkImageData *);
-  BBTK_DECLARE_OUTPUT(OutFileNames  , std::vector<std::string>);
-  BBTK_DECLARE_OUTPUT(IPP                      , std::vector<double>);
-  BBTK_DECLARE_OUTPUT(IOP                      , std::vector<double>);
-  BBTK_DECLARE_OUTPUT(PixelSpacing     , std::vector<double>);
-  BBTK_DECLARE_OUTPUT(DicomInfo                , VectorMapInfoDicom);
+  BBTK_DECLARE_INPUT(In                                            , std::vector<std::string>);
+  BBTK_DECLARE_INPUT(IPPSort                       , bool);
+  BBTK_DECLARE_INPUT(DicomTags                     , std::vector<std::string>);
+  BBTK_DECLARE_INPUT(ReadRaw                       , bool);
+  BBTK_DECLARE_INPUT(RespectSerieUID            , bool);
+  BBTK_DECLARE_INPUT(DropDuplicatePositions     , bool);
+
+  BBTK_DECLARE_OUTPUT(Out                                  , vtkImageData *);
+  BBTK_DECLARE_OUTPUT(OutFileNames              , std::vector<std::string>);
+  BBTK_DECLARE_OUTPUT(IPP                                  , std::vector<double>);
+  BBTK_DECLARE_OUTPUT(IOP                                  , std::vector<double>);
+  BBTK_DECLARE_OUTPUT(PixelSpacing                 , std::vector<double>);
+  BBTK_DECLARE_OUTPUT(DicomInfo                            , VectorMapInfoDicom);
 
   BBTK_PROCESS(Process);
   void Process();
@@ -98,18 +99,20 @@ BBTK_BEGIN_DESCRIBE_BLACK_BOX(GetXCoherentInfoGdcmReader,bbtk::AtomicBlackBox);
   BBTK_DESCRIPTION("Get Dicom info from a File Set (a list of Dicom image file names) and read (as a vtkImageData)");
   BBTK_CATEGORY("");
 
-  BBTK_INPUT(GetXCoherentInfoGdcmReader,In                             ,"List of Dicom image file names", std::vector<std::string>,"");
-  BBTK_INPUT(GetXCoherentInfoGdcmReader,IPPSort                        ,"Sort on Image Position Patient", bool,"");
-  BBTK_INPUT(GetXCoherentInfoGdcmReader,DicomTags              ,"Dicom Tags (vector of Dicom tags ex: D0028_0030  D0020_0037)", std::vector<std::string>,"");
-  BBTK_INPUT(GetXCoherentInfoGdcmReader,ReadRaw                    ,"(default true) false: not read raw just dicom tags", bool,"");
-  BBTK_INPUT(GetXCoherentInfoGdcmReader,RespectSerieUID ,"(default true) Respect Serie UID to be read", bool,"");
-
-  BBTK_OUTPUT(GetXCoherentInfoGdcmReader,Out                   ,"Output image"                                         , vtkImageData *,"");
-  BBTK_OUTPUT(GetXCoherentInfoGdcmReader,OutFileNames   ,"List of the files in the good order"  , std::vector<std::string>,"");
-  BBTK_OUTPUT(GetXCoherentInfoGdcmReader,IPP                   ,"Image Position (Patient)"                     , std::vector<double>,"");
-  BBTK_OUTPUT(GetXCoherentInfoGdcmReader,IOP                   ,"Image Orientation (Patient)"          , std::vector<double>,"");
-  BBTK_OUTPUT(GetXCoherentInfoGdcmReader,PixelSpacing  ,"Pixel Spacing"                                        , std::vector<double>,"");
-  BBTK_OUTPUT(GetXCoherentInfoGdcmReader,DicomInfo             ,"vector of maps of Dicom tags"         , VectorMapInfoDicom,"");
+  BBTK_INPUT(GetXCoherentInfoGdcmReader,In                                     ,"List of Dicom image file names", std::vector<std::string>,"");
+  BBTK_INPUT(GetXCoherentInfoGdcmReader,IPPSort                                ,"Sort on Image Position Patient", bool,"");
+  BBTK_INPUT(GetXCoherentInfoGdcmReader,DicomTags                      ,"Dicom Tags (vector of Dicom tags ex: D0028_0030  D0020_0037)", std::vector<std::string>,"");
+  BBTK_INPUT(GetXCoherentInfoGdcmReader,ReadRaw                            ,"(default true) false: not read raw just dicom tags", bool,"");
+  BBTK_INPUT(GetXCoherentInfoGdcmReader,RespectSerieUID         ,"(default true) Respect Serie UID to be read", bool,"");
+  BBTK_INPUT(GetXCoherentInfoGdcmReader,DropDuplicatePositions  ,"(default true) Drop slices with Duplicate Positions", bool,"");
+
+
+  BBTK_OUTPUT(GetXCoherentInfoGdcmReader,Out                           ,"Output image"                                         , vtkImageData *,"");
+  BBTK_OUTPUT(GetXCoherentInfoGdcmReader,OutFileNames           ,"List of the files in the good order"  , std::vector<std::string>,"");
+  BBTK_OUTPUT(GetXCoherentInfoGdcmReader,IPP                           ,"Image Position (Patient)"                     , std::vector<double>,"");
+  BBTK_OUTPUT(GetXCoherentInfoGdcmReader,IOP                           ,"Image Orientation (Patient)"          , std::vector<double>,"");
+  BBTK_OUTPUT(GetXCoherentInfoGdcmReader,PixelSpacing          ,"Pixel Spacing"                                        , std::vector<double>,"");
+  BBTK_OUTPUT(GetXCoherentInfoGdcmReader,DicomInfo                     ,"vector of maps of Dicom tags"         , VectorMapInfoDicom,"");
 BBTK_END_DESCRIBE_BLACK_BOX(GetXCoherentInfoGdcmReader);
 } // EO namespace bbgdcmvtk
 
index c1821170b0b43056d61f5ae479b8d860f0006365..c25db9390b3e2e6dea9acb88f3b13dd173cbf6a2 100644 (file)
@@ -45,6 +45,8 @@ SET(${BBTK_PACKAGE_NAME}_USE_ITK  ON)
 # SET(${BBTK_PACKAGE_NAME}_USE_GDCM2 ON)
 # SET(${BBTK_PACKAGE_NAME}_USE_GSMIS ON)
 # SET(${BBTK_PACKAGE_NAME}_USE_WXWIDGETS ON)
+SET(${BBTK_PACKAGE_NAME}_USE_OPENMP ON)
+
 #===========================================================================
 
 #===========================================================================
@@ -140,6 +142,9 @@ SET(${BBTK_PACKAGE_NAME}_INCLUDE_DIRS
   ../std/src
   # The path to the build tree folder is needed to find bbstd_EXPORT.h
   ${PROJECT_BINARY_DIR}/packages/std/src
+  
+  /opt/local/include/libomp
+  
   )
 #===========================================================================
 
index 66277c97ff40e3a620ed184f3dee70f47b119bc7..5738cb3b2c558029501aa1b6fa64999c295a8a84 100644 (file)
@@ -112,7 +112,6 @@ namespace bbitk
     bbSetOutputOut ( itk::ImageRegion<Dimension>(I,S) );
   }
 
-}
-// eo namespace
+}// eo namespace
 
 #endif
index f8d3b5c10766b0cb645d05b0401ebfe89c058979..dba1bc0fe1833062db4ad94e494fdd23dd32baf3 100644 (file)
@@ -91,7 +91,8 @@ namespace bbitk
     typename itkWriterType::Pointer writer = itkWriterType::New();
     writer->SetInput(bbGetInputIn().unsafe_get<const itkImageType*>());
     writer->SetFileName(bbGetInputFilename().c_str());
-
+    writer->SetUseCompression(true);
+      
     try { writer->Update(); }
     catch( std::exception & e ) 
       {
index f31dc870ba93dcfb5953b4471876fccbdb4df7bc..31a3696217ecad389cfcb48017cb382fbab2fddf 100644 (file)
@@ -86,8 +86,8 @@ namespace bbitk
   //=================================================================
   
 
-}
-//namespace bbitk
+}//namespace bbitk
+
 #endif
 
 #endif  // _USE_ITK_
index 1b62a97e20929c2707b136fe844c81d16eb51247..594830be72b2a470190ba5685f97d202d8e6fa44 100644 (file)
@@ -138,6 +138,8 @@ SET(${BBTK_PACKAGE_NAME}_INCLUDE_DIRS
   #  - automatically handled libraries or packages : wx, vtk... (see above)
   #  - the dirs automatically set by other libraries found by FIND_PACKAGE
  ../itk/src
+   /opt/local/include/libomp
+
   )
 #===========================================================================
 
index e1dc48ff7457b33e867ea2e84456122b990e9cb2..d45e7da0025382162453504b25f43ea5faed5f7f 100644 (file)
 
 namespace bbkw
 {
-  
-  
-  
-  
   class LayoutSplit : public bbtk::KWBlackBox
   {
-    
     BBTK_BLACK_BOX_INTERFACE(LayoutSplit,bbtk::KWBlackBox);
     BBTK_DECLARE_INPUT(Widget1,vtkKWWidget*);
     BBTK_DECLARE_INPUT(Widget2,vtkKWWidget*);
@@ -71,15 +66,12 @@ namespace bbkw
     BBTK_DECLARE_INPUT(Proportion,int);
     BBTK_PROCESS(Process);
     BBTK_CREATE_KWWIDGET(CreateWidget);
-   void CreateWidget(vtkKWFrame*);
-
-    void Process();
+      void CreateWidget(vtkKWFrame*);
+      void Process();
   protected:
-    virtual void bbUserConstructor();
-
+      virtual void bbUserConstructor();
   };
   
 //=================================================================
 // BlackBox description
   BBTK_BEGIN_DESCRIBE_BLACK_BOX(LayoutSplit,bbtk::KWBlackBox);
@@ -90,7 +82,7 @@ namespace bbkw
   BBTK_INPUT(LayoutSplit,Widget1,"Upper or left widget",vtkKWWidget*,"");
   BBTK_INPUT(LayoutSplit,Widget2,"Lower or right widget",vtkKWWidget*,"");
   BBTK_INPUT(LayoutSplit,Orientation,"Orientation (default H), 0=H=HORIZONTAL , 1=V=VERTICAL",std::string,"");
-   BBTK_INPUT(LayoutSplit,Proportion,"Proportion (in percent) of the first children in the window",int,"");
+  BBTK_INPUT(LayoutSplit,Proportion,"Proportion (in percent) of the first children in the window",int,"");
   BBTK_END_DESCRIBE_BLACK_BOX(LayoutSplit);
   //=================================================================
 }
index d7925c17d819018fe9e4c7a59ac7a322b6b35f5f..065720c7773ac0f0ef9b35c2b8604657db646e26 100644 (file)
   Version:   $Revision: 1.4 $
 =========================================================================*/
 
-
-    
-
 /**
  *  \file
  *  \brief
  */
 
-
 #ifdef USE_QT
 
 #include "bbqtLayoutLine.h"
index a8117edaad5d5dc588f3f1132edb4554ee6772c2..6ec29bea4a834122b11de6f961688f9afcd94406 100644 (file)
@@ -94,10 +94,13 @@ namespace bbqt
        
   void LayoutSplit::Process()
   {
+      printf("EED LayoutSplit::Process start\n");
+      printf("EED LayoutSplit::Process end\n");
   }
 
   void LayoutSplit::CreateWidget(QWidget* parent)
   {
+      printf("EED LayoutSplit::CreateWidget\n");
     Qt::Orientation ori;
     if (bbtk::Utilities::loosematch(bbGetInputOrientation(),
                                    "0|H|HORIZONTAL")==true)  
@@ -172,6 +175,7 @@ namespace bbqt
   // when window is shown
   void  LayoutSplit::OnShowWidget()
   {
+      printf("EED LayoutSplit::OnShowWidget\n");
     /*
     bbUserOnShowWidget("Widget1");
     bbUserOnShowWidget("Widget2");
diff --git a/packages/std/bbs/appli/exampleEncrypting.bbg b/packages/std/bbs/appli/exampleEncrypting.bbg
new file mode 100644 (file)
index 0000000..fcddfba
--- /dev/null
@@ -0,0 +1,101 @@
+# ----------------------------------
+# - BBTKGEditor v 1.6 BBG BlackBox Diagram file
+# - /Users/davila/Creatis/C23/creatools_source/bbtk/packages/std/bbs/appli/exampleEncrypting.bbg
+# ----------------------------------
+
+APP_START
+CATEGORY:<VOID>
+DESCRIPTION:Description ??
+AUTHOR:Author ??
+EXPORTFORMAT:0
+COMPLEXBOX:FALSE
+COMPLEXINPUTS:0
+BOXES:8
+BOX
+std:Encrypting:Box00
+ISEXEC:FALSE
+0.698659:41.492586:-900.000000
+22.348659:38.992586:-900.000000
+PORT
+Mode:"1"
+FIN_BOX
+BOX
+wx:OutputText:Box01
+ISEXEC:FALSE
+3.959068:15.642200:-900.000000
+25.629068:13.142200:-900.000000
+FIN_BOX
+BOX
+wx:LayoutLine:Box02
+ISEXEC:TRUE
+-19.562454:1.824276:-900.000000
+13.757546:-0.675724:-900.000000
+FIN_BOX
+BOX
+wx:OutputText:Box03
+ISEXEC:FALSE
+-19.380378:15.587155:-900.000000
+2.289622:13.087155:-900.000000
+FIN_BOX
+BOX
+std:Encrypting:Box04
+ISEXEC:FALSE
+4.839803:32.044457:-900.000000
+26.489803:29.544457:-900.000000
+PORT
+Mode:"2"
+FIN_BOX
+BOX
+std:ConcatStrings:Box05
+ISEXEC:FALSE
+-28.179249:56.863085:-900.000000
+-5.419249:54.363085:-900.000000
+PORT
+In1:"hola eduardo 1972 COLOMBIA kz"
+FIN_BOX
+BOX
+wx:OutputText:Box06
+ISEXEC:FALSE
+-44.660543:15.687367:-900.000000
+-22.990543:13.187367:-900.000000
+FIN_BOX
+BOX
+std:ConcatStrings:Box07
+ISEXEC:FALSE
+18.087507:57.639373:-900.000000
+40.847507:55.139373:-900.000000
+PORT
+In1:"3"
+FIN_BOX
+CONNECTIONS:10
+CONNECTION
+Box05:Out:Box00:In
+NumberOfControlPoints:0
+CONNECTION
+Box00:Out:Box03:In
+NumberOfControlPoints:0
+CONNECTION
+Box00:Out:Box04:In
+NumberOfControlPoints:0
+CONNECTION
+Box04:Out:Box01:In
+NumberOfControlPoints:0
+CONNECTION
+Box01:Widget:Box02:Widget3
+NumberOfControlPoints:0
+CONNECTION
+Box03:Widget:Box02:Widget2
+NumberOfControlPoints:0
+CONNECTION
+Box05:Out:Box06:In
+NumberOfControlPoints:0
+CONNECTION
+Box06:Widget:Box02:Widget1
+NumberOfControlPoints:0
+CONNECTION
+Box07:Out:Box00:Type
+NumberOfControlPoints:0
+CONNECTION
+Box07:Out:Box04:Type
+NumberOfControlPoints:0
+APP_END
diff --git a/packages/std/bbs/appli/exampleEncrypting.bbs b/packages/std/bbs/appli/exampleEncrypting.bbs
new file mode 100644 (file)
index 0000000..ca44672
--- /dev/null
@@ -0,0 +1,62 @@
+# ----------------------------------
+# - BBTKGEditor v 1.6 BBS BlackBox Script
+# - /Users/davila/Creatis/C23/creatools_source/bbtk/packages/std/bbs/appli/exampleEncrypting.bbs
+# ----------------------------------
+
+# BBTK GEditor Script
+# ----------------------
+
+include std
+include itkvtk
+include std
+include wx
+
+author "Author ??"
+description "Description ??"
+category "<VOID>"
+
+new std:Encrypting Box00
+  set Box00.Mode "1"
+
+new wx:OutputText Box01
+
+new wx:LayoutLine Box02
+
+new wx:OutputText Box03
+
+new std:Encrypting Box04
+  set Box04.Mode "2"
+
+new std:ConcatStrings Box05
+  set Box05.In1 "hola eduardo 1972 COLOMBIA kz"
+
+new wx:OutputText Box06
+
+new std:ConcatStrings Box07
+  set Box07.In1 "3"
+
+
+connect Box05.Out Box00.In
+
+connect Box00.Out Box03.In
+
+connect Box00.Out Box04.In
+
+connect Box04.Out Box01.In
+
+connect Box01.Widget Box02.Widget3
+
+connect Box03.Widget Box02.Widget2
+
+connect Box05.Out Box06.In
+
+connect Box06.Widget Box02.Widget1
+
+connect Box07.Out Box00.Type
+
+connect Box07.Out Box04.Type
+
+
+
+# Complex input ports
+exec Box02
index a085e87ff6df3e49c22dd81914cd4a0e449f4293..c12d9bc8affbd744508e361d7f3f47219bf91129 100644 (file)
@@ -3,7 +3,7 @@
 <blackbox name="Add">
 
   <author>laurent.guigues@creatis.insa-lyon.fr </author>
-  <description>Adds its inputs                 </description>
+  <description>(C++,Python) Adds its inputs                 </description>
   <category>math                               </category>
 
   <input name="In1"  type="double" description="First number to add"/>
index 6bc651c2e557f6fe9e7e12138fb9e4ec0a9903bf..5f2f72151bab0d16ae5cc31c08640740dd82c507 100644 (file)
@@ -3,7 +3,7 @@
 <blackbox name="Div">
 
   <author>laurent.guigues@creatis.insa-lyon.fr</author>
-  <description>(C++,Python) Divides its inputs</description>
+  <description>(C++,Python,JavaScript) Divides its inputs</description>
   <category>math</category>
 
   <input name="In1"  type="double" description="Numerator"/>
diff --git a/packages/std/src/bbstdEncrypting.cxx b/packages/std/src/bbstdEncrypting.cxx
new file mode 100644 (file)
index 0000000..c787af8
--- /dev/null
@@ -0,0 +1,353 @@
+//===== 
+// 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 "bbstdEncrypting.h"
+#include "bbstdPackage.h"
+
+#include "bbtkBlackBoxInputConnector.h"
+
+
+#include <iostream>
+#include <string>
+
+
+namespace bbstd
+{
+
+class Connection;
+
+//
+//
+// https://stackoverflow.com/questions/66380465/c-encoding-decoding
+//
+//
+
+class encryptor
+{
+public:
+    virtual std::string encode(std::string original) = 0;
+    virtual std::string decode(std::string secret) = 0;
+};
+
+class shift_encryptor : public encryptor
+{
+    int shift;
+
+public:
+    shift_encryptor(int shift)
+    {
+        // Your code starts here
+        this->shift = shift;
+        // Your code ends here
+    }
+
+    std::string encode(std::string original)
+    {
+        // Your code starts here
+            
+            char c_original[73] = {     
+                ' ', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i',
+                'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's',
+                't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2',
+                '3', '4', '5', '6', '7', '8', '9', '.', ',', ':',
+                ';', '@', '*', '$', '/', '-', '_', 'A', 'B', 'C',
+                'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
+                'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',
+                'X', 'Y', 'Z' };
+
+        
+
+        this->shift = this->shift % 73;
+        
+        std::string original_result = "";
+        for (int i = 0; i < original.length(); i++)
+        {
+            int c_index = 0;
+            for (int j = 0; j < sizeof(c_original); j++)
+            {
+                if (original[i] == c_original[j])
+                {
+                    c_index = j;
+                    break;
+                }
+            }
+            int final_index = c_index + this->shift;
+            if (final_index > sizeof(c_original) - 1)
+                final_index -= sizeof(c_original);
+            original_result += c_original[final_index];
+        }
+        return original_result;
+        // Your code ends here
+    }
+
+    std::string decode(std::string secret)
+    {
+        // Your code starts here
+        char c_secret[73] = {     
+            ' ', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i',
+            'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's',
+            't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2',
+            '3', '4', '5', '6', '7', '8', '9', '.', ',', ':',
+            ';', '@', '*', '$', '/', '-', '_', 'A', 'B', 'C',
+            'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
+            'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',
+            'X', 'Y', 'Z' };
+
+        
+        
+        this->shift = this->shift % 73;
+
+        std::string secret_result = "";
+        for (int i = 0; i < secret.length(); i++)
+        {
+            int c_index = 0;
+            for (int j = 0; j < sizeof(c_secret); j++)
+            {
+                if (secret[i] == c_secret[j])
+                {
+                    c_index = j;
+                    break;
+                }
+            }
+            int final_index = c_index - this->shift;
+            if (final_index < 0)
+                final_index += sizeof(c_secret);
+            secret_result += c_secret[final_index];
+        }
+        return secret_result;
+        // Your code ends here
+    }
+};
+
+class cypher_encryptor : public encryptor
+{
+    std::string cypher;
+public:
+    cypher_encryptor(std::string cypher)
+    {
+        // Your code starts here
+        this->cypher = cypher;
+        // Your code ends here
+    }
+    std::string encode(std::string original)
+    {
+        // Your code starts here
+        char c_original[73] =  {     
+                        ' ', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i',
+                        'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's',
+                        't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2',
+                        '3', '4', '5', '6', '7', '8', '9', '.', ',', ':',
+                        ';', '@', '*', '$', '/', '-', '_', 'A', 'B', 'C',
+                        'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
+                        'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',
+                        'X', 'Y', 'Z' };
+
+        std::string original_result = "";
+        for (int i = 0; i < original.length(); i++)
+        {
+            int c_index = 0;
+            for (int j = 0; j < this->cypher.length(); j++)
+            {
+                if (original[i] == this->cypher[j])
+                {
+                    c_index = j;
+                    break;
+                }
+            }
+            original_result += c_original[c_index];
+        }
+        return original_result;
+        // Your code ends here
+    }
+
+    std::string decode(std::string secret)
+    {
+        // Your code starts here
+        char c_secret[73] = {     
+            ' ', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i',
+            'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's',
+            't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2',
+            '3', '4', '5', '6', '7', '8', '9', '.', ',', ':',
+            ';', '@', '*', '$', '/', '-', '_', 'A', 'B', 'C',
+            'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
+            'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',
+            'X', 'Y', 'Z' };
+
+        std::string secret_result = "";
+        for (int i = 0; i < secret.length(); i++)
+        {
+            int c_index = 0;
+            for (int j = 0; j < sizeof(c_secret); j++)
+            {
+                if (secret[i] == c_secret[j])
+                {
+                    c_index = j;
+                    break;
+                }
+            }
+            secret_result += this->cypher[c_index];
+        }
+        return secret_result;
+        // Your code ends here
+    }
+};
+
+
+std::string encryptDecrypt(std::string toEncrypt) {
+    char key[5] = {'K', 'C', 'Q','e','r'}; //Any chars will work
+    std::string output = toEncrypt;
+    
+    for (int i = 0; i < toEncrypt.size(); i++)
+        output[i] = toEncrypt[i] ^ key[i % (sizeof(key) / sizeof(char))];
+    
+    return output;
+}
+
+BBTK_ADD_BLACK_BOX_TO_PACKAGE(std,Encrypting)
+BBTK_BLACK_BOX_IMPLEMENTATION(Encrypting,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 Encrypting::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() );
+
+    if (bbGetInputType()==1)
+    {
+        shift_encryptor* shiftTest = new shift_encryptor(9);
+        if (bbGetInputMode()==1)
+        {
+            bbSetOutputOut ( shiftTest->encode( bbGetInputIn() ) );
+        }
+        if (bbGetInputMode()==2)
+        {
+            bbSetOutputOut ( shiftTest->decode( bbGetInputIn() ) );
+        }
+    }
+    if (bbGetInputType()==2)
+    {
+        cypher_encryptor* crypter = new cypher_encryptor("04dw51CeVD23 67W89XYZASTBEfyhazlvjnktbogrumcpiqxs.,:;@*$/-_OHIPKLQRUJGMNF");
+        if (bbGetInputMode()==1)
+        {
+            bbSetOutputOut ( crypter->encode( bbGetInputIn() ) );
+        }
+        if (bbGetInputMode()==2)
+        {
+            bbSetOutputOut ( crypter->decode( bbGetInputIn() ) );
+        }
+    }
+
+    if (bbGetInputType()==3)
+    {
+        if ((bbGetInputMode()==1) ||(bbGetInputMode()==2) )
+        {
+            bbSetOutputOut ( encryptDecrypt( bbGetInputIn() ) );
+        }
+    }
+
+    if (bbGetInputType()==4)
+    {
+        InputConnectorMapType::iterator i = bbGetInputConnectorMap().find("In");
+        bbtk::Connection *c = i->second->GetConnection();
+        int idchar1 = 0;
+        int idchar2 = 8;
+        int idcode  = 8;
+        if (c!=NULL)
+        {
+            int pos             = c->GetBlackBoxFrom()->bbGetFullName().find("<");
+            std::string idstr1  = c->GetBlackBoxFrom()->bbGetFullName().substr(pos-2,2);
+            idchar1         = std::stoi( idstr1 );
+            std::string idstr2  = c->GetBlackBoxFrom()->bbGetFullName().substr(pos-1,1);
+            idchar2 = idstr2.at(0);
+            idcode = idchar1 + idchar2;
+        }
+
+        shift_encryptor* shiftTest = new shift_encryptor(idcode);
+        cypher_encryptor* crypter = new cypher_encryptor("04dw51CeVD23 67W89XYZASTBEfyhazlvjnktbogrumcpiqxs.,:;@*$/-_OHIPKLQRUJGMNF");
+        if (bbGetInputMode()==1)
+        {
+            bbSetOutputOut ( shiftTest->encode(  crypter->encode( bbGetInputIn() ))  );
+        } // if
+        if (bbGetInputMode()==2)
+        {
+            bbSetOutputOut ( crypter->decode( shiftTest->decode( bbGetInputIn() )) );
+        } // if
+    }
+
+    
+    /*
+        encodeResult = shiftTest->encode("hello world");
+        std::cout << "shift encode result == " << encodeResult << std::endl;
+
+        decodeResult = shiftTest->decode("lipps${svph");
+        std::cout << "shift encode result == " << decodeResult << std::endl;
+
+        // string encodeResult = shiftTest->en
+
+        cypher_encryptor* crypterTest = new cypher_encryptor("efyhadwzlvjnktbogrumcpiqxs");
+
+#        encodeResult = crypterTest->encode("heyj fvmpe");
+        std::cout << "encryptor encode result == " << encodeResult << std::endl;
+        decodeResult = crypterTest->decode("me emt shevyp wtjp ihls ftssjkt");
+        std::cout << "encryptor decode result == " << decodeResult << 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 Encrypting::bbUserSetDefaultValues()
+{
+
+//  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
+//    Here we initialize the input 'In' to 0
+   bbSetInputIn("");
+   bbSetInputMode(0);
+   bbSetInputType(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 Encrypting::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 Encrypting::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/bbstdEncrypting.h b/packages/std/src/bbstdEncrypting.h
new file mode 100644 (file)
index 0000000..a8b53c7
--- /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 __bbstdEncrypting_h_INCLUDED__
+#define __bbstdEncrypting_h_INCLUDED__
+
+#include "bbstd_EXPORT.h"
+#include "bbtkAtomicBlackBox.h"
+#include "iostream"
+
+namespace bbstd
+{
+
+class bbstd_EXPORT Encrypting
+ : 
+   public bbtk::AtomicBlackBox
+{
+  BBTK_BLACK_BOX_INTERFACE(Encrypting,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(Mode,int);
+  BBTK_DECLARE_INPUT(Type,int);
+  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(Encrypting,bbtk::AtomicBlackBox);
+  BBTK_NAME("Encrypting");
+  BBTK_AUTHOR("InfoDev");
+  BBTK_DESCRIPTION("No Description.");
+  BBTK_CATEGORY("empty");
+  BBTK_INPUT(Encrypting,In,"Input string",std::string,"");
+  BBTK_INPUT(Encrypting,Mode,"(default 0) 0:Nothing Type1: 0_Nothing 1_Encode 2_Decode   Type2: 0_Nothing 1_Encode 2_Decode  Type3: 0_Nothing 1:EncodeDecode",int,"");
+  BBTK_INPUT(Encrypting,Type,"(default 0) 0:Nothing 1:shiftTest(LowerCase) 2:cypher_encryptor(LowerCase) 3:EncodeDecode  4:EncodeDecode2",int,"");
+  BBTK_OUTPUT(Encrypting,Out,"Output string",std::string,"");
+BBTK_END_DESCRIBE_BLACK_BOX(Encrypting);
+//===== 
+// 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 // __bbstdEncrypting_h_INCLUDED__
+
index d50c2215e4c0d011fb55dbbe888406074038c951..2f11d2e623a674cdd27e2396543b34656f8ee127 100755 (executable)
@@ -86,7 +86,7 @@ namespace bbstd
 
         
 #ifdef __APPLE__
-        ccommand = "source ~/.bashrc ; " + ccommand;
+        ccommand = "source ~/.bashrc_CreaTools ; " + ccommand;
 #endif
         
                if (bbGetInputVerbose()==true) 
index 64353a68d28bca87142c2a67dff74126e6a89c44..452b43c7ea9f1eb3a1b90d11cadbb8b2e48dba77 100644 (file)
@@ -63,7 +63,7 @@ namespace bbstd
   BBTK_NAME("Get"+bbtk::HumanTypeName<std::vector<T> >()+"Element");
   BBTK_AUTHOR("info-dev@creatis.insa-lyon.fr");
  // BBTK_DEFAULT_ADAPTOR();
-  BBTK_DESCRIPTION("(C++,Python) Gets the i-th element from the input vector ("+bbtk::TypeName<std::vector<T> >());
+  BBTK_DESCRIPTION("(C++,Python,JavaScript) 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, "iElement (default 0)",int);  
index 99d27e872937bd25399a12388379f56eb1ead0e5..05435d54949b21c216eeb4e77960978ca3247041 100644 (file)
@@ -107,7 +107,7 @@ namespace bbstd
   BBTK_NAME("MagicBox");
   BBTK_AUTHOR("laurent.guigues@creatis.insa-lyon.fr");
   BBTK_CATEGORY("misc");
-  BBTK_DESCRIPTION("(C++,Python) Takes *any kind* of data and copies it to its output. Is a magic box as any box output can be plugged into it and its output can be plugged into any other box input (dynamic type checking, see below), hence it can be put between **any** two boxes. Type matching between its output and the input of the box(es) to which it is connected is made at *run-time*. The pipeline will be executed if the data types : i) match exactly ii) can be transformed by an adaptor iii) are related pointers, i.e. if the output pointer can be upcasted (static_cast) or downcasted (dynamic_cast) to an input type pointer (see the bbtk::any output connection rule in the guide for details). Important uses of the MagicBox are : 1) performing run-time pointer cast, either upward or backward an object hierarchy 2) perform data adaptation (adaptor creation) at run-time vs. pipeline creation time.");
+  BBTK_DESCRIPTION("(C++,Python,JavaScript) Takes *any kind* of data and copies it to its output. Is a magic box as any box output can be plugged into it and its output can be plugged into any other box input (dynamic type checking, see below), hence it can be put between **any** two boxes. Type matching between its output and the input of the box(es) to which it is connected is made at *run-time*. The pipeline will be executed if the data types : i) match exactly ii) can be transformed by an adaptor iii) are related pointers, i.e. if the output pointer can be upcasted (static_cast) or downcasted (dynamic_cast) to an input type pointer (see the bbtk::any output connection rule in the guide for details). Important uses of the MagicBox are : 1) performing run-time pointer cast, either upward or backward an object hierarchy 2) perform data adaptation (adaptor creation) at run-time vs. pipeline creation time.");
  
  AddInputDescriptor
   (new bbtk::AtomicBlackBoxInputDescriptor
@@ -117,7 +117,7 @@ namespace bbstd
     (&MagicBox::bbGetInputIn),
     new MagicBoxSetFunctor (&MagicBox::bbSetInputIn) ) );
 
-  BBTK_INPUT(MagicBox, Active, "Active True/False (default True)",bool,"");  
+  BBTK_INPUT(MagicBox, Active, "(default True) Active True/False",bool,"");  
 
 
   AddOutputDescriptor
index 2d01e057559df5f8e1f194cbd1dafcd855881588..df2a9ef2affab8d6e2232dadc9ba71281899dad1 100644 (file)
@@ -3,7 +3,7 @@
 <blackbox name="MultipleInputs">
 
   <author>laurent.guigues@creatis.insa-lyon.fr</author>
-  <description>(C++,Python) This box has multiple Void inputs and one Void output. Hence it relays any input modification to its output. It is usefull to plug different BoxChange outputs into the same BoxExecute input.</description>
+  <description>(C++,Python,JavaScript) This box has multiple Void inputs and one Void output. Hence it relays any input modification to its output. It is usefull to plug different BoxChange outputs into the same BoxExecute input.</description>
   <category>misc</category>
 
   <input name="In1"  type="bbtk::Void" description="Input 1"/>
index 92f0557ab138d05213d6c32b85d3968123ad2fde..0d3d21d2815726a1191435b8c8fc713945f867a9 100644 (file)
@@ -67,8 +67,8 @@ void ReadColumnsDouble::Process()
                }       
                fclose(ff1);
        } else {   // else ff1
-               printf("bbcreaMaracasVisuReadAxisTree3D::Process  ...Error... reading file InputFileName_Points>%s", bbGetInputFileName().c_str() );
-       } //ff1 
+               printf("ReadColumnsDouble::Process  ...Error... reading file InputFileName_Points:%s\n", bbGetInputFileName().c_str() );
+       } //ff1
        
        i=1; if (i<=bbGetInputDimension()) { bbSetOutputlstData1( *(tlst[i-1]) ); }
        i=2; if (i<=bbGetInputDimension()) { bbSetOutputlstData2( *(tlst[i-1]) ); }
index 5a0c08a9fc9226431a55c08fee049c2afae95b9c..faf915b8476c613d0af127799f9a3a9469e2296b 100644 (file)
@@ -67,7 +67,7 @@ void ReadColumnsInt::Process()
                }       
                fclose(ff1);
        } else {   // else ff1
-               printf("ReadColumnsDouble::Process  ...Error... reading file FileName <%s>\n", 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]) ); }
index 2860219d384957e978256e26e9ff3744bc0c10a8..64318bccd77406a019f3fecd3d98efd918a00c2c 100644 (file)
@@ -31,7 +31,6 @@
 #include "bbstdReadColumnsString.h"
 #include "bbstdPackage.h"
 
-
 #include<vector>
 
 namespace bbstd
@@ -61,7 +60,6 @@ void ReadColumnsString::Process()
        {
                fgets( tmpValue , 500, ff1 ); 
        }
-
                while (!feof(ff1))
                {
                        for( i=0 ;  i<bbGetInputDimension() ; i++)
@@ -76,9 +74,8 @@ void ReadColumnsString::Process()
                }       
                fclose(ff1);
        } else {   // else ff1
-               printf("bbcreaMaracasVisuReadAxisTree3D::Process  ...Error... reading file InputFileName_Points>%s", bbGetInputFileName().c_str() );
-       } //ff1 
-       
+               printf("ReadColumnsString::Process ...Error... reading file InputFileName_Points:%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]) ); }
@@ -88,47 +85,42 @@ void ReadColumnsString::Process()
        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]) ); }
-       
 }
-//===== 
+
+//=====
 // 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 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(""); 
-  
+       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 ReadColumnsString::bbUserInitializeProcessing()
 {
-
 //  THE INITIALIZATION METHOD BODY :
 //    Here does nothing 
 //    but this is where you should allocate the internal/output pointers 
-//    if any 
-
-  
+//    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 ReadColumnsString::bbUserFinalizeProcessing()
 {
-
 //  THE FINALIZATION METHOD BODY :
 //    Here does nothing 
 //    but this is where you should desallocate the internal/output pointers 
 //    if any
-  
 }
-}
-// EO namespace bbstd
+
+}// EO namespace bbstd
 
 
index 2b8c32be500105effa5032142183191cdf0f2dee..25fc72c620ba2a77cfd7c163cf5a2aef3ae1d257 100644 (file)
@@ -30,7 +30,7 @@ class bbstd_EXPORT ReadLinesString
 BBTK_BEGIN_DESCRIBE_BLACK_BOX(ReadLinesString,bbtk::AtomicBlackBox);
   BBTK_NAME("ReadLinesString");
   BBTK_AUTHOR("Info-Dev");
-  BBTK_DESCRIPTION("No Description.");
+  BBTK_DESCRIPTION("(C++,JavaScipt) No Description.");
   BBTK_CATEGORY("empty");
  
   BBTK_INPUT(ReadLinesString,FileName,"FileName",std::string,"");
index d4c931b0c806b93db54a6d1da6fa364fbc92c35d..84a57747670a0f36d8edf7f90972d096669c340e 100644 (file)
@@ -33,7 +33,7 @@ class bbstd_EXPORT ReplaceCleanString
 BBTK_BEGIN_DESCRIBE_BLACK_BOX(ReplaceCleanString,bbtk::AtomicBlackBox);
  BBTK_NAME("ReplaceCleanString");
  BBTK_AUTHOR("InfoDev");
- BBTK_DESCRIPTION("No Description.");
+ BBTK_DESCRIPTION("(C++,Python,JavaScript) No Description.");
  BBTK_CATEGORY("empty");
  BBTK_INPUT(ReplaceCleanString,In,"Input string",std::string,"");
  BBTK_INPUT(ReplaceCleanString,Replace,"New string to be put",std::string,"");
index 8e71238bc76e16faffb8af2b708ac6659875ed97..631d8742ffadf10f877863e23c6385b60c8194b7 100644 (file)
@@ -34,7 +34,7 @@ class bbstd_EXPORT SplitFilePathVector
 BBTK_BEGIN_DESCRIBE_BLACK_BOX(SplitFilePathVector,bbtk::AtomicBlackBox);
   BBTK_NAME("SplitFilePathVector");
   BBTK_AUTHOR("Info-Dev");
-  BBTK_DESCRIPTION("No Description.");
+  BBTK_DESCRIPTION("(C++,JavaScript) No Description.");
   BBTK_CATEGORY("empty");
 
   BBTK_INPUT(SplitFilePathVector,In,"PathFileName",std::vector<std::string>,"");
index 09de441616111e90457c5d55a1d67f89a2368dce..055e60ee7f416f085947701a6d0e4a63c16cea8f 100644 (file)
@@ -49,24 +49,25 @@ namespace bbstd
   // Template specialization of DoIt
   template <> void StringTo<bool> ::DoIt()
   {
-    if ( (bbGetInputIn()=="true") || 
+    if ( (bbGetInputIn()=="true") ||
          (bbGetInputIn()=="TRUE") || 
          (bbGetInputIn()=="True") || 
          (bbGetInputIn()=="1")     )  
     {
-       bbSetOutputOut(true);
-    }
-    else if ( (bbGetInputIn()=="false") || 
-              (bbGetInputIn()=="FALSE") ||
-              (bbGetInputIn()=="False") ||
-              (bbGetInputIn()=="0") )  
+        bbSetOutputOut(true);
+    } else if ( (bbGetInputIn()=="false") ||
+              (bbGetInputIn()=="FALSE")   ||
+              (bbGetInputIn()=="False")   ||
+              (bbGetInputIn()=="0") )
     {   
-       bbSetOutputOut(false); 
-    }
-    else 
-    {
-       bbtkError("cannot convert '"<<bbGetInputIn()<<"' to a bool");
+        bbSetOutputOut(false);
+    } else {
+        printf("EED StringTo box  cannot convert  >>%s<<\n", bbGetInputIn().c_str() );
+//        bbtkError("cannot convert '"<<bbGetInputIn()<<"' to a bool");
+        bbSetOutputOut(true);
+
     }
+        printf("EED StringTo 5\n");
   }
   
   // Template specialization of DoIt
index c132e918a19f4bdf67b98d34977c885849eeb50b..3d467ca3641ec31f3e5860dded5fdeb6a5ac42f5 100644 (file)
@@ -250,8 +250,10 @@ void VectorFilterDouble::Process()
                        Out2[j]=In2[iBack]; 
                } // for i
        }       // Type 7
-       if (bbGetInputType()==8)   // order all vectors using as base the vector In0
+       if (bbGetInputType()==8)   // order all vectors using as base the vector InK
        {
+        int k=0;
+        if (bbGetInputk1().size()==1) k=bbGetInputk1()[0];
                double tmp;
                int i,j,ii,sizeII;
                sizeII=pLstVec.size();
@@ -267,7 +269,7 @@ void VectorFilterDouble::Process()
                {
                        for (j=i;j<size;j++)
                        {
-                               if ((*pLstVecOut[0])[j] <= (*pLstVecOut[0])[i] ) 
+                               if ((*pLstVecOut[k])[j] <= (*pLstVecOut[k])[i] )    ///  <<<  k element to be order
                                {
                                        for (ii=0;ii<sizeII;ii++)
                                        {
@@ -467,7 +469,49 @@ void VectorFilterDouble::Process()
             } // if k1 not empty
         }
      } // Type 14
+    if (bbGetInputType()==15)   // 15 swhitch element in a point k1=0 yz, k1=1 nothing k2=2 xz
+    {
+        double x,y,z;
+        double xx,yy,zz;
+        std::vector<double> k1 =bbGetInputk1();
+        if ( (In0.size()==3) && (k1.size()==1 ) )
+        {
+            if (k1[0]==0) {
+                Out0.push_back( In0[0] );  // x
+                Out0.push_back( In0[2] );  // z
+                Out0.push_back( In0[1] );  // y
+            }
+            if (k1[0]==1) {
+                Out0.push_back( In0[0] );  // x
+                Out0.push_back( In0[1] );  // y
+                Out0.push_back( In0[2] );  // z
+            }
+            if (k1[0]==2) {
+                Out0.push_back( In0[2] );  // z
+                Out0.push_back( In0[1] );  // y
+                Out0.push_back( In0[0] );  // x
+            }
+        } // if In0.size   and  k1.size
+     } // Type 15
 
+    if (bbGetInputType()==16)   // 16 switch In0 and In1 (k1=1 nothing, k0 swhich)
+    {
+        if (bbGetInputk1().size()==1)
+        {
+            if (bbGetInputk1()[0] == 0)
+            {
+                Out0 = In0;
+                Out1 = In1;
+            } // if k1 == 0
+            if (bbGetInputk1()[0] == 1)
+            {
+                Out0 = In1;
+                Out1 = In0;
+            } // if k1 == 1
+        } // if size k1 == 1
+    } // if Type 16
+    
+    
        bbSetOutputOut0( Out0 );
        bbSetOutputOut1( Out1 );
        bbSetOutputOut2( Out2 );
index c9d9438eb255b738f4c6493049206db66c9ef6dc..9595be2df346050be5b318134386d422ea5a1dd8 100644 (file)
@@ -52,8 +52,8 @@ BBTK_BEGIN_DESCRIBE_BLACK_BOX(VectorFilterDouble,bbtk::AtomicBlackBox);
   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 k1, 4=Substraction k1, 5=Multilication k1, 6=Division k1, 7=Connect mesh X1,Y1,Z1,idxs1,X2,X2,X2,idx2, 8=Order All vectors with the logic of In0 , 9=Invert Vectors, 10=Nearest Point in the vector. In3PointXYZ In0LstX In1LstY In2LstZ  (Out0-index Out1-PointXYZ), 11=Mul Spacing (K1[spcX,spcY,spcZ]=Spacing), 12=Div Spacing (K1[spcX,spcY,spcZ]=Spacing), 13=Distance pointIn0 and pontIn1,  14=Select specific segments [k1] in In0=lstPx In1=lstPy In2=lstPz In3=lstIndex (if k1 empty all segments are selected) ",int,"");
-  BBTK_INPUT(VectorFilterDouble,k1,"(default [0])  nothing (Type0), k1[0]=new size vectors (Type 1) , nothing (Type2), k1[0] = Addition const. (Type 3), k1[0] = Substraction const. (Type 4), k1[0] = Multiplication const. (Type 5) , k1[0] = Division const. (Type 6)  , k1[spcX,spcY,spcZ] MulSpc In0_X,In1_Y,In2_Z (type 11),  k1[spcX,spcY,spcZ] DivSpc In0_X,In1_Y,In2_Z (type 12) , k1[segment1, segment2,..] (type 14) ",std::vector<double>,"");
+  BBTK_INPUT(VectorFilterDouble,Type,"default (0)  0=Erase duplicated lines, 1=Redimention Vectors, 2=Insert intermediat points,3=Adition k1, 4=Substraction k1, 5=Multilication k1, 6=Division k1, 7=Connect mesh X1,Y1,Z1,idxs1,X2,X2,X2,idx2, 8=Order All vectors with the logic of In0 , 9=Invert Vectors, 10=Nearest Point in the vector. In3PointXYZ In0LstX In1LstY In2LstZ  (Out0-index Out1-PointXYZ), 11=Mul Spacing (K1[spcX,spcY,spcZ]=Spacing), 12=Div Spacing (K1[spcX,spcY,spcZ]=Spacing), 13=Distance pointIn0 and pontIn1,  14=Select specific segments [k1] in In0=lstPx In1=lstPy In2=lstPz In3=lstIndex (if k1 empty all segments are selected) , 15 swhitch element in a point k1=0 yz, k1=1 nothing k1=2 xz , 16 switch In0 and In1 (k1=1 nothing k0 swhich)",int,"");
+  BBTK_INPUT(VectorFilterDouble,k1,"(default [0])  nothing (Type0), k1[0]=new size vectors (Type 1) , nothing (Type2), k1[0] = Addition const. (Type 3), k1[0] = Substraction const. (Type 4), k1[0] = Multiplication const. (Type 5) , k1[0] = Division const. (Type 6),  k1[0] In0..9 element base to be order (Type 8)  , k1[spcX,spcY,spcZ] MulSpc In0_X,In1_Y,In2_Z (type 11),  k1[spcX,spcY,spcZ] DivSpc In0_X,In1_Y,In2_Z (type 12) , k1[segment1, segment2,..] (type 14) , direction (type 15), direction (type 16) ",std::vector<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>,"");
index 3c5d8d529fad22996977b50262ce561d00cd0421..6c0845c9b38500b37691ed072a5c57f9295c67f8 100644 (file)
@@ -47,6 +47,7 @@ void WriteColumnsString::Process()
        int i,size      = values.size();
        for ( i=0 ; i<size-1 ; i++ )
        {
+        printf("EED WriteColumnsString::Process %d    %d   \n", values[i].size()  , values[i+1].size()  );
                if ( values[i].size() != values[i+1].size() )
                {
                        ok=false;
@@ -85,7 +86,7 @@ void WriteColumnsString::Process()
                                } // for
                        } // for
                } else { // if write_fi.is_open()
-                       std::cout<<"EED WriteColumnsString::Process   Imposible to open file."<<std::endl;
+                       std::cout<<"EED WriteColumnsString::Process   Impossible to open file."<<std::endl;
                }//if open
 
        } else {
index b35d0ba05430309305edbfbb259015ae98263d5d..e64277729cb8283dc02ac7b7776404b0e7df94fa 100644 (file)
@@ -5,7 +5,7 @@
 
 APP_START
 CATEGORY:<VOID>
-DESCRIPTION:(C++,Python) Description ??
+DESCRIPTION:(C++,Python,JavaScript) Description ??
 AUTHOR:Author ??
 EXPORTFORMAT:0
 COMPLEXBOX:TRUE
index bfcf1e44053356b0065cd23986ddf6f7edd0cd79..91a09a8245b3f2a7b3bf00f4149ebc2a7b995af2 100644 (file)
@@ -12,7 +12,7 @@ include std
 define ImageVtkPropertiesWidget toolsbbtk
 
 author "Author ??"
-description "(C++,Python) Description ??"
+description "(C++,Python,JavaScript) Description ??"
 
 category "<VOID>"
 
index 6689a6089c52f8a5bbe6e345d219eff9ea0db8aa..13ae68a820abced8d0a88b2742ebb2047fa15d6d 100644 (file)
@@ -67,6 +67,7 @@ SET(${BBTK_PACKAGE_NAME}_BUILD_VERSION 0)
 # SET(${BBTK_PACKAGE_NAME}_USE_GDCM2 ON)
 # SET(${BBTK_PACKAGE_NAME}_USE_GSMIS ON)
 # SET(${BBTK_PACKAGE_NAME}_USE_WXWIDGETS ON)
+SET(${BBTK_PACKAGE_NAME}_USE_OPENMP ON)
 #===========================================================================
 
 #===========================================================================
index d6812aee9de8c3cbcb29190a902e23185784c106..69ff24f80b83883cef7292897b3310f5723e17f3 100644 (file)
@@ -49,43 +49,54 @@ void BinaryOperations::Process()
     
     if (bbGetInputIn1() == NULL)
     {
-        printf( "EED Warning!!!  (%s)  BinaryOperations::Process  Set In1 at least", bbGetFullName().c_str() );
+        printf( "EED Warning!!!  (%s)  BinaryOperations::Process  Set In1 at least \n", bbGetFullName().c_str() );
         bbSetOutputOut(NULL);
         return;
     }
-    
-    if (ope!=NULL)
-    {
-        ope->Delete();
-        ope = NULL;
-    } // if
-    ope = vtkImageMathematics::New();
-    
-    //EED 2017-01-01 Migration VTK7
-#if (VTK_MAJOR_VERSION <= 5) 
-    ope->SetInput1((vtkDataObject*)bbGetInputIn1());
-#endif
-#if (VTK_MAJOR_VERSION >= 6) 
-    ope->SetInput1Data((vtkDataObject*)bbGetInputIn1());
-#endif
-    
-    if (bbGetInputIn2() != NULL)
-    {
-        //EED 2017-01-01 Migration VTK7
-#if (VTK_MAJOR_VERSION <= 5) 
-        ope->SetInput2((vtkDataObject*)bbGetInputIn2());
-#endif
-#if (VTK_MAJOR_VERSION >= 6) 
-        ope->SetInput2Data((vtkDataObject*)bbGetInputIn2());
-#endif
-    } else {
-        printf( "EED Warning!!!  (%s)  BinaryOperations::Process  Set In2 at least", bbGetFullName().c_str() );
-        bbSetOutputOut(NULL);
-        return;
-    }
-    
+
     if ( (bbGetInputOperation()>=0) &&  (bbGetInputOperation()<=5) )
     {
+        if (ope!=NULL)
+        {
+            ope->Delete();
+            ope = NULL;
+        } // if
+        ope = vtkImageMathematics::New();
+        
+        //EED 2017-01-01 Migration VTK7
+    #if (VTK_MAJOR_VERSION <= 5)
+        ope->SetInput1((vtkDataObject*)bbGetInputIn1());
+    #endif
+    #if (VTK_MAJOR_VERSION >= 6)
+        ope->SetInput1Data((vtkDataObject*)bbGetInputIn1());
+    #endif
+     
+        if (bbGetInputIn2() != NULL)
+        {
+            //EED 2017-01-01 Migration VTK7
+    #if (VTK_MAJOR_VERSION <= 5)
+            ope->SetInput2((vtkDataObject*)bbGetInputIn2());
+    #endif
+    #if (VTK_MAJOR_VERSION >= 6)
+            ope->SetInput2Data((vtkDataObject*)bbGetInputIn2());
+    #endif
+        } else {
+            printf( "EED Warning!!!  (%s)  BinaryOperations::Process  Set In2 at least \n", bbGetFullName().c_str() );
+            bbSetOutputOut(NULL);
+            return;
+        }
+
+        int ext1[6];
+        int ext2[6];
+        bbGetInputIn1()->GetExtent(ext1);
+        bbGetInputIn2()->GetExtent(ext2);
+        if ( (ext1[0]!=ext2[0]) || (ext1[1]!=ext2[1]) || (ext1[2]!=ext2[2])  || (ext1[3]!=ext2[3])  || (ext1[4]!=ext2[4])  || (ext1[5]!=ext2[5]) )
+        {
+            printf( "EED Warning!!!  (%s)  BinaryOperations::Process  Sizes of images are not the same.\n", bbGetFullName().c_str() );
+            bbSetOutputOut(NULL);
+            return;
+        }
+        
         switch ( bbGetInputOperation() )
         {
             case 0:
@@ -124,6 +135,44 @@ void BinaryOperations::Process()
     {
         bbSetOutputOut( bbGetInputIn2() );
     }
+    if ( bbGetInputOperation()==8 )
+    {
+        if (bbGetInputIn1()!=NULL)
+        {
+            if (bbGetInputIn2()==NULL)
+            {
+                int ext[6];
+                bbGetInputIn1()->GetExtent(ext);
+                int dimX        = ext[1]-ext[0] + 1;
+                int dimY        = ext[3]-ext[2] + 1;
+                int dimZ        = ext[5]-ext[4] + 1;
+                int scalarSize  = bbGetInputIn1()->GetScalarSize();
+                long int size   = dimX * dimY * dimZ *scalarSize;
+                memset ( bbGetInputIn1()->GetScalarPointer(), 0 , size );
+            } else {
+                /*
+                int ext[6];
+                bbGetInputIn1()->GetExtent(ext);
+                int dimX1       = ext[1]-ext[0] + 1;
+                int dimY1       = ext[3]-ext[2] + 1;
+                int dimZ1       = ext[5]-ext[4] + 1;
+                int scalarSize1 = bbGetInputIn1()->GetScalarSize();
+                bbGetInputIn2()->GetExtent(ext);
+                int dimX2       = ext[1]-ext[0] + 1;
+                int dimY2       = ext[3]-ext[2] + 1;
+                int dimZ2       = ext[5]-ext[4] + 1;
+                int scalarSize2  = bbGetInputIn1()->GetScalarSize();
+                long int size   = dimX1 * dimY1 * dimZ1 * scalarSize1;
+                if ((dimX1==dimX2) && (dimY1==dimY2) && (dimZ1==dimZ2) && (scalarSize1==scalarSize2))
+                {
+                    memcpy( bbGetInputIn1()->GetScalarPointer(), bbGetInputIn2()->GetScalarPointer() , size );
+                } // if dim size
+                */
+                bbGetInputIn1()->DeepCopy( bbGetInputIn2() );
+            } // if In2
+        } // if In1
+        bbSetOutputOut( bbGetInputIn1() );
+    } // Operation 8
     // bbSignalOutputModification();
 }
 
index 49db6b15d79e308f211d7491167e1b094a2aeeac..ca684be0d7de3cb35aa30ac391119148df265f30 100644 (file)
@@ -73,7 +73,7 @@ BBTK_BEGIN_DESCRIBE_BLACK_BOX(BinaryOperations,bbtk::AtomicBlackBox);
   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, 6=Replace with In1, 7=Replace with In2",int,"");
+  BBTK_INPUT(BinaryOperations,Operation,"0:Add (default) , 1:subtract, 2:multiply, 3:divide, 4=Max, 5=Min, 6=Replace with In1, 7=Replace with In2, 8=DeepCopy de In2 to In1 (output In1)",int,"");
   BBTK_OUTPUT(BinaryOperations,Out,"",vtkImageData*,"");
 BBTK_END_DESCRIBE_BLACK_BOX(BinaryOperations);
 }
index 59de7670dfb893bef6e2f05335620008c99e32fd..385dcf5e7d98b3a92340a50c169b47c37b48dcb5 100644 (file)
@@ -72,7 +72,7 @@ BBTK_BEGIN_DESCRIBE_BLACK_BOX(CreateImage,bbtk::AtomicBlackBox);
        
        BBTK_NAME("CreateImage");
        BBTK_AUTHOR("Info-Dev");
-       BBTK_DESCRIPTION("(C++,Python)Create a new vtkImageData");
+       BBTK_DESCRIPTION("(C++,Python,JavaScript) Create a new vtkImageData");
        BBTK_CATEGORY("Filter");
        
        BBTK_INPUT(CreateImage,Dimensions,"[SizeX SizeY SizeZ] of the image ([250 250 250] default)",std::vector<int>,"");
index d8dd729c6bd7be6171ba0e77c88c83a0379807f8..6a766dc4a85efdc9003d536f1b9473eed3f68602 100644 (file)
@@ -85,7 +85,7 @@ namespace bbvtk
 //   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> >());
+  BBTK_DESCRIPTION("(C++,JavaScript) Gets the i-th element from the input vector ("+bbtk::TypeName<std::vector<T> >());
   typedef std::vector<T> Tvector;
   BBTK_TEMPLATE_INPUT(GetVectorElement, In,"(default NULL) Input",Tvector);
   BBTK_TEMPLATE_INPUT(GetVectorElement, I, "iElement (default 0)",int);
index c477aade336f12711fd8376ed00224843a8eca37..036553da4c835ef75135ea51dae6536cf70e0302 100644 (file)
@@ -77,30 +77,45 @@ void ImageBoundaries::Process()
                double lowervalue = bbGetInputLowerValue();
                double uppervalue = bbGetInputUpperValue();
                DEF_POINTER_IMAGE_VTK_CREA(vI,ssI,pI,stI,bbGetInputIn())        
-               long int index=0;
-
-               //int i,j;
-               int k;  
-
-int k1omp=(double)(maxZ-1)*0.0;
-int k2omp=(double)(maxZ-1)*0.2;
-int k3omp=(double)(maxZ-1)*0.4;
-int k4omp=(double)(maxZ-1)*0.6;
-int k5omp=(double)(maxZ-1)*0.8;
-int k6omp=(double)(maxZ-1)*1.0;
-
-//printf("EED ImageBoundaries::Process (with openmp)\n");
 
+        
+        int *vecXMin = (int*)malloc( maxZ*sizeof(int) );
+        int *vecYMin = (int*)malloc( maxZ*sizeof(int) );
+        int *vecZMin = (int*)malloc( maxZ*sizeof(int) );
+        int *vecXMax = (int*)malloc( maxZ*sizeof(int) );
+        int *vecYMax = (int*)malloc( maxZ*sizeof(int) );
+        int *vecZMax = (int*)malloc( maxZ*sizeof(int) );
+
+        //int i,j;
+        int k;
+
+        for ( k=0 ; k<maxZ ; k++)
+        {
+            vecXMax[k] = 0;
+            vecYMax[k] = 0;
+            vecZMax[k] = 0;
+            vecXMin[k] = maxX-1;
+            vecYMin[k] = maxY-1;
+            vecZMin[k] = maxZ-1;
+        } // for
+        
+        int k1omp = (double)(maxZ-1)*0.0;
+        int k2omp = (double)(maxZ-1)*0.2;
+        int k3omp = (double)(maxZ-1)*0.4;
+        int k4omp = (double)(maxZ-1)*0.6;
+        int k5omp = (double)(maxZ-1)*0.8;
+        int k6omp = (double)(maxZ-1)*1.0;
+
+printf("EED ImageBoundaries::Process (with openmp)\n");
 // http://jakascorner.com/blog/2016/05/omp-for.html
-//#pragma omp parallel shared(maxZ,bXMin,bYMin,bZMin,bXMax,bYMax,bZMax)
-//{ 
-               #pragma omp for
+      #pragma omp parallel for
                for ( k=0 ; k<maxZ ; k++)
                {
-//if ( (k1omp==k) || (k2omp==k) || (k3omp==k) || 
-//     (k4omp==k) || (k5omp==k) || (k6omp==k) ) { printf("  %d%\n", (int)(((double)k/(double)(maxZ-1))*100 )); }
+if ( (k1omp==k) || (k2omp==k) || (k3omp==k) ||
+     (k4omp==k) || (k5omp==k) || (k6omp==k) ) { printf("  %d%\n", (int)(((double)k/(double)(maxZ-1))*100 )); }
                        int i,j;
                        double vItmpOMP;
+            long int index = maxX * maxY * k;
                        for (j=0 ; j<maxY ; j++)
                        {
                                for (i=0 ; i<maxX ; i++)
@@ -110,19 +125,44 @@ int k6omp=(double)(maxZ-1)*1.0;
                                        index++;
                                        if ( (vItmpOMP>=lowervalue) && (vItmpOMP<=uppervalue)  )
                                        {
+                        /*
                                                if (i<bXMin) bXMin = i;
                                                if (j<bYMin) bYMin = j;
                                                if (k<bZMin) bZMin = k;
                                                if (i>bXMax) bXMax = i;
                                                if (j>bYMax) bYMax = j;
                                                if (k>bZMax) bZMax = k;
+                         */
+                        if (i<vecXMin[k]) vecXMin[k] = i;
+                        if (j<vecYMin[k]) vecYMin[k] = j;
+                        if (k<vecZMin[k]) vecZMin[k] = k;
+                        if (i>vecXMax[k]) vecXMax[k] = i;
+                        if (j>vecYMax[k]) vecYMax[k] = j;
+                        if (k>vecZMax[k]) vecZMax[k] = k;
                                        }
                                } // for k
                        } // for j
                } // i
-// } // #pragma
 
-               std::vector<int> tmpIndex;              
+        
+        for ( k=0 ; k<maxZ ; k++)
+        {
+            if (vecXMin[k]<bXMin) bXMin = vecXMin[k];
+            if (vecYMin[k]<bYMin) bYMin = vecYMin[k];
+            if (vecZMin[k]<bZMin) bZMin = vecZMin[k];
+            if (vecXMax[k]>bXMax) bXMax = vecXMax[k];
+            if (vecYMax[k]>bYMax) bYMax = vecYMax[k];
+            if (vecZMax[k]>bZMax) bZMax = vecZMax[k];
+        }
+                
+        delete vecXMin;
+        delete vecYMin;
+        delete vecZMin;
+        delete vecXMax;
+        delete vecYMax;
+        delete vecZMax;
+
+               std::vector<int> tmpIndex;
                std::vector<int> tmpSize;
                if (bXMin>bXMax){
                        tmpIndex.push_back(0);
index 23d43eafd2f045cbadb772855ba7aa2f1dba235a..815beba2b8c5c838870987879230f8ccf623761a 100644 (file)
@@ -68,7 +68,7 @@ class bbvtk_EXPORT ImageVtkProperties
 BBTK_BEGIN_DESCRIBE_BLACK_BOX(ImageVtkProperties,bbtk::AtomicBlackBox);
  BBTK_NAME("ImageVtkProperties");
  BBTK_AUTHOR("Info-Dev Creatis");
- BBTK_DESCRIPTION("(C++,Python) Image information Dim, Spc, Type, MinMax");
+ BBTK_DESCRIPTION("(C++,Python,JavaScript) Image information Dim, Spc, Type, MinMax");
  BBTK_CATEGORY("filter");
  BBTK_INPUT(ImageVtkProperties,In,"Input image (vtk)",vtkImageData*,"");
  BBTK_OUTPUT(ImageVtkProperties,Origin,"Origin", std::vector<double>  ,"");
index c3d673735b909fa31a941161b6cda435bc120144..04c398c5aad2973841ff5dc3f56adb1a819c0dd0 100644 (file)
@@ -177,7 +177,7 @@ class bbvtk_EXPORT Magnitud
 BBTK_BEGIN_DESCRIBE_BLACK_BOX(Magnitud,bbtk::AtomicBlackBox);
 BBTK_NAME("Magnitud");
 BBTK_AUTHOR("seba-tor@uniandes.edu.co");
-BBTK_DESCRIPTION("Receive an ImgaData and generates an Actor. 'EED this box habe to be splited in 5 box'");
+BBTK_DESCRIPTION("Receive an ImgaData and generates an Actor. 'EED this box have to be splited in 5 box'");
 BBTK_CATEGORY("");
 // -------------- [
   BBTK_INPUT(Magnitud,In,"Receive the image source",vtkImageData*, "");
index c82ca61b7d19ca42edbf29bcc7ff15889080ba6e..3e4c117cbfb190889f59635676da928301a39735 100644 (file)
 
 namespace bbvtk
 {
-
    BBTK_ADD_BLACK_BOX_TO_PACKAGE(vtk,MarchingCubes)
    BBTK_BLACK_BOX_IMPLEMENTATION(MarchingCubes,bbtk::AtomicBlackBox);
 
-
        void MarchingCubes::Process()
        {
             if (bbGetInputActive()==true)
@@ -71,29 +69,25 @@ namespace bbvtk
                 bbGetVtkObject()->Update();
             } // Active
        }
-       
        //-----------------------------------------------------------------     
        void MarchingCubes::bbUserSetDefaultValues()
        {
-                BBTK_VTK_SET_DEFAULT_VALUES();
+        BBTK_VTK_SET_DEFAULT_VALUES();
                bbSetInputActive(true);
                bbSetInputValue(400);
                bbSetInputComputeNormalsOn(true);
                bbSetInputComputeScalarsOn(true);
        }
-       
-       //-----------------------------------------------------------------     
+       //-----------------------------------------------------------------
        void MarchingCubes::bbUserInitializeProcessing()
        {
                BBTK_VTK_INITIALIZE_PROCESSING();
        }
-       
        //-----------------------------------------------------------------     
        void MarchingCubes::bbUserFinalizeProcessing()
        {
                BBTK_VTK_FINALIZE_PROCESSING();
        }       
-       
 } // EO namespace bbvtk
 #endif //_USE_VTK_
 
index 9e63987690a16c1fcd6fb8757738a5505ffb18ca..07eafb70cd47c87542ae39e522b28aa2708621aa 100644 (file)
@@ -41,32 +41,29 @@ void PlaneClipPolyData::Process()
     bbSetOutputClippedPolyData(outPolydata);
 
    // std::cout << "RaC PlaneClipPolyData::Process END "<<polydataCopy<< 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 PlaneClipPolyData::bbUserSetDefaultValues()
 {
-
-  
 }
-//===== 
+
+//=====
 // 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 PlaneClipPolyData::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 PlaneClipPolyData::bbUserFinalizeProcessing()
 {
-  
 }
-}
-// EO namespace bbvtk
+
+}// EO namespace bbvtk
 
 
index d75378b2b960c165f38753cad40ed3243f9379f5..7fa160ac21d90d427efd76c825b29487af20cc8d 100644 (file)
@@ -24,9 +24,10 @@ void ProbeFilter::Process()
 //      (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 ( (bbGetInputSource()==NULL) || (bbGetInputInput()==NULL)  )
        {
-                bbSetOutputOut( NULL ); 
+                bbSetOutputOut( NULL );
        } else {
        //EED 2017-01-01 Migration VTK7
 
@@ -41,7 +42,8 @@ void ProbeFilter::Process()
                  bbSetOutputOut( _probefilter->GetOutput() );
        } // if source input
 }
-//===== 
+
+//=====
 // 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()
@@ -53,36 +55,31 @@ void ProbeFilter::bbUserSetDefaultValues()
 //   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 
-
+//    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
+
+}// EO namespace bbvtk
 
 
index 4117fdfd60750c9e56acc9ff36f745ae2d7c9de0..3b5535cd2e67ff533ddb67772d4af4b7db243cbc 100644 (file)
@@ -63,8 +63,19 @@ void RescaleSlopeIntercept::Process()
        double  A=bbGetInputA();
        double  B=bbGetInputB();
        
-       if (bbGetInputIn()!=0)
+       if (bbGetInputIn()!=NULL)
        {
+
+        if (filter1!=NULL){
+            mchange->Delete();
+            filter1->Delete();
+            filter2->Delete();
+            filter1    = vtkImageShiftScale::New();
+            filter2    = vtkImageShiftScale::New();
+            mchange = vtkImageChangeInformation::New();
+        }
+        
+        
                int outputformat = bbtkStaticLecture::GetTypeFormat( bbGetInputOutputFormat() , bbGetInputIn() );
                bbGetInputIn()->GetScalarRange(range);
                bbGetInputIn()->GetSpacing(spc);
@@ -149,7 +160,6 @@ void RescaleSlopeIntercept::Process()
 //===== 
 void RescaleSlopeIntercept::bbUserSetDefaultValues()
 {
-
 //  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
 //    Here we initialize the input 'In' to 0
        bbSetInputIn(NULL);
@@ -161,7 +171,8 @@ void RescaleSlopeIntercept::bbUserSetDefaultValues()
        filter2 = NULL;
        mchange = NULL;
 }
-//===== 
+
+//=====
 // Don't edit this file. This file is generated from xml description.. 
 //===== 
 void RescaleSlopeIntercept::bbUserInitializeProcessing()
@@ -174,12 +185,12 @@ void RescaleSlopeIntercept::bbUserInitializeProcessing()
        filter2 = vtkImageShiftScale::New();
        mchange = vtkImageChangeInformation::New();
 }
-//===== 
+
+//=====
 // Don't edit this file. This file is generated from xml description.. 
 //===== 
 void RescaleSlopeIntercept::bbUserFinalizeProcessing()
 {
-
 //  THE FINALIZATION METHOD BODY :
 //    Here does nothing 
 //    but this is where you should desallocate the internal/output pointers 
@@ -189,7 +200,6 @@ void RescaleSlopeIntercept::bbUserFinalizeProcessing()
        filter2->Delete();
 }
        
-}
-// EO namespace bbvtk
+}// EO namespace bbvtk
 
 
index 917a66effc0896ca8f942a5f3b1f5a33c9f537b8..6f7817d74fa6d205347144cff727705f263fbd39 100644 (file)
@@ -35,86 +35,80 @@ namespace bbvtk
 
 BBTK_ADD_BLACK_BOX_TO_PACKAGE(vtk,StructuredPointsReader)
 BBTK_BLACK_BOX_IMPLEMENTATION(StructuredPointsReader,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 StructuredPointsReader::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')
-
+    
+    // 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')
+    
     //warning: comparison with string literal results in unspecified behaviour
-       //if ( bbGetInputIn().c_str()!="")
+    //if ( bbGetInputIn().c_str()!="")
     std::string empty("");  // JPR
     if ( bbGetInputIn().c_str()!=empty)
-       {
-               spr -> SetFileName( bbGetInputIn().c_str() );
-//EED 2017-01-01 Migration VTK7
+    {
+        spr -> SetFileName( bbGetInputIn().c_str() );
+        //EED 2017-01-01 Migration VTK7
 #if VTK_MAJOR_VERSION <= 5
-               sp = spr->GetOutput();
-               sp -> Update();
-               bbSetOutputOut( sp );
+        sp = spr->GetOutput();
+        sp -> Update();
+        bbSetOutputOut( sp );
 #else
-               spr -> Update();
-               bbSetOutputOut( spr->GetOutput() );
+        spr -> Update();
+        bbSetOutputOut( spr->GetOutput() );
 #endif
-       } else {
-               bbSetOutputOut( NULL );
-       }
-       
+    } 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 StructuredPointsReader::bbUserSetDefaultValues()
 {
-
-//  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
-//    Here we initialize the input 'In' to 0
-   bbSetInputIn("");
-   bbSetOutputOut( NULL );
-
+    
+    //  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
+    //    Here we initialize the input 'In' to 0
+    bbSetInputIn("");
+    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 StructuredPointsReader::bbUserInitializeProcessing()
 {
-
-//  THE INITIALIZATION METHOD BODY :
-//    Here does nothing 
-//    but this is where you should allocate the internal/output pointers 
-//    if any 
-       
-       sp = vtkImageData::New();
-       spr = vtkStructuredPointsReader::New();    
-       
-       
-       
+    //  THE INITIALIZATION METHOD BODY :
+    //    Here does nothing
+    //    but this is where you should allocate the internal/output pointers
+    //    if any
+    sp = vtkImageData::New();
+    spr = vtkStructuredPointsReader::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 StructuredPointsReader::bbUserFinalizeProcessing()
 {
-
-//  THE FINALIZATION METHOD BODY :
-//    Here does nothing 
-//    but this is where you should desallocate the internal/output pointers 
-//    if any
-  
-}
+    //  THE FINALIZATION METHOD BODY :
+    //    Here does nothing
+    //    but this is where you should desallocate the internal/output pointers
+    //    if any
 }
-// EO namespace bbvtk
+
+}// EO namespace bbvtk
 
 
index 8b71e0052137ffced07620883c868fcabab315e4..88cc6acbc3c5a5a4c8c309d29b0dbeb092ea3674 100644 (file)
 
 #include "bbvtkTransform.h"
 #include "bbvtkPackage.h"
+
 #include "vtkMath.h"
+#include "vtkMatrix4x4.h"
+
 namespace bbvtk
 {
   BBTK_ADD_BLACK_BOX_TO_PACKAGE(vtk,Transform);
@@ -130,16 +133,48 @@ namespace bbvtk
           result->RotateWXYZ( ang  , v3[0], v3[1], v3[2] );
       } // if rotation size >=4
 
+      if (bbGetInputManualMatrixIn().size()==16)
+      {
+          std::vector<double> manaulMatrixIn = bbGetInputManualMatrixIn();
+          vtkMatrix4x4* m = result->GetMatrix();
+          int i,j,ii=0;
+          for (j=0;j<4;j++)
+          {
+              for (i=0;i<4;i++)
+              {
+                  m->SetElement(j,i,manaulMatrixIn[ii]);
+                  ii++;
+              }// for i
+          } // for j
+          m->Modified();
+          result->Update();
+      } // ManualMatrix
+      
+      vtkTransform * finalTransform;
          if (bbGetInputInverse()==false)
          {
-               bbSetOutputOut(result);
+        finalTransform = result;
          } else {
                vtkMatrix4x4 *matrix;
                matrix=vtkMatrix4x4::New();
                result->GetInverse(matrix);
                resultInverse->SetMatrix( matrix );
-               bbSetOutputOut(resultInverse);
+               finalTransform = resultInverse;
          }  // if Inverse
+      
+      bbSetOutputOut(finalTransform);
+
+      std::vector<double> manualMatrixOut;
+      vtkMatrix4x4* m = finalTransform->GetMatrix();
+      int i,j,ii=0;
+      for (j=0;j<4;j++)
+      {
+          for (i=0;i<4;i++)
+          {
+              manualMatrixOut.push_back( m->GetElement(i,j) );
+          }// for i
+      } // for j
+      bbSetOutputManualMatrixOut( manualMatrixOut );
   }
   
 }// EO namespace bbvtk
index 46e1c766c6c83da018be478fd8bf05f3bfa6bca8..2a8d0cd7886accf5438c5e6c5083e88630ad2a92 100644 (file)
@@ -48,7 +48,9 @@ namespace bbvtk
     BBTK_DECLARE_INPUT(Translate,std::vector<double>);
     BBTK_DECLARE_INPUT(Spacing,std::vector<double>);
     BBTK_DECLARE_INPUT(RotateToNormal,std::vector<double>);
+    BBTK_DECLARE_INPUT(ManualMatrixIn,std::vector<double>);
     BBTK_DECLARE_OUTPUT(Out,vtkLinearTransform *);
+    BBTK_DECLARE_OUTPUT(ManualMatrixOut,std::vector<double>);
     BBTK_PROCESS(Process);
     void Process();
     
@@ -73,8 +75,10 @@ BBTK_BEGIN_DESCRIBE_BLACK_BOX(Transform,bbtk::AtomicBlackBox);
   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_INPUT(Transform,RotateToNormal,"(default is EMPTY) Normal vector [nx,ny,nz]",std::vector<double>,"");
+  BBTK_INPUT(Transform,ManualMatrixIn,"(default EMPTY) The 16 elements of a 4x4 matrix",std::vector<double>,"");
 
   BBTK_OUTPUT(Transform,Out,"vtkTransform result",vtkLinearTransform *,"");
+  BBTK_OUTPUT(Transform,ManualMatrixOut,"The 16 elements of the 4x4 matrix",std::vector<double>,"");
 
 BBTK_END_DESCRIBE_BLACK_BOX(Transform);
 }
index fb58558ccb6c27dc3f3814fd4b44194f972f8231..160fd52a2d88aee9377f22240f90e1a9bb46bf98 100644 (file)
@@ -39,7 +39,9 @@ void UpdateRender::Process()
     {
         if (bbGetInputRenderer()!=NULL)
         {
-            bbGetInputRenderer()->GetRenderWindow()->Render();
+//EED 2025-01-20 Create sync mechanism windows
+//          bbGetInputRenderer()->GetRenderWindow()->Render();
+            bbGetInputRenderer()->GetRenderWindow()->GetInteractor()->Render();
         } // Renderer
     } // if Active
 }
index 87e3acfffb44e1b30a7897a77200fdd0f20a6c1d..fd386a27348cc8518d332e2908c06c2fda776247 100644 (file)
@@ -141,10 +141,6 @@ void ButtonSelectFilesDirectoryWidget::OnButton( wxEvent& )
   }
 
 
-
-
-
-
 BBTK_ADD_BLACK_BOX_TO_PACKAGE(wx,ButtonSelectFilesDirectory)
 BBTK_BLACK_BOX_IMPLEMENTATION(ButtonSelectFilesDirectory,bbtk::WxBlackBox);
 //===== 
@@ -152,28 +148,33 @@ BBTK_BLACK_BOX_IMPLEMENTATION(ButtonSelectFilesDirectory,bbtk::WxBlackBox);
 //===== 
 void ButtonSelectFilesDirectory::Process()
 {
-
     ButtonSelectFilesDirectoryWidget* w = (ButtonSelectFilesDirectoryWidget*)bbGetOutputWidget();
     if (w) 
        {
                UpdateLabel();
        }
-  
+    
+    if (bbGetInputType()==1)
+    {
+        bbSetOutputOut( bbGetInputDefaultDir() );
+    } else {
+        bbSetOutputOut( bbGetInputDefaultFile() );
+    }
+
 }
-//===== 
+
+//=====
 // 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 ButtonSelectFilesDirectory::CreateWidget(wxWindow* parent)
 {
-
     bbSetOutputWidget
       ( new ButtonSelectFilesDirectoryWidget ( this, //bbGetWxParent(), 
                                                                 parent,
                                                                 bbtk::std2wx(bbGetInputLabel()) ) );
-
-  
 }
-//===== 
+
+//=====
 // 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 ButtonSelectFilesDirectory::bbUserSetDefaultValues()
@@ -186,14 +187,13 @@ void ButtonSelectFilesDirectory::bbUserSetDefaultValues()
 //===== 
 void ButtonSelectFilesDirectory::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 ButtonSelectFilesDirectory::bbUserFinalizeProcessing()
 {
-
 }
 
 void ButtonSelectFilesDirectory::UpdateLabel()
@@ -202,8 +202,6 @@ void ButtonSelectFilesDirectory::UpdateLabel()
     wxwidget->SetLabel( bbtk::std2wx( bbGetInputLabel() ) );
 }   
 
-
-
 }// EO namespace bbwx
 
 
index 28f55ca9d9b1157d4d8919b9a2c4c0d7543e1430..9f44c5bf862172a3555eb12425e6b7847f76c4af 100644 (file)
@@ -50,7 +50,7 @@ class bbwx_EXPORT ButtonSelectFilesDirectory
 BBTK_BEGIN_DESCRIBE_BLACK_BOX(ButtonSelectFilesDirectory,bbtk::WxBlackBox);
   BBTK_NAME("ButtonSelectFilesDirectory");
   BBTK_AUTHOR("InfoDev");
-  BBTK_DESCRIPTION("No Description.");
+  BBTK_DESCRIPTION("(C++,Python) No Description.");
   BBTK_CATEGORY("__CategoryBlackBox__");
   BBTK_INPUT(ButtonSelectFilesDirectory,Type,"(default 0)  0:Files  1:Directory",int,"");
   BBTK_INPUT(ButtonSelectFilesDirectory,Label,"Label",std::string,"");
index ef5ec23d8810a246c12a4b35fa86f75406d6052c..820e2ae0ff2f93f922733f0a2ea2519662a78f8e 100644 (file)
@@ -151,11 +151,11 @@ namespace bbwx
   BBTK_NAME("CheckBox");
   BBTK_AUTHOR("jpr@creatis.insa-lyon.fr");
   // Already inserted for any WxBlackBox  BBTK_CATEGORY("widget");
-  BBTK_DESCRIPTION("(C++,Python) CheckBox widget");
+  BBTK_DESCRIPTION("(C++,Python,JavaScript) CheckBox widget");
   BBTK_INPUT(CheckBox, In,   "Initial value of the CheckBox (default false)",bool,       "");
   BBTK_INPUT(CheckBox, Title,"Title shown above the CheckBox (default '') ", std::string,"");
   BBTK_OUTPUT(CheckBox,Out,  "Current value of the CheckBox",                bool,       "");
-  BBTK_INPUT(CheckBox,ReactiveOnKeystroke,"0: no event generated when the checkbox is clicked on, 1: event generated when the checkbox is clicked on (default 1) ", int,"");
+  BBTK_INPUT(CheckBox,ReactiveOnKeystroke,"(default 1)   0: no event generated when the checkbox is clicked on, 1: event generated when the checkbox is clicked on ", int,"");
   BBTK_END_DESCRIBE_BLACK_BOX(CheckBox);
   //=================================================================
   
index 68ea71c3a668f7700c1940c70c485ca7682dcb38..59735b103a311011334025165f79775dd3064815 100644 (file)
@@ -40,7 +40,7 @@ class bbwx_EXPORT ComboBox
 BBTK_BEGIN_DESCRIBE_BLACK_BOX(ComboBox,bbtk::WxBlackBox);
        BBTK_NAME("ComboBox");
        BBTK_AUTHOR("Info-Dev");
-       BBTK_DESCRIPTION("(C++,Python) wxComboBox");
+       BBTK_DESCRIPTION("(C++,Python,JavaScript) wxComboBox");
        BBTK_CATEGORY("__CategoryBlackBox__");
 
        BBTK_INPUT(ComboBox,Title,"Title prepended to the text",std::string,"");
index aa4ac32c26fa24d1a9e7e73c0c71159548aef2dc..eb4b68e7e8788669dfc2877a296032815120db83 100644 (file)
@@ -88,7 +88,7 @@ namespace bbwx
   BBTK_BEGIN_DESCRIBE_BLACK_BOX(CommandButton,bbtk::WxBlackBox); 
   BBTK_NAME("CommandButton"); 
   BBTK_AUTHOR("eduardo.davila@creatis.insa-lyon.fr"); 
-  BBTK_DESCRIPTION("Button which executes bbi commands"); 
+  BBTK_DESCRIPTION("(C++,JavaScript) Button which executes bbi commands"); 
   
   typedef std::vector<double> vectorcolour;
   
index ab4116b407a95cba523061f961d1e31a8ab88675..461a7d4865ee5b536f3dac8c2d2e735dcd94c8bb 100644 (file)
@@ -3,6 +3,7 @@
 //===== 
 #include "bbwxFreeMemoryAlert.h"
 #include "bbwxPackage.h"
+
 #include <wx/msgdlg.h>
 
 namespace bbwx
@@ -31,53 +32,52 @@ void FreeMemoryAlert::Process()
        double memfreeGB = (double) (wxGetFreeMemory().ToLong()/1000000000.0);
        if ( memfreeGB < bbGetInputFreeMemoryLimit() ) 
        {
-               wxMessageBox(wxString::Format(  "This application needs minimum %4.1f Gb to be executed correctly. \nTry to close somes applications you don't need. \n\n Actual free memory = %4.1f Gb\n",bbGetInputFreeMemoryLimit(),
+        /*
+        wxMessageBox( wxString::Format(        "This application needs minimum %4.1f Gb to be executed correctly. \nTry to close somes applications you don't need. \n\n Actual free memory = %4.1f Gb\n" ,bbGetInputFreeMemoryLimit(),
                                                                memfreeGB ),
                                                                _T("Warning!"), 
-                                                               wxOK | wxICON_INFORMATION, 
-                                                               NULL);          
-       } // if memfree
-
+                                                               wxOK | wxICON_INFORMATION | wxSTAY_ON_TOP | wxCENTRE ,
+                                                               NULL);
+        */
 
-  
+        
+        wxMessageDialog *dial = new wxMessageDialog( NULL , wxT("Please select a Contour"), wxT("Warning"), wxOK | wxSTAY_ON_TOP| wxICON_EXCLAMATION  ) ;
+        dial->ShowModal();
+       } // if memfree
 }
-//===== 
+
+//=====
 // 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 FreeMemoryAlert::bbUserSetDefaultValues()
 {
-
 //  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
 //    Here we initialize the input 'In' to 0
    bbSetInputFreeMemoryLimit(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)
 //===== 
 void FreeMemoryAlert::bbUserInitializeProcessing()
 {
-
 //  THE INITIALIZATION METHOD BODY :
 //    Here does nothing 
 //    but this is where you should allocate the internal/output pointers 
-//    if any 
-
-  
+//    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 FreeMemoryAlert::bbUserFinalizeProcessing()
 {
-
 //  THE FINALIZATION METHOD BODY :
 //    Here does nothing 
 //    but this is where you should desallocate the internal/output pointers 
 //    if any
-  
 }
-}
-// EO namespace bbwx
+
+}// EO namespace bbwx
 
 
index 9474ae5e4bf29e686d72532ed154e1bf0bbe06d5..face2183304d08c047bfc3a9a34376da6ad53db0 100644 (file)
   Version:   $Revision: 1.10 $
 =========================================================================*/
 
-
 /**
  *  \file
  *  \brief
  */
 
-
 #ifdef _USE_WXWIDGETS_
 
 #include "bbwxLayoutLine.h"
 #include "bbwxPackage.h"
 #include "bbtkUtilities.h"
 
-
 namespace bbwx
 {
   BBTK_ADD_BLACK_BOX_TO_PACKAGE(wx, LayoutLine);
@@ -67,23 +64,22 @@ namespace bbwx
                bbSetInputWidget9(NULL);
        }
        
-       //-----------------------------------------------------------------     
-       void LayoutLine::bbUserInitializeProcessing()
-       {
-       }
-       
-       //-----------------------------------------------------------------     
-       void LayoutLine::bbUserFinalizeProcessing()
-       {
-       }       
+//-----------------------------------------------------------------
+void LayoutLine::bbUserInitializeProcessing()
+{
+}
        
+//-----------------------------------------------------------------
+void LayoutLine::bbUserFinalizeProcessing()
+{
+}
        
+//-----------------------------------------------------------------
 void LayoutLine::Process()
 {
-       PutWinTitle();
+    PutWinTitle();
 }
-  
-       
+       
 /*
   void LayoutLine::TryInsertWindow(wxWindow *parent, wxWindow *w,wxBoxSizer *sizer)
   {
@@ -98,7 +94,7 @@ void LayoutLine::Process()
   void LayoutLine::CreateWidget(wxWindow* parent)
   {
     wxBoxSizer *sizer;
-    wxPanel *w=new wxPanel(parent, -1, wxDefaultPosition, wxSize(40,40) );
+    wxPanel *w = new wxPanel(parent, -1, wxDefaultPosition, wxSize(40,40) );
     w->SetName( bbtk::std2wx( bbGetInputWinTitle() ) );
     
     int style=0;
@@ -110,9 +106,7 @@ void LayoutLine::Process()
     { 
                style=wxVERTICAL;   
        } // if
-    
     sizer      = new wxBoxSizer(style);
-
        wxWindow* cw;
       
 //
@@ -150,15 +144,21 @@ void LayoutLine::Process()
     TryInsertWindow(w,bbGetInputWidget8(),sizer);
     TryInsertWindow(w,bbGetInputWidget9(),sizer);
     */
+    w -> SetSizer(sizer);
     w -> SetAutoLayout(true);
-    w  -> SetSizer(sizer);
+    w -> Layout();
     bbSetOutputWidget( w );
+      
   }
   
   // This callback is necessary to get actual processing of the view 
   // when window is shown
   void  LayoutLine::OnShowWidget()
   {
+      if (bbGetOutputWidget()!=NULL)
+      {
+          bbGetOutputWidget()->Layout();
+      } // if bbGetOutputWidget
   }
 
 }//namespace bbwx
index e4889b440f98a221c669547aa5dd13ef391ec274..9599c0384c96e423b9c1b8a250f0e73bdbb76bdf 100644 (file)
  * \class bbtk::NodePatern 
  * \brief Pattern for the definition of a new type of Node 
  */
-
-
 #ifdef USE_WXWIDGETS
 
-
 #ifndef __bbWxLayoutLine_h__
 #define __bbWxLayoutLine_h__
 
 #include "bbtkWxBlackBox.h"
 #include "bbwx_EXPORT.h"
 
-
 namespace bbwx
 {
-  
-
-  
   //===========================================================
   class bbwx_EXPORT LayoutLine : public bbtk::WxBlackBox
   {
-    
     BBTK_BLACK_BOX_INTERFACE(LayoutLine,bbtk::WxBlackBox);
     BBTK_DECLARE_INPUT(Widget1,wxWindow*);
     BBTK_DECLARE_INPUT(Widget2,wxWindow*);
@@ -83,24 +75,20 @@ namespace bbwx
     BBTK_PROCESS(Process);
     BBTK_CREATE_WIDGET(CreateWidget);
     BBTK_ON_SHOW_WIDGET(OnShowWidget);
     void Process();
     void CreateWidget(wxWindow*);
     void OnShowWidget();
-    
   protected:
        void TryInsertWindow(wxWindow *parent, wxWindow *w,wxBoxSizer *sizer);
-
   };
   //===========================================================
-  
+
   //=================================================================
   // BlackBox description
   BBTK_BEGIN_DESCRIBE_BLACK_BOX(LayoutLine,bbtk::WxBlackBox);
   BBTK_NAME("LayoutLine");
   BBTK_AUTHOR("eduardo.davila@creatis.insa-lyon.fr");
-  BBTK_DESCRIPTION("(C++,Python) LayoutLine widget (wxBoxSizer)");
+  BBTK_DESCRIPTION("(C++,Python,JavaScript) LayoutLine widget (wxBoxSizer)");
   // Already inserted for any WxBlackBox  BBTK_CATEGORY("widget");  
   BBTK_INPUT(LayoutLine,Widget1,"widget 1",wxWindow*,"");
   BBTK_INPUT(LayoutLine,Widget2,"widget 2",wxWindow*,"");
@@ -114,13 +102,7 @@ namespace bbwx
   BBTK_INPUT(LayoutLine,Orientation,"Orientation (default V), 0=H=HORIZONTAL , 1=V=VERTICAL",std::string,"");
   BBTK_END_DESCRIBE_BLACK_BOX(LayoutLine);
   //=================================================================
-  
-  
-  
 }
-
-
-
 //namespace bbtk
 #endif  //__bbtkWxLayoutLine_h__
 
index e632f95ef453afc75e6c0222e4b818dd3f58098e..f1a9c786ed8ee7fa943fef85618032d869a65b74 100644 (file)
@@ -58,7 +58,7 @@ namespace bbwx
                bbSetInputProportion(50);
                bbSetInputWidget1(NULL);
                bbSetInputWidget2(NULL);
-               w=NULL; 
+               w = NULL;
        }
        
        //-----------------------------------------------------------------     
@@ -78,7 +78,7 @@ namespace bbwx
 
   void LayoutSplit::CreateWidget(wxWindow* parent)
   {
-    wxPanel            *splitterWindowPanel    = new wxPanel(parent, -1, wxDefaultPosition, wxSize(40,40) );
+    wxPanel *splitterWindowPanel       = new wxPanel(parent, -1, wxDefaultPosition, wxSize(40,40) );
 
  //   wxSplitterWindow *w
                        w                       = new wxSplitterWindow( splitterWindowPanel, //bbGetWxParent(),
@@ -88,7 +88,7 @@ namespace bbwx
 //                                                                     wxSize(400,200),
                                                                        wxSP_3DSASH |
                                                                        wxSP_LIVE_UPDATE );
-       w->SetName( bbtk::std2wx( bbGetInputWinTitle() ) );
+    w->SetName( bbtk::std2wx( bbGetInputWinTitle() ) );
        w->SetMinimumPaneSize(15);
        //RaC Nov2012 Correctly resize internal panels with the window resize event
        w->SetSashGravity(0.5);
@@ -100,20 +100,26 @@ namespace bbwx
     if (w2==NULL) { w2=new wxPanel(bbGetWxParent()); }
     w1->Reparent(w);
     w2->Reparent(w);
- */ 
-
+ */
          wxWindow* w1 = bbCreateWidgetOfInput("Widget1",w);
          wxWindow* w2 = bbCreateWidgetOfInput("Widget2",w);
          if (w1==NULL) { w1=new wxPanel(splitterWindowPanel); }
          if (w2==NULL) { w2=new wxPanel(splitterWindowPanel); }
-         
          int orientation=0;
-    if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"0|H|h|horizontal|Horizontal|HORIZONTAL")==true)  { orientation=0; }
-    if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"1|V|v|vertical|Vertical|VERTICAL")==true)    { orientation=1; }
-    
-
-    if (orientation==1) { w->SplitHorizontally( w1, w2, 100); }
-    else                { w->SplitVertically( w1, w2, 100);   }
+    if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"0|H|h|horizontal|Horizontal|HORIZONTAL")==true)  
+    {
+        orientation=0;
+    }
+    if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"1|V|v|vertical|Vertical|VERTICAL")==true)    
+    {
+        orientation=1;
+    } // ig
+    if (orientation==1)
+    {
+        w->SplitHorizontally( w1, w2, 100);
+    } else {
+        w->SplitVertically( w1, w2, 100);
+    }
 
 //EED 2024-03-30  
     wxBoxSizer *sizer  = new wxBoxSizer(wxVERTICAL);
@@ -123,10 +129,8 @@ namespace bbwx
     splitterWindowPanel->Layout();
     bbSetOutputWidget( splitterWindowPanel );
 //    bbSetOutputWidget( w );
-
   }
 
-
   // This callback is necessary to get actual processing of the view 
   // when window is shown
   void  LayoutSplit::OnShowWidget()
@@ -145,27 +149,22 @@ namespace bbwx
        //      bbtkError("LayoutSplit::OnShowWidget() : win == 0 !");
       }
     w->GetParent()->GetParent()->GetClientSize(&width,&height);
-    int    pos = 100;
-    double ww  = width;
-    double hh  = height;
-    double proportion = bbGetInputProportion();
+    int    pos          = 100;
+    double ww           = width;
+    double hh           = height;
+    double proportion   = bbGetInputProportion();
     if (bbtk::Utilities::loosematch(bbGetInputOrientation(),
                                    "0|H|h|horizontal|Horizontal|HORIZONTAL")==true)  
-      { 
-       pos = (int)(ww * proportion * 0.01);
-      }    else {
-       pos = (int)(hh * proportion * 0.01);
-      } 
-  
-       printf("EED LayoutSplit::OnShowWidget  width=%d   height=%d  proportion=%d pos=%d box=%s\n", width,height,bbGetInputProportion(),pos, bbGetFullName().c_str() );        
+    {
+        pos = (int)(ww * proportion * 0.01);
+    }    else {
+        pos = (int)(hh * proportion * 0.01);
+    }
     w->SetSashPosition(pos,true);
     //RaC Nov2012 Correctly resize internal panels with the window resize event
     w->SetSashGravity(0.5);
-
   }
 
-
-
 }//namespace bbwx
 
 #endif // _USE_WXWIDGETS_
index 02ac02c5c0dbe09faed7d3f9dc3d96721d140298..39c23e331e04ecddeb7f6362383eb10f0972df1b 100644 (file)
@@ -88,7 +88,7 @@ namespace bbwx
   BBTK_BEGIN_DESCRIBE_BLACK_BOX(LayoutSplit,bbtk::WxBlackBox);
   BBTK_NAME("LayoutSplit");
   BBTK_AUTHOR("laurent.guigues@creatis.insa-lyon.fr");
-  BBTK_DESCRIPTION("(C++,Python) Widget which splits a window in two fixed size parts (wxSplitterWindow)");
+  BBTK_DESCRIPTION("(C++,Python,JavaScript) Widget which splits a window in two fixed size parts (wxSplitterWindow)");
   // Already inserted for any WxBlackBox  BBTK_CATEGORY("widget");
   BBTK_INPUT(LayoutSplit,Widget1,"Upper or left widget",wxWindow*,"");
   BBTK_INPUT(LayoutSplit,Widget2,"Lower or right widget",wxWindow*,"");
index e96c281dcf8307e19abe1fc508c07b39f2dc0a76..1aad1fd3be5586d11c79e5a14a0578f2749858b0 100644 (file)
   Date:      $Date: 2012/11/16 08:52:14 $
   Version:   $Revision: 1.12 $
 =========================================================================*/
-
 /**
  *  \file 
  *  \brief 
  */
-
-
 #ifdef _USE_WXWIDGETS_
 
-
 #include "bbwxLayoutTab.h"
 #include "bbwxPackage.h"
 #include "bbtkUtilities.h"
 #include "bbtkBlackBoxInputConnector.h"
 
-
-
 namespace bbwx
 {
-
-
    //--------------------------------------------------------------------------
   class TabWidget : public wxPanel
   {
@@ -66,7 +58,6 @@ namespace bbwx
     wxNotebook *mwxNotebook;
   }; 
 
-
   TabWidget::TabWidget(LayoutTab* box, wxWindow *parent,long style )
     : wxPanel( parent, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL),
       mBox(box)
@@ -191,8 +182,8 @@ void LayoutTab::SetTitleTabs()
 
   void LayoutTab::Process() 
   { 
-       PutWinTitle();
-       SetTitleTabs();
+      PutWinTitle();
+      SetTitleTabs();
   }
     
   void LayoutTab::CreateWidget(wxWindow* parent) 
@@ -229,21 +220,22 @@ void LayoutTab::SetTitleTabs()
     TryInsertWindow(w,"Widget7");
     TryInsertWindow(w,"Widget8");
     TryInsertWindow(w,"Widget9");
+    w->SetAutoLayout(true);
     w->Layout();
+    tabwidget->Layout();
 //EED2020-04-06
 //    bbSetOutputWidget( w );
     bbSetOutputWidget( tabwidget );
-  }
-  
-  
- // This callback is necessary to get actual processing of the view 
+}
+    
+// 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!=NULL)
        {
                if (w->GetPageCount()>0)
                {
@@ -253,10 +245,13 @@ void  LayoutTab::OnShowWidget()
                                w->AdvanceSelection(); 
                        } // for
                } // if PageCount
-       } // if w    
+       } // if w
+    if (bbGetOutputWidget()!=NULL)
+    {
+        bbGetOutputWidget()->Layout();
+    } // if bbGetOutputWidget
 }
 
-
 }//namespace bbwx
 
 #endif
index f00c62e4ecbb88dfb0a4d9980c5e70ecf2c2c43f..157a3e64c17db9479485ff33542a277406028949 100644 (file)
@@ -93,7 +93,7 @@ namespace bbwx
   BBTK_BEGIN_DESCRIBE_BLACK_BOX(LayoutTab,bbtk::WxBlackBox);
   BBTK_NAME("LayoutTab");
   BBTK_AUTHOR("eduardo.davila@creatis.insa-lyon.fr");
-  BBTK_DESCRIPTION("(C++, Python) LayoutTab widget (wxNotebook) The label of each 'note book'  will be the name of the object it contains");
+  BBTK_DESCRIPTION("(C++,Python,JavaScript) LayoutTab widget (wxNotebook) The label of each 'note book'  will be the name of the object it contains");
     // Already inserted for any WxBlackBox  BBTK_CATEGORY("widget");
     BBTK_INPUT(LayoutTab,Widget1,"widget 1",wxWindow*,"");
     BBTK_INPUT(LayoutTab,Widget2,"widget 2",wxWindow*,"");
index 97c47049702bccf07b2d90b6b49cdb74c6a3b0ba..5b6b0167ace2d17b9dd42d8914d5ee70a990dd0f 100644 (file)
@@ -3,7 +3,7 @@
 <blackbox name="OutputText" widget>
 
   <author>laurent.guigues at creatis.insa-lyon.fr</author>
-  <description>(C++,Python) Text zone to be inserted into a window (wxStaticText)</description>
+  <description>(C++,Python,JavaScript) Text zone to be inserted into a window (wxStaticText)</description>
   <category></category>
 
   <input name="Title" type="std::string" description="Title prepended to the text"/>
index d5cc04df31489d4c60f88e8c54184a7e53ab8d97..37d5c2b3893b393849fdf8a73edb13e65f61d25c 100644 (file)
@@ -99,7 +99,7 @@ namespace bbwx
   BBTK_NAME("Slider");
   BBTK_AUTHOR("eduardo.davila@creatis.insa-lyon.fr");
   // Already inserted for any WxBlackBox  BBTK_CATEGORY("widget");
-  BBTK_DESCRIPTION("(C++,Python) Slider widget (wxSlider)");
+  BBTK_DESCRIPTION("(C++,Python,JavaScript) Slider widget (wxSlider)");
   BBTK_INPUT(Slider,In,               "Initial position of the slider (default 0)",                          int,         "");
   BBTK_INPUT(Slider,Min,              "Minimum value of the slider (default 0)",                             int,         "");
   BBTK_INPUT(Slider,Max,              "Maximum value of the slider (default 500)",                           int,         "");