]> Creatis software - bbtk.git/commitdiff
*** empty log message ***
authorguigues <guigues>
Wed, 8 Apr 2009 07:56:03 +0000 (07:56 +0000)
committerguigues <guigues>
Wed, 8 Apr 2009 07:56:03 +0000 (07:56 +0000)
57 files changed:
kernel/appli/bbStudio/bbStudio.cxx
kernel/appli/bbi/bbi.cxx
kernel/cmake/BBTKConfigurePackage.cmake
kernel/cmake/BBTKConfigurePackage_src.cmake
kernel/cmake/BBTKDefineOptions.cmake
kernel/cmake/BBTKFindLibraries.cmake
kernel/src/CMakeLists.txt
kernel/src/bbtkAtomicBlackBoxMacros.h
kernel/src/bbtkBlackBox.cxx
kernel/src/bbtkBlackBox.h
kernel/src/bbtkBlackBoxDescriptor.cxx
kernel/src/bbtkInterpreter.cxx
kernel/src/bbtkKWBlackBox.cxx
kernel/src/bbtkKWBlackBox.h
kernel/src/bbtkQt.cxx [new file with mode: 0644]
kernel/src/bbtkQt.h [new file with mode: 0644]
kernel/src/bbtkQtBlackBox.cxx [new file with mode: 0644]
kernel/src/bbtkQtBlackBox.h [new file with mode: 0644]
kernel/src/bbtkQtBlackBoxDialog.cxx [new file with mode: 0644]
kernel/src/bbtkQtBlackBoxDialog.h [new file with mode: 0644]
kernel/src/bbtkQtBlackBoxDialog.ui [new file with mode: 0644]
kernel/src/bbtkQtBlackBoxDialogParent.h [new file with mode: 0644]
kernel/src/bbtkWidgetBlackBox.h [new file with mode: 0644]
kernel/src/bbtkWidgetBlackBox.txx [new file with mode: 0644]
kernel/src/bbtkWidgetBlackBoxWindow.h [new file with mode: 0644]
kernel/src/bbtkWidgetBlackBoxWindow.txx [new file with mode: 0644]
kernel/src/bbtkWx.cxx
kernel/src/bbtkWx.h
kernel/src/bbtkWxBlackBox.cxx
kernel/src/bbtkWxBlackBox.h
kernel/src/vtkKWBlackBoxDialog.h
packages/CMakeLists.txt
packages/qt/CMakeLists.txt [new file with mode: 0644]
packages/qt/Configure.cmake [new file with mode: 0644]
packages/qt/PackageConfig.cmake.in [new file with mode: 0644]
packages/qt/UsePackage.cmake.in [new file with mode: 0644]
packages/qt/bbs/CMakeLists.txt [new file with mode: 0644]
packages/qt/data/CMakeLists.txt [new file with mode: 0644]
packages/qt/doc/CMakeLists.txt [new file with mode: 0644]
packages/qt/doc/bbdoc/CMakeLists.txt [new file with mode: 0644]
packages/qt/doc/bbdoc/header.html.in [new file with mode: 0644]
packages/qt/doc/doxygen/CMakeLists.txt [new file with mode: 0644]
packages/qt/doc/doxygen/DoxyMainPage.txt.in [new file with mode: 0644]
packages/qt/doc/doxygen/Doxyfile.txt.in [new file with mode: 0644]
packages/qt/src/CMakeLists.txt [new file with mode: 0644]
packages/qt/src/bbqtQLayoutLine.cxx [new file with mode: 0644]
packages/qt/src/bbqtQLayoutLine.cxx~ [new file with mode: 0644]
packages/qt/src/bbqtQLayoutLine.h [new file with mode: 0644]
packages/qt/src/bbqtQLayoutLine.h~ [new file with mode: 0644]
packages/qt/src/bbqtQOutputText.cxx [new file with mode: 0644]
packages/qt/src/bbqtQOutputText.cxx~ [new file with mode: 0644]
packages/qt/src/bbqtQOutputText.h [new file with mode: 0644]
packages/qt/src/bbqtQOutputText.h~ [new file with mode: 0644]
packages/qt/src/bbqtQSlider.cxx [new file with mode: 0644]
packages/qt/src/bbqtQSlider.cxx~ [new file with mode: 0644]
packages/qt/src/bbqtQSlider.h [new file with mode: 0644]
packages/qt/src/bbqtQSlider.h~ [new file with mode: 0644]

index 7e066269f562dabaa1dcd5f034d6bc522f48b1fd..2acaa14ade80e2883873df6259e8c60b72063008 100644 (file)
@@ -115,6 +115,7 @@ int main(int argc, char* argv[])
 //==========================================================================
 // WITHOUT WX
 //==========================================================================
+#include <iostream>
 int main(int argc, char* argv[])
 {  
   std::cout << "bbStudio was not compiled with wxWidgets : ciao !" <<std::endl;
index bb06f6816802ca84e8d8af43b9ef2a4d583b0559..8d0aecd1938d06376290c56d51eb1d6005d07263 100644 (file)
@@ -314,6 +314,7 @@ int main(int argc, char* argv[])
 //==========================================================================
 
 #include "bbtkInterpreter.h"
+//#include "bbtkWx.h"
 
 int main(int argc, char* argv[])
 {  
@@ -339,7 +340,7 @@ int main(int argc, char* argv[])
       I->InterpretFile(f);
     }
   
-  bbtk::Wx::LoopUntilAllWindowsClose(); 
+  //  bbtk::Wx::LoopUntilAllWindowsClose(); 
      
   return 0;
 
index ac1298e8fe88c64b2c8b078bb5e8637442b11d9f..f92766f9e1d68737bf5dae2f069213d029f132a0 100644 (file)
@@ -107,6 +107,14 @@ IF(${BBTK_PACKAGE_NAME}_USE_ITK)
     )
 ENDIF(${BBTK_PACKAGE_NAME}_USE_ITK)
 
+IF(${BBTK_PACKAGE_NAME}_USE_QT)
+  SET(USE_QT4 ON CACHE BOOL "Use QT" FORCE)
+  SET(${BBTK_PACKAGE_NAME}_LIBS
+    ${${BBTK_PACKAGE_NAME}_LIBS}
+    ${QT_LIBRARIES}
+    )
+ENDIF(${BBTK_PACKAGE_NAME}_USE_QT)
+
 IF(${BBTK_PACKAGE_NAME}_USE_GDCM)
   SET(USE_GDCM ON CACHE BOOL "Use GDCM" FORCE)
   SET(USE_GDCM_VTK ON CACHE BOOL "Use GDCM_VTK" FORCE)
index b16e0fa541fd9504d6effec7289cc59d979f598a..f7363645a0e2f4971b6bfcb2a93204851954928c 100644 (file)
@@ -53,6 +53,7 @@ IF(${BBTK_PACKAGE_NAME}_COMPILE_ALL_CXX)
   SET(${BBTK_PACKAGE_NAME}_CXX_SOURCES ${${BBTK_PACKAGE_NAME}_CXX_SOURCES} ${${BBTK_PACKAGE_NAME}_CPP_SOURCES})
   FILE(GLOB ${BBTK_PACKAGE_NAME}_H_SOURCES "." "*.h")
 ENDIF(${BBTK_PACKAGE_NAME}_COMPILE_ALL_CXX) 
+
 IF(NOT PROJECT_BINARY_DIR STREQUAL ${PROJECT_SOURCE_DIR})
   SET(${BBTK_PACKAGE_NAME}_CXX_SOURCES
     ${${BBTK_PACKAGE_NAME}_CXX_SOURCES}
@@ -210,6 +211,7 @@ SET(${LIBRARY_NAME}_INSTALL_TREE_RELATIVE_LIBRARY_PATHS ${BBTK_PACKAGE_LIB_PATH}
 # Prepare for configure
 SET(BBTK_PACKAGE_USE_VTK ${${BBTK_PACKAGE_NAME}_USE_VTK})
 SET(BBTK_PACKAGE_USE_ITK ${${BBTK_PACKAGE_NAME}_USE_ITK})
+SET(BBTK_PACKAGE_USE_QT ${${BBTK_PACKAGE_NAME}_USE_QT})
 SET(BBTK_PACKAGE_USE_GDCM ${${BBTK_PACKAGE_NAME}_USE_GDCM})
 SET(BBTK_PACKAGE_USE_GSMIS ${${BBTK_PACKAGE_NAME}_USE_GSMIS})
 SET(BBTK_PACKAGE_USE_WXWIDGETS ${${BBTK_PACKAGE_NAME}_USE_WXWIDGETS})
index 7c521fc10ca8ac4cb055890d4a913814df7170c3..34c0a776209ba9afd671520a52808c90d14546ae 100644 (file)
@@ -74,9 +74,19 @@ IF (BBTK_USE_KWWIDGETS)
 ELSE (BBTK_USE_KWWIDGETS)
   SET(USE_KWWIDGETS OFF CACHE BOOL "Use KWWidgets" FORCE)
 ENDIF (BBTK_USE_KWWIDGETS)
+SWITCH_ON_IF_BUILD_ALL(BBTK_USE_KWWIDGETS)
+#-----------------------------------------------------------------------------
+
+#-----------------------------------------------------------------------------
+OPTION(BBTK_USE_QT "Build bbtk with QT ?" OFF)
+IF (BBTK_USE_QT)
+  SET(USE_QT4 ON CACHE BOOL "Use QT" FORCE)
+ELSE (BBTK_USE_QT)
+  SET(USE_QT4 OFF CACHE BOOL "Use QT" FORCE)
+ENDIF (BBTK_USE_QT)
+SWITCH_ON_IF_BUILD_ALL(BBTK_USE_QT)
 #-----------------------------------------------------------------------------
 
-#SWITCH_ON_IF_BUILD_ALL(BUILD_KWWIDGETS)
 
 #-----------------------------------------------------------------------------
 IF(USE_ITK)
index 463a773aaad0ea26a929f37c5c9434ec38fef48c..9947b1c01252e453bdedbb68942ed481929dcf20 100644 (file)
@@ -85,6 +85,16 @@ IF(BBTK_USE_KWWIDGETS)
 ENDIF(BBTK_USE_KWWIDGETS)
 #-----------------------------------------------------------------------------
 
+#-----------------------------------------------------------------------------
+# QT
+IF(BBTK_USE_QT)
+  SET(BBTK_LINK_LIBRARIES
+    ${BBTK_LINK_LIBRARIES}
+    ${QT_LIBRARIES} 
+    )
+ENDIF(BBTK_USE_QT)
+#-----------------------------------------------------------------------------
+
 #-----------------------------------------------------------------------------
 # BOOST 
 SET(BBTK_LINK_LIBRARIES
index 5c7ca31f3365f5051e8b031f0f2c7303f4132cd3..f9ee9f880679a566ac561d743b40df5de6a719b8 100644 (file)
@@ -128,6 +128,7 @@ FILE(GLOB SOURCES "." "*.cxx" "*.cpp")
 # "ThirdParty/wx/treemultictrl/*.cpp")
 FILE(GLOB SOURCES_H "." "*.h" )
 
+#-----------------------------------------------------------------------------
 IF(BBTK_USE_KWWIDGETS)
   IF(KWWidgets_FOUND)
     include("${KWWidgets_CMAKE_DIR}/KWWidgetsWrappingMacros.cmake")
@@ -135,6 +136,25 @@ IF(BBTK_USE_KWWIDGETS)
     SET(SOURCES ${SOURCES} ${LIB_TCL_SRCS})
   ENDIF(KWWidgets_FOUND)
 ENDIF(BBTK_USE_KWWIDGETS)
+#-----------------------------------------------------------------------------
+
+#-----------------------------------------------------------------------------
+IF(BBTK_USE_QT)
+  #--------------------------------------------------------------------------- 
+  # MOC
+  SET(QT4_HEADERS_TO_WRAP
+    bbtkQtBlackBoxDialog.h
+    )
+  QT4_WRAP_CPP(MOC_SOURCES ${QT4_HEADERS_TO_WRAP})
+  #--------------------------------------------------------------------------- 
+  # UI
+  QT4_WRAP_UI(UI_SOURCES
+    bbtkQtBlackBoxDialog.ui
+    )
+  SET(SOURCES ${SOURCES} ${MOC_SOURCES} ${UI_SOURCES})
+ENDIF(BBTK_USE_QT)
+#-----------------------------------------------------------------------------
+
 
 #-----------------------------------------------------------------------------
 # lib definition
index 69bcc7c5bbae88b923c4d0d4a2e9cc0b9fd23548..8d8df46887321cba621ccdd968e863dbad63de29 100644 (file)
@@ -2,8 +2,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkAtomicBlackBoxMacros.h,v $
   Language:  C++
-  Date:      $Date: 2008/11/25 11:17:13 $
-  Version:   $Revision: 1.13 $
+  Date:      $Date: 2009/04/08 07:56:11 $
+  Version:   $Revision: 1.14 $
 =========================================================================*/
 
 /* ---------------------------------------------------------------------
 
 //============================================================================
 /// Begins the AtomicBlackBox description block
-#define BBTK_BEGIN_DESCRIBE_BLACK_BOX(CLASS,PARENT)                    \
-  class /*BBTK_EXPORT*/ CLASS ## Descriptor : public PARENT ## Descriptor \
+#define BBTK_BEGIN_DESCRIBE_BLACK_BOX_BODY(CLASS)                      \
   {                                                                    \
   public: typedef CLASS ## Descriptor Self;                            \
     BBTK_OBJECT_MINIMAL_INTERFACE;                                     \
                         <<#CLASS<<"Descriptor()"<<std::endl);          
 //============================================================================
 
+//============================================================================
+/// Begins the AtomicBlackBox description block
+#define BBTK_BEGIN_DESCRIBE_BLACK_BOX(CLASS,PARENT)                    \
+  class /*BBTK_EXPORT*/ CLASS ## Descriptor : public PARENT ## Descriptor \
+  BBTK_BEGIN_DESCRIBE_BLACK_BOX_BODY(CLASS);
+
 //============================================================================
 /// Ends the AtomicBlackBox description block
 #define BBTK_END_DESCRIBE_BLACK_BOX(CLASS)                             \
index 8be7d01d0e3a283d659957fcf63f6284a8dbb7ba..9eb65e2c30f97e768a500843947362d000f37475 100644 (file)
@@ -2,8 +2,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkBlackBox.cxx,v $
   Language:  C++
-  Date:      $Date: 2009/03/30 14:42:16 $
-  Version:   $Revision: 1.41 $
+  Date:      $Date: 2009/04/08 07:56:11 $
+  Version:   $Revision: 1.42 $
 =========================================================================*/
 
 /* ---------------------------------------------------------------------
@@ -40,6 +40,7 @@
 
 #include "bbtkConfigurationFile.h"
 #include "bbtkWxBlackBox.h"
+#include "bbtkWx.h"
 
 #include <fstream>
 //#include <vector>
@@ -770,9 +771,10 @@ namespace bbtk
     bbSetExecuting(true);
     bool wasExecuting = bbGlobalGetSomeBoxExecuting();
     bbGlobalSetSomeBoxExecuting(true);
-
-       this->bbCreateWidget();
-
+    
+    // Creates the window if the black box has one
+    this->bbCreateWindow();
+    
     // Updates its inputs
     IOStatus s = bbUpdateInputs();
     
@@ -809,7 +811,8 @@ namespace bbtk
                         <<std::endl);
       }
 
-         this->bbShowWidget(); 
+    // Shows the window if the black box has one
+    this->bbShowWindow(); 
 
          
     bbtkDebugMessage("process",3,
index c9a6395a033a423d30b7225506e294da47070a36..6e44fde62c7b12b5f8e24f9564a7ac706c70b513 100644 (file)
@@ -2,8 +2,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkBlackBox.h,v $
   Language:  C++
-  Date:      $Date: 2009/03/23 13:06:41 $
-  Version:   $Revision: 1.22 $
+  Date:      $Date: 2009/04/08 07:56:11 $
+  Version:   $Revision: 1.23 $
 =========================================================================*/
 
 /* ---------------------------------------------------------------------
@@ -379,24 +379,24 @@ namespace bbtk
     //==================================================================
 
          
-         //==================================================================
-         /// Actual CreateWidget method (vitual)
-         /// Overloaded in AtomicBlacBox and descendants 
-         virtual void bbCreateWidget()
-         {
-               //  bbtkError("BlackBox::bbCreateWidget called : how can this happen ?");
-         }
-         //==================================================================
-         
-         //==================================================================
-         /// Actual ShowWidget method (vitual)
-         /// Overloaded in AtomicBlacBox and descendants 
-         virtual void bbShowWidget()
-         {
-               //  bbtkError("BlackBox::bbShowWidget called : how can this happen ?");
-         }
-         //==================================================================
-         
+    //==================================================================
+    /// Actual CreateWindow method (vitual)
+    /// Overloaded in AtomicBlacBox and descendants 
+    virtual void bbCreateWindow()
+    {
+      //  bbtkError("BlackBox::bbCreateWidget called : how can this happen ?");
+    }
+    //==================================================================
+    
+    //==================================================================
+    /// Actual ShowWindow method (vitual)
+    /// Overloaded in AtomicBlacBox and descendants 
+    virtual void bbShowWindow()
+    {
+      //  bbtkError("BlackBox::bbShowWidget called : how can this happen ?");
+    }
+    //==================================================================
+    
                  
    //==================================================================
     /// Actual processing method (vitual)
index 4fba9436ad38f520bd92adda727cbed642a514f2..00127c1f2a99d432fcccfe4218cb9b816004a7f1 100644 (file)
@@ -2,8 +2,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkBlackBoxDescriptor.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/10/17 08:18:12 $
-  Version:   $Revision: 1.19 $
+  Date:      $Date: 2009/04/08 07:56:11 $
+  Version:   $Revision: 1.20 $
 =========================================================================*/
 
 /* ---------------------------------------------------------------------
@@ -390,12 +390,14 @@ namespace bbtk
          col = ubbcol; 
          iotype = 1;
        }
+#ifdef USE_WXWIDGETS
       else if (in->second->GetCreatorTypeInfo() == 
               typeid(WxBlackBoxDescriptor))
        {
          col = wxbbcol; 
          iotype = 2;
        }
+#endif
 
       std::string name(in->second->GetName());
       Utilities::html_format(name);
@@ -453,12 +455,14 @@ namespace bbtk
            col = ubbcol; 
            iotype = 1;
          }
+#ifdef USE_WXWIDGETS
        else if (o->second->GetCreatorTypeInfo() == 
                 typeid(WxBlackBoxDescriptor))
          {
            col = wxbbcol; 
            iotype = 2;
          }
+#endif
        
        std::string name(o->second->GetName());
        Utilities::html_format(name);
index afa23734826a312b2370d74f6d98ff5fca0a5650..ef8be1b5f84ebb664c0fd51a7c10f2cfb0ba5a32 100644 (file)
@@ -2,8 +2,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkInterpreter.cxx,v $
   Language:  C++
-  Date:      $Date: 2009/01/27 14:22:57 $
-  Version:   $Revision: 1.82 $
+  Date:      $Date: 2009/04/08 07:56:11 $
+  Version:   $Revision: 1.83 $
 =========================================================================*/
 
 /* ---------------------------------------------------------------------
@@ -39,6 +39,7 @@
 #include "bbtkMessageManager.h"
 #include "bbtkConfigurationFile.h"
 #include "bbtkUtilities.h"
+#include "bbtkAtomicBlackBox.h"
 #include "bbtkWxBlackBox.h"
 #include <sys/stat.h>
 #include <algorithm>
@@ -2128,9 +2129,14 @@ void  Interpreter::NewGUI(const std::string& boxname,
       // Get the input descriptor 
       const BlackBoxInputDescriptor* d = box->bbGetDescriptor()->GetInputDescriptor(i->first);
       // If it is a "system" input : skip it
+#ifdef USE_WXWIDGETS
       if ( ( d->GetCreatorTypeInfo() == typeid(AtomicBlackBoxDescriptor)) ||
           ( d->GetCreatorTypeInfo() == typeid(WxBlackBoxDescriptor)) )
        continue;
+#else
+      if ( ( d->GetCreatorTypeInfo() == typeid(AtomicBlackBoxDescriptor)) )
+       continue;
+#endif
       bool widok = true;
       std::string widget,adaptor;
       // try to find a widget adaptor
index 08679361b1b485a4123fd916b7c12f5ba0e38066..ea7f31f446f5cedac9e5c1973b1502418c9399a0 100644 (file)
@@ -2,8 +2,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkKWBlackBox.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/12/18 11:54:44 $
-  Version:   $Revision: 1.8 $
+  Date:      $Date: 2009/04/08 07:56:11 $
+  Version:   $Revision: 1.9 $
 =========================================================================*/
 
 /* ---------------------------------------------------------------------
@@ -54,172 +54,50 @@ namespace bbtk
   //=========================================================================
   //=========================================================================
   //=========================================================================
-  BBTK_BLACK_BOX_IMPLEMENTATION(KWBlackBox,AtomicBlackBox);
+  BBTK_BLACK_BOX_IMPLEMENTATION(KWBlackBox,WidgetBlackBox<wxWindow>);
   //=========================================================================
   
-  //=========================================================================
-  void KWBlackBox::bbUserConstructor()
-  {
-    bbtkDebugMessage("Kernel",9,"KWBlackBox::bbUserConstructor()"<<std::endl);
-    bbInitAttributes();
-  }
-  //=========================================================================
-
-  //=========================================================================
-  void KWBlackBox::bbUserCopyConstructor(bbtk::BlackBox::Pointer)
+  //==================================================================    
+  /// Callback for creating a Dialog window (modal)
+  void WxBlackBox::bbCreateDialogWindow()
   {
-    bbtkDebugMessage("Kernel",9,"KWBlackBox::bbUserCopyConstructor()"
-                    <<std::endl);
-    bbInitAttributes();
-  }
-  //=========================================================================
-
+    KW::GetApplication();
+    vtkKWBlackBoxDialog* win = vtkKWBlackBoxDialog::New();
+    show = (Window*) win;
+    win->bbSetBlackBox( GetThisPointer<KWBlackBox>());
+    KW::GetApplication()->AddWindow((vtkKWWindowBase*)win);
+    win->Create();
+    win->SetResizable(0,0);
+    
+    bbUserCreateWidget(win->GetFrame());
+    /*
+      KW::GetApplication()->Script
+      ("pack %s -expand yes -fill both",
+      bbGetOutputWidget()->GetWidgetName());
+    */
+    
+    KW::GetApplication()->Script("place %s -x 0 -y 0 -width %d -height %d",
+                                bbGetOutputWidget()->GetWidgetName(),
+                                bbGetInputWinWidth(),
+                                bbGetInputWinHeight());
+    
 
-  //=========================================================================
-  void KWBlackBox::bbUserDestructor()
-  {
-    bbtkDebugMessage("kw",9,"==> KWBlackBox::bbUserDestructor() ["<<bbGetFullName()<<"]"<<std::endl);
-    if (bbGetWindow()) {
-      bbGetWindow()->bbClose();
-      bbSetWindow(0);
-    }
-    bbtkDebugMessage("kw",9,"<== KWBlackBox::bbUserDestructor() ["<<bbGetFullName()<<"]"<<std::endl);
   }
-  //=========================================================================
-  
+  //==================================================================    
 
-
-  //=========================================================================
-  /**
-   * \brief Initialize the attributes of the class
-   *
-   */
-  void KWBlackBox::bbInitAttributes()
+  //==================================================================    
+  /// Callback for creating a Frame window 
+  void WxBlackBox::bbCreateFrameWindow()
   {
-    bbmWindow = 0;
-    //    bbmWidget = 0;
-    //    bbSetInputWinParent(0);
-    bbSetInputWinTitle(bbGetName());
-    bbSetInputWinWidth(800);
-    bbSetInputWinHeight(800);
-    bbSetInputWinDialog(false);
-    bbSetOutputWidget(0);
-
-    //    bbSetWidgetEventHandler(0);
-    //  bbSetUpdateTransferedToParent(false);
+    bbtkWarning("KW: Frame windows not supported: creating a Dialog!");
+    bbCreateDialogWindow();
   }
-  //=========================================================================
-
-
-  //=========================================================================
-  void KWBlackBox::bbProcess()
-  { 
-
-    this->bbUserProcess(); 
-
-    // If output widget not connected create the window 
-    if ( (*bbGetOutputConnectorMap().find("Widget")).second
-        ->GetConnectionVector().size() == 0 ) 
-      {
-       Window* show = 0;
-       // If the window already exists : no need creating it
-       if (bbGetWindow()!=0)
-         {
-           bbtkDebugMessage("kw",2,
-                            "-> Window already exists"
-                            <<std::endl);
-           show = bbGetWindow();
-         }
-       // Else create window 
-       else 
-         {
-           bbtkDebugMessage("kw",2,
-                            "-> Creating the window"
-                            <<std::endl);
-           KW::GetApplication();
-           
-           // Input WinDialog set to true : creating a Dialog
-           /*
-           if (bbGetInputWinDialog()) 
-             {
-               bbtkDebugMessage("kw",2,
-                                "   Input WinDialog set to true : creating a Dialog"
-                                <<std::endl);
-           */
-               vtkKWBlackBoxDialog* win = vtkKWBlackBoxDialog::New();
-               show = (Window*) win;
-               win->bbSetBlackBox( GetThisPointer<KWBlackBox>());
-               KW::GetApplication()->AddWindow((vtkKWWindowBase*)win);
-               win->Create();
-               win->SetResizable(0,0);
-
-               bbUserCreateWidget(win->GetFrame());
-               /*
-               KW::GetApplication()->Script
-                 ("pack %s -expand yes -fill both",
-                  bbGetOutputWidget()->GetWidgetName());
-               */
-               
-               KW::GetApplication()->Script("place %s -x 0 -y 0 -width %d -height %d",
-                                            bbGetOutputWidget()->GetWidgetName(),
-                                            bbGetInputWinWidth(),
-                                            bbGetInputWinHeight());
-               
-               
-
+  //==================================================================    
 
 
-               /*
-               bbGetOutputWidget()->SetParent(win);
-               bbGetOutputWidget()->Create();
-               KW::GetApplication()->Script("pack %s -side left -anchor c -expand y",
-                       
-                                    //"pack %s -side top -anchor nw -expand y -fill none -padx 2 -pady 2", 
-                                            bbGetOutputWidget()->GetWidgetName());
-               */                           
-               /*      
-                 }
-       
-           // Input WinDialog set to false : creating a Frame
-           else 
-             {
-               bbtkDebugMessage("process",2,
-                                "   Input WinDialog set to false : creating a Frame"
-                                <<std::endl);
-               vtkKWBlackBoxFrame* win = vtkKWBlackBoxFrame::New();
-               show = (Window*) win;
-               win->bbSetBlackBox( GetThisPointer<KWBlackBox>());
-               //              win->SetName( bbGetInputWinTitle() + " - bbtk (c) CREATIS LRMN" );
-               //              win->SetWidth( bbGetInputWinWidth() );
-               //              win->SetHeight( bbGetInputWinHeight() );
-               KW::GetApplication()->AddWindow((vtkKWWindowBase*)win);
-               win->Create();
-               
-               bbGetOutputWidget()->SetParent(win);
-               bbGetOutputWidget()->Create();
-               KW::GetApplication()->Script("pack %s -side top -anchor nw -expand y -fill none -padx 2 -pady 2", 
-                                            bbGetOutputWidget()->GetWidgetName());           }
-       */
-       
-               //      win->Invoke();
-         }
-       
-       // Show the window
-
-       show->bbShow(); 
-       //      std::cout << "KW::GetApplication()->Start();"<<std::endl;
-       //      KW::GetApplication()->Start();
-       //      std::cout << "AFTER KW::GetApplication()->Start();"<<std::endl;
-       
-      }                  
-    //   
-    
-  }
-  //=========================================================================
-  
-
   //==================================================================
-  vtkKWWidget*  KWBlackBox::bbCreateWidgetOfInput(const std::string& in, vtkKWFrame* parent)
+  vtkKWWidget*  KWBlackBox::bbCreateWidgetOfInput(const std::string& in, 
+                                                 vtkKWFrame* parent)
   {
     vtkKWWidget* w = 0;
     // If input is connected 
@@ -242,59 +120,18 @@ namespace bbtk
 
 
   //==================================================================
-   void KWBlackBox::bbHideWindow()
-  {
-    bbtkDebugMessageInc("kw",1,"=> KWBlackBox::bbHideWindow() ["
-                       <<bbGetFullName()<<"]"<<std::endl);
-
-    if (bbGetWindow()!=0) bbGetWindow()->bbHide();
-
-    bbtkDebugMessageDec("kw",2,"<= KWBlackBox::bbHideWindow() ["
-                       <<bbGetFullName()<<"]"<<std::endl);
-  }
-  //==================================================================
-
-
-  //==================================================================
-   void KWBlackBox::bbCloseWindow()
-  {
-    bbtkDebugMessageInc("kw",1,"=> KWBlackBox::bbCloseWindow() ["
-                       <<bbGetFullName()<<"]"<<std::endl);
-
-    if (bbGetWindow()!=0) bbGetWindow()->bbClose();
-
-    bbtkDebugMessageDec("kw",2,"<= KWBlackBox::bbCloseWindow() ["
-                       <<bbGetFullName()<<"]"<<std::endl);
-  }
-  //==================================================================
-
-  //==================================================================
-  KWBlackBox::Window* KWBlackBox::bbGetContainingWindow()
-  {
-    if (bbGetWindow()!=0) return bbGetWindow();
-    BlackBox::OutputConnectorMapType::const_iterator i 
-      = bbGetOutputConnectorMap().find("Widget");
-    if ( i->second->GetConnectionVector().size() != 0 ) 
-      {
-       return boost::static_pointer_cast<KWBlackBox>
-         (i->second->GetConnectionVector().front() //.lock()
-          ->GetBlackBoxTo())->bbGetContainingWindow();
-      }
-    return 0;
-  }
-  //==================================================================
-
-
-  //==================================================================
-  bool KWBlackBox::bbIsShown()
-  {
-    if (bbGetContainingWindow()!=0)
-      return bbGetContainingWindow()->bbIsShown();
-    return false;
-  }
+  //  void KWBlackBox::InitWindowManagerIfNeeded() { KW::
+  void KWBlackBox::IncNbWindowsAlive() { KW::IncNbWindowsAlive(); }
+  void KWBlackBox::DecNbWindowsAlive() { KW::DecNbWindowsAlive(); }
+  int  KWBlackBox::GetNbWindowsAlive() { return KW::GetNbWindowsAlive(); }
+  bool KWBlackBox::IsSomeWindowAlive() { return KW::IsSomeWindowAlive(); }
+  
+  void KWBlackBox::IncNbWindowsShown() { KW::IncNbWindowsShown(); }
+  void KWBlackBox::DecNbWindowsShown() { KW::DecNbWindowsShown(); }
+  int  KWBlackBox::GetNbWindowsShown() { return KW::GetNbWindowsShown(); }
+  bool KWBlackBox::IsSomeWindowShown() { return KW::GetNbWindowsShown(); }
   //==================================================================
-
-
+  
 }//namespace bbtk
 
 
index 6a2eb35f1a5767f7f564c645449d2ebcff422398..470c286040685c6d52424a6fc38718f3d2ae21e0 100644 (file)
@@ -2,8 +2,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkKWBlackBox.h,v $
   Language:  C++
-  Date:      $Date: 2008/12/11 09:50:35 $
-  Version:   $Revision: 1.5 $
+  Date:      $Date: 2009/04/08 07:56:11 $
+  Version:   $Revision: 1.6 $
 ========================================================================*/
 
 
 
 #ifdef USE_KWWIDGETS
 
-#include "bbtkAtomicBlackBox.h"
+#include "bbtkWidgetBlackBox.h"
 
 
 #include "bbtkKW.h"
 
 
-//==================================================================
-// Forward declaration of the class of window associated to a KWBlackBox
-class vtkKWBlackBoxWindow;
-class vtkKWBlackBoxDialog;
-class vtkKWFrame;
-//==================================================================
-
 
 namespace bbtk
 {
 
 
 
-
-
   //==================================================================
   /// Widget black boxes
-  class BBTK_EXPORT KWBlackBox : public bbtk::AtomicBlackBox  
+  class BBTK_EXPORT KWBlackBox : public bbtk::WidgetBlackBox<vtkKWWidget>
   { 
-    BBTK_BLACK_BOX_INTERFACE(KWBlackBox,bbtk::AtomicBlackBox);
-    BBTK_DECLARE_INPUT(WinTitle,std::string);
-    BBTK_DECLARE_INPUT(WinWidth,int);
-    BBTK_DECLARE_INPUT(WinHeight,int);
-    BBTK_DECLARE_INPUT(WinDialog,bool);
-    BBTK_DECLARE_INPUT(WinHide,Void);
-    BBTK_DECLARE_INPUT(WinClose,Void);
-    BBTK_DECLARE_OUTPUT(Widget, vtkKWWidget*);
-
+    BBTK_BLACK_BOX_INTERFACE(KWBlackBox,bbtk::WidgetBlackBox<vtkKWWidget>);
   public:
-    
-    typedef vtkKWBlackBoxDialog Window;
-    
-    /// Returns the **OWN** window associated to the box
-    /// If 0 returned = no window
-    Window* bbGetWindow() { return bbmWindow; }
-
-    /// Returns the window containing the widget associated to the box
-    /// Which can be the own window of **ANOTHER** box in case of 
-    /// a hierarchy of widgets.
-    /// More precisely :
-    /// If bbGetWindow() != 0 then returns bbGetWindow()
-    /// Else if the output 'Widget' is connected 
-    ///  then returns bbGetContainingWindow() of the box connected to 'Widget'
-    /// Else returns 0;
-    Window* bbGetContainingWindow();
-
-
-    /// Returns true iff the 'containing window' exists and is shown 
-    /// (see bbGetContainingWindow).
-    bool bbIsShown();
-
-    //==================================================================    
-    /// User callback invoked when the containing window is shown
-    virtual void bbUserOnShow() {}
+   //==================================================================    
+    /// Callback for creating a Dialog window (modal)
+    virtual void bbCreateDialogWindow();
     //==================================================================    
+
     //==================================================================    
-    /// User callback invoked when the containing window is hidden
-    virtual void bbUserOnHide() {}
+    /// Callback for creating a Frame window 
+    virtual void bbCreateFrameWindow();
     //==================================================================    
 
-    /// Sets the window
-    inline void bbSetWindow(Window* w) { bbmWindow=w; }
-
-         
-  protected:
+    //==================================================================
+    //    virtual void InitWindowManagerIfNeeded();
+    virtual void IncNbWindowsAlive();
+    virtual void DecNbWindowsAlive();
+    virtual int  GetNbWindowsAlive();
+    virtual bool IsSomeWindowAlive();
     
-  
+    virtual void IncNbWindowsShown();
+    virtual void DecNbWindowsShown();
+    virtual int  GetNbWindowsShown();
+    virtual bool IsSomeWindowShown();
     //==================================================================
-    /// User callback called in the box contructor
-    virtual void bbUserConstructor();
-    /// User callback called in the box copy constructor
-    virtual void bbUserCopyConstructor(bbtk::BlackBox::Pointer);
-    /// User callback called in the box destructor
-    virtual void bbUserDestructor();
-    //==================================================================    
-
-    //==================================================================    
-    /// User callback for creating the widget associated to the box
-    /// ** Must be defined **
-    // LG 24/11/08 : New widget pipeline
-    virtual void bbUserCreateWidget(vtkKWFrame* parent) 
-    {
-      bbtkError(bbGetTypeName()<<" is a KWBlackBox whose bbUserCreateWidget methods is not overloaded : is it a feature or a bug ?!?");
-    }
-    //==================================================================    
 
 
     //==================================================================
     vtkKWWidget* bbCreateWidgetOfInput(const std::string& in, 
                                       vtkKWFrame* parent);
     //==================================================================
 
 
-    //==================================================================
-    /// Overloaded processing method for KWBlackBoxes
-    virtual void bbProcess();
-    //==================================================================
-
-    //==================================================================
-    /// If necessary creates the KWBlackBoxWindow associated to the box
-    /// and shows it 
-    /// (does nothing if the box output 'Widget' is connected which 
-    /// means that the box does not have its own window but is contained 
-    /// into another window)
-    void bbShowWindow();
-    /// Hides the KWBlackBoxWindow associated to the box (if exists)
-    void bbHideWindow();
-    /// Closes (destroys) the KWBlackBoxWindow associated to the box (if exists)
-    void bbCloseWindow();
-    //==================================================================
-
-  private:
-    /// friendship
-    friend class vtkKWBlackBoxWindow;
-    //    friend class KWBlackBoxWidgetEventHandler;
-
-    /// The KWBlackBoxWindow associated to the box
-    Window* bbmWindow;
-
-
-    void bbInitAttributes();
-
   };
   //=================================================================
  
 
-  //======================================================================
-  /// Defines the bbUserCreateWidget method
-#define BBTK_CREATE_KWWIDGET(CALLBACK)                                 \
-  public:                                                              \
-  inline void bbUserCreateWidget(vtkKWFrame* parent)                   \
-  {                                                                    \
-    bbtkDebugMessageInc("kw",1,"**> Creating widget for ["             \
-                       <<bbGetFullName()<<"]"<<std::endl);             \
-    CALLBACK(parent);                                                  \
-    bbtkDebugMessageInc("kw",1,"<** Creating widget for ["             \
-                       <<bbGetFullName()<<"]"<<std::endl);             \
-  }
-  
-  //======================================================================
-
-  //======================================================================
-  /// Defines the bbUserOnShow method
-#define BBTK_ON_SHOW_WIDGET(CALLBACK)                                  \
-  public:                                                              \
-  inline void bbUserOnShow()                                   \
-  {                                                                    \
-    bbtkDebugMessageInc("wx",1,"**> Showing ["         \
-                       <<bbGetFullName()<<"]"<<std::endl);             \
-    CALLBACK();                                                                \
-    bbtkDebugMessageInc("wx",1,"<** Showing ["         \
-                       <<bbGetFullName()<<"]"<<std::endl);             \
-  }
-  
-  //======================================================================
-
   //=================================================================
   // KWBlackBoxDescriptor declaration
-  BBTK_BEGIN_DESCRIBE_BLACK_BOX(KWBlackBox,bbtk::AtomicBlackBox);
+  class KWBlackBoxDescriptor : public WidgetBlackBoxDescriptor<vtkKWWidget>
+  BBTK_BEGIN_DESCRIBE_BLACK_BOX_BODY(KWBlackBox);
   BBTK_NAME("KWBlackBox");
-  // 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_INPUT(KWBlackBox,WinTitle,
-            "Title of the window (*)",
-            std::string,"");
-  BBTK_INPUT(KWBlackBox,WinWidth,
-            "Width of the window (* : only used if the widget is not connected to a Layout box)",int,"");
-  BBTK_INPUT(KWBlackBox,WinHeight,
-            "Height of the window (*)",int,"");
-  BBTK_INPUT(KWBlackBox,WinDialog,
-            "Set to 'true' to create a dialog window, i.e. which blocks the pipeline until it is closed (modal) (*)",bool,"");
-  BBTK_INPUT(KWBlackBox,WinHide,
-            "Any signal received hides the window (*)",Void,"signal");
-  BBTK_INPUT(KWBlackBox,WinClose,
-            "Any signal received closes the window (*)",Void,"signal");
-  BBTK_OUTPUT(KWBlackBox,Widget,"Output widget",vtkKWWidget*,"");
   BBTK_END_DESCRIBE_BLACK_BOX(KWBlackBox);
   //=================================================================
 
@@ -241,34 +116,6 @@ namespace bbtk
 
 
 
-  /*
-  //=================================================================
-  // Handles the destroy events of a widget associated to a KWBlackBox 
-  // in order to signal the widget death to its associated box
-  class BBTK_EXPORT KWBlackBoxWidgetEventHandler : public wxEvtHandler
-  {
-  public:
-    /// Ctor with the box and widget 
-    KWBlackBoxWidgetEventHandler( KWBlackBox::Pointer box, wxWindow *widget );
-    /// Dtor
-    ~KWBlackBoxWidgetEventHandler();
-    /// Returns true iff is the handler for that window  
-    bool IsHandlerOf( wxWindow* w ) { return mWindow == w; }
-    // wxWindow* GetKWWindow() { return mWindow; }
-    /// Method processing the destroy event of the widget
-    void OnWindowDestroy(wxWindowDestroyEvent&);
-    //
-    //bool IsDead() { return mDead; }
-
-  private:
-    KWBlackBox::WeakPointer mBox;
-    wxWindow* mWindow;
-    //bool mDead;
-  };  
-  //=================================================================
-  */
-
-
 } //namespace bbtk
 
 
diff --git a/kernel/src/bbtkQt.cxx b/kernel/src/bbtkQt.cxx
new file mode 100644 (file)
index 0000000..e12409e
--- /dev/null
@@ -0,0 +1,406 @@
+/*=========================================================================                                                                               
+  Program:   bbtk
+  Module:    $RCSfile: bbtkQt.cxx,v $
+  Language:  C++
+  Date:      $Date: 2009/04/08 07:56:11 $
+  Version:   $Revision: 1.1 $
+=========================================================================*/
+
+/* ---------------------------------------------------------------------
+
+* Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
+* Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux
+*
+*  This software is governed by the CeCILL-B license under French law and 
+*  abiding by the rules of distribution of free software. You can  use, 
+*  modify and/ or redistribute the software under the terms of the CeCILL-B 
+*  license as circulated by CEA, CNRS and INRIA at the following URL 
+*  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html 
+*  or in the file LICENSE.txt.
+*
+*  As a counterpart to the access to the source code and  rights to copy,
+*  modify and redistribute granted by the license, users are provided only
+*  with a limited warranty  and the software's author,  the holder of the
+*  economic rights,  and the successive licensors  have only  limited
+*  liability. 
+*
+*  The fact that you are presently reading this means that you have had
+*  knowledge of the CeCILL-B license and that you accept its terms.
+* ------------------------------------------------------------------------ */                                                                         
+#include "bbtkQt.h"
+#include "bbtkMessageManager.h"
+
+#ifdef USE_QT
+
+#include <QApplication>
+
+
+namespace bbtk
+{
+  //=========================================================================
+  //  class QtApp;
+  //=========================================================================
+
+  //=========================================================================
+  static QApplication* mgQtApp = 0;
+  //  static wxWindow* mgTopWindow = 0;
+  //  static wxWindow* mgTopWindowParent = 0;
+  //  static bool mgAutoDestroyTopWindow = true;
+  static int mgNbWindowsAlive  = 0;
+  static int mgNbWindowsShown  = 0;
+  //=========================================================================
+
+  //=========================================================================
+  // BBTKWXSIG
+  static Qt::Signal_type mgQtSignal;
+  // \BBTKWXSIG
+  //=========================================================================
+
+  //=========================================================================
+  // The wxApp class which is used when no user wxApp was created
+  /*
+  class QtApp : public wxApp
+  {
+  public:
+    bool OnInit( );
+    int  OnExit() { return true; }
+  };
+  //=========================================================================
+  IMPLEMENT_APP_NO_MAIN(QtApp);
+  //=========================================================================
+  bool QtApp::OnInit( )
+  {     
+    wxApp::OnInit();
+#ifdef __WXGTK__
+    //See http://www.wxwindows.org/faqgtk.htm#locale
+    setlocale(LC_NUMERIC, "C");
+#endif
+    return true;
+  }
+  */
+  //=========================================================================
+
+  int argc = 1;
+  char* argv = "QApp";
+
+  //=========================================================================
+  void Qt::CreateQtAppIfNeeded()
+  {
+    
+    if (QApplication::instance()==0)
+      {
+       if (mgQtApp != 0) 
+         {
+           bbtkGlobalError("Qt::CreateQtAppIfNeeded() : INTERNAL ERROR ! (QCoreApplication::instance()==0) && (mgQtApp != 0)");
+         }
+       bbtkDebugMessage("qt",1,"  --> Creating bbtk QApplication"<<std::endl);
+       mgQtApp = new QApplication(argc,&argv);
+
+       //      std::cout << ">>>> mgQtApp.exec()"<<std::endl;
+       
+       //      mgQtApp->exec();
+
+       //      std::cout << "<<<< mgQtApp.exec()"<<std::endl;
+       //      wxApp::SetInstance(mgQtApp);
+
+       //int argc = 0;
+       //wxEntry(argc,0);
+
+       //      wxInitialize();
+      }
+    
+  }
+  //=========================================================================
+
+  //=========================================================================
+  void Qt::DestroyQtAppIfNeeded()
+  {
+    /*
+    if (mgQtApp!= 0) 
+      {
+       bbtkDebugMessage("wx",1,"  --> Destructing bbtk QApplication"<<std::endl);
+       //delete mgQtApp;
+       //      mgQtApp = 0;
+       // Uninit wx
+       //      wxUninitialize();
+      }
+    */
+  }
+  //=========================================================================
+
+  //=========================================================================  
+  void Qt::SetTopWindowParent(QWidget* w)
+  {
+    /*
+    if (mgTopWindowParent != 0)
+      {
+       bbtkGlobalError("Qt::SetTopWindowParent : top window parent != 0");
+      }
+    mgTopWindowParent = w;
+    */
+  }
+  //=========================================================================
+
+  //=========================================================================
+  void Qt::CreateTopWindowIfNeeded()
+  {
+    /*
+    if (mgTopWindow!=0) return;
+    bbtkDebugMessage("wx",1,"  --> Creating bbtk top window"<<std::endl);
+
+    CreateQtAppIfNeeded();
+
+    wxWindow* top = 
+      new wxFrame(mgTopWindowParent,
+                 -1,
+                 _T("TOP BBTK FRAME (YOU SHOULD NOT SEE ME !!)"));
+    top->Hide();
+
+    Qt::SetTopWindow(top);
+    */
+  }
+  //=========================================================================
+
+  //=========================================================================
+  void Qt::DestroyTopWindowIfNeeded()
+  {
+    /*
+    if ( (mgNbWindowsAlive==0) && 
+        (mgAutoDestroyTopWindow) )
+      {
+       bbtkDebugMessage("wx",1,"  --> Destructing bbtk top window"<<std::endl);
+       mgTopWindow->Close();
+       mgTopWindow = 0;
+       
+       DestroyQtAppIfNeeded();
+      }
+    */
+  } 
+  //=========================================================================
+
+  //=========================================================================
+  void Qt::LoopUntilAllWindowsClose()
+  {
+    /*
+    int i = 0;
+    while (mgTopWindow != 0)
+      {
+       if (i % 100 == 0) 
+         {
+           bbtkDebugMessage("wx",2,"Qt::Loop "<<i << std::endl);
+         }
+       i++;
+       wxMilliSleep(10);
+
+      }
+    */
+  }
+  //=========================================================================
+
+  //=========================================================================
+  QWidget* Qt::GetTopWindow() 
+  { 
+    /*
+    Qt::CreateTopWindowIfNeeded();
+    return mgTopWindow; 
+    */
+    return 0;
+  }
+  //=========================================================================
+  
+  //=========================================================================
+  bool Qt::TopWindowExists()
+  {
+    //return (mgTopWindow!=0);
+    return true;
+  }
+  //=========================================================================
+
+  // BBTKWXSIG
+  //=========================================================================
+  void Qt::AddSignalObserver(Slot_function_type f)
+  {
+    mgQtSignal.connect(f);
+  }
+  //=========================================================================
+  // \BBTKWXSIG
+
+  //=========================================================================
+  void Qt::SetAutoDestroyTopWindow(bool b)
+  {
+    // mgAutoDestroyTopWindow = b;
+  }
+  //=========================================================================
+  
+  //=========================================================================
+  void Qt::SetTopWindow(QWidget* w) 
+  {
+    /*
+    if ( mgTopWindow ) 
+      {
+       bbtkGlobalError("wx::SetTopWindow : top window already set !");
+      } 
+    mgTopWindow = w;
+    */
+  }
+  //=========================================================================
+
+
+  //=========================================================================
+  void Qt::IncNbWindowsAlive() 
+  { 
+    mgNbWindowsAlive++; 
+    bbtkDebugMessage("wx",2,"* Number of windows alive = "<<mgNbWindowsAlive
+                    <<std::endl);
+    // BBTKWXSIG
+    mgQtSignal();
+    // \BBTKWXSIG
+  }
+  //=========================================================================
+
+  //=========================================================================
+  void Qt::DecNbWindowsAlive()
+  { 
+    mgNbWindowsAlive--; 
+    bbtkDebugMessage("wx",2,"* Number of windows alive = "<<mgNbWindowsAlive
+                    <<std::endl);
+
+    DestroyTopWindowIfNeeded();
+     // BBTKWXSIG
+    mgQtSignal();
+    // \BBTKWXSIG
+  }
+  //=========================================================================
+  
+  //=========================================================================
+  void Qt::IncNbWindowsShown() 
+  { 
+    mgNbWindowsShown++; 
+    bbtkDebugMessage("wx",2,"* Number of windows shown = "<<mgNbWindowsShown
+                    <<std::endl);
+    // BBTKWXSIG
+    mgQtSignal();
+    // \BBTKWXSIG
+  }
+  //=========================================================================
+
+  //=========================================================================
+  void Qt::DecNbWindowsShown()
+  { 
+    mgNbWindowsShown--; 
+    bbtkDebugMessage("wx",2,"* Number of windows shown = "<<mgNbWindowsShown
+                    <<std::endl);
+
+    DestroyTopWindowIfNeeded();
+
+    // BBTKWXSIG
+    mgQtSignal();
+    // \BBTKWXSIG
+  }
+  //=========================================================================
+
+
+  //=========================================================================
+  int  Qt::GetNbWindowsAlive() 
+  { 
+    return mgNbWindowsAlive; 
+  }
+  //=========================================================================
+  
+  //=========================================================================
+  bool Qt::IsSomeWindowAlive() 
+  { 
+    return (mgNbWindowsAlive>0);
+  }
+  //=========================================================================
+  
+  
+  //=========================================================================
+  int  Qt::GetNbWindowsShown() 
+  { 
+    return mgNbWindowsShown; 
+  }
+  //=========================================================================
+  
+  //=========================================================================
+  bool Qt::IsSomeWindowShown() 
+  { 
+    return (mgNbWindowsShown>0);
+  }
+  //=========================================================================
+  
+
+  //=========================================================================
+  Qt::BusyCursor::BusyCursor()
+  {
+    /*
+    mCursor = 0;
+    if (wxApp::GetInstance()!=0) 
+      {        
+       bbtkDebugMessage("wx",2,
+                        "Qt::BusyCursor::BusyCursor() : creating new cursor"
+                        <<std::endl);
+       mCursor = new wxBusyCursor; 
+    }
+    */
+  }
+  Qt::BusyCursor::~BusyCursor()
+  {
+    /*
+    if (mCursor)
+      { 
+       delete mCursor;
+       bbtkDebugMessage("wx",2,
+                        "Qt::BusyCursor::~BusyCursor() : deleting cursor"<<std::endl);
+      }
+    */
+  }
+  //=========================================================================
+
+  /*
+  //=========================================================================
+  void Qt::ResetCursor() 
+  {
+    if (!TopWindowExists()) return;
+    bbtkDebugMessage("wx",9,"Qt::ResetCursor()"<<std::endl);
+    while (wxIsBusy()) ::wxEndBusyCursor();
+  }
+  //=========================================================================
+  //=========================================================================
+  void Qt::BeginBusyCursor() 
+  {
+    if (!TopWindowExists()) return;
+    bbtkDebugMessage("wx",9,"Qt::BeginBusyCursor()"<<std::endl);
+    ::wxBeginBusyCursor();
+  }
+  //=========================================================================
+  //=========================================================================
+  void Qt::EndBusyCursor()
+  {
+    if (!TopWindowExists()) return;
+    bbtkDebugMessage("wx",9,"Qt::EndBusyCursor()"<<std::endl);
+    ::wxEndBusyCursor();
+  }
+  //=========================================================================
+  */
+
+} // namespace bbtk
+
+#else
+//=======================================================================
+// WITHOUT WX
+//=========================================================================
+namespace bbtk
+{
+  Qt::BusyCursor::BusyCursor()
+  {
+  }
+  Qt::BusyCursor::~BusyCursor()
+  {
+  }
+  //=========================================================================
+
+} // namespace bbtk
+#endif
+
diff --git a/kernel/src/bbtkQt.h b/kernel/src/bbtkQt.h
new file mode 100644 (file)
index 0000000..68af65d
--- /dev/null
@@ -0,0 +1,172 @@
+/*=========================================================================                                                                               
+  Program:   bbtk
+  Module:    $RCSfile: bbtkQt.h,v $
+  Language:  C++
+  Date:      $Date: 2009/04/08 07:56:11 $
+  Version:   $Revision: 1.1 $
+=========================================================================*/
+
+/* ---------------------------------------------------------------------
+
+* Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
+* Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux
+*
+*  This software is governed by the CeCILL-B license under French law and 
+*  abiding by the rules of distribution of free software. You can  use, 
+*  modify and/ or redistribute the software under the terms of the CeCILL-B 
+*  license as circulated by CEA, CNRS and INRIA at the following URL 
+*  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html 
+*  or in the file LICENSE.txt.
+*
+*  As a counterpart to the access to the source code and  rights to copy,
+*  modify and redistribute granted by the license, users are provided only
+*  with a limited warranty  and the software's author,  the holder of the
+*  economic rights,  and the successive licensors  have only  limited
+*  liability. 
+*
+*  The fact that you are presently reading this means that you have had
+*  knowledge of the CeCILL-B license and that you accept its terms.
+* ------------------------------------------------------------------------ */                                                                         
+
+
+/* ---------------------------------------------------------------------
+
+* Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
+* Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux
+*
+*  This software is governed by the CeCILL-B license under French law and 
+*  abiding by the rules of distribution of free software. You can  use, 
+*  modify and/ or redistribute the software under the terms of the CeCILL-B 
+*  license as circulated by CEA, CNRS and INRIA at the following URL 
+*  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html 
+*  or in the file LICENSE.txt.
+*
+*  As a counterpart to the access to the source code and  rights to copy,
+*  modify and redistribute granted by the license, users are provided only
+*  with a limited warranty  and the software's author,  the holder of the
+*  economic rights,  and the successive licensors  have only  limited
+*  liability. 
+*
+*  The fact that you are presently reading this means that you have had
+*  knowledge of the CeCILL-B license and that you accept its terms.
+* ------------------------------------------------------------------------ */                                                                         
+
+
+#ifndef __bbtkQt_h_INCLUDED__
+#define __bbtkQt_h_INCLUDED__
+
+//===========================================================================
+// SIGNAL/SLOT MECHANISM 
+// FOR bbtk WINDOWS CREATION/DESTRUCTION OBSERVATION 
+// BBTKWXSIG
+#include <boost/signal.hpp>
+#include <boost/bind.hpp>
+typedef boost::signals::trackable SignalObserver;
+// \BBTKWXSIG
+//===========================================================================
+
+
+//===========================================================================
+// Qt headers
+#ifdef USE_QT
+#include "qwidget.h"
+// EO Qt headers
+
+#else //USE_QT
+
+// define QWidget
+typedef void QWidget;
+typedef void QBusyCursor;
+
+#endif // EO USE_WXWIDGETS
+//===========================================================================
+
+//===========================================================================
+#include "bbtkSystem.h"
+//===========================================================================
+
+
+namespace bbtk
+{
+
+  //==================================================================
+  /// Global qt handlers (cursor...)
+  
+// BBTKWXSIG
+#define bbtkAddQtSignalObserver(METHOD)                \
+  Qt::AddSignalObserver(boost::bind(&METHOD, this))
+// \BBTKWXSIG
+
+#define BBTK_BUSY_CURSOR bbtk::Qt::BusyCursor __bbtk_dummy_busy_cursor;
+
+  struct BBTK_EXPORT Qt
+  {    
+  public:
+    // BBTKWXSIG
+    // The keyword 'signals' is also a macro in qt
+    //    typedef boost::signals::trackable SignalObserver;
+    typedef boost::signal<void ()>  Signal_type;
+    typedef Signal_type::slot_function_type Slot_function_type;
+    // \BBTKWXSIG
+
+    /*
+    static void ResetCursor();
+    static void BeginBusyCursor(); 
+    static void EndBusyCursor();
+    */
+
+    static void LoopUntilAllWindowsClose();
+
+    class BusyCursor
+    {
+    public:
+      BusyCursor();
+      ~BusyCursor();
+      //wxBusyCursor* mCursor;
+    };
+
+    static void SetTopWindowParent(QWidget*);
+    static void SetAutoDestroyTopWindow(bool);
+
+    /// Returns the creation time parent of all bbtk windows 
+    /// (window can be reparented after creation)
+    static QWidget* GetTopWindow();
+    static bool TopWindowExists();
+    
+    static void IncNbWindowsAlive();
+    static void DecNbWindowsAlive();
+    static int  GetNbWindowsAlive();
+    static bool IsSomeWindowAlive();
+    
+    static void IncNbWindowsShown();
+    static void DecNbWindowsShown();
+    static int  GetNbWindowsShown();
+    static bool IsSomeWindowShown();
+
+    // BBTKWXSIG
+    static void AddSignalObserver(Slot_function_type);
+    // \BBTKWXSIG
+
+
+
+    static void CreateQtAppIfNeeded();
+    static void DestroyQtAppIfNeeded();
+
+  private:
+    static void CreateTopWindowIfNeeded();
+    static void DestroyTopWindowIfNeeded();
+
+    /// Sets the creation time parent of all bbtk windows
+    static void SetTopWindow(QWidget*);
+  }; // struct Qt
+  //==================================================================
+  
+
+
+
+
+  
+} // namespace bbtk
+  
+
+#endif // EO __bbtkQt_h_INCLUDED__
diff --git a/kernel/src/bbtkQtBlackBox.cxx b/kernel/src/bbtkQtBlackBox.cxx
new file mode 100644 (file)
index 0000000..7534fd6
--- /dev/null
@@ -0,0 +1,107 @@
+/*=========================================================================                                                                               
+  Program:   bbtk
+  Module:    $RCSfile: bbtkQtBlackBox.cxx,v $
+  Language:  C++
+  Date:      $Date: 2009/04/08 07:56:11 $
+  Version:   $Revision: 1.1 $
+=========================================================================*/
+
+/* ---------------------------------------------------------------------
+
+* Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
+* Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux
+*
+*  This software is governed by the CeCILL-B license under French law and 
+*  abiding by the rules of distribution of free software. You can  use, 
+*  modify and/ or redistribute the software under the terms of the CeCILL-B 
+*  license as circulated by CEA, CNRS and INRIA at the following URL 
+*  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html 
+*  or in the file LICENSE.txt.
+*
+*  As a counterpart to the access to the source code and  rights to copy,
+*  modify and redistribute granted by the license, users are provided only
+*  with a limited warranty  and the software's author,  the holder of the
+*  economic rights,  and the successive licensors  have only  limited
+*  liability. 
+*
+*  The fact that you are presently reading this means that you have had
+*  knowledge of the CeCILL-B license and that you accept its terms.
+* ------------------------------------------------------------------------ */                                                                         
+/**
+ *  \file 
+ *  \brief 
+ */
+
+#ifdef USE_QT
+
+
+#include "bbtkQtBlackBox.h"
+//#include "bbtkBlackBoxOutputConnector.h"
+//#include "bbtkQtBlackBoxDialog.h"
+#include "bbtkQtBlackBoxDialog.h"
+
+
+namespace bbtk
+{
+
+
+
+  //=========================================================================
+  // QtBlackBox
+  //=========================================================================
+
+  //=========================================================================
+  //=========================================================================
+  //=========================================================================
+  //=========================================================================
+  BBTK_BLACK_BOX_IMPLEMENTATION(QtBlackBox,WidgetBlackBox<QWidget>);
+  //=========================================================================
+  
+  //==================================================================    
+  /// Callback for creating a Dialog window (modal)
+  void QtBlackBox::bbCreateDialogWindow()
+  {
+    Qt::CreateQtAppIfNeeded();
+    QtBlackBoxDialog* w = 0;  
+    w = new QtBlackBoxDialog( GetThisPointer<QtBlackBox>(),
+                             0, 
+                             bbGetInputWinTitle() 
+                             + " - bbtk (c) CREATIS LRMN",
+                             bbGetInputWinWidth() , 
+                             bbGetInputWinHeight()  );
+  }
+  //==================================================================    
+
+  //==================================================================    
+  /// Callback for creating a Frame window 
+  void QtBlackBox::bbCreateFrameWindow()
+  {
+    
+    this->bbCreateDialogWindow();
+
+  }
+  //==================================================================    
+
+   
+  //==================================================================
+  //  void QtBlackBox::InitWindowManagerIfNeeded() { Qt::
+  void QtBlackBox::IncNbWindowsAlive() { Qt::IncNbWindowsAlive(); }
+  void QtBlackBox::DecNbWindowsAlive() { Qt::DecNbWindowsAlive(); }
+  int  QtBlackBox::GetNbWindowsAlive() { return Qt::GetNbWindowsAlive(); }
+  bool QtBlackBox::IsSomeWindowAlive() { return Qt::IsSomeWindowAlive(); }
+  
+  void QtBlackBox::IncNbWindowsShown() { Qt::IncNbWindowsShown(); }
+  void QtBlackBox::DecNbWindowsShown() { Qt::DecNbWindowsShown(); }
+  int  QtBlackBox::GetNbWindowsShown() { return Qt::GetNbWindowsShown(); }
+  bool QtBlackBox::IsSomeWindowShown() { return Qt::GetNbWindowsShown(); }
+  //==================================================================
+  
+
+
+
+}//namespace bbtk
+
+
+#endif
+
diff --git a/kernel/src/bbtkQtBlackBox.h b/kernel/src/bbtkQtBlackBox.h
new file mode 100644 (file)
index 0000000..5cee0ba
--- /dev/null
@@ -0,0 +1,122 @@
+/*=========================================================================                                                                               
+  Program:   bbtk
+  Module:    $RCSfile: bbtkQtBlackBox.h,v $
+  Language:  C++
+  Date:      $Date: 2009/04/08 07:56:11 $
+  Version:   $Revision: 1.1 $
+========================================================================*/
+
+
+/* ---------------------------------------------------------------------
+
+* Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
+* Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux
+*
+*  This software is governed by the CeCILL-B license under French law and 
+*  abiding by the rules of distribution of free software. You can  use, 
+*  modify and/ or redistribute the software under the terms of the CeCILL-B 
+*  license as circulated by CEA, CNRS and INRIA at the following URL 
+*  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html 
+*  or in the file LICENSE.txt.
+*
+*  As a counterpart to the access to the source code and  rights to copy,
+*  modify and redistribute granted by the license, users are provided only
+*  with a limited warranty  and the software's author,  the holder of the
+*  economic rights,  and the successive licensors  have only  limited
+*  liability. 
+*
+*  The fact that you are presently reading this means that you have had
+*  knowledge of the CeCILL-B license and that you accept its terms.
+* ------------------------------------------------------------------------ */                                                                         
+/**
+ * \brief Short description in one line
+ * 
+ * Long description which 
+ * can span multiple lines
+ */
+/**
+ * \file 
+ * \brief 
+ */
+/**
+ * \class bbtk::
+ * \brief 
+ */
+#ifndef __bbtkQtBlackBox_h_INCLUDED__
+#define __bbtkQtBlackBox_h_INCLUDED__
+
+
+#ifdef USE_QT
+
+
+#include "bbtkWidgetBlackBox.h"
+
+
+#include "bbtkQt.h"
+
+
+//==================================================================
+class QWidget;
+//==================================================================
+
+
+namespace bbtk
+{
+
+
+
+
+
+  //==================================================================
+  /// Widget black boxes
+  class BBTK_EXPORT QtBlackBox : public bbtk::WidgetBlackBox<QWidget>
+  { 
+    BBTK_BLACK_BOX_INTERFACE(QtBlackBox,bbtk::WidgetBlackBox<QWidget>);
+  public:
+   //==================================================================    
+    /// Callback for creating a Dialog window (modal)
+    /// ** Must be defined ** in toolkit specific descendants 
+    virtual void bbCreateDialogWindow();
+    //==================================================================    
+
+    //==================================================================    
+    /// Callback for creating a Frame window 
+    /// ** Must be defined ** in toolkit specific descendants 
+    virtual void bbCreateFrameWindow();
+    //==================================================================    
+
+   
+    //==================================================================
+    //    virtual void InitWindowManagerIfNeeded();
+    virtual void IncNbWindowsAlive();
+    virtual void DecNbWindowsAlive();
+    virtual int  GetNbWindowsAlive();
+    virtual bool IsSomeWindowAlive();
+    
+    virtual void IncNbWindowsShown();
+    virtual void DecNbWindowsShown();
+    virtual int  GetNbWindowsShown();
+    virtual bool IsSomeWindowShown();
+    //==================================================================
+
+  };
+  //=================================================================
+
+ //=================================================================
+  // QtBlackBoxDescriptor declaration
+  //
+  class QtBlackBoxDescriptor : public WidgetBlackBoxDescriptor<QWidget>
+  BBTK_BEGIN_DESCRIBE_BLACK_BOX_BODY(QtBlackBox);
+  BBTK_NAME("QtBlackBox");
+  BBTK_END_DESCRIBE_BLACK_BOX(QtBlackBox);
+  //=================================================================
+
+
+
+} //namespace bbtk
+
+
+
+#endif  // USE_QT
+#endif  //__bbtkQtBlackBox_h__
diff --git a/kernel/src/bbtkQtBlackBoxDialog.cxx b/kernel/src/bbtkQtBlackBoxDialog.cxx
new file mode 100644 (file)
index 0000000..06189d5
--- /dev/null
@@ -0,0 +1,82 @@
+#ifdef USE_QT
+
+#include "bbtkQtBlackBoxDialog.h"
+#include "bbtkQtBlackBox.h"
+
+namespace bbtk
+{
+
+
+  //=========================================================================
+  QtBlackBoxDialog::QtBlackBoxDialog(QtBlackBox::Pointer box,
+                                    QWidget *parent,
+                                    const std::string& title,
+                                    int width, int height)
+
+    :
+    QtBlackBoxDialogParent(box,parent)
+                                   //    QDialog( parent )
+  {
+    bbtkDebugMessage("qt",9,"QtBlackBoxDialog::QtBlackBoxDialog("<<
+                    bbGetBlackBox()->bbGetFullName()<<","<<parent<<","
+                    <<title<<","<<width<<"x"<<height<<")"<<std::endl);
+    // Sets up the GUI inherited from Ui::bbtkQtblackBoxDialog
+    setupUi(this);
+    resize ( width  , height );
+    setWindowTitle(title.c_str());
+    
+   // Create the widget
+    box->bbUserCreateWidget(widget);
+
+    // Insert into the layout
+    horizontalLayout->addWidget(box->bbGetOutputWidget());
+
+    //    updateGeometry();
+
+  }
+  //=========================================================================
+  
+  //=========================================================================
+  void QtBlackBoxDialog::bbShow()
+  { 
+    if (bbIsShown()) return;
+    bbtkDebugMessage("qt",5,"QtBlackBoxDialog::bbShow() ["
+                    <<bbGetBlackBox()->bbGetFullName()<<"]"<<std::endl);
+    Parent::bbShow();
+    updateGeometry();
+    exec();
+    //    Show(false);
+    //SetReturnCode( wxDialog::ShowModal() ); 
+    bbClose();
+  }
+  //=========================================================================
+
+  //=========================================================================
+  void QtBlackBoxDialog::bbHide()
+  {
+    bbtkDebugMessage("qt",9,"QtBlackBoxDialog::bbHide()"<<std::endl);
+    Parent::bbHide();
+    
+    //Hide();
+  }
+  //=========================================================================
+
+  //=========================================================================
+  void QtBlackBoxDialog::bbClose()
+  {
+    bbtkDebugMessage("qt",9,"QtBlackBoxDialog::bbClose()"<<std::endl);
+    //wxDialog::Destroy();
+  }
+  //=========================================================================
+
+  //=========================================================================
+  QtBlackBoxDialog::~QtBlackBoxDialog()
+  {
+  }
+  //=========================================================================
+
+}
+#endif
+
diff --git a/kernel/src/bbtkQtBlackBoxDialog.h b/kernel/src/bbtkQtBlackBoxDialog.h
new file mode 100644 (file)
index 0000000..34df264
--- /dev/null
@@ -0,0 +1,44 @@
+#ifndef __bbtkQtBlackBoxDialog_h_INCLUDED__
+#define __bbtkQtBlackBoxDialog_h_INCLUDED__
+
+#ifdef USE_QT
+
+
+#include "bbtkQtBlackBox.h"
+#include "bbtkWidgetBlackBoxWindow.h"
+#include "ui_bbtkQtBlackBoxDialog.h"
+#include "bbtkQtBlackBoxDialogParent.h"
+
+namespace bbtk
+{
+
+  //=========================================================================
+  // QtBlackBoxDialog
+  //=========================================================================
+  class QtBlackBoxDialog : public QtBlackBoxDialogParent,
+                          // WidgetBlackBoxWindow<QWidget>, 
+                          // public QDialog,
+                          private Ui::bbtkQtBlackBoxDialog
+  {
+    Q_OBJECT
+  public:
+    typedef QtBlackBoxDialogParent Parent;
+    //  typedef WidgetBlackBoxWindow<QWidget> Parent;
+    //QtBlackBoxDialog() : Parent(QtBlackBox::Pointer()) {}
+    QtBlackBoxDialog(QtBlackBox::Pointer box,
+                    QWidget *parent,
+                    const std::string& title,
+                    int width, int height);
+    ~QtBlackBoxDialog();
+    void bbShow();
+    void bbHide();
+    void bbClose();
+    bool bbIsDialog() { return true; }
+  };
+  //=========================================================================
+
+}
+
+#endif
+#endif
+
diff --git a/kernel/src/bbtkQtBlackBoxDialog.ui b/kernel/src/bbtkQtBlackBoxDialog.ui
new file mode 100644 (file)
index 0000000..98ec27f
--- /dev/null
@@ -0,0 +1,37 @@
+<ui version="4.0" >
+ <class>bbtkQtBlackBoxDialog</class>
+ <widget class="QDialog" name="bbtkQtBlackBoxDialog" >
+  <property name="geometry" >
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>143</width>
+    <height>603</height>
+   </rect>
+  </property>
+  <property name="sizePolicy" >
+   <sizepolicy vsizetype="MinimumExpanding" hsizetype="MinimumExpanding" >
+    <horstretch>1</horstretch>
+    <verstretch>1</verstretch>
+   </sizepolicy>
+  </property>
+  <property name="windowTitle" >
+   <string>Dialog</string>
+  </property>
+  <layout class="QVBoxLayout" name="verticalLayout" >
+   <item>
+    <widget class="QWidget" native="1" name="widget" >
+     <property name="sizePolicy" >
+      <sizepolicy vsizetype="MinimumExpanding" hsizetype="MinimumExpanding" >
+       <horstretch>1</horstretch>
+       <verstretch>1</verstretch>
+      </sizepolicy>
+     </property>
+     <layout class="QHBoxLayout" name="horizontalLayout" />
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/kernel/src/bbtkQtBlackBoxDialogParent.h b/kernel/src/bbtkQtBlackBoxDialogParent.h
new file mode 100644 (file)
index 0000000..95f5a87
--- /dev/null
@@ -0,0 +1,20 @@
+#include <QDialog>
+
+namespace bbtk
+{
+  class QtBlackBoxDialogParent : public WidgetBlackBoxWindow<QWidget>, 
+                                public QDialog
+  {
+  public:
+    QtBlackBoxDialogParent(QtBlackBox::Pointer box,
+                    QWidget *parent)
+      :
+      WidgetBlackBoxWindow<QWidget>(box),
+      QDialog( parent )
+    {
+      
+    }
+
+  };
+
+}
diff --git a/kernel/src/bbtkWidgetBlackBox.h b/kernel/src/bbtkWidgetBlackBox.h
new file mode 100644 (file)
index 0000000..deed3f7
--- /dev/null
@@ -0,0 +1,292 @@
+/*=========================================================================                                                                               
+  Program:   bbtk
+  Module:    $RCSfile: bbtkWidgetBlackBox.h,v $
+  Language:  C++
+  Date:      $Date: 2009/04/08 07:56:11 $
+  Version:   $Revision: 1.1 $
+========================================================================*/
+
+
+/* ---------------------------------------------------------------------
+
+* Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
+* Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux
+*
+*  This software is governed by the CeCILL-B license under French law and 
+*  abiding by the rules of distribution of free software. You can  use, 
+*  modify and/ or redistribute the software under the terms of the CeCILL-B 
+*  license as circulated by CEA, CNRS and INRIA at the following URL 
+*  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html 
+*  or in the file LICENSE.txt.
+*
+*  As a counterpart to the access to the source code and  rights to copy,
+*  modify and redistribute granted by the license, users are provided only
+*  with a limited warranty  and the software's author,  the holder of the
+*  economic rights,  and the successive licensors  have only  limited
+*  liability. 
+*
+*  The fact that you are presently reading this means that you have had
+*  knowledge of the CeCILL-B license and that you accept its terms.
+* ------------------------------------------------------------------------ */                                                                         
+/**
+ * \brief Short description in one line
+ * 
+ * Long description which 
+ * can span multiple lines
+ */
+/**
+ * \file 
+ * \brief 
+ */
+/**
+ * \class bbtk::
+ * \brief 
+ */
+#ifndef __bbtkWidgetBlackBox_h_INCLUDED__
+#define __bbtkWidgetBlackBox_h_INCLUDED__
+
+#include "bbtkAtomicBlackBox.h"
+
+namespace bbtk
+{
+
+
+  template <class T> class WidgetBlackBoxWindow;
+
+
+  //==================================================================
+  /// Generic (template) Widget black box from which all 
+  /// widget black boxes for a specific GUI toolkit inherit with 
+  /// apropriate traits.
+  /// Declares the common inputs / outputs and interface to all widget boxes
+  template <class W>
+  class BBTK_EXPORT WidgetBlackBox : public bbtk::AtomicBlackBox  
+  { 
+  public:
+    //    typedef WidgetTraits Traits;
+    typedef W Widget;
+    typedef Widget* WidgetPointer;
+    typedef WidgetBlackBoxWindow<W> Window;
+    
+    
+    BBTK_BLACK_BOX_INTERFACE(WidgetBlackBox,bbtk::AtomicBlackBox);
+    BBTK_DECLARE_INPUT(WinTitle,std::string);
+    BBTK_DECLARE_INPUT(WinWidth,int);
+    BBTK_DECLARE_INPUT(WinHeight,int);
+    BBTK_DECLARE_INPUT(WinDialog,bool);
+    BBTK_DECLARE_INPUT(WinHide,Void);
+    BBTK_DECLARE_INPUT(WinClose,Void);
+    BBTK_DECLARE_OUTPUT(Widget,Widget*);
+
+    //==================================================================
+    /// Overloaded bbCreateWindow method for WidgetBlackBoxes which handles 
+    /// the window creation if needed
+    virtual void bbCreateWindow();
+    //==================================================================
+    
+    //==================================================================
+    /// Overloaded bbShowWindow method for WidgetBlackBoxes which handles 
+    /// the window creation if needed
+    virtual void bbShowWindow();
+    //==================================================================    
+
+    //==================================================================
+    /// Returns the **OWN** window associated to the box
+    /// If 0 returned = no window
+    Window* bbGetWindow() { return bbmWindow; }
+    /// Returns the window containing the widget associated to the box
+    /// Which can be the own window of **ANOTHER** box in case of 
+    /// a hierarchy of widgets (layouts)
+    /// More precisely :
+    /// If bbGetWindow() != 0 then returns bbGetWindow()
+    /// Else if the output 'Widget' is connected 
+    ///  then returns bbGetContainingWindow() of the box connected to 'Widget'
+    /// Else returns 0;
+    Window* bbGetContainingWindow();
+
+
+    /// Returns true iff the 'containing window' exists and is shown 
+    /// (see bbGetContainingWindow).
+    bool bbIsShown();
+
+    /// Convenient method which returns true iff the output Widget is connected
+    bool bbIsOutputWidgetConnected();
+
+    //==================================================================    
+    /// User callback invoked when the containing window is shown
+    virtual void bbUserOnShow() {}
+    //==================================================================    
+    //==================================================================    
+    /// User callback invoked when the containing window is hidden
+    virtual void bbUserOnHide() {}
+    //==================================================================    
+
+    /// Sets the window
+    inline void bbSetWindow(Window* w) { bbmWindow=w; }
+
+    //==================================================================    
+    /// User callback for creating the widget associated to the box
+    /// ** Must be defined ** in user classes
+    virtual void bbUserCreateWidget(Widget* parent) 
+    {
+      bbtkError(bbGetTypeName()<<" is a WidgetBlackBox whose bbUserCreateWidget methods is not overloaded : is it a feature or a bug ?!?");
+    }
+    //==================================================================    
+
+         
+  protected:
+    
+  
+    //==================================================================
+    /// User callback called in the box contructor
+    virtual void bbUserConstructor();
+    /// User callback called in the box copy constructor
+    virtual void bbUserCopyConstructor(bbtk::BlackBox::Pointer);
+    /// User callback called in the box destructor
+    virtual void bbUserDestructor();
+    //==================================================================    
+
+
+
+    //==================================================================
+    /// Convenient method for layout widgets which creates and returns
+    /// (calls bbUserCreateWidget) 
+    /// the widget of the box connected to the input in.
+    /// Returns NULL if the input is not connected
+    Widget* bbCreateWidgetOfInput(const std::string& in, 
+                                 Widget* parent);
+    //==================================================================
+
+   //==================================================================    
+    /// Callback for creating a Dialog window (modal)
+    /// ** Must be defined ** in toolkit specific descendants 
+    virtual void bbCreateDialogWindow()
+    {
+      bbtkError(bbGetTypeName()<<" is a WidgetBlackBox whose bbCreateDialogWindow method is not overloaded ?!?");
+    }
+    //==================================================================    
+
+ //==================================================================    
+    /// Callback for creating a Frame window 
+    /// ** Must be defined ** in toolkit specific descendants 
+    virtual void bbCreateFrameWindow()
+    {
+      bbtkError(bbGetTypeName()<<" is a WidgetBlackBox whose bbCreateFrameWindow method is not overloaded ?!?");
+    }
+    //==================================================================    
+    //==================================================================
+    /// Overloaded processing method for WidgetBlackBoxes
+    virtual void bbProcess();
+    //==================================================================
+
+    //==================================================================
+    /// Hides the WidgetBlackBoxWindow associated to the box (if exists)
+    void bbHideWindow();
+    /// Closes (destroys) the WidgetBlackBoxWindow associated to the box 
+    /// (if exists)
+    void bbCloseWindow();
+    //==================================================================
+
+    
+    //==================================================================
+    //   virtual void InitWindowManagerIfNeeded();
+    virtual void IncNbWindowsAlive() {}
+    virtual void DecNbWindowsAlive() {}
+    virtual int  GetNbWindowsAlive() { return 0; }
+    virtual bool IsSomeWindowAlive() { return false; }
+    
+    virtual void IncNbWindowsShown() {}
+    virtual void DecNbWindowsShown() {}
+    virtual int  GetNbWindowsShown() { return 0; }
+    virtual bool IsSomeWindowShown() { return false; }
+    //==================================================================
+
+
+  private:
+    /// friendship
+    friend class WidgetBlackBoxWindow<W>;
+    //    friend class WidgetBlackBoxWidgetEventHandler;
+
+    /// The WidgetBlackBoxWindow associated to the box
+    Window* bbmWindow;
+
+
+    void bbInitAttributes();
+
+  };
+  //=================================================================
+
+  //======================================================================
+  /// Defines the bbUserCreateWidget method
+#define BBTK_CREATE_WIDGET(CALLBACK)                                   \
+  public:                                                              \
+  inline void bbUserCreateWidget(Widget* parent)                       \
+  {                                                                    \
+    bbtkDebugMessageInc("kw",1,"**> Creating widget for ["             \
+                       <<bbGetFullName()<<"]"<<std::endl);             \
+    CALLBACK(parent);                                                  \
+    bbtkDebugMessageInc("kw",1,"<** Creating widget for ["             \
+                       <<bbGetFullName()<<"]"<<std::endl);             \
+  }
+  
+  //======================================================================
+
+  //======================================================================
+  /// Defines the bbUserOnShow method
+#define BBTK_ON_SHOW_WIDGET(CALLBACK)                                  \
+  public:                                                              \
+  inline void bbUserOnShow()                                   \
+  {                                                                    \
+    bbtkDebugMessageInc("wx",1,"**> Showing ["         \
+                       <<bbGetFullName()<<"]"<<std::endl);             \
+    CALLBACK();                                                                \
+    bbtkDebugMessageInc("wx",1,"<** Showing ["         \
+                       <<bbGetFullName()<<"]"<<std::endl);             \
+  }
+  
+  //======================================================================
+
+  //=================================================================
+  // WidgetBlackBoxDescriptor declaration
+  BBTK_BEGIN_DESCRIBE_TEMPLATE_BLACK_BOX(WidgetBlackBox,bbtk::AtomicBlackBox);
+  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);
+  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
+#include "bbtkWidgetBlackBox.txx"
+
+// WidgetBlackBoxWindow interface + code inclusion
+#include "bbtkWidgetBlackBoxWindow.h"
+
+#endif  //__bbtkWidgetBlackBox_h__
diff --git a/kernel/src/bbtkWidgetBlackBox.txx b/kernel/src/bbtkWidgetBlackBox.txx
new file mode 100644 (file)
index 0000000..7413e8c
--- /dev/null
@@ -0,0 +1,278 @@
+/*=========================================================================                                                                               
+  Program:   bbtk
+  Module:    $RCSfile: bbtkWidgetBlackBox.txx,v $
+  Language:  C++
+  Date:      $Date: 2009/04/08 07:56:11 $
+  Version:   $Revision: 1.1 $
+=========================================================================*/
+
+/* ---------------------------------------------------------------------
+
+* Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
+* Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux
+*
+*  This software is governed by the CeCILL-B license under French law and 
+*  abiding by the rules of distribution of free software. You can  use, 
+*  modify and/ or redistribute the software under the terms of the CeCILL-B 
+*  license as circulated by CEA, CNRS and INRIA at the following URL 
+*  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html 
+*  or in the file LICENSE.txt.
+*
+*  As a counterpart to the access to the source code and  rights to copy,
+*  modify and redistribute granted by the license, users are provided only
+*  with a limited warranty  and the software's author,  the holder of the
+*  economic rights,  and the successive licensors  have only  limited
+*  liability. 
+*
+*  The fact that you are presently reading this means that you have had
+*  knowledge of the CeCILL-B license and that you accept its terms.
+* ------------------------------------------------------------------------ */                                                                         
+/**
+ *  \file 
+ *  \brief 
+ */
+
+
+#include "bbtkWidgetBlackBoxWindow.h"
+#include "bbtkBlackBoxOutputConnector.h"
+
+
+namespace bbtk
+{
+
+  //=========================================================================
+  // WidgetBlackBox
+  //=========================================================================
+
+  //=========================================================================
+  //=========================================================================
+  //=========================================================================
+  //=========================================================================
+  BBTK_BLACK_BOX_TEMPLATE_IMPLEMENTATION(WidgetBlackBox,AtomicBlackBox);
+  //=========================================================================
+  
+//=========================================================================
+  template <class T>  
+  void WidgetBlackBox<T>::bbUserConstructor()
+  {
+    bbtkDebugMessage("widget",9,"WidgetBlackBox::bbUserConstructor()"<<std::endl);
+    bbInitAttributes();
+  }
+  //=========================================================================
+
+  //=========================================================================
+  template <class T>  
+  void WidgetBlackBox<T>::bbUserCopyConstructor(bbtk::BlackBox::Pointer)
+  {
+    bbtkDebugMessage("widget",9,"WidgetBlackBox::bbUserCopyConstructor()"
+                    <<std::endl);
+    bbInitAttributes();
+  }
+  //=========================================================================
+
+
+  //=========================================================================
+  template <class T>  
+  void WidgetBlackBox<T>::bbUserDestructor()
+  {
+    bbtkDebugMessage("widget",9,"==> WidgetBlackBox::bbUserDestructor() ["<<bbGetFullName()<<"]"<<std::endl);
+    if (bbGetWindow()) {
+      bbGetWindow()->bbClose();
+      bbSetWindow(0);
+    }
+    bbtkDebugMessage("widget",9,"<== WidgetBlackBox::bbUserDestructor() ["<<bbGetFullName()<<"]"<<std::endl);
+  }
+  //=========================================================================
+  
+
+
+  //=========================================================================
+  /**
+   * \brief Initialize the attributes of the class
+   *
+   */
+  template <class T>  
+  void WidgetBlackBox<T>::bbInitAttributes()
+  {
+    bbmWindow = 0;
+    bbSetInputWinTitle(bbGetName());
+    bbSetInputWinWidth(800);
+    bbSetInputWinHeight(800);
+    bbSetInputWinDialog(false);
+    bbSetOutputWidget(0);
+  }
+  //=========================================================================
+
+
+  //=========================================================================
+  template <class T>  
+  void WidgetBlackBox<T>::bbProcess()
+  { 
+    // TODO : update the window size and title 
+    this->bbUserProcess(); 
+  }
+  //=========================================================================
+
+  //=========================================================================
+  template <class T>  
+  void WidgetBlackBox<T>::bbCreateWindow()
+  { 
+
+
+    // If output 'Widget' not connected then
+    // it is a top level Widget have to create and show the Window
+    if ( ! bbIsOutputWidgetConnected() )
+      {
+       // create the Window if does not exist
+       if ( bbGetWindow() == 0)
+         {
+           bbtkDebugMessage("widget",2,
+                            "-> Creating the window"
+                            <<std::endl);
+           //      this->InitWindowManagerIfNeeded();
+           // If is a Dialog requested
+           if ( bbGetInputWinDialog() )
+             {
+               bbtkDebugMessage("process",2,
+                                "   Input WinDialog set to true : creating a Dialog"
+                                <<std::endl);
+               this->bbCreateDialogWindow();
+             }
+           // Input WinDialog set to false : creating a Frame
+           else 
+             {
+               bbtkDebugMessage("process",2,
+                                "   Input WinDialog set to false : creating a Frame"
+                                <<std::endl);
+               this->bbCreateFrameWindow();
+             }
+         }
+       // Show the window
+       if ( !bbGetWindow() )
+         {
+           bbtkInternalError("Need to show the Window of widget "<<bbGetName()
+                             <<" however was not created by apropriate cb");
+         }
+       bbtkDebugMessage("widget",2,
+                        "-> Showing the window"
+                        <<std::endl);
+       bbGetWindow()->bbShow(); 
+      }                  
+    //   
+  }
+  //=========================================================================
+  
+
+  //==================================================================
+  template <class T>  
+  typename WidgetBlackBox<T>::WidgetPointer  
+  WidgetBlackBox<T>::bbCreateWidgetOfInput
+  (const std::string& in, WidgetBlackBox<T>::WidgetPointer parent)
+  {
+    Widget* w = 0;
+    // If input is connected 
+    BlackBoxInputConnector* c = bbGetInputConnectorMap().find(in)->second ;
+    if ( c->IsConnected() )                    
+      {
+       // Get black box from 
+       BlackBox::Pointer from = 
+         c->GetConnection()->GetBlackBoxFrom();
+       // Cast it into a WidgetBlackBox
+       typename WidgetBlackBox<T>::Pointer wfrom 
+         = boost::dynamic_pointer_cast<WidgetBlackBox<T> >(from);
+       // Call bbCreateWidget
+       wfrom->bbUserCreateWidget(parent);
+       // Get the widget created
+       w = wfrom->bbGetOutputWidget();
+      }
+    return w;
+  }
+  //==================================================================
+
+  //=========================================================================
+  template <class T>  
+  bool WidgetBlackBox<T>::bbIsOutputWidgetConnected()
+  {
+    return ((*bbGetOutputConnectorMap().find("Widget")).second->GetConnectionVector().size() != 0 );
+  }
+  //==================================================================
+
+ //==================================================================
+  template <class T>  
+   void WidgetBlackBox<T>::bbShowWindow()
+  {
+    bbtkDebugMessageInc("widget",1,"=> WidgetBlackBox::bbShowWindow() ["
+                       <<bbGetFullName()<<"]"<<std::endl);
+
+    if (bbGetWindow()!=0) bbGetWindow()->bbShow();
+
+    bbtkDebugMessageDec("widget",2,"<= WidgetBlackBox::bbShowWindow() ["
+                       <<bbGetFullName()<<"]"<<std::endl);
+  }
+  //==================================================================
+
+  //==================================================================
+  template <class T>  
+   void WidgetBlackBox<T>::bbHideWindow()
+  {
+    bbtkDebugMessageInc("widget",1,"=> WidgetBlackBox::bbHideWindow() ["
+                       <<bbGetFullName()<<"]"<<std::endl);
+
+    if (bbGetWindow()!=0) bbGetWindow()->bbHide();
+
+    bbtkDebugMessageDec("widget",2,"<= WidgetBlackBox::bbHideWindow() ["
+                       <<bbGetFullName()<<"]"<<std::endl);
+  }
+  //==================================================================
+
+
+  //==================================================================
+  template <class T>  
+  void WidgetBlackBox<T>::bbCloseWindow()
+  {
+    bbtkDebugMessageInc("widget",1,"=> WidgetBlackBox::bbCloseWindow() ["
+                       <<bbGetFullName()<<"]"<<std::endl);
+
+    if (bbGetWindow()!=0) bbGetWindow()->bbClose();
+
+    bbtkDebugMessageDec("widget",2,"<= WidgetBlackBox::bbCloseWindow() ["
+                       <<bbGetFullName()<<"]"<<std::endl);
+  }
+  //==================================================================
+
+  //==================================================================
+  template <class T>  
+  typename WidgetBlackBox<T>::Window* 
+  WidgetBlackBox<T>::bbGetContainingWindow()
+  {
+    if (bbGetWindow()!=0) return bbGetWindow();
+    BlackBox::OutputConnectorMapType::const_iterator i 
+      = bbGetOutputConnectorMap().find("Widget");
+    if ( i->second->GetConnectionVector().size() != 0 ) 
+      {
+       return boost::static_pointer_cast<WidgetBlackBox>
+         (i->second->GetConnectionVector().front() //.lock()
+          ->GetBlackBoxTo())->bbGetContainingWindow();
+      }
+    return 0;
+  }
+  //==================================================================
+
+
+  //==================================================================
+  template <class T>  
+  bool WidgetBlackBox<T>::bbIsShown()
+  {
+    if (bbGetContainingWindow()!=0)
+      return bbGetContainingWindow()->bbIsShown();
+    return false;
+  }
+  //==================================================================
+
+
+}//namespace bbtk
+
+
+
+
diff --git a/kernel/src/bbtkWidgetBlackBoxWindow.h b/kernel/src/bbtkWidgetBlackBoxWindow.h
new file mode 100644 (file)
index 0000000..5fea07c
--- /dev/null
@@ -0,0 +1,90 @@
+/*=========================================================================                                                                               
+  Program:   bbtk
+  Module:    $RCSfile: bbtkWidgetBlackBoxWindow.h,v $
+  Language:  C++
+  Date:      $Date: 2009/04/08 07:56:11 $
+  Version:   $Revision: 1.1 $
+========================================================================*/
+
+
+/* ---------------------------------------------------------------------
+
+* Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
+* Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux
+*
+*  This software is governed by the CeCILL-B license under French law and 
+*  abiding by the rules of distribution of free software. You can  use, 
+*  modify and/ or redistribute the software under the terms of the CeCILL-B 
+*  license as circulated by CEA, CNRS and INRIA at the following URL 
+*  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html 
+*  or in the file LICENSE.txt.
+*
+*  As a counterpart to the access to the source code and  rights to copy,
+*  modify and redistribute granted by the license, users are provided only
+*  with a limited warranty  and the software's author,  the holder of the
+*  economic rights,  and the successive licensors  have only  limited
+*  liability. 
+*
+*  The fact that you are presently reading this means that you have had
+*  knowledge of the CeCILL-B license and that you accept its terms.
+* ------------------------------------------------------------------------ */                                                                         
+/**
+ * \brief Short description in one line
+ * 
+ * Long description which 
+ * can span multiple lines
+ */
+/**
+ * \file 
+ * \brief 
+ */
+/**
+ * \class bbtk::
+ * \brief 
+ */
+
+
+
+#ifndef __bbtkWidgetBlackBoxWindow_h__
+#define __bbtkWidgetBlackBoxWindow_h__
+
+
+#include "bbtkWidgetBlackBox.h"
+
+namespace bbtk
+{
+
+
+  //==================================================================
+  // The base of the hierarchy of windows associated to a WidgetBlackBox
+  template <class W>
+  class BBTK_EXPORT WidgetBlackBoxWindow 
+  {
+  public:
+    typedef typename WidgetBlackBox<W>::Pointer WidgetBlackBoxPointer;
+    typedef typename WidgetBlackBox<W>::WeakPointer WidgetBlackBoxWeakPointer;
+
+    WidgetBlackBoxWindow(WidgetBlackBoxPointer box);
+    virtual ~WidgetBlackBoxWindow();
+    virtual void bbShow();
+    virtual void bbHide();
+    virtual void bbClose();
+    bool bbIsShown() { return mShown; }
+    virtual WidgetBlackBoxPointer bbGetBlackBox() { return mBox.lock(); }
+    //virtual wxDialog* bbGetDialog() { return 0; } 
+    //virtual wxFrame* bbGetFrame() { return 0; } 
+    virtual bool bbIsDialog() { return false; }
+    virtual bool bbIsFrame() { return false; }
+  private:
+    WidgetBlackBoxWeakPointer mBox;
+    bool mShown;
+  };
+  //==================================================================
+
+
+} //namespace bbtk
+
+#include "bbtkWidgetBlackBoxWindow.txx"
+
+#endif  //__bbtkWidgetBlackBoxWindow_h__
+
diff --git a/kernel/src/bbtkWidgetBlackBoxWindow.txx b/kernel/src/bbtkWidgetBlackBoxWindow.txx
new file mode 100644 (file)
index 0000000..2c7c266
--- /dev/null
@@ -0,0 +1,118 @@
+/*=========================================================================                                                                               
+  Program:   bbtk
+  Module:    $RCSfile: bbtkWidgetBlackBoxWindow.txx,v $
+  Language:  C++
+  Date:      $Date: 2009/04/08 07:56:11 $
+  Version:   $Revision: 1.1 $
+=========================================================================*/
+
+/* ---------------------------------------------------------------------
+
+* Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
+* Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux
+*
+*  This software is governed by the CeCILL-B license under French law and 
+*  abiding by the rules of distribution of free software. You can  use, 
+*  modify and/ or redistribute the software under the terms of the CeCILL-B 
+*  license as circulated by CEA, CNRS and INRIA at the following URL 
+*  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html 
+*  or in the file LICENSE.txt.
+*
+*  As a counterpart to the access to the source code and  rights to copy,
+*  modify and redistribute granted by the license, users are provided only
+*  with a limited warranty  and the software's author,  the holder of the
+*  economic rights,  and the successive licensors  have only  limited
+*  liability. 
+*
+*  The fact that you are presently reading this means that you have had
+*  knowledge of the CeCILL-B license and that you accept its terms.
+* ------------------------------------------------------------------------ */                                                                         
+
+/**
+ *  \file 
+ *  \brief 
+ */
+
+namespace bbtk
+{
+
+
+
+
+  //=========================================================================
+  // WidgetBlackBoxWindow
+  //=========================================================================
+
+
+
+  //=========================================================================
+  template <class W>
+  WidgetBlackBoxWindow<W>::WidgetBlackBoxWindow
+  (typename WidgetBlackBox<W>::Pointer box)
+    : mBox(box), mShown(false)
+  {
+    bbtkDebugMessage("widget",9,"WidgetBlackBoxWindow::WidgetBlackBoxWindow("
+                    <<mBox.lock()->bbGetName()<<")"<<std::endl);
+    mBox.lock()->bbSetWindow(this);
+    mBox.lock()->IncNbWindowsAlive();
+  }
+  //=========================================================================
+
+  //=========================================================================
+  template <class W>
+  WidgetBlackBoxWindow<W>::~WidgetBlackBoxWindow()
+  {
+    bbtkDebugMessage("widget",9,
+                    "WidgetBlackBoxWindow::~WidgetBlackBoxWindow() "
+                    <<this<<std::endl);
+    bbHide();
+    mBox.lock()->DecNbWindowsAlive();
+    if (!mBox.expired())
+      {
+       mBox.lock()->bbSetWindow(0);
+      }
+  }
+  //========================================================================= 
+
+
+  //=========================================================================
+  template <class W>
+  void WidgetBlackBoxWindow<W>::bbShow()
+  {
+    if (bbIsShown()) return;
+    bbtkDebugMessage("widget",9,"WidgetBlackBoxWindow::bbShow() ["
+                    <<mBox.lock()->bbGetName()<<"]"<<std::endl);
+    mBox.lock()->IncNbWindowsShown();
+    mShown = true;
+    if (bbGetBlackBox()) bbGetBlackBox()->bbUserOnShow();
+  }
+  //=========================================================================
+
+  //=========================================================================
+  template <class W>
+  void WidgetBlackBoxWindow<W>::bbHide()
+  {
+    if (!bbIsShown()) return;
+    bbtkDebugMessage("widget",9,"WidgetBlackBoxWindow::bbHide() ["
+                    <<mBox.lock()->bbGetName()<<"]"<<std::endl);
+    mBox.lock()->DecNbWindowsShown();
+    mShown = false;
+  }
+  //=========================================================================
+
+  //=========================================================================
+  template <class W>
+  void WidgetBlackBoxWindow<W>::bbClose()
+  {
+    bbtkDebugMessage("widget",9,"WidgetBlackBoxWindow::bbClose() [" 
+                    <<mBox.lock()->bbGetName()<<"]"<<std::endl);
+  }
+  //=========================================================================
+
+
+
+}//namespace bbtk
+
+
+
index c8026e40b24f97a4cfa6d1d238e2c45376430d63..a15bb866cc7e47b13804a78a658641e5127a9159 100644 (file)
@@ -2,8 +2,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkWx.cxx,v $
   Language:  C++
-  Date:      $Date: 2009/01/27 14:22:57 $
-  Version:   $Revision: 1.12 $
+  Date:      $Date: 2009/04/08 07:56:11 $
+  Version:   $Revision: 1.13 $
 =========================================================================*/
 
 /* ---------------------------------------------------------------------
 *  The fact that you are presently reading this means that you have had
 *  knowledge of the CeCILL-B license and that you accept its terms.
 * ------------------------------------------------------------------------ */                                                                         
-
-#ifdef _USE_WXWIDGETS_
-
 #include "bbtkWx.h"
 #include "bbtkMessageManager.h"
 
+#ifdef _USE_WXWIDGETS_
+
 namespace bbtk
 {
   //=========================================================================
@@ -348,6 +347,22 @@ namespace bbtk
   //=========================================================================
   */
 
-}
+} // namespace bbtk
+
+#else
+//=======================================================================
+// WITHOUT WX
+//=========================================================================
+namespace bbtk
+{
+  Wx::BusyCursor::BusyCursor()
+  {
+  }
+  Wx::BusyCursor::~BusyCursor()
+  {
+  }
+  //=========================================================================
 
+} // namespace bbtk
 #endif
+
index b2ed350963d3a5bbfdc59ecd94b9915d12921986..fd674b4f4972d91c76321c2466594474dba18af6 100644 (file)
@@ -2,8 +2,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkWx.h,v $
   Language:  C++
-  Date:      $Date: 2008/12/11 15:30:04 $
-  Version:   $Revision: 1.9 $
+  Date:      $Date: 2009/04/08 07:56:11 $
+  Version:   $Revision: 1.10 $
 =========================================================================*/
 
 /* ---------------------------------------------------------------------
@@ -80,6 +80,7 @@
 
 // define wxWindow
 typedef void wxWindow;
+typedef void wxBusyCursor;
 
 #endif // EO USE_WXWIDGETS
 //===========================================================================
index 86c3775d77addaf0331ff993bea6306d8fad4db7..b99ca45163c9d13b5c8875341f30b87226950201 100644 (file)
@@ -2,8 +2,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkWxBlackBox.cxx,v $
   Language:  C++
-  Date:      $Date: 2009/03/23 13:06:41 $
-  Version:   $Revision: 1.37 $
+  Date:      $Date: 2009/04/08 07:56:11 $
+  Version:   $Revision: 1.38 $
 =========================================================================*/
 
 /* ---------------------------------------------------------------------
@@ -56,65 +56,6 @@ namespace bbtk
 
 
 
-  //=========================================================================
-  // WxBlackBoxWindow
-  //=========================================================================
-
-
-
-  //=========================================================================
-  WxBlackBoxWindow::WxBlackBoxWindow(WxBlackBox::Pointer box)
-    : mBox(box), mShown(false)
-  {
-    bbtkDebugMessage("wx",9,"WxBlackBoxWindow::WxBlackBoxWindow("<<
-                    mBox.lock()->bbGetFullName()<<")"<<std::endl);
-    mBox.lock()->bbSetWindow(this);
-    Wx::IncNbWindowsAlive();
-  }
-  //=========================================================================
-
-  //=========================================================================
-  WxBlackBoxWindow::~WxBlackBoxWindow()
-  {
-    bbtkDebugMessage("wx",9,"WxBlackBoxWindow::~WxBlackBoxWindow() "
-                    <<this<<std::endl);
-    bbHide();
-    Wx::DecNbWindowsAlive();
-    if (!mBox.expired())
-      {
-       mBox.lock()->bbSetWindow(0);
-      }
-  }
-  //========================================================================= 
-
-
-  //=========================================================================
-  void WxBlackBoxWindow::bbShow()
-  {
-    if (bbIsShown()) return;
-    bbtkDebugMessage("wx",9,"WxBlackBoxWindow::bbShow()"<<std::endl);
-    Wx::IncNbWindowsShown();
-    mShown = true;
-    if (bbGetBlackBox()) bbGetBlackBox()->bbUserOnShow();
-  }
-  //=========================================================================
-
-  //=========================================================================
-  void WxBlackBoxWindow::bbHide()
-  {
-    if (!bbIsShown()) return;
-    bbtkDebugMessage("wx",9,"WxBlackBoxWindow::bbHide()"<<std::endl);
-    Wx::DecNbWindowsShown();
-    mShown = false;
-  }
-  //=========================================================================
-
-  //=========================================================================
-  void WxBlackBoxWindow::bbClose()
-  {
-  }
-  //=========================================================================
-
 
   //=========================================================================
   // WxBlackBoxDialog
@@ -138,17 +79,16 @@ namespace bbtk
                wxMINIMIZE_BOX | 
                wxCAPTION  
              ),
-    WxBlackBoxWindow(box)
+    Parent(box)
   {
     bbtkDebugMessage("wx",9,"WxBlackBoxDialog::WxBlackBoxDialog("<<
                     bbGetBlackBox()->bbGetFullName()<<","<<parent<<","
                     <<title<<",size)"<<std::endl);
     // Insert the widget into the window
     wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL);
-         // LG 22/11/08 : new widget pipeline
-         bbGetBlackBox()->bbCreateWidgetAndEventHandler(this);
+    // Create the widget
+    box->bbCreateWidgetAndEventHandler(this);
     wxWindow* widget = bbGetBlackBox()->bbGetOutputWidget();
-// old :    widget->Reparent(this);
     sizer->Add( widget, 1, wxALL|wxEXPAND, 2);
     //SetAutoLayout(true);
     SetSizer(sizer);
@@ -162,8 +102,8 @@ namespace bbtk
     if (bbIsShown()) return;
     bbtkDebugMessage("wx",5,"WxBlackBoxDialog::bbShow() ["
                     <<bbGetBlackBox()->bbGetFullName()<<"]"<<std::endl);
-    WxBlackBoxWindow::bbShow();
-       Show(false);
+    Parent::bbShow();
+    Show(false);
     SetReturnCode( wxDialog::ShowModal() ); 
     bbClose();
   }
@@ -173,7 +113,7 @@ namespace bbtk
   void WxBlackBoxDialog::bbHide()
   {
     bbtkDebugMessage("wx",9,"WxBlackBoxDialog::bbHide()"<<std::endl);
-    WxBlackBoxWindow::bbHide();
+    Parent::bbHide();
     Hide();
   }
   //=========================================================================
@@ -217,18 +157,16 @@ namespace bbtk
               wxMINIMIZE_BOX | 
               wxCAPTION  
                ),
-       WxBlackBoxWindow(box)
+       Parent(box)
   {
     bbtkDebugMessage("wx",9,"WxBlackBoxFrame::WxBlackBoxFrame("<<
                     bbGetBlackBox()->bbGetFullName()<<","<<parent<<","
                     <<title<<",size)"<<std::endl);
     // Insert the widget into the window
     wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL);
-         // LG 22/11/08 : new widget pipeline
-         bbGetBlackBox()->bbCreateWidgetAndEventHandler(this);
+    box->bbCreateWidgetAndEventHandler(this);
     wxWindow* widget = bbGetBlackBox()->bbGetOutputWidget();
     wxFrame* frame = (wxFrame*)this;
-// old :    widget->Reparent(frame);
     sizer->Add( widget, 1, wxALL|wxGROW, 2);
     //  frame->SetAutoLayout(true);
     frame->SetSizer(sizer);
@@ -249,7 +187,7 @@ namespace bbtk
     if (bbIsShown()) return;
     bbtkDebugMessage("wx",5,"WxBlackBoxFrame::bbShow("
                     <<bbGetBlackBox()->bbGetFullName()<<")"<<std::endl);
-    WxBlackBoxWindow::bbShow();
+    Parent::bbShow();
     wxFrame::Show();
     // This Update is ** MANDATORY ** 
     // to synchronize wxvtkRenderWindowInteractor objects
@@ -270,7 +208,7 @@ namespace bbtk
   void WxBlackBoxFrame::bbHide()
   {
     bbtkDebugMessage("wx",9,"WxBlackBoxFrame::bbHide()"<<std::endl);
-    WxBlackBoxWindow::bbHide();
+    Parent::bbHide();
     wxFrame::Hide();
     if (bbGetBlackBox()) bbGetBlackBox()->bbUserOnHide();
   }
@@ -350,7 +288,7 @@ namespace bbtk
   //=========================================================================
   //=========================================================================
   //=========================================================================
-  BBTK_BLACK_BOX_IMPLEMENTATION(WxBlackBox,AtomicBlackBox);
+  BBTK_BLACK_BOX_IMPLEMENTATION(WxBlackBox,WidgetBlackBox<wxWindow>);
   //=========================================================================
   
   //=========================================================================
@@ -371,186 +309,47 @@ namespace bbtk
   //=========================================================================
 
 
-  //=========================================================================
-  void WxBlackBox::bbUserDestructor()
-  {
-    bbtkDebugMessage("wx",9,"==> WxBlackBox::bbUserDestructor() ["<<bbGetFullName()<<"]"<<std::endl);
-    if (bbGetWindow()) {
-      delete bbGetWindow();
-      bbSetWindow(0);
-    }
-    bbtkDebugMessage("wx",9,"<== WxBlackBox::bbUserDestructor() ["<<bbGetFullName()<<"]"<<std::endl);
-  }
-  //=========================================================================
-  
 
   //=========================================================================
-  /**
-   * \brief Initialize the attributes of the class
-   *
-   */
+  /// Initialize the attributes of the class
   void WxBlackBox::bbInitAttributes()
   {
-    bbmWindow = 0;
-    //    bbmWidget = 0;
-    //    bbSetInputWinParent(0);
-    bbSetInputWinTitle(bbGetName());
-    bbSetInputWinWidth(800);
-    bbSetInputWinHeight(800);
-    bbSetInputWinDialog(false);
-    bbSetOutputWidget(0);
-
     bbSetWidgetEventHandler(0);
-    //    bbSetUpdateTransferedToParent(false);
   }
   //=========================================================================
 
+  //==================================================================    
+  /// Callback for creating a Dialog window (modal)
+  void WxBlackBox::bbCreateDialogWindow()
+  {
+    WxBlackBoxDialog* w = 0;  
+    w = new WxBlackBoxDialog( GetThisPointer<WxBlackBox>(),
+                             Wx::GetTopWindow(),
+                             std2wx( bbGetInputWinTitle() 
+                                     + " - bbtk (c) CREATIS LRMN"),
+                             wxSize( bbGetInputWinWidth() , 
+                                     bbGetInputWinHeight()  ));
+    w->Show(true);  
+  }
+  //==================================================================    
 
-       //=========================================================================
-       void WxBlackBox::bbCreateWidget()
-       {
-               // If output widget not connected : have to create and show the window
-               if ( (*bbGetOutputConnectorMap().find("Widget")).second->GetConnectionVector().size() == 0 ) 
-               {
-                       Window* show = 0;
-                       // If the window already exists : no need creating it
-                       if (bbGetWindow()!=0)
-                       {
-                               bbtkDebugMessage("wx",2,
-                                                                "-> Window already exists"
-                                                                <<std::endl);
-                               show = bbGetWindow();
-                       } // bbGetWindow
-                       // Else create window 
-                       else 
-                       {
-                               bbtkDebugMessage("wx",2,
-                                                                "-> Creating the window"
-                                                                <<std::endl);
-                               
-                               // Input WinDialog set to true : creating a Dialog
-                               if (bbGetInputWinDialog()) 
-                               {
-                                       bbtkDebugMessage("wx",2,
-                                                                        "   Input WinDialog set to true : creating a Dialog"
-                                                                        <<std::endl);
-                                       show = (Window*) new WxBlackBoxDialog( GetThisPointer<WxBlackBox>(),
-                                                                                                                 Wx::GetTopWindow(),
-                                                                                                                 std2wx( bbGetInputWinTitle() + " - bbtk (c) CREATIS LRMN"),
-                                                                                                                 wxSize( bbGetInputWinWidth() , bbGetInputWinHeight()  )); 
-                                       //bbGetInputWinWidth() , bbGetInputWinHeight() ) );
-//                                     show->bbGetDialog()->Update();
-//                                     show->bbGetDialog()->Refresh();
-                                       
-                                       //show->bbGetDialog()->Iconize(true);
-                                       show->bbGetDialog()->Show(true);
-//                                     show->bbGetDialog()->Show(false);
-//                                     show->bbGetDialog()->SetSize(wxSize( bbGetInputWinWidth() , bbGetInputWinHeight() ));
-                                       
-                               }
-                               // Input WinDialog set to false : creating a Frame
-                               else 
-                               {
-                                       bbtkDebugMessage("process",2,
-                                                                        "   Input WinDialog set to false : creating a Frame"
-                                                                        <<std::endl);
-                                       show = (Window*) new WxBlackBoxFrame( GetThisPointer<WxBlackBox>(),
-                                                                                                                Wx::GetTopWindow(),
-                                                                                                                std2wx( bbGetInputWinTitle()  + " - bbtk (c) CREATIS LRMN"),
-                                                                                                                wxSize( bbGetInputWinWidth() , bbGetInputWinHeight() ) );
-//                                     show->bbGetFrame()->Update();
-//                                     show->bbGetFrame()->Refresh();
-                                                                                       show->bbGetFrame()->Show();
-                               }
-                               
-                       } // else bbGetWindow
-//                     show->bbShow();
-                       
-               } // bbGetOutputConnectorMap().find("Widget")).second->GetConnectionVector().size()  
-       }
-       //=========================================================================
-
-       
-       //=========================================================================
-       void WxBlackBox::bbShowWidget()
-       {
-               // Show the window
-               Window *show = bbGetWindow();
-               if (show!=NULL)
-               {
-                       show->bbShow(); 
-               }
-       }
-       //=========================================================================
-       
-       
-       //=========================================================================
-       void WxBlackBox::bbProcess()
-       { 
-               // TODO : update the window size and title 
-               this->bbUserProcess(); 
-       }
-       //=========================================================================
-       
-       /* EED BORRAME  original  18 mars 2009
-  //=========================================================================
-  void WxBlackBox::bbProcess()
-  { 
-    // If output widget not connected : have to create and show the window
-    if ( (*bbGetOutputConnectorMap().find("Widget")).second->GetConnectionVector().size() == 0 ) 
-      {
-               Window* show = 0;
-       // If the window already exists : no need creating it
-       if (bbGetWindow()!=0)
-         {
-           bbtkDebugMessage("wx",2,
-                            "-> Window already exists"
-                            <<std::endl);
-           show = bbGetWindow();
-         }
-       // Else create window 
-       else 
-         {
-           bbtkDebugMessage("wx",2,
-                            "-> Creating the window"
-                            <<std::endl);
-           
-           // Input WinDialog set to true : creating a Dialog
-           if (bbGetInputWinDialog()) 
-             {
-               bbtkDebugMessage("wx",2,
-                                "   Input WinDialog set to true : creating a Dialog"
-                                <<std::endl);
-               show = (Window*) new WxBlackBoxDialog( GetThisPointer<WxBlackBox>(),
-                                                      Wx::GetTopWindow(),
-                                                      std2wx( bbGetInputWinTitle() + " - bbtk (c) CREATIS LRMN"),
-                                                      wxSize( bbGetInputWinWidth() , bbGetInputWinHeight() ) );
-             }
-           // Input WinDialog set to false : creating a Frame
-           else 
-             {
-               bbtkDebugMessage("process",2,
-                                "   Input WinDialog set to false : creating a Frame"
-                                <<std::endl);
-               show = (Window*) new WxBlackBoxFrame( GetThisPointer<WxBlackBox>(),
-                                                     Wx::GetTopWindow(),
-                                                     std2wx( bbGetInputWinTitle()  + " - bbtk (c) CREATIS LRMN"),
-                                                     wxSize( bbGetInputWinWidth() , bbGetInputWinHeight() ) );
-             }
-           
-         }
-       
-       // Show the window
-       show->bbShow(); 
-       
-       
-      }                  
-    this->bbUserProcess(); 
-    
+  //==================================================================    
+  /// Callback for creating a Frame window 
+  void WxBlackBox::bbCreateFrameWindow()
+  {
+    WxBlackBoxFrame* w = 0;  
+    w = new WxBlackBoxFrame( GetThisPointer<WxBlackBox>(),
+                            Wx::GetTopWindow(),
+                            std2wx( bbGetInputWinTitle()  
+                                    + " - bbtk (c) CREATIS LRMN"),
+                            wxSize( bbGetInputWinWidth() , 
+                                    bbGetInputWinHeight() ) );
+    w->Show();
   }
-  //=========================================================================
-*/ 
-       
+  //==================================================================    
+
+  
        
   //=========================================================================
   void WxBlackBox::bbCreateWidgetAndEventHandler(wxWindow* parent)
@@ -559,7 +358,8 @@ namespace bbtk
       {
        this->bbUserCreateWidget(parent);
       }                
-    // If Event Handler for the widget does not exist or is obsolete : create it 
+    // If Event Handler for the widget does not exist or is obsolete:
+    // create it 
     if (bbGetOutputWidget()!=0)
       {
        if (bbGetWidgetEventHandler()==0)
@@ -589,83 +389,19 @@ namespace bbtk
   //=========================================================================
   
   
-  //========================================================================= 
-  wxWindow*  WxBlackBox::bbCreateWidgetOfInput(const std::string& in, 
-                                              wxWindow* parent)
-  {
-    wxWindow* w = 0;
-    // If input is connected 
-    BlackBoxInputConnector* c = bbGetInputConnectorMap().find(in)->second ;
-    if ( c->IsConnected() )                    
-      {
-       // Get black box from 
-       BlackBox::Pointer from = 
-         c->GetConnection()->GetBlackBoxFrom();
-       // Cast it into a WxBlackBox
-       WxBlackBox::Pointer wfrom = boost::dynamic_pointer_cast<WxBlackBox>(from);
-       // Call bbCreateWidgetAndEventHandler
-       wfrom->bbCreateWidgetAndEventHandler(parent);
-       // Get the widget created
-       w = wfrom->bbGetOutputWidget();
-      }
-    return w;
-  }
-  //==================================================================
-
-
-  //==================================================================
-   void WxBlackBox::bbHideWindow()
-  {
-    bbtkDebugMessageInc("wx",1,"=> WxBlackBox::bbHideWindow() ["
-                       <<bbGetFullName()<<"]"<<std::endl);
-
-    if (bbGetWindow()!=0) bbGetWindow()->bbHide();
-
-    bbtkDebugMessageDec("wx",2,"<= WxBlackBox::bbHideWindow() ["
-                       <<bbGetFullName()<<"]"<<std::endl);
-  }
   //==================================================================
-
-
-  //==================================================================
-   void WxBlackBox::bbCloseWindow()
-  {
-    bbtkDebugMessageInc("wx",1,"=> WxBlackBox::bbCloseWindow() ["
-                       <<bbGetFullName()<<"]"<<std::endl);
-
-    if (bbGetWindow()!=0) bbGetWindow()->bbClose();
-
-    bbtkDebugMessageDec("wx",2,"<= WxBlackBox::bbCloseWindow() ["
-                       <<bbGetFullName()<<"]"<<std::endl);
-  }
-  //==================================================================
-
-  //==================================================================
-  WxBlackBox::Window* WxBlackBox::bbGetContainingWindow()
-  {
-    if (bbGetWindow()!=0) return bbGetWindow();
-    BlackBox::OutputConnectorMapType::const_iterator i 
-      = bbGetOutputConnectorMap().find("Widget");
-    if ( i->second->GetConnectionVector().size() != 0 ) 
-      {
-       return boost::static_pointer_cast<WxBlackBox>
-         (i->second->GetConnectionVector().front() //.lock()
-          ->GetBlackBoxTo())->bbGetContainingWindow();
-      }
-    return 0;
-  }
-  //==================================================================
-
-
-  //==================================================================
-  bool WxBlackBox::bbIsShown()
-  {
-    if (bbGetContainingWindow()!=0)
-      return bbGetContainingWindow()->bbIsShown();
-    return false;
-  }
+  //  void WxBlackBox::InitWindowManagerIfNeeded() { Wx::
+  void WxBlackBox::IncNbWindowsAlive() { Wx::IncNbWindowsAlive(); }
+  void WxBlackBox::DecNbWindowsAlive() { Wx::DecNbWindowsAlive(); }
+  int  WxBlackBox::GetNbWindowsAlive() { return Wx::GetNbWindowsAlive(); }
+  bool WxBlackBox::IsSomeWindowAlive() { return Wx::IsSomeWindowAlive(); }
+  
+  void WxBlackBox::IncNbWindowsShown() { Wx::IncNbWindowsShown(); }
+  void WxBlackBox::DecNbWindowsShown() { Wx::DecNbWindowsShown(); }
+  int  WxBlackBox::GetNbWindowsShown() { return Wx::GetNbWindowsShown(); }
+  bool WxBlackBox::IsSomeWindowShown() { return Wx::GetNbWindowsShown(); }
   //==================================================================
-
+  
 
 }//namespace bbtk
 
index 0acfbf88b2b3220997993835f6b4ee5a568a6e26..368491847f0fa498f2b00b1f588f2f93c80d4fda 100644 (file)
@@ -2,8 +2,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkWxBlackBox.h,v $
   Language:  C++
-  Date:      $Date: 2009/03/23 13:06:41 $
-  Version:   $Revision: 1.25 $
+  Date:      $Date: 2009/04/08 07:56:11 $
+  Version:   $Revision: 1.26 $
 ========================================================================*/
 
 
@@ -52,7 +52,7 @@
 
 
 #include "bbtkWx.h"
-#include "bbtkAtomicBlackBox.h"
+#include "bbtkWidgetBlackBox.h"
 
 
 namespace bbtk
@@ -61,10 +61,6 @@ namespace bbtk
 
 
 
-  //==================================================================
-  // Forward declaration of the class of window associated to a WxBlackBox
-  class WxBlackBoxWindow;
-  //==================================================================
 
   //==================================================================
   // Forward declaration of the widget event handler class
@@ -74,215 +70,80 @@ namespace bbtk
 
   //==================================================================
   /// Widget black boxes
-  class BBTK_EXPORT WxBlackBox : public bbtk::AtomicBlackBox  
+  class BBTK_EXPORT WxBlackBox : public bbtk::WidgetBlackBox<wxWindow>
   { 
-    BBTK_BLACK_BOX_INTERFACE(WxBlackBox,bbtk::AtomicBlackBox);
-    BBTK_DECLARE_INPUT(WinTitle,std::string);
-    BBTK_DECLARE_INPUT(WinWidth,int);
-    BBTK_DECLARE_INPUT(WinHeight,int);
-    BBTK_DECLARE_INPUT(WinDialog,bool);
-    BBTK_DECLARE_INPUT(WinHide,Void);
-    BBTK_DECLARE_INPUT(WinClose,Void);
-    BBTK_DECLARE_OUTPUT(Widget, wxWindow*);
-
   public:
-    /// Main processing method of the box. Overloaded to handle windows inclusion : if the output Widget is connected then the execution is transfered to the box to which it is connected (as the container window must be created and displayed - this box will be executed by the normal pipeline recursion mechanism)
-    //   virtual void bbExecute(bool force = false);
-
+    BBTK_BLACK_BOX_INTERFACE(WxBlackBox,bbtk::WidgetBlackBox<wxWindow>);
 
-    typedef WxBlackBoxWindow Window;
+         
+    //  protected:
     
-    /// Returns the **OWN** window associated to the box
-    /// If 0 returned = no window
-    Window* bbGetWindow() { return bbmWindow; }
-
-    /// Returns the window containing the widget associated to the box
-    /// Which can be the own window of **ANOTHER** box in case of 
-    /// a hierarchy of widgets.
-    /// More precisely :
-    /// If bbGetWindow() != 0 then returns bbGetWindow()
-    /// Else if the output 'Widget' is connected 
-    ///  then returns bbGetContainingWindow() of the box connected to 'Widget'
-    /// Else returns 0;
-    Window* bbGetContainingWindow();
-
-    /// Returns true iff the 'containing window' exists and is shown 
-    /// (see bbGetContainingWindow).
-    bool bbIsShown();
-
-    //==================================================================    
-    /// User callback invoked when the containing window is shown
-    virtual void bbUserOnShow() {}
-    //==================================================================    
-    //==================================================================    
-    /// User callback invoked when the containing window is hidden
-    virtual void bbUserOnHide() {}
+  public:
+  
+   //==================================================================    
+    /// Callback for creating a Dialog window (modal)
+    /// ** Must be defined ** in toolkit specific descendants 
+    virtual void bbCreateDialogWindow();
     //==================================================================    
 
-
     //==================================================================    
-    void bbCreateWidgetAndEventHandler(wxWindow* parent); 
+    /// Callback for creating a Frame window 
+    /// ** Must be defined ** in toolkit specific descendants 
+    virtual void bbCreateFrameWindow();
     //==================================================================    
-         
-  protected:
-    
-  
+
     //==================================================================
     /// User callback called in the box contructor
     virtual void bbUserConstructor();
     /// User callback called in the box copy constructor
     virtual void bbUserCopyConstructor(bbtk::BlackBox::Pointer);
-    /// User callback called in the box destructor
-    virtual void bbUserDestructor();
     //==================================================================    
 
-    //==================================================================    
-    /// User callback for creating the widget associated to the box
-    /// ** Must be defined **
-    virtual void bbUserCreateWidget(wxWindow* parent) 
-    {
-      bbtkError(bbGetTypeName()<<" is a WxBlackBox whose bbUserCreateWidget methods is not overloaded : is it a feature or a bug ?!?");
-    }
-    //==================================================================    
+  
+    //==================================================================
+    //    virtual void InitWindowManagerIfNeeded();
+    virtual void IncNbWindowsAlive();
+    virtual void DecNbWindowsAlive();
+    virtual int  GetNbWindowsAlive();
+    virtual bool IsSomeWindowAlive();
+    
+    virtual void IncNbWindowsShown();
+    virtual void DecNbWindowsShown();
+    virtual int  GetNbWindowsShown();
+    virtual bool IsSomeWindowShown();
+    //==================================================================
 
 
+         
     //==================================================================    
-    // For layout widgets : creates and returns the widget 
-    // of the box connected to input in
-    wxWindow* bbCreateWidgetOfInput(const std::string& in, wxWindow* parent);
+    void bbCreateWidgetAndEventHandler(wxWindow* parent); 
+    //==================================================================    
+    
     //==================================================================    
-
-
-         //==================================================================
-         /// Overloaded bbCreateWidget method for WxBlackBoxes which handles 
-         /// the window creation if needed
-         virtual void bbCreateWidget();
-         //==================================================================
-         
-         //==================================================================
-         /// Overloaded bbShowWidget method for WxBlackBoxes which handles 
-         /// the window creation if needed
-         virtual void bbShowWidget();
-         //==================================================================
-         
-         //==================================================================
-    /// Overloaded processing method for WxBlackBoxes which handles 
-    /// the window creation if needed
-    virtual void bbProcess();
-    //==================================================================
-         
-         
-         
-         
-         
-    //==================================================================
-    /// If necessary creates the WxBlackBoxWindow associated to the box
-    /// and shows it 
-    /// (does nothing if the box output 'Widget' is connected which 
-    /// means that the box does not have its own window but is contained 
-    /// into another window)
-    //    void bbShowWindow();
-    /// Hides the WxBlackBoxWindow associated to the box (if exists)
-    void bbHideWindow();
-    /// Closes (destroys) the WxBlackBoxWindow associated to the box (if exists)
-    void bbCloseWindow();
-    //==================================================================
 
   private:
     /// friendship
-    friend class WxBlackBoxWindow;
     friend class WxBlackBoxWidgetEventHandler;
-
-    /// Sets the window
-    inline void bbSetWindow(Window* w) { bbmWindow=w; }
-
     /// Sets the Widget Event Handler
     inline void bbSetWidgetEventHandler(WxBlackBoxWidgetEventHandler* w) 
     { bbmWidgetEventHandler = w; }
     /// Gets the Widget Event Handler
     inline WxBlackBoxWidgetEventHandler* bbGetWidgetEventHandler()
     { return bbmWidgetEventHandler; }
-
-
-    /// The WxBlackBoxWindow associated to the box
-    Window* bbmWindow;
-         
     /// The WxBlackBoxWidgetEventHandler associated to the box
     WxBlackBoxWidgetEventHandler* bbmWidgetEventHandler;
-
-
+    /// Init the attributes 
     void bbInitAttributes();
-
-  protected :
-
-
-    /// For Forward update mechanism when execution is called 
-    /// on a contained window
-    /// Is set to true before transfering update to parent 
-    /// in order to not re-transfer a second time...
-    /*
-    bool bbmUpdateTransferedToParent;
-
-    bool bbGetUpdateTransferedToParent() const { return bbmUpdateTransferedToParent; }
-    void bbSetUpdateTransferedToParent(bool b) 
-    { bbmUpdateTransferedToParent = b; }
-    */
   };
   //=================================================================
  
 
-  //======================================================================
-  /// Defines the bbUserCreateWidget method
-#define BBTK_CREATE_WIDGET(CALLBACK)                                   \
-  public:                                                              \
-  inline void bbUserCreateWidget(wxWindow* parent)                                     \
-  {                                                                    \
-    bbtkDebugMessageInc("wx",1,"**> Creating widget for ["             \
-                       <<bbGetFullName()<<"]"<<std::endl);             \
-    CALLBACK(parent);                                                          \
-    bbtkDebugMessageInc("wx",1,"<** Creating widget for ["             \
-                       <<bbGetFullName()<<"]"<<std::endl);             \
-  }
-  
-  //======================================================================
-
-  //======================================================================
-  /// Defines the bbUserOnShow method
-#define BBTK_ON_SHOW_WIDGET(CALLBACK)                                  \
-  public:                                                              \
-  inline void bbUserOnShow()                                   \
-  {                                                                    \
-    bbtkDebugMessageInc("wx",1,"**> Showing ["         \
-                       <<bbGetFullName()<<"]"<<std::endl);             \
-    CALLBACK();                                                                \
-    bbtkDebugMessageInc("wx",1,"<** Showing ["         \
-                       <<bbGetFullName()<<"]"<<std::endl);             \
-  }
-  
-  //======================================================================
-
   //=================================================================
   // WxBlackBoxDescriptor declaration
-  BBTK_BEGIN_DESCRIBE_BLACK_BOX(WxBlackBox,bbtk::AtomicBlackBox);
+  //
+  class WxBlackBoxDescriptor : public WidgetBlackBoxDescriptor<wxWindow>
+  BBTK_BEGIN_DESCRIBE_BLACK_BOX_BODY(WxBlackBox);
   BBTK_NAME("WxBlackBox");
-  // 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_INPUT(WxBlackBox,WinTitle,
-            "Title of the window (*)",
-            std::string,"");
-  BBTK_INPUT(WxBlackBox,WinWidth,
-            "Width of the window (* : only used if the widget is not connected to a Layout box)",int,"");
-  BBTK_INPUT(WxBlackBox,WinHeight,
-            "Height of the window (*)",int,"");
-  BBTK_INPUT(WxBlackBox,WinDialog,
-            "Set to 'true' to create a dialog window, i.e. which blocks the pipeline until it is closed (modal) (*)",bool,"");
-  BBTK_INPUT(WxBlackBox,WinHide,
-            "Any signal received hides the window (*)",Void,"signal");
-  BBTK_INPUT(WxBlackBox,WinClose,
-            "Any signal received closes the window (*)",Void,"signal");
-  BBTK_OUTPUT(WxBlackBox,Widget,"Output widget",wxWindow*,"");
   BBTK_END_DESCRIBE_BLACK_BOX(WxBlackBox);
   //=================================================================
 
@@ -294,52 +155,41 @@ namespace bbtk
 
 
 
-  //==================================================================
-  // The base of the hierarchy of windows associated to a WxBlackBox
-  class BBTK_EXPORT WxBlackBoxWindow //: public wxWindow
-  {
-  public:
-    WxBlackBoxWindow(WxBlackBox::Pointer box);
-    virtual ~WxBlackBoxWindow();
-    virtual void bbShow();
-    virtual void bbHide();
-    virtual void bbClose();
-    bool bbIsShown() { return mShown; }
-    virtual WxBlackBox::Pointer bbGetBlackBox() { return mBox.lock(); }
-    virtual wxDialog* bbGetDialog() { return 0; } 
-    virtual wxFrame* bbGetFrame() { return 0; } 
-  private:
-    WxBlackBox::WeakPointer mBox;
-    bool mShown;
-  };
-  //==================================================================
 
   //==================================================================
   // Dialog window which is modal
-  class BBTK_EXPORT  WxBlackBoxDialog : public wxDialog, public WxBlackBoxWindow
+  class BBTK_EXPORT  WxBlackBoxDialog : public wxDialog, 
+                                       public WidgetBlackBoxWindow<wxWindow>
   {
   public:
+    typedef WidgetBlackBoxWindow<wxWindow> Parent;
     WxBlackBoxDialog(WxBlackBox::Pointer box, 
                     wxWindow *parent, wxString title, wxSize size);
     ~WxBlackBoxDialog();
     void bbShow();  
     void bbHide();
     void bbClose();
+    bool IsDialog() { return true; }
+    bool IsFrame() { return false; }
     wxDialog* bbGetDialog() { return this; } 
   };
   //==================================================================
 
   //==================================================================
   // Frame window which is not modal
-  class BBTK_EXPORT  WxBlackBoxFrame : public wxFrame, public WxBlackBoxWindow
+  class BBTK_EXPORT  WxBlackBoxFrame : public wxFrame, 
+                                      public WidgetBlackBoxWindow<wxWindow>
   {
   public:
+    typedef WidgetBlackBoxWindow<wxWindow> Parent;
     WxBlackBoxFrame(WxBlackBox::Pointer box,
                    wxWindow *parent, wxString title, wxSize size);
     ~WxBlackBoxFrame();
     void bbShow();
     void bbHide();
     void bbClose();
+    bool IsDialog() { return false; }
+    bool IsFrame() { return true; }
     wxFrame* bbGetFrame() { return this; } 
   };
   //==================================================================
index 00588ffeaac41194b12af9deeafd418ffab54233..03a2b073d3b930f83a2281810346a5c1fa6b8338 100644 (file)
@@ -11,8 +11,8 @@
 typedef bbtk::KWBlackBox::Pointer BBPointer;
 typedef bbtk::KWBlackBox::WeakPointer BBWeakPointer;
 
-class BBTK_EXPORT vtkKWBlackBoxDialog : public vtkKWDialog
-                                         //public vtkKWBlackBoxWindow
+class BBTK_EXPORT vtkKWBlackBoxDialog : public vtkKWDialog,
+                                       public WidgetBlackBoxWindow<vtkKWWidget>
 
 {
 public:
index c4d750e6d6660bcff983abfe5373b628859fccdd..211a1f8364e471541ed6244895c498725f62b522 100644 (file)
@@ -17,6 +17,9 @@ IF(BBTK_USE_KWWIDGETS)
   SUBDIRS(kw)
 ENDIF(BBTK_USE_KWWIDGETS)
 
+IF(BBTK_USE_QT)
+  SUBDIRS(qt)
+ENDIF(BBTK_USE_QT)
 #-----------------------------------------------------------------------------
 
 
diff --git a/packages/qt/CMakeLists.txt b/packages/qt/CMakeLists.txt
new file mode 100644 (file)
index 0000000..f9f9d75
--- /dev/null
@@ -0,0 +1,160 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+
+#===========================================================================
+# CMAKE SETTINGS FOR BUILDING A BBTK PACKAGE
+#===========================================================================
+
+#===========================================================================
+# THE NAME OF THE BBTK PACKAGE
+SET(BBTK_PACKAGE_NAME qt)
+#===========================================================================
+
+
+
+#===========================================================================
+# IF IT IS A STANDALONE PROJECT UNCOMMENT NEXT LINE TO DECLARE YOUR PROJECT
+# PROJECT(bb${BBTK_PACKAGE_NAME})
+#===========================================================================
+
+#===========================================================================
+# PACKAGE AUTHOR
+# !!! NO COMMA ALLOWED !!!
+SET(${BBTK_PACKAGE_NAME}_AUTHOR "laurent.guigues@creatis.insa-lyon.fr")
+#===========================================================================
+
+#===========================================================================
+# PACKAGE DESCRIPTION
+SET(${BBTK_PACKAGE_NAME}_DESCRIPTION "Qt boxes")
+#===========================================================================
+
+#===========================================================================
+# PACKAGE VERSION NUMBER 
+SET(${BBTK_PACKAGE_NAME}_MAJOR_VERSION 1)
+SET(${BBTK_PACKAGE_NAME}_MINOR_VERSION 0)
+SET(${BBTK_PACKAGE_NAME}_BUILD_VERSION 0)
+#===========================================================================
+
+
+#===========================================================================
+# UNCOMMENT EACH LIBRARY NEEDED (WILL BE FOUND AND USED AUTOMATICALLY)
+# SET(${BBTK_PACKAGE_NAME}_USE_VTK  ON)
+SET(${BBTK_PACKAGE_NAME}_USE_QT  ON)
+# SET(${BBTK_PACKAGE_NAME}_USE_ITK  ON)
+# SET(${BBTK_PACKAGE_NAME}_USE_GDCM ON)
+# SET(${BBTK_PACKAGE_NAME}_USE_GDCM_VTK ON)
+# SET(${BBTK_PACKAGE_NAME}_USE_GSMIS ON)
+# SET(${BBTK_PACKAGE_NAME}_USE_WXWIDGETS ON)
+# SET(${BBTK_PACKAGE_NAME}_USE_KWWIDGETS ON)
+#===========================================================================
+
+#===========================================================================
+# LIST HERE THE OTHER bbtk PACKAGES NEEDED
+# (WILL BE FOUND AND USED AUTOMATICALLY)
+SET(${BBTK_PACKAGE_NAME}_USE_PACKAGES 
+  # std
+  # wx
+  # itk
+  # vtk
+  # ...
+  )
+#===========================================================================
+
+#===========================================================================
+# THE SOURCES OF THE PACKAGE
+# EITHER UNCOMMENT NEXT LINE TO COMPILE ALL .cxx OF THE src DIRECTORY :
+SET(${BBTK_PACKAGE_NAME}_COMPILE_ALL_CXX OFF)
+# ... OR LIST THE FILES TO COMPILE MANUALLY :
+SET(${BBTK_PACKAGE_NAME}_CXX_SOURCES
+# LIST HERE THE FILES TO COMPILE TO BUILD THE LIB
+# E.G. TO COMPILE "toto.cxx" ADD "toto" (NO EXTENSION)
+# THE PATH MUST BE RELATIVE TO THE src FOLDER
+bbqtQOutputText
+bbqtQSlider 
+bbqtQLayoutLine
+    )
+#===========================================================================
+
+#===========================================================================
+# THE xml SOURCES OF THE PACKAGE
+# EITHER UNCOMMENT NEXT LINE TO bbfy ALL .xml OF THE src DIRECTORY :
+SET(${BBTK_PACKAGE_NAME}_COMPILE_ALL_XML ON)
+# ... OR LIST THE FILES TO COMPILE MANUALLY :
+#SET(${BBTK_PACKAGE_NAME}_XML_SOURCES
+# LIST HERE THE FILES TO bbfy TO BUILD THE LIB
+# E.G. TO bbfy "toto.xml" ADD "toto" (NO EXTENSION)
+# THE PATH MUST BE RELATIVE TO THE src FOLDER
+#    )
+#===========================================================================
+
+#===========================================================================
+# THE SCRIPT-DEFINED BOXES OF THE PACKAGE (bbs)
+# EITHER UNCOMMENT NEXT LINE TO INCLUDE ALL .bbs OF THE bbs/boxes DIRECTORY :
+SET(${BBTK_PACKAGE_NAME}_INCLUDE_ALL_BBS_BOXES ON)
+# ... OR LIST THE FILES TO INCLUDE MANUALLY :
+# SET(${BBTK_PACKAGE_NAME}_BBS_BOXES
+# LIST HERE THE bbs FILES TO INCLUDE 
+# E.G. TO INCLUDE "boxes/bbtoto.bbs" ADD "boxes/bbtoto" (NO EXTENSION)
+# !! THE PATH MUST BE RELATIVE TO THE bbs FOLDER !!
+#)
+#===========================================================================
+
+#===========================================================================
+# THE SCRIPT-DEFINED APPLICATIONS OF THE PACKAGE (bbs)
+# EITHER UNCOMMENT NEXT LINE TO INCLUDE ALL .bbs OF THE bbs/appli DIRECTORY :
+SET(${BBTK_PACKAGE_NAME}_INCLUDE_ALL_BBS_APPLI ON)
+# ... OR LIST THE FILES TO INCLUDE MANUALLY :
+# SET(${BBTK_PACKAGE_NAME}_BBS_APPLI
+# LIST HERE THE bbs FILES TO INCLUDE 
+# E.G. TO INCLUDE "appli/testToto.bbs" ADD "appli/testToto" (NO EXTENSION)
+# !! THE PATH MUST BE RELATIVE TO THE bbs FOLDER !!
+#)
+#===========================================================================
+
+#===========================================================================
+SET(${BBTK_PACKAGE_NAME}_INCLUDE_DIRS
+  # LIST HERE YOUR ADDITIONAL INCLUDE DIRECTORIES 
+  # EXCEPT :
+  #  - src
+  #  - bbtk dirs
+  #  - automatically handled libraries or packages : wx, vtk... (see above)
+  #  - the dirs automatically set by other libraries found by FIND_PACKAGE
+  )
+#===========================================================================
+
+#===========================================================================
+SET(${BBTK_PACKAGE_NAME}_LIBS 
+  # LIST HERE THE ADDITIONAL LIBS TO LINK AGAINST
+  # EXCEPT : the same libs than for INCLUDE_DIRS 
+  )
+#===========================================================================
+
+
+#===========================================================================
+# IF NEEDED : UNCOMMENT NEXT LINE 
+# AND LIST ADDITIONNAL DIRECTORIES 
+# IN WHICH TO LOOK FOR LIBRARIES TO LINK AGAINST
+# LINK_DIRECTORIES()
+#===========================================================================
+
+#===========================================================================
+# SET TO TRUE TO HAVE INFORMATION ON LIBRARIES FOUND DURING CMAKE CONFIGURE
+SET(FIND_PACKAGE_VERBOSE TRUE)
+#===========================================================================
+
+#===========================================================================
+# END OF USER SECTION
+#===========================================================================
+
+
+
+
+
+#===========================================================================
+# Include configuration script
+INCLUDE(Configure.cmake)
+#===========================================================================
+
+#===========================================================================
+# EOF
+#===========================================================================
+
diff --git a/packages/qt/Configure.cmake b/packages/qt/Configure.cmake
new file mode 100644 (file)
index 0000000..58c09d5
--- /dev/null
@@ -0,0 +1,35 @@
+#===========================================================================
+# DOES THE USER WANT TO BUILD THE PACKAGE ?
+OPTION(BUILD_BBTK_PACKAGE_${BBTK_PACKAGE_NAME} 
+  "Build the bbtk package ${BBTK_PACKAGE_NAME} ?" OFF)
+#===========================================================================
+
+IF(BUILD_BBTK_PACKAGE_${BBTK_PACKAGE_NAME})
+  #===========================================================================
+  # THE USER HAS CHOSEN TO BUILD THE PACKAGE  
+  #===========================================================================
+
+  #===========================================================================
+  # If the package is not a "core" bbtk package (included into the toolkit)
+  # then we have to find and use bbtk 
+  IF(NOT BBTK_CORE_PACKAGE)
+    FIND_PACKAGE(BBTK REQUIRED)
+    INCLUDE(${BBTK_USE_FILE})
+  ENDIF(NOT BBTK_CORE_PACKAGE)
+  #===========================================================================
+  
+  #===========================================================================
+  # Include package configuration cmake script from bbtk cmake dir
+  INCLUDE(${BBTK_CMAKE_DIR}/BBTKConfigurePackage.cmake)
+  #=========================================================================== 
+   
+ELSE(BUILD_BBTK_PACKAGE_${BBTK_PACKAGE_NAME})
+
+  #===========================================================================
+  # Else if it is a core package we have to reset some things...
+  IF(BBTK_CORE_PACKAGE)
+    INCLUDE(${BBTK_CMAKE_DIR}/BBTKConfigurePackage_BuildOff.cmake)   
+  ENDIF(BBTK_CORE_PACKAGE)
+  #===========================================================================
+
+ENDIF(BUILD_BBTK_PACKAGE_${BBTK_PACKAGE_NAME})
diff --git a/packages/qt/PackageConfig.cmake.in b/packages/qt/PackageConfig.cmake.in
new file mode 100644 (file)
index 0000000..0ade94b
--- /dev/null
@@ -0,0 +1,27 @@
+#========================================================================
+# BBTK package configuration 
+# ** DO NOT REMOVE **
+SET(BBTK_PACKAGE_NAME                 @BBTK_PACKAGE_NAME@)
+SET(@BBTK_PACKAGE_NAME@_USE_VTK       @BBTK_PACKAGE_USE_VTK@)
+SET(@BBTK_PACKAGE_NAME@_USE_ITK       @BBTK_PACKAGE_USE_ITK@)
+SET(@BBTK_PACKAGE_NAME@_USE_GDCM      @BBTK_PACKAGE_USE_GDCM@)
+SET(@BBTK_PACKAGE_NAME@_USE_GSMIS     @BBTK_PACKAGE_USE_GSMIS@)
+SET(@BBTK_PACKAGE_NAME@_USE_WXWIDGETS @BBTK_PACKAGE_USE_WXWIDGETS@)
+SET(@BBTK_PACKAGE_NAME@_USE_PACKAGES  @BBTK_PACKAGE_USE_PACKAGES@)
+SET(@BBTK_PACKAGE_NAME@_AUTHOR        "@BBTK_PACKAGE_AUTHOR@") 
+SET(@BBTK_PACKAGE_NAME@_DESCRIPTION   "@BBTK_PACKAGE_DESCRIPTION@")
+SET(@BBTK_PACKAGE_NAME@_MAJOR_VERSION @BBTK_PACKAGE_MAJOR_VERSION@)
+SET(@BBTK_PACKAGE_NAME@_MINOR_VERSION @BBTK_PACKAGE_MINOR_VERSION@) 
+SET(@BBTK_PACKAGE_NAME@_BUILD_VERSION @BBTK_PACKAGE_BUILD_VERSION@)
+SET(@BBTK_PACKAGE_NAME@_INCLUDE_DIRS  @BBTK_PACKAGE_INCLUDE_DIRS@)
+SET(@BBTK_PACKAGE_NAME@_LIBS          @BBTK_PACKAGE_LIBS@)
+# A BBTK PACKAGE NEEDS BBTK
+FIND_PACKAGE(BBTK REQUIRED)
+# BBTK Package configuration file inclusion
+INCLUDE(${BBTK_CMAKE_DIR}/BBTKConfigurePackage_PackageConfig.cmake)
+# End of BBTK package configuration 
+#========================================================================
+
+#========================================================================
+# INSERT YOUR CUSTOM CONFIG HERE 
+#========================================================================
diff --git a/packages/qt/UsePackage.cmake.in b/packages/qt/UsePackage.cmake.in
new file mode 100644 (file)
index 0000000..2ecb206
--- /dev/null
@@ -0,0 +1,4 @@
+# DO NOT REMOVE :
+INCLUDE(${BBTK_CMAKE_DIR}/BBTKConfigurePackage_UsePackage.cmake)
+
+# INSERT YOUR CUSTOM USE HERE 
diff --git a/packages/qt/bbs/CMakeLists.txt b/packages/qt/bbs/CMakeLists.txt
new file mode 100644 (file)
index 0000000..2c0eb7c
--- /dev/null
@@ -0,0 +1,4 @@
+
+INCLUDE(${BBTK_CMAKE_DIR}/BBTKConfigurePackage_bbs.cmake)
+
+
diff --git a/packages/qt/data/CMakeLists.txt b/packages/qt/data/CMakeLists.txt
new file mode 100644 (file)
index 0000000..eb2556d
--- /dev/null
@@ -0,0 +1,4 @@
+#===========================================================================
+# Include package data configuration cmake script from bbtk dir
+INCLUDE(${BBTK_CMAKE_DIR}/BBTKConfigurePackage_data.cmake)
+#===========================================================================
diff --git a/packages/qt/doc/CMakeLists.txt b/packages/qt/doc/CMakeLists.txt
new file mode 100644 (file)
index 0000000..033496e
--- /dev/null
@@ -0,0 +1,5 @@
+#===========================================================================
+# Include package doc configuration cmake script
+INCLUDE(${BBTK_CMAKE_DIR}/BBTKConfigurePackage_doc.cmake)
+#===========================================================================
+
diff --git a/packages/qt/doc/bbdoc/CMakeLists.txt b/packages/qt/doc/bbdoc/CMakeLists.txt
new file mode 100644 (file)
index 0000000..86ca574
--- /dev/null
@@ -0,0 +1,2 @@
+INCLUDE(${BBTK_CMAKE_DIR}/BBTKConfigurePackage_doc_bbdoc.cmake)
+
diff --git a/packages/qt/doc/bbdoc/header.html.in b/packages/qt/doc/bbdoc/header.html.in
new file mode 100644 (file)
index 0000000..28c72c2
--- /dev/null
@@ -0,0 +1,12 @@
+
+<h1>bbtk package <b>@BBTK_PACKAGE_NAME@</b></h1>
+
+<p>
+Version <b>@BBTK_PACKAGE_MAJOR_VERSION@.@BBTK_PACKAGE_MINOR_VERSION@.@BBTK_PACKAGE_BUILD_VERSION@</b> - 
+by <b>@BBTK_PACKAGE_AUTHOR@</b>
+
+<p>
+@BBTK_PACKAGE_DESCRIPTION@
+
+<p>
+ <a href="../../doxygen/@BBTK_PACKAGE_NAME@/index.html">Doxygen documentation</a> of the source code
diff --git a/packages/qt/doc/doxygen/CMakeLists.txt b/packages/qt/doc/doxygen/CMakeLists.txt
new file mode 100644 (file)
index 0000000..0194111
--- /dev/null
@@ -0,0 +1 @@
+INCLUDE(${BBTK_CMAKE_DIR}/BBTKConfigurePackage_doc_doxygen.cmake)
diff --git a/packages/qt/doc/doxygen/DoxyMainPage.txt.in b/packages/qt/doc/doxygen/DoxyMainPage.txt.in
new file mode 100644 (file)
index 0000000..9909a5c
--- /dev/null
@@ -0,0 +1,14 @@
+/**
+ * \mainpage bbtk package @BBTK_PACKAGE_NAME@
+
+\htmlonly 
+
+<p>Version 
+<b>@BBTK_PACKAGE_MAJOR_VERSION@.@BBTK_PACKAGE_MINOR_VERSION@.@BBTK_PACKAGE_BUILD_VERSION@</b> - 
+by <b>@BBTK_PACKAGE_AUTHOR@</b>
+<p>
+@BBTK_PACKAGE_DESCRIPTION@
+
+\endhtmlonly
+
+ */
diff --git a/packages/qt/doc/doxygen/Doxyfile.txt.in b/packages/qt/doc/doxygen/Doxyfile.txt.in
new file mode 100644 (file)
index 0000000..6b4211a
--- /dev/null
@@ -0,0 +1,764 @@
+# Doxyfile 1.2.14
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+#       TAG = value [value, ...]
+# For lists items can also be appended using:
+#       TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# General configuration options
+#---------------------------------------------------------------------------
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded 
+# by quotes) that should identify the project.
+PROJECT_NAME           = @DOXYGEN_PROJECT_NAME@
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number. 
+# This could be handy for archiving the generated documentation or 
+# if some version control system is used.
+PROJECT_NUMBER         = @PROJECT_VERSION@
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) 
+# base path where the generated documentation will be put. 
+# If a relative path is entered, it will be relative to the location 
+# where doxygen was started. If left blank the current directory will be used.
+OUTPUT_DIRECTORY       = @DOXYGEN_OUTPUT@
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all 
+# documentation generated by doxygen is written. Doxygen will use this 
+# information to generate all constant output in the proper language. 
+# The default language is English, other supported languages are: 
+# Brazilian, Chinese, Croatian, Czech, Danish, Dutch, Finnish, French, 
+# German, Greek, Hungarian, Italian, Japanese, Korean, Norwegian, Polish, 
+# Portuguese, Romanian, Russian, Slovak, Slovene, Spanish and Swedish.
+OUTPUT_LANGUAGE        = English
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in 
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless 
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+EXTRACT_ALL            = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class 
+# will be included in the documentation.
+EXTRACT_PRIVATE        = YES
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file 
+# will be included in the documentation.
+EXTRACT_STATIC         = YES
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) 
+# defined locally in source files will be included in the documentation. 
+# If set to NO only classes defined in header files are included.
+EXTRACT_LOCAL_CLASSES  = YES
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all 
+# undocumented members of documented classes, files or namespaces. 
+# If set to NO (the default) these members will be included in the 
+# various overviews, but no documentation section is generated. 
+# This option has no effect if EXTRACT_ALL is enabled.
+HIDE_UNDOC_MEMBERS     = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all 
+# undocumented classes that are normally visible in the class hierarchy. 
+# If set to NO (the default) these class will be included in the various 
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+HIDE_UNDOC_CLASSES     = NO
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will 
+# include brief member descriptions after the members that are listed in 
+# the file and class documentation (similar to JavaDoc). 
+# Set to NO to disable this.
+BRIEF_MEMBER_DESC      = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend 
+# the brief description of a member or function before the detailed description. 
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the 
+# brief descriptions will be completely suppressed.
+REPEAT_BRIEF           = YES
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then 
+# Doxygen will generate a detailed section even if there is only a brief 
+# description.
+ALWAYS_DETAILED_SEC    = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all inherited 
+# members of a class in the documentation of that class as if those members were 
+# ordinary class members. Constructors, destructors and assignment operators of 
+# the base classes will not be shown.
+INLINE_INHERITED_MEMB  = YES
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full 
+# path before files name in the file list and in the header files. If set 
+# to NO the shortest path that makes the file name unique will be used.
+FULL_PATH_NAMES        = YES
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag 
+# can be used to strip a user defined part of the path. Stripping is 
+# only done if one of the specified strings matches the left-hand part of 
+# the path. It is allowed to use relative paths in the argument list.
+STRIP_FROM_PATH        = 
+
+# The INTERNAL_DOCS tag determines if documentation 
+# that is typed after a \internal command is included. If the tag is set 
+# to NO (the default) then the documentation will be excluded. 
+# Set it to YES to include the internal documentation.
+INTERNAL_DOCS          = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct 
+# doxygen to hide any special comment blocks from generated source code 
+# fragments. Normal C and C++ comments will always remain visible.
+STRIP_CODE_COMMENTS    = YES
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate 
+# file names in lower case letters. If set to YES upper case letters are also 
+# allowed. This is useful if you have classes or files whose names only differ 
+# in case and if your file system supports case sensitive file names. Windows 
+# users are adviced to set this option to NO.
+CASE_SENSE_NAMES       = YES
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter 
+# (but less readable) file names. This can be useful is your file systems 
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+SHORT_NAMES            = NO
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen 
+# will show members with their full class and namespace scopes in the 
+# documentation. If set to YES the scope will be hidden.
+HIDE_SCOPE_NAMES       = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen 
+# will generate a verbatim copy of the header file for each class for 
+# which an include is specified. Set to NO to disable this.
+VERBATIM_HEADERS       = YES
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen 
+# will put list of the files that are included by a file in the documentation 
+# of that file.
+SHOW_INCLUDE_FILES     = YES
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen 
+# will interpret the first line (until the first dot) of a JavaDoc-style 
+# comment as the brief description. If set to NO, the JavaDoc 
+# comments  will behave just like the Qt-style comments (thus requiring an 
+# explict @brief command for a brief description.
+JAVADOC_AUTOBRIEF      = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented 
+# member inherits the documentation from any documented member that it 
+# reimplements.
+INHERIT_DOCS           = YES
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] 
+# is inserted in the documentation for inline members.
+INLINE_INFO            = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen 
+# will sort the (detailed) documentation of file and class members 
+# alphabetically by member name. If set to NO the members will appear in 
+# declaration order.
+SORT_MEMBER_DOCS       = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC 
+# tag is set to YES, then doxygen will reuse the documentation of the first 
+# member in the group (if any) for the other members of the group. By default 
+# all members of a group must be documented explicitly.
+DISTRIBUTE_GROUP_DOC   = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab. 
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+TAB_SIZE               = 8
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or 
+# disable (NO) the todo list. This list is created by putting \todo 
+# commands in the documentation.
+GENERATE_TODOLIST      = YES
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or 
+# disable (NO) the test list. This list is created by putting \test 
+# commands in the documentation.
+GENERATE_TESTLIST      = YES
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or 
+# disable (NO) the bug list. This list is created by putting \bug 
+# commands in the documentation.
+GENERATE_BUGLIST       = YES
+
+# This tag can be used to specify a number of aliases that acts 
+# as commands in the documentation. An alias has the form "name=value". 
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to 
+# put the command \sideeffect (or @sideeffect) in the documentation, which 
+# will result in a user defined paragraph with heading "Side Effects:". 
+# You can put \n's in the value part of an alias to insert newlines.
+ALIASES                = 
+
+# The ENABLED_SECTIONS tag can be used to enable conditional 
+# documentation sections, marked by \if sectionname ... \endif.
+ENABLED_SECTIONS       = 
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines 
+# the initial value of a variable or define consist of for it to appear in 
+# the documentation. If the initializer consists of more lines than specified 
+# here it will be hidden. Use a value of 0 to hide initializers completely. 
+# The appearance of the initializer of individual variables and defines in the 
+# documentation can be controlled using \showinitializer or \hideinitializer 
+# command in the documentation regardless of this setting.
+MAX_INITIALIZER_LINES  = 30
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources 
+# only. Doxygen will then generate output that is more tailored for C. 
+# For instance some of the names that are used will be different. The list 
+# of all members will be omitted, etc.
+OPTIMIZE_OUTPUT_FOR_C  = NO
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated 
+# at the bottom of the documentation of classes and structs. If set to YES the 
+# list will mention the files that were used to generate the documentation.
+SHOW_USED_FILES        = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated 
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+QUIET                  = YES
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are 
+# generated by doxygen. Possible values are YES and NO. If left blank 
+# NO is used.
+WARNINGS               = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings 
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will 
+# automatically be disabled.
+WARN_IF_UNDOCUMENTED   = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, then doxygen will generate warnings 
+# for error documented members. If EXTRACT_ALL is set to YES then this flag will 
+# automatically be disabled.
+WARN_IF_DOC_ERROR      = YES
+
+# The WARN_FORMAT tag determines the format of the warning messages that 
+# doxygen can produce. The string should contain the $file, $line, and $text 
+# tags, which will be replaced by the file and line number from which the 
+# warning originated and the warning text.
+WARN_FORMAT            = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning 
+# and error messages should be written. If left blank the output is written 
+# to stderr.
+WARN_LOGFILE           = @DOXYGEN_LOGFILE@
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain 
+# documented source files. You may enter file names like "myfile.cpp" or 
+# directories like "/usr/src/myproject". Separate the files or directories 
+# with spaces.
+INPUT                  = @DOXYGEN_INPUT@
+
+# If the value of the INPUT tag contains directories, you can use the 
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
+# and *.h) to filter out the source-files in the directories. If left 
+# blank the following patterns are tested: 
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx *.hpp 
+# *.h++ *.idl *.odl
+FILE_PATTERNS          = *.h *.cxx *.txx
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories 
+# should be searched for input files as well. Possible values are YES and NO. 
+# If left blank NO is used.
+RECURSIVE              = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should 
+# excluded from the INPUT source files. This way you can easily exclude a 
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+EXCLUDE                = @DOXYGEN_EXCLUDE@
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or directories 
+# that are symbolic links (a Unix filesystem feature) are excluded from the input.
+EXCLUDE_SYMLINKS       = NO
+
+# If the value of the INPUT tag contains directories, you can use the 
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude 
+# certain files from those directories.
+EXCLUDE_PATTERNS       = 
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
+# the \include command).
+EXAMPLE_PATH           = 
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the 
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
+# and *.h) to filter out the source-files in the directories. If left 
+# blank all files are included.
+EXAMPLE_PATTERNS       = *.cxx
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be 
+# searched for input files to be used with the \include or \dontinclude 
+# commands irrespective of the value of the RECURSIVE tag. 
+# Possible values are YES and NO. If left blank NO is used.
+EXAMPLE_RECURSIVE      = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or 
+# directories that contain image that are included in the documentation (see 
+# the \image command).
+IMAGE_PATH             = 
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should 
+# invoke to filter for each input file. Doxygen will invoke the filter program 
+# by executing (via popen()) the command <filter> <input-file>, where <filter> 
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an 
+# input file. Doxygen will then use the output that the filter program writes 
+# to standard output.
+INPUT_FILTER           = 
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using 
+# INPUT_FILTER) will be used to filter the input files when producing source 
+# files to browse.
+FILTER_SOURCE_FILES    = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will 
+# be generated. Documented entities will be cross-referenced with these sources.
+SOURCE_BROWSER         = YES
+
+# Setting the INLINE_SOURCES tag to YES will include the body 
+# of functions and classes directly in the documentation.
+INLINE_SOURCES         = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES (the default) 
+# then for each documented function all documented 
+# functions referencing it will be listed.
+REFERENCED_BY_RELATION = YES
+
+# If the REFERENCES_RELATION tag is set to YES (the default) 
+# then for each documented function all documented entities 
+# called/used by that function will be listed.
+REFERENCES_RELATION    = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index 
+# of all compounds will be generated. Enable this if the project 
+# contains a lot of classes, structs, unions or interfaces.
+ALPHABETICAL_INDEX     = YES
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then 
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns 
+# in which this list will be split (can be a number in the range [1..20])
+COLS_IN_ALPHA_INDEX    = 3
+
+# In case all classes in a project start with a common prefix, all 
+# classes will be put under the same header in the alphabetical index. 
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that 
+# should be ignored while generating the index headers.
+IGNORE_PREFIX          = 
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will 
+# generate HTML output.
+GENERATE_HTML          = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `html' will be used as the default path.
+HTML_OUTPUT            = @DOXYGEN_HTML_OUTPUT@
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for 
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank 
+# doxygen will generate files with .html extension.
+HTML_FILE_EXTENSION    = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for 
+# each generated HTML page. If it is left blank doxygen will generate a 
+# standard header.
+HTML_HEADER            =
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard footer.
+HTML_FOOTER            = 
+
+# The HTML_STYLESHEET tag can be used to specify a user defined cascading 
+# style sheet that is used by each HTML page. It can be used to 
+# fine-tune the look of the HTML output. If the tag is left blank doxygen 
+# will generate a default style sheet
+HTML_STYLESHEET        = 
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, 
+# files or namespaces will be aligned in HTML using tables. If set to 
+# NO a bullet list will be used.
+HTML_ALIGN_MEMBERS     = YES
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files 
+# will be generated that can be used as input for tools like the 
+# Microsoft HTML help workshop to generate a compressed HTML help file (.chm) 
+# of the generated HTML documentation.
+GENERATE_HTMLHELP      = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag 
+# controls if a separate .chi index file is generated (YES) or that 
+# it should be included in the master .chm file (NO).
+GENERATE_CHI           = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag 
+# controls whether a binary table of contents is generated (YES) or a 
+# normal table of contents (NO) in the .chm file.
+BINARY_TOC             = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members 
+# to the contents of the Html help documentation and to the tree view.
+TOC_EXPAND             = NO
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at 
+# top of each HTML page. The value NO (the default) enables the index and 
+# the value YES disables it.
+DISABLE_INDEX          = NO
+
+# This tag can be used to set the number of enum values (range [1..20]) 
+# that doxygen will group on one line in the generated HTML documentation.
+ENUM_VALUES_PER_LINE   = 4
+
+# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be
+# generated containing a tree-like index structure (just like the one that 
+# is generated for HTML Help). For this to work a browser that supports 
+# JavaScript and frames is required (for instance Mozilla, Netscape 4.0+, 
+# or Internet explorer 4.0+). Note that for large projects the tree generation 
+# can take a very long time. In such cases it is better to disable this feature. 
+# Windows users are probably better off using the HTML help feature.
+GENERATE_TREEVIEW      = YES
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be 
+# used to set the initial width (in pixels) of the frame in which the tree 
+# is shown.
+TREEVIEW_WIDTH         = 250
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will 
+# generate Latex output.
+GENERATE_LATEX         = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `latex' will be used as the default path.
+LATEX_OUTPUT           = latex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact 
+# LaTeX documents. This may be useful for small projects and may help to 
+# save some trees in general.
+COMPACT_LATEX          = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used 
+# by the printer. Possible values are: a4, a4wide, letter, legal and 
+# executive. If left blank a4wide will be used.
+PAPER_TYPE             = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX 
+# packages that should be included in the LaTeX output.
+EXTRA_PACKAGES         = 
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for 
+# the generated latex document. The header should contain everything until 
+# the first chapter. If it is left blank doxygen will generate a 
+# standard header. Notice: only use this tag if you know what you are doing!
+LATEX_HEADER           = 
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated 
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will 
+# contain links (just like the HTML output) instead of page references 
+# This makes the output suitable for online browsing using a pdf viewer.
+PDF_HYPERLINKS         = NO
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of 
+# plain latex in the generated Makefile. Set this option to YES to get a 
+# higher quality PDF documentation.
+USE_PDFLATEX           = NO
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. 
+# command to the generated LaTeX files. This will instruct LaTeX to keep 
+# running if errors occur, instead of asking the user for help. 
+# This option is also used when generating formulas in HTML.
+LATEX_BATCHMODE        = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output 
+# The RTF output is optimised for Word 97 and may not look very pretty with 
+# other RTF readers or editors.
+GENERATE_RTF           = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `rtf' will be used as the default path.
+RTF_OUTPUT             = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact 
+# RTF documents. This may be useful for small projects and may help to 
+# save some trees in general.
+COMPACT_RTF            = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated 
+# will contain hyperlink fields. The RTF file will 
+# contain links (just like the HTML output) instead of page references. 
+# This makes the output suitable for online browsing using WORD or other 
+# programs which support those fields. 
+# Note: wordpad (write) and others do not support links.
+RTF_HYPERLINKS         = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's 
+# config file, i.e. a series of assigments. You only have to provide 
+# replacements, missing definitions are set to their default value.
+RTF_STYLESHEET_FILE    = 
+
+# Set optional variables used in the generation of an rtf document. 
+# Syntax is similar to doxygen's config file.
+RTF_EXTENSIONS_FILE    = 
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will 
+# generate man pages
+GENERATE_MAN           = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `man' will be used as the default path.
+MAN_OUTPUT             = man
+
+# The MAN_EXTENSION tag determines the extension that is added to 
+# the generated man pages (default is the subroutine's section .3)
+MAN_EXTENSION          = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output, 
+# then it will generate one additional man file for each entity 
+# documented in the real man page(s). These additional files 
+# only source the real man page, but without them the man command 
+# would be unable to find the correct page. The default is NO.
+MAN_LINKS              = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will 
+# generate an XML file that captures the structure of 
+# the code including all documentation. Note that this 
+# feature is still experimental and incomplete at the 
+# moment.
+GENERATE_XML           = NO
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will 
+# generate an AutoGen Definitions (see autogen.sf.net) file 
+# that captures the structure of the code including all 
+# documentation. Note that this feature is still experimental 
+# and incomplete at the moment.
+GENERATE_AUTOGEN_DEF   = NO
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor   
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will 
+# evaluate all C-preprocessor directives found in the sources and include 
+# files.
+ENABLE_PREPROCESSING   = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro 
+# names in the source code. If set to NO (the default) only conditional 
+# compilation will be performed. Macro expansion can be done in a controlled 
+# way by setting EXPAND_ONLY_PREDEF to YES.
+MACRO_EXPANSION        = YES
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES 
+# then the macro expansion is limited to the macros specified with the 
+# PREDEFINED and EXPAND_AS_PREDEFINED tags.
+EXPAND_ONLY_PREDEF     = NO
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files 
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+SEARCH_INCLUDES        = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that 
+# contain include files that are not input files but should be processed by 
+# the preprocessor.
+INCLUDE_PATH           = 
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard 
+# patterns (like *.h and *.hpp) to filter out the header-files in the 
+# directories. If left blank, the patterns specified with FILE_PATTERNS will 
+# be used.
+INCLUDE_FILE_PATTERNS  = 
+
+# The PREDEFINED tag can be used to specify one or more macro names that 
+# are defined before the preprocessor is started (similar to the -D option of 
+# gcc). The argument of the tag is a list of macros of the form: name 
+# or name=definition (no spaces). If the definition and the = are 
+# omitted =1 is assumed.
+PREDEFINED             = @DOXYGEN_DOC_PREDEFINED@
+                        
+
+# If the MACRO_EXPANSION and EXPAND_PREDEF_ONLY tags are set to YES then 
+# this tag can be used to specify a list of macro names that should be expanded. 
+# The macro definition that is found in the sources will be used. 
+# Use the PREDEFINED tag if you want to use a different macro definition.
+EXPAND_AS_DEFINED      = 
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then 
+# doxygen's preprocessor will remove all function-like macros that are alone 
+# on a line and do not end with a semicolon. Such function macros are typically 
+# used for boiler-plate code, and will confuse the parser if not removed.
+SKIP_FUNCTION_MACROS   = YES
+
+#---------------------------------------------------------------------------
+# Configuration::addtions related to external references   
+#---------------------------------------------------------------------------
+
+# The TAGFILES tag can be used to specify one or more tagfiles.
+TAGFILES               = 
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create 
+# a tag file that is based on the input files it reads.
+GENERATE_TAGFILE       = 
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed 
+# in the class index. If set to NO only the inherited external classes 
+# will be listed.
+ALLEXTERNALS           = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed 
+# in the modules index. If set to NO, only the current project's groups will 
+# be listed.
+EXTERNAL_GROUPS        = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script 
+# interpreter (i.e. the result of `which perl').
+PERL_PATH              = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool   
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will 
+# generate a inheritance diagram (in Html, RTF and LaTeX) for classes with base or 
+# super classes. Setting the tag to NO turns the diagrams off. Note that this 
+# option is superceded by the HAVE_DOT option below. This is only a fallback. It is 
+# recommended to install and use dot, since it yield more powerful graphs.
+CLASS_DIAGRAMS         = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is 
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
+# have no effect if this option is set to NO (the default)
+HAVE_DOT               = @DOXYGEN_HAVE_DOT@
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen 
+# will generate a graph for each documented class showing the direct and 
+# indirect inheritance relations. Setting this tag to YES will force the 
+# the CLASS_DIAGRAMS tag to NO.
+CLASS_GRAPH            = YES
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen 
+# will generate a graph for each documented class showing the direct and 
+# indirect implementation dependencies (inheritance, containment, and 
+# class references variables) of the class with other documented classes.
+COLLABORATION_GRAPH    = YES
+
+# If set to YES, the inheritance and collaboration graphs will show the
+# relations between templates and their instances.
+TEMPLATE_RELATIONS     = YES
+
+# If set to YES, the inheritance and collaboration graphs will hide 
+# inheritance and usage relations if the target is undocumented 
+# or is not a class.
+HIDE_UNDOC_RELATIONS   = YES
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT 
+# tags are set to YES then doxygen will generate a graph for each documented 
+# file showing the direct and indirect include dependencies of the file with 
+# other documented files.
+INCLUDE_GRAPH          = YES
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and 
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each 
+# documented header file showing the documented files that directly or 
+# indirectly include this file.
+INCLUDED_BY_GRAPH      = YES
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen 
+# will graphical hierarchy of all classes instead of a textual one.
+GRAPHICAL_HIERARCHY    = YES
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images 
+# generated by dot. Possible values are gif, jpg, and png
+# If left blank gif will be used.
+DOT_IMAGE_FORMAT       = png
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be 
+# found. If left blank, it is assumed the dot tool can be found on the path.
+DOT_PATH               = "@DOXYGEN_DOT_PATH@"
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that 
+# contain dot files that are included in the documentation (see the 
+# \dotfile command).
+DOTFILE_DIRS           = 
+
+# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width 
+# (in pixels) of the graphs generated by dot. If a graph becomes larger than 
+# this value, doxygen will try to truncate the graph, so that it fits within 
+# the specified constraint. Beware that most browsers cannot cope with very 
+# large images.
+MAX_DOT_GRAPH_WIDTH    = 1024
+
+# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height 
+# (in pixels) of the graphs generated by dot. If a graph becomes larger than 
+# this value, doxygen will try to truncate the graph, so that it fits within 
+# the specified constraint. Beware that most browsers cannot cope with very 
+# large images.
+MAX_DOT_GRAPH_HEIGHT   = 1024
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will 
+# generate a legend page explaining the meaning of the various boxes and 
+# arrows in the dot generated graphs.
+GENERATE_LEGEND        = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will 
+# remove the intermedate dot files that are used to generate 
+# the various graphs.
+DOT_CLEANUP            = YES
+
+#---------------------------------------------------------------------------
+# Configuration::addtions related to the search engine   
+#---------------------------------------------------------------------------
+
+# The SEARCHENGINE tag specifies whether or not a search engine should be 
+# used. If set to NO the values of all tags below this one will be ignored.
+SEARCHENGINE           = NO
diff --git a/packages/qt/src/CMakeLists.txt b/packages/qt/src/CMakeLists.txt
new file mode 100644 (file)
index 0000000..b056f60
--- /dev/null
@@ -0,0 +1,23 @@
+#--------------------------------------------------------------------------- 
+# MOC
+SET(QT4_HEADERS_TO_WRAP
+  bbqtQSlider.h
+  )
+QT4_WRAP_CPP(MOC_SOURCES ${QT4_HEADERS_TO_WRAP})
+#--------------------------------------------------------------------------- 
+# UI
+#QT4_WRAP_UI(UI_SOURCES
+#  bbtkQtBlackBoxDialog.ui
+#  )
+#SET(SOURCES ${SOURCES} ${MOC_SOURCES} ${UI_SOURCES})
+#--------------------------------------------------------------------------- 
+SET(${BBTK_PACKAGE_NAME}_CXX_SOURCES 
+  ${${BBTK_PACKAGE_NAME}_CXX_SOURCES}
+  ${MOC_SOURCES}
+  )
+MESSAGE(STATUS "Sources : ${${BBTK_PACKAGE_NAME}_SOURCES}")
+#---------------------------------------------------------------------------
+# Include src configuration cmake script
+INCLUDE(${BBTK_CMAKE_DIR}/BBTKConfigurePackage_src.cmake)
+#---------------------------------------------------------------------------
+
diff --git a/packages/qt/src/bbqtQLayoutLine.cxx b/packages/qt/src/bbqtQLayoutLine.cxx
new file mode 100644 (file)
index 0000000..ffe64dd
--- /dev/null
@@ -0,0 +1,117 @@
+/*=========================================================================                                                                               
+  Program:   bbtk
+  Module:    $RCSfile: bbqtQLayoutLine.cxx,v $
+  Language:  C++
+  Date:      $Date: 2009/04/08 07:56:33 $
+  Version:   $Revision: 1.1 $
+=========================================================================*/
+
+/* ---------------------------------------------------------------------
+
+* Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
+* Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux
+*
+*  This software is governed by the CeCILL-B license under French law and 
+*  abiding by the rules of distribution of free software. You can  use, 
+*  modify and/ or redistribute the software under the terms of the CeCILL-B 
+*  license as circulated by CEA, CNRS and INRIA at the following URL 
+*  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html 
+*  or in the file LICENSE.txt.
+*
+*  As a counterpart to the access to the source code and  rights to copy,
+*  modify and redistribute granted by the license, users are provided only
+*  with a limited warranty  and the software's author,  the holder of the
+*  economic rights,  and the successive licensors  have only  limited
+*  liability. 
+*
+*  The fact that you are presently reading this means that you have had
+*  knowledge of the CeCILL-B license and that you accept its terms.
+* ------------------------------------------------------------------------ */                                                                         
+    
+
+/**
+ *  \file
+ *  \brief
+ */
+
+
+#ifdef USE_QT
+
+#include "bbqtQLayoutLine.h"
+#include "bbqtPackage.h"
+#include "bbtkUtilities.h"
+
+#include <QBoxLayout>
+
+namespace bbqt
+{
+  BBTK_ADD_BLACK_BOX_TO_PACKAGE(qt, LayoutLine);
+  BBTK_BLACK_BOX_IMPLEMENTATION(LayoutLine,bbtk::QtBlackBox);
+  
+  void LayoutLine::bbUserConstructor()
+  {
+    bbSetInputOrientation("VERTICAL");
+    bbSetInputWidget1(NULL);
+    bbSetInputWidget2(NULL);
+    bbSetInputWidget3(NULL);
+    bbSetInputWidget4(NULL);
+    bbSetInputWidget5(NULL);
+    bbSetInputWidget6(NULL);
+    bbSetInputWidget7(NULL);
+    bbSetInputWidget8(NULL);
+    bbSetInputWidget9(NULL);
+  }
+  
+  void LayoutLine::Process()
+  {
+  }
+  
+
+       
+  void LayoutLine::CreateWidget(QWidget* parent)
+  {
+    QWidget *w = new QWidget(parent);
+    QSizePolicy sizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
+    sizePolicy.setHorizontalStretch(1);
+    sizePolicy.setVerticalStretch(1);
+    sizePolicy.setHeightForWidth(parent->sizePolicy().hasHeightForWidth());
+    w->setSizePolicy(sizePolicy);
+
+    QBoxLayout::Direction dir;
+    if (bbtk::Utilities::loosematch(bbGetInputOrientation(),
+                                   "0|H|HORIZONTAL")==true)  
+      { dir = QBoxLayout::LeftToRight; }
+    if (bbtk::Utilities::loosematch(bbGetInputOrientation(),
+                                   "1|V|VERTICAL")==true)      
+      {  dir = QBoxLayout::TopToBottom; }
+    QBoxLayout* l = new QBoxLayout(dir);
+    
+    QWidget* cw;
+    if ((cw=bbCreateWidgetOfInput("Widget1",w)) != 0) l->addWidget(cw);
+    if ((cw=bbCreateWidgetOfInput("Widget2",w)) != 0) l->addWidget(cw);
+    w->setLayout(l);
+
+    
+    bbSetOutputWidget( w );
+  }
+  
+  // This callback is necessary to get actual processing of the view 
+  // when window is shown
+  void  LayoutLine::OnShowWidget()
+  {
+    bbUserOnShowWidget("Widget1");
+    bbUserOnShowWidget("Widget2");
+    bbUserOnShowWidget("Widget3");
+    bbUserOnShowWidget("Widget4");
+    bbUserOnShowWidget("Widget5");
+    bbUserOnShowWidget("Widget6");
+    bbUserOnShowWidget("Widget7");
+    bbUserOnShowWidget("Widget8");
+    bbUserOnShowWidget("Widget9");
+  }
+
+}//namespace bbqt
+
+#endif // USE_QT
+
diff --git a/packages/qt/src/bbqtQLayoutLine.cxx~ b/packages/qt/src/bbqtQLayoutLine.cxx~
new file mode 100644 (file)
index 0000000..9ef5f7d
--- /dev/null
@@ -0,0 +1,140 @@
+/*=========================================================================                                                                               
+  Program:   bbtk
+  Module:    $RCSfile: bbqtQLayoutLine.cxx~,v $
+  Language:  C++
+  Date:      $Date: 2009/04/08 07:56:33 $
+  Version:   $Revision: 1.1 $
+=========================================================================*/
+
+/* ---------------------------------------------------------------------
+
+* Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
+* Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux
+*
+*  This software is governed by the CeCILL-B license under French law and 
+*  abiding by the rules of distribution of free software. You can  use, 
+*  modify and/ or redistribute the software under the terms of the CeCILL-B 
+*  license as circulated by CEA, CNRS and INRIA at the following URL 
+*  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html 
+*  or in the file LICENSE.txt.
+*
+*  As a counterpart to the access to the source code and  rights to copy,
+*  modify and redistribute granted by the license, users are provided only
+*  with a limited warranty  and the software's author,  the holder of the
+*  economic rights,  and the successive licensors  have only  limited
+*  liability. 
+*
+*  The fact that you are presently reading this means that you have had
+*  knowledge of the CeCILL-B license and that you accept its terms.
+* ------------------------------------------------------------------------ */                                                                         
+    
+
+/**
+ *  \file
+ *  \brief
+ */
+
+
+#ifdef _USE_WXWIDGETS_
+
+#include "bbwxLayoutLine.h"
+#include "bbwxPackage.h"
+#include "bbtkUtilities.h"
+
+
+namespace bbwx
+{
+  BBTK_ADD_BLACK_BOX_TO_PACKAGE(wx, LayoutLine);
+  BBTK_BLACK_BOX_IMPLEMENTATION(LayoutLine,bbtk::WxBlackBox);
+  
+  void LayoutLine::bbUserConstructor()
+  {
+    bbSetInputOrientation("VERTICAL");
+    bbSetInputWidget1(NULL);
+    bbSetInputWidget2(NULL);
+    bbSetInputWidget3(NULL);
+    bbSetInputWidget4(NULL);
+    bbSetInputWidget5(NULL);
+    bbSetInputWidget6(NULL);
+    bbSetInputWidget7(NULL);
+    bbSetInputWidget8(NULL);
+    bbSetInputWidget9(NULL);
+  }
+  
+  void LayoutLine::Process()
+  {
+  }
+  
+       
+/*
+  void LayoutLine::TryInsertWindow(wxWindow *parent, wxWindow *w,wxBoxSizer *sizer)
+  {
+    if (w!=NULL)
+      {
+       w->Reparent(parent);
+       sizer->Add(w, 1, wxEXPAND, 0);
+      }
+  }
+  */
+       
+  void LayoutLine::CreateWidget(wxWindow* parent)
+  {
+    wxBoxSizer *sizer;
+    wxPanel *w=new wxPanel(parent, //bbGetWxParent(),
+                                                  -1);
+    w->SetName( bbtk::std2wx( bbGetInputWinTitle() ) );
+    
+    int style=0;
+    if (bbtk::Utilities::loosematch(bbGetInputOrientation(),
+                                   "0|H|HORIZONTAL")==true)  
+      { style=wxHORIZONTAL; }
+    if (bbtk::Utilities::loosematch(bbGetInputOrientation(),
+                                   "1|V|VERTICAL")==true)      
+      { style=wxVERTICAL;   }
+    
+    sizer      = new wxBoxSizer(style);
+
+         wxWindow* cw;
+       if ((cw=bbCreateWidgetOfInput("Widget1",w)) != 0) sizer->Add(cw, 1, wxEXPAND, 0);
+         if ((cw=bbCreateWidgetOfInput("Widget2",w)) != 0) sizer->Add(cw, 1, wxEXPAND, 0);
+         if ((cw=bbCreateWidgetOfInput("Widget3",w)) != 0) sizer->Add(cw, 1, wxEXPAND, 0);
+         if ((cw=bbCreateWidgetOfInput("Widget4",w)) != 0) sizer->Add(cw, 1, wxEXPAND, 0);
+         if ((cw=bbCreateWidgetOfInput("Widget5",w)) != 0) sizer->Add(cw, 1, wxEXPAND, 0);
+         if ((cw=bbCreateWidgetOfInput("Widget6",w)) != 0) sizer->Add(cw, 1, wxEXPAND, 0);
+         if ((cw=bbCreateWidgetOfInput("Widget7",w)) != 0) sizer->Add(cw, 1, wxEXPAND, 0);
+         if ((cw=bbCreateWidgetOfInput("Widget8",w)) != 0) sizer->Add(cw, 1, wxEXPAND, 0);
+         if ((cw=bbCreateWidgetOfInput("Widget9",w)) != 0) sizer->Add(cw, 1, wxEXPAND, 0);
+         /*
+    TryInsertWindow(w,bbGetInputWidget1(),sizer);
+    TryInsertWindow(w,bbGetInputWidget2(),sizer);
+    TryInsertWindow(w,bbGetInputWidget3(),sizer);
+    TryInsertWindow(w,bbGetInputWidget4(),sizer);
+    TryInsertWindow(w,bbGetInputWidget5(),sizer);
+    TryInsertWindow(w,bbGetInputWidget6(),sizer);
+    TryInsertWindow(w,bbGetInputWidget7(),sizer);
+    TryInsertWindow(w,bbGetInputWidget8(),sizer);
+    TryInsertWindow(w,bbGetInputWidget9(),sizer);
+    */
+    w  -> SetSizer(sizer);
+    bbSetOutputWidget( w );
+  }
+  
+  // This callback is necessary to get actual processing of the view 
+  // when window is shown
+  void  LayoutLine::OnShowWidget()
+  {
+         bbUserOnShowWidget("Widget1");
+         bbUserOnShowWidget("Widget2");
+         bbUserOnShowWidget("Widget3");
+         bbUserOnShowWidget("Widget4");
+         bbUserOnShowWidget("Widget5");
+         bbUserOnShowWidget("Widget6");
+         bbUserOnShowWidget("Widget7");
+         bbUserOnShowWidget("Widget8");
+         bbUserOnShowWidget("Widget9");
+  }
+
+}//namespace bbwx
+
+#endif // _USE_WXWIDGETS_
+
diff --git a/packages/qt/src/bbqtQLayoutLine.h b/packages/qt/src/bbqtQLayoutLine.h
new file mode 100644 (file)
index 0000000..8208ef9
--- /dev/null
@@ -0,0 +1,123 @@
+/*=========================================================================                                                                               
+  Program:   bbtk
+  Module:    $RCSfile: bbqtQLayoutLine.h,v $
+  Language:  C++
+  Date:      $Date: 2009/04/08 07:56:33 $
+  Version:   $Revision: 1.1 $
+=========================================================================*/
+
+/* ---------------------------------------------------------------------
+
+* Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
+* Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux
+*
+*  This software is governed by the CeCILL-B license under French law and 
+*  abiding by the rules of distribution of free software. You can  use, 
+*  modify and/ or redistribute the software under the terms of the CeCILL-B 
+*  license as circulated by CEA, CNRS and INRIA at the following URL 
+*  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html 
+*  or in the file LICENSE.txt.
+*
+*  As a counterpart to the access to the source code and  rights to copy,
+*  modify and redistribute granted by the license, users are provided only
+*  with a limited warranty  and the software's author,  the holder of the
+*  economic rights,  and the successive licensors  have only  limited
+*  liability. 
+*
+*  The fact that you are presently reading this means that you have had
+*  knowledge of the CeCILL-B license and that you accept its terms.
+* ------------------------------------------------------------------------ */                                                                         
+
+
+/**
+ * \brief Short description in one line
+ * 
+ * Long description which 
+ * can span multiple lines
+ */
+/**
+ * \file 
+ * \brief Pattern for the definition of a new type of Node (header)
+ */
+/**
+ * \class bbtk::NodePatern 
+ * \brief Pattern for the definition of a new type of Node 
+ */
+
+
+#ifdef USE_QT
+
+
+#ifndef __bbqtQLayoutLine_h__
+#define __bbqtQLayoutLine_h__
+
+#include "bbtkQtBlackBox.h"
+#include "bbqt_EXPORT.h"
+
+
+namespace bbqt
+{
+  
+
+  
+  //===========================================================
+  class bbqt_EXPORT LayoutLine : public bbtk::QtBlackBox
+  {
+    
+    BBTK_BLACK_BOX_INTERFACE(LayoutLine,bbtk::QtBlackBox);
+    BBTK_DECLARE_INPUT(Widget1,QWidget*);
+    BBTK_DECLARE_INPUT(Widget2,QWidget*);
+    BBTK_DECLARE_INPUT(Widget3,QWidget*);
+    BBTK_DECLARE_INPUT(Widget4,QWidget*);
+    BBTK_DECLARE_INPUT(Widget5,QWidget*);
+    BBTK_DECLARE_INPUT(Widget6,QWidget*);
+    BBTK_DECLARE_INPUT(Widget7,QWidget*);
+    BBTK_DECLARE_INPUT(Widget8,QWidget*);
+    BBTK_DECLARE_INPUT(Widget9,QWidget*);
+    BBTK_DECLARE_INPUT(Orientation,std::string);
+    BBTK_PROCESS(Process);
+    BBTK_CREATE_WIDGET(CreateWidget);
+    BBTK_ON_SHOW_WIDGET(OnShowWidget);
+    void Process();
+    void CreateWidget(QWidget*);
+    void OnShowWidget();
+    
+  protected:
+    virtual void bbUserConstructor();
+    // void TryInsertWindow(QWidget *parent, QWidget *w,qtBoxSizer *sizer);
+    //
+  };
+  //===========================================================
+  
+  //=================================================================
+  // BlackBox description
+  BBTK_BEGIN_DESCRIBE_BLACK_BOX(LayoutLine,bbtk::QtBlackBox);
+  BBTK_NAME("QLayoutLine");
+  BBTK_AUTHOR("laurent.guigues@creatis.insa-lyon.fr");
+  BBTK_DESCRIPTION("Linear layout widget (QBoxLayout)");
+  // Already inserted for any QtBlackBox  BBTK_CATEGORY("widget");  
+  BBTK_INPUT(LayoutLine,Widget1,"widget 1",QWidget*,"");
+  BBTK_INPUT(LayoutLine,Widget2,"widget 2",QWidget*,"");
+  BBTK_INPUT(LayoutLine,Widget3,"widget 3",QWidget*,"");
+  BBTK_INPUT(LayoutLine,Widget4,"widget 4",QWidget*,"");
+  BBTK_INPUT(LayoutLine,Widget5,"widget 5",QWidget*,"");
+  BBTK_INPUT(LayoutLine,Widget6,"widget 6",QWidget*,"");
+  BBTK_INPUT(LayoutLine,Widget7,"widget 7",QWidget*,"");
+  BBTK_INPUT(LayoutLine,Widget8,"widget 8",QWidget*,"");
+  BBTK_INPUT(LayoutLine,Widget9,"widget 9",QWidget*,"");
+  BBTK_INPUT(LayoutLine,Orientation,"Orientation (default V), 0=H=HORIZONTAL , 1=V=VERTICAL",std::string,"");
+  BBTK_END_DESCRIBE_BLACK_BOX(LayoutLine);
+  //=================================================================
+  
+  
+  
+}
+
+
+
+//namespace bbtk
+#endif  //__bbtkQtLayoutLine_h__
+
+#endif //USE_QTWIDGETS
diff --git a/packages/qt/src/bbqtQLayoutLine.h~ b/packages/qt/src/bbqtQLayoutLine.h~
new file mode 100644 (file)
index 0000000..63388ef
--- /dev/null
@@ -0,0 +1,123 @@
+/*=========================================================================                                                                               
+  Program:   bbtk
+  Module:    $RCSfile: bbqtQLayoutLine.h~,v $
+  Language:  C++
+  Date:      $Date: 2009/04/08 07:56:33 $
+  Version:   $Revision: 1.1 $
+=========================================================================*/
+
+/* ---------------------------------------------------------------------
+
+* Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
+* Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux
+*
+*  This software is governed by the CeCILL-B license under French law and 
+*  abiding by the rules of distribution of free software. You can  use, 
+*  modify and/ or redistribute the software under the terms of the CeCILL-B 
+*  license as circulated by CEA, CNRS and INRIA at the following URL 
+*  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html 
+*  or in the file LICENSE.txt.
+*
+*  As a counterpart to the access to the source code and  rights to copy,
+*  modify and redistribute granted by the license, users are provided only
+*  with a limited warranty  and the software's author,  the holder of the
+*  economic rights,  and the successive licensors  have only  limited
+*  liability. 
+*
+*  The fact that you are presently reading this means that you have had
+*  knowledge of the CeCILL-B license and that you accept its terms.
+* ------------------------------------------------------------------------ */                                                                         
+
+
+/**
+ * \brief Short description in one line
+ * 
+ * Long description which 
+ * can span multiple lines
+ */
+/**
+ * \file 
+ * \brief Pattern for the definition of a new type of Node (header)
+ */
+/**
+ * \class bbtk::NodePatern 
+ * \brief Pattern for the definition of a new type of Node 
+ */
+
+
+#ifdef USE_QTWIDGETS
+
+
+#ifndef __bbQtLayoutLine_h__
+#define __bbQtLayoutLine_h__
+
+#include "bbtkQtBlackBox.h"
+#include "bbqt_EXPORT.h"
+
+
+namespace bbqt
+{
+  
+
+  
+  //===========================================================
+  class bbqt_EXPORT LayoutLine : public bbtk::QtBlackBox
+  {
+    
+    BBTK_BLACK_BOX_INTERFACE(LayoutLine,bbtk::QtBlackBox);
+    BBTK_DECLARE_INPUT(Widget1,qtWindow*);
+    BBTK_DECLARE_INPUT(Widget2,qtWindow*);
+    BBTK_DECLARE_INPUT(Widget3,qtWindow*);
+    BBTK_DECLARE_INPUT(Widget4,qtWindow*);
+    BBTK_DECLARE_INPUT(Widget5,qtWindow*);
+    BBTK_DECLARE_INPUT(Widget6,qtWindow*);
+    BBTK_DECLARE_INPUT(Widget7,qtWindow*);
+    BBTK_DECLARE_INPUT(Widget8,qtWindow*);
+    BBTK_DECLARE_INPUT(Widget9,qtWindow*);
+    BBTK_DECLARE_INPUT(Orientation,std::string);
+    BBTK_PROCESS(Process);
+    BBTK_CREATE_WIDGET(CreateWidget);
+    BBTK_ON_SHOW_WIDGET(OnShowWidget);
+    void Process();
+    void CreateWidget(qtWindow*);
+    void OnShowWidget();
+    
+  protected:
+       virtual void bbUserConstructor();
+       void TryInsertWindow(qtWindow *parent, qtWindow *w,qtBoxSizer *sizer);
+
+  };
+  //===========================================================
+  
+  //=================================================================
+  // BlackBox description
+  BBTK_BEGIN_DESCRIBE_BLACK_BOX(LayoutLine,bbtk::QtBlackBox);
+  BBTK_NAME("LayoutLine");
+  BBTK_AUTHOR("eduardo.davila@creatis.insa-lyon.fr");
+  BBTK_DESCRIPTION("LayoutLine widget (qtBoxSizer)");
+  // Already inserted for any QtBlackBox  BBTK_CATEGORY("widget");  
+  BBTK_INPUT(LayoutLine,Widget1,"widget 1",qtWindow*,"");
+  BBTK_INPUT(LayoutLine,Widget2,"widget 2",qtWindow*,"");
+  BBTK_INPUT(LayoutLine,Widget3,"widget 3",qtWindow*,"");
+  BBTK_INPUT(LayoutLine,Widget4,"widget 4",qtWindow*,"");
+  BBTK_INPUT(LayoutLine,Widget5,"widget 5",qtWindow*,"");
+  BBTK_INPUT(LayoutLine,Widget6,"widget 6",qtWindow*,"");
+  BBTK_INPUT(LayoutLine,Widget7,"widget 7",qtWindow*,"");
+  BBTK_INPUT(LayoutLine,Widget8,"widget 8",qtWindow*,"");
+  BBTK_INPUT(LayoutLine,Widget9,"widget 9",qtWindow*,"");
+  BBTK_INPUT(LayoutLine,Orientation,"Orientation (default V), 0=H=HORIZONTAL , 1=V=VERTICAL",std::string,"");
+  BBTK_END_DESCRIBE_BLACK_BOX(LayoutLine);
+  //=================================================================
+  
+  
+  
+}
+
+
+
+//namespace bbtk
+#endif  //__bbtkQtLayoutLine_h__
+
+#endif //USE_QTWIDGETS
diff --git a/packages/qt/src/bbqtQOutputText.cxx b/packages/qt/src/bbqtQOutputText.cxx
new file mode 100644 (file)
index 0000000..b7fbad5
--- /dev/null
@@ -0,0 +1,57 @@
+#include "bbqtQOutputText.h"
+#include "bbqtPackage.h"
+#include <QLabel>
+namespace bbqt
+{
+
+BBTK_ADD_BLACK_BOX_TO_PACKAGE(qt,QOutputText)
+BBTK_BLACK_BOX_IMPLEMENTATION(QOutputText,bbtk::QtBlackBox);
+void QOutputText::Process()
+{
+
+   std::string msg;
+    if (bbGetInputTitle()!="")
+      {
+       msg = bbGetInputTitle()+": " + bbGetInputIn();
+      }
+    else
+      {
+       msg = bbGetInputIn();
+      }
+    ((QLabel*)bbGetOutputWidget())->setText( msg.c_str() );
+    //SetLabel( bbtk::std2wx( msg ) ); 
+  
+}
+void QOutputText::CreateWidget(QWidget* parent)
+{
+
+  bbSetOutputWidget( new 
+                    QLabel( parent ) );
+                    //wxStaticText ( bbGetWxParent() , -1 , _T("") ) );
+   Process();
+  
+}
+void QOutputText::bbUserConstructor()
+{
+    bbSetInputIn("");
+    bbSetInputTitle("");
+  
+}
+void QOutputText::bbUserCopyConstructor(bbtk::BlackBox::Pointer)
+{
+
+
+  
+}
+void QOutputText::bbUserDestructor()
+{
+
+
+  
+}
+}
+// EO namespace bbqt
+
+
diff --git a/packages/qt/src/bbqtQOutputText.cxx~ b/packages/qt/src/bbqtQOutputText.cxx~
new file mode 100644 (file)
index 0000000..451bf3f
--- /dev/null
@@ -0,0 +1,57 @@
+#include "bbqtQOutputText.h"
+#include "bbqtPackage.h"
+#include <QLabel>
+
+namespace bbqt
+{
+
+BBTK_ADD_BLACK_BOX_TO_PACKAGE(qt,QOutputText)
+BBTK_BLACK_BOX_IMPLEMENTATION(QOutputText,bbtk::QtBlackBox);
+void QOutputText::Process()
+{
+
+   std::string msg;
+    if (bbGetInputTitle()!="")
+      {
+       msg = bbGetInputTitle()+": " + bbGetInputIn();
+      }
+    else
+      {
+       msg = bbGetInputIn();
+      }
+    ((QLabel*)bbGetOutputWidget())->setText( msg.c_str() );
+    //SetLabel( bbtk::std2wx( msg ) ); 
+  
+}
+void QOutputText::CreateWidget(QWidget* parent)
+{
+
+  bbSetOutputWidget( new 
+                    QLabel( parent ) );
+                    //wxStaticText ( bbGetWxParent() , -1 , _T("") ) );
+   Process();
+  
+}
+void QOutputText::bbUserConstructor()
+{
+    bbSetInputIn("");
+    bbSetInputTitle("");
+  
+}
+void QOutputText::bbUserCopyConstructor(bbtk::BlackBox::Pointer)
+{
+
+
+  
+}
+void QOutputText::bbUserDestructor()
+{
+
+
+  
+}
+}
+// EO namespace bbqt
+
+
diff --git a/packages/qt/src/bbqtQOutputText.h b/packages/qt/src/bbqtQOutputText.h
new file mode 100644 (file)
index 0000000..d61db3c
--- /dev/null
@@ -0,0 +1,45 @@
+#ifdef USE_QT
+
+#ifndef __bbqtQOutputText_h_INCLUDED__
+#define __bbqtQOutputText_h_INCLUDED__
+#include "bbqt_EXPORT.h"
+#include "bbtkQtBlackBox.h"
+
+namespace bbqt
+{
+
+class bbqt_EXPORT QOutputText
+ : 
+   public bbtk::QtBlackBox
+{
+  BBTK_BLACK_BOX_INTERFACE(QOutputText,bbtk::QtBlackBox);
+//==================================================================
+/// User callback called in the box contructor
+virtual void bbUserConstructor();
+/// User callback called in the box copy constructor
+virtual void bbUserCopyConstructor(bbtk::BlackBox::Pointer);
+/// User callback called in the box destructor
+virtual void bbUserDestructor();
+//==================================================================
+  BBTK_DECLARE_INPUT(Title,std::string);
+  BBTK_DECLARE_INPUT(In,std::string);
+  BBTK_PROCESS(Process);
+  void Process();
+  BBTK_CREATE_WIDGET(CreateWidget);
+  void CreateWidget(QWidget*);
+};
+
+BBTK_BEGIN_DESCRIBE_BLACK_BOX(QOutputText,bbtk::QtBlackBox);
+BBTK_NAME("QOutputText");
+BBTK_AUTHOR("laurent.guigues@creatis.insa-lyon.fr");
+BBTK_DESCRIPTION("OutputText");
+BBTK_CATEGORY("");
+BBTK_INPUT(QOutputText,Title,"Title prepended to the text",std::string,"");
+BBTK_INPUT(QOutputText,In,"Text",std::string,"");
+BBTK_END_DESCRIBE_BLACK_BOX(QOutputText);
+}
+// EO namespace bbqt
+
+#endif // __bbqtQOutputText_h_INCLUDED__
+#endif // USE_QT
+
diff --git a/packages/qt/src/bbqtQOutputText.h~ b/packages/qt/src/bbqtQOutputText.h~
new file mode 100644 (file)
index 0000000..2b0153f
--- /dev/null
@@ -0,0 +1,44 @@
+#ifdef _USE_WXWIDGETS_
+#ifndef __bbqtQOutputText_h_INCLUDED__
+#define __bbqtQOutputText_h_INCLUDED__
+#include "bbqt_EXPORT.h"
+#include "bbtkQtBlackBox.h"
+
+namespace bbqt
+{
+
+class bbqt_EXPORT QOutputText
+ : 
+   public bbtk::QtBlackBox
+{
+  BBTK_BLACK_BOX_INTERFACE(QOutputText,bbtk::QtBlackBox);
+//==================================================================
+/// User callback called in the box contructor
+virtual void bbUserConstructor();
+/// User callback called in the box copy constructor
+virtual void bbUserCopyConstructor(bbtk::BlackBox::Pointer);
+/// User callback called in the box destructor
+virtual void bbUserDestructor();
+//==================================================================
+  BBTK_DECLARE_INPUT(Title,std::string);
+  BBTK_DECLARE_INPUT(In,std::string);
+  BBTK_PROCESS(Process);
+  void Process();
+  BBTK_CREATE_WIDGET(CreateWidget);
+  void CreateWidget(QWidget*);
+};
+
+BBTK_BEGIN_DESCRIBE_BLACK_BOX(QOutputText,bbtk::QtBlackBox);
+BBTK_NAME("QOutputText");
+BBTK_AUTHOR("laurent.guigues@creatis.insa-lyon.fr");
+BBTK_DESCRIPTION("OutputText");
+BBTK_CATEGORY("");
+BBTK_INPUT(QOutputText,Title,"Title prepended to the text",std::string,"");
+BBTK_INPUT(QOutputText,In,"Text",std::string,"");
+BBTK_END_DESCRIBE_BLACK_BOX(QOutputText);
+}
+// EO namespace bbqt
+
+#endif // __bbqtQOutputText_h_INCLUDED__
+#endif // _USE_WXWIDGETS_
+
diff --git a/packages/qt/src/bbqtQSlider.cxx b/packages/qt/src/bbqtQSlider.cxx
new file mode 100644 (file)
index 0000000..530473e
--- /dev/null
@@ -0,0 +1,139 @@
+/*=========================================================================                                                                               
+  Program:   bbtk
+  Module:    $RCSfile: bbqtQSlider.cxx,v $
+  Language:  C++
+  Date:      $Date: 2009/04/08 07:56:33 $
+  Version:   $Revision: 1.1 $
+=========================================================================*/
+
+/* ---------------------------------------------------------------------
+
+* Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
+* Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux
+*
+*  This software is governed by the CeCILL-B license under French law and 
+*  abiding by the rules of distribution of free software. You can  use, 
+*  modify and/ or redistribute the software under the terms of the CeCILL-B 
+*  license as circulated by CEA, CNRS and INRIA at the following URL 
+*  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html 
+*  or in the file LICENSE.txt.
+*
+*  As a counterpart to the access to the source code and  rights to copy,
+*  modify and redistribute granted by the license, users are provided only
+*  with a limited warranty  and the software's author,  the holder of the
+*  economic rights,  and the successive licensors  have only  limited
+*  liability. 
+*
+*  The fact that you are presently reading this means that you have had
+*  knowledge of the CeCILL-B license and that you accept its terms.
+* ------------------------------------------------------------------------ */                                                                         
+
+/**
+ * \file 
+ * \brief Short description in one line
+ *
+ * Long 
+ * description
+ *  
+ */
+
+#ifdef USE_QT
+
+#include "bbqtQSlider.h"
+#include "bbqtPackage.h"
+#include "bbtkUtilities.h"
+
+namespace bbqt
+{
+
+
+  //--------------------------------------------------------------------------
+  //-------------------------------------------------------------------------
+  // QtBlackBox implementation
+  //--------------------------------------------------------------------------
+  //--------------------------------------------------------------------------
+
+  //--------------------------------------------------------------------------
+  BBTK_BLACK_BOX_IMPLEMENTATION(Slider,bbtk::QtBlackBox);
+  BBTK_ADD_BLACK_BOX_TO_PACKAGE(qt,Slider);
+  
+  //--------------------------------------------------------------------------
+  void Slider::bbUserConstructor() 
+  { 
+    bbSetInputIn(0);
+    bbSetInputMin(0);
+    bbSetInputMax(500);
+    bbSetOutputOut(0);
+    bbSetInputOrientation("HORIZONTAL");
+    bbSetInputChangeResolution(false);
+    bbSetInputLabel(true);
+    bbSetInputReactiveOnTrack(false);    
+  }
+  //--------------------------------------------------------------------------
+  
+  //--------------------------------------------------------------------------
+  void Slider::Process() 
+  {
+    bbtkDebugMessage("process",3,
+                    "Slider "<<bbGetName()<<" input="
+                    <<bbGetInputIn()<<std::endl);
+   
+    bbSetOutputOut( bbGetInputIn() );
+    if (bbGetOutputWidget()!=0)
+      {
+       ((QSlider*)bbGetOutputWidget())->setValue(bbGetInputIn());
+      }
+  }
+  //--------------------------------------------------------------------------
+
+  //--------------------------------------------------------------------------
+  void Slider::CreateWidget(QWidget* parent)
+  {
+
+     Qt::Orientation orientation;
+    if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"0|H|HORIZONTAL")
+       ==true)  
+      { orientation = Qt::Horizontal; }
+    if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"1|V|VERTICAL")
+       ==true)    
+      { orientation = Qt::Vertical ; }
+    
+    
+    //    std::cout << "bbGetQtParent = "<<bbGetQtParent()<<std::endl;
+    QSlider *w =  new QSlider(parent);
+    w->setOrientation(orientation);
+    w->setMinimum( bbGetInputMin() );
+    w->setMaximum( bbGetInputMax() );
+    w->setSliderPosition ( bbGetInputIn() );
+    
+    if (bbGetInputReactiveOnTrack()) 
+      w->setTracking(true);
+    else 
+      w->setTracking(false);
+
+    connect(w,SIGNAL(valueChanged(int)),this,SLOT(OnValueChanged(int)));
+
+
+    bbSetOutputWidget( w );
+  }
+  //--------------------------------------------------------------------------
+
+  //--------------------------------------------------------------------------
+  void Slider::OnValueChanged(int v)
+  {
+    //   std::cout << "OnValueChanged "<<v<<std::endl;
+    bbSetOutputOut( v ); 
+    bbSetInputIn( v );
+    // and signal that the output has changed
+    bbSignalOutputModification(std::string("Out"));
+
+  }
+  //--------------------------------------------------------------------------
+
+
+} //namespace bbqt
+
+#endif // USE_QT
+
+
diff --git a/packages/qt/src/bbqtQSlider.cxx~ b/packages/qt/src/bbqtQSlider.cxx~
new file mode 100644 (file)
index 0000000..3a5fccf
--- /dev/null
@@ -0,0 +1,482 @@
+/*=========================================================================                                                                               
+  Program:   bbtk
+  Module:    $RCSfile: bbqtQSlider.cxx~,v $
+  Language:  C++
+  Date:      $Date: 2009/04/08 07:56:33 $
+  Version:   $Revision: 1.1 $
+=========================================================================*/
+
+/* ---------------------------------------------------------------------
+
+* Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
+* Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux
+*
+*  This software is governed by the CeCILL-B license under French law and 
+*  abiding by the rules of distribution of free software. You can  use, 
+*  modify and/ or redistribute the software under the terms of the CeCILL-B 
+*  license as circulated by CEA, CNRS and INRIA at the following URL 
+*  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html 
+*  or in the file LICENSE.txt.
+*
+*  As a counterpart to the access to the source code and  rights to copy,
+*  modify and redistribute granted by the license, users are provided only
+*  with a limited warranty  and the software's author,  the holder of the
+*  economic rights,  and the successive licensors  have only  limited
+*  liability. 
+*
+*  The fact that you are presently reading this means that you have had
+*  knowledge of the CeCILL-B license and that you accept its terms.
+* ------------------------------------------------------------------------ */                                                                         
+
+/**
+ * \file 
+ * \brief Short description in one line
+ *
+ * Long 
+ * description
+ *  
+ */
+
+#ifdef USE_QT
+
+#include "bbqtQSlider.h"
+#include "bbqtPackage.h"
+#include "bbtkUtilities.h"
+
+namespace bbqt
+{
+
+  /*
+  //--------------------------------------------------------------------------
+  // The widget created by the box 
+  class SliderWidget : public qtPanel 
+  {
+  public:
+    /// Ctor with the two first params the parent window and the creator box
+    /// which must be passed to the QtBlackBoxWidget constructor.
+    /// The other params initialize the widget 
+    SliderWidget(Slider* box, qtWindow *parent,
+                int orientation,
+                bool changeresolution,
+                bool label, 
+                qtString title,
+                int vmin,
+                int vmax,
+                int value,
+                 bool track);
+    /// Dtor
+    ~SliderWidget();
+    /// Events callbacks
+    /// Called when the slider is moved
+    void OnSliderTrack(qtScrollEvent& event);
+    /// Called when the slider is released
+    void OnSliderRelease(qtScrollEvent& event);
+    /// Called when the little slider which controls the resolution
+    /// of the main slider is moved (if activated)
+    void OnResolutionOfSlider(qtScrollEvent& event);
+
+    // Accessors
+    void SetValue(int v) { mqtSlider->SetValue(v); }
+    int  GetValue() { return mqtSlider->GetValue(); }
+    void SetRange(int min, int max);
+    // Update the texts which display the min/max/current values of the slider
+    void RefreshLabels();
+       
+  private:
+    Slider*    mBox;
+    qtSlider   *mqtSlider;
+    qtSlider   *mResolutionOfSlider;
+    int        min;
+    int        max;
+    bool       reactiveOnTrack;
+    qtStaticText       *label_vertical;
+    qtStaticText       *label_min;
+    qtStaticText       *label_max;
+  };
+  //------------------------------------------------------------------------
+  //------------------------------------------------------------------------
+  //------------------------------------------------------------------------
+
+  
+    
+  //-------------------------------------------------------------------------
+  SliderWidget::SliderWidget(Slider* box, qtWindow *parent,
+                            int orientation,
+                            bool changeresolution,
+                            bool labels,
+                            qtString title,
+                            int vmin,
+                            int vmax,
+                            int value,
+                             bool reactiveontrack)
+    :  
+    qtPanel( parent, -1, qtDefaultPosition, qtDefaultSize, qtTAB_TRAVERSAL),
+    mBox(box),
+    min(vmin),
+    max(vmax),
+    reactiveOnTrack(reactiveontrack)
+  {
+    qtPanel * panel = this;
+    
+    label_min           = NULL;
+    label_max           = NULL;
+    label_vertical      = NULL;
+    mResolutionOfSlider        = NULL;
+
+    int sizeX,sizeY;
+    long qtlabels=0;
+    long qtorientation=0;
+    if (orientation==0) 
+      {
+       sizeX                   = 2; 
+       sizeY                   = 40;
+       qtorientation           = qtSL_HORIZONTAL;
+       if (labels==true)
+         {
+           qtlabels = qtSL_LABELS;
+         }
+      } 
+    else 
+      {
+       sizeX           = 20;
+       sizeY           = 2;
+       qtorientation   = qtSL_VERTICAL;
+      }
+    
+    //---------------------------------------------------------------------
+    // 1) Creation of the components of the widget
+    // Any top level sub-widget must have the panel returned by panel
+    // for parent
+    mqtSlider = new qtSlider( panel, 
+                             -1, 0 , 0, 500 , 
+                             qtDefaultPosition, 
+                             qtSize(sizeX,sizeY), 
+                             qtorientation  | qtlabels );
+
+    //    mqtSlider->SetInitialSize(qtSize(sizeX,sizeY));
+
+    // mqtSlider->SetTickFreq(100,0);
+    mqtSlider->SetRange(min,max);
+    mqtSlider->SetValue(value);
+
+    //    RefreshLabels();
+
+    // Connecting events to callbacks
+    Connect( mqtSlider->GetId(), 
+            qtEVT_SCROLL_THUMBRELEASE, 
+            (qtObjectEventFunction) 
+            (void (qtPanel::*)(qtScrollEvent&))
+            &SliderWidget::OnSliderRelease ); 
+
+    Connect( mqtSlider->GetId(),  
+            qtEVT_SCROLL_THUMBTRACK, 
+            (qtObjectEventFunction) 
+            (void (qtPanel::*)(qtScrollEvent&))
+             &SliderWidget::OnSliderTrack ); 
+    
+    Connect( mqtSlider->GetId(),  
+            qtEVT_SCROLL_CHANGED, 
+            (qtObjectEventFunction) 
+            (void (qtPanel::*)(qtScrollEvent&))
+             &SliderWidget::OnSliderTrack );
+              
+    // If asked : creation of the other little slider which allows to change 
+    // the resolution of the main slider
+    if (changeresolution==true){
+      // has panel for parent too
+      mResolutionOfSlider = new qtSlider(panel,
+                                        -1,5,1,10,
+                                        qtDefaultPosition,
+                                        qtSize(25,45),
+                                        qtSL_VERTICAL | 
+                                        qtSL_AUTOTICKS |
+                                        qtSL_LEFT  );
+   
+
+      mResolutionOfSlider->SetRange(1,8);
+      mResolutionOfSlider->SetValue(5);
+      // Is qtEVT_COMMAND_SLIDER_UPDATED event 
+      // is connected to the method OnResolutionOfSlider
+      Connect(mResolutionOfSlider->GetId(),
+             qtEVT_COMMAND_SLIDER_UPDATED,
+             (qtObjectEventFunction) 
+             (void (qtPanel::*)(qtScrollEvent&))
+             &SliderWidget::OnResolutionOfSlider ); 
+    }
+    //---------------------------------------------------------------------
+
+    //---------------------------------------------------------------------
+    // 2) Insertion of the components in the window
+    
+    // We use a FlexGridSizer
+    qtFlexGridSizer *sizer;
+
+
+    if (orientation==0) 
+      {
+       // HORIZONTAL
+       if (mResolutionOfSlider!=NULL) 
+         {
+           sizer       = new qtFlexGridSizer(2);
+           if (title!=_T(""))
+             {
+               sizer   -> Add( new qtStaticText(panel,-1, title ) ); 
+               sizer   -> Add( new qtStaticText(panel,-1, _T("") ) ); 
+             }
+         } 
+       else 
+         {
+           sizer       = new qtFlexGridSizer(1);
+           if (title!=_T(""))
+             {
+               sizer   -> Add( new qtStaticText(panel,-1, title ) ); 
+             }
+         }
+       sizer   -> Add( mqtSlider,1,qtGROW ); 
+       sizer   -> AddGrowableCol(0);
+       if (mResolutionOfSlider!=NULL) 
+         {
+           sizer       -> Add( mResolutionOfSlider ); 
+         }
+      } 
+    else 
+      {
+       // VERTICAL 
+       sizer   = new qtFlexGridSizer(1);
+       if (labels==true)  // with lable
+         {
+           label_vertical = new qtStaticText(panel,-1,_T(""));
+           label_min = new qtStaticText(panel,-1,_T(""));
+           label_max = new qtStaticText(panel,-1,_T(""));
+           if (title!=_T(""))
+             {
+               sizer   -> Add( new qtStaticText(panel,-1, title ) );
+               sizer   -> AddGrowableRow(3);
+             } 
+           else 
+             {
+               sizer   -> AddGrowableRow(2);
+             }
+           sizer       -> Add( label_vertical );
+           sizer       -> Add( label_min );
+           sizer       -> Add( mqtSlider,1,qtGROW );
+           sizer       -> Add( label_max );
+           if (mResolutionOfSlider!=NULL) 
+             {
+               sizer   -> Add( mResolutionOfSlider ); 
+             }
+         } 
+       else 
+         {
+           if (title!=_T(""))
+             {
+               sizer   -> Add( new qtStaticText(panel,-1, title ) );
+               sizer   -> AddGrowableRow(1);
+             } 
+           else 
+             {
+               sizer   -> AddGrowableRow(0);
+             }
+           sizer       -> Add( mqtSlider,1,qtGROW );
+           if (mResolutionOfSlider!=NULL) 
+             {
+               sizer   -> Add( mResolutionOfSlider ); 
+             }
+         }
+      }
+    // Initialize the labels 
+    RefreshLabels();  
+    // Insert the sizer in the main panel and refresh the layout
+    panel->SetSizer(sizer);
+  }
+  //-------------------------------------------------------------------------
+  
+
+  //-------------------------------------------------------------------------
+  SliderWidget::~SliderWidget()
+  {
+  }
+  //-------------------------------------------------------------------------
+
+
+  //-------------------------------------------------------------------------
+  void SliderWidget::OnResolutionOfSlider(qtScrollEvent& event)
+  {
+    int value = mqtSlider->GetValue();
+    int delta = (int) (pow( 4 , mResolutionOfSlider->GetValue() ));
+    int minTmp   = value - delta/2;
+    int maxTmp   = value + delta/2;
+    if (minTmp<min)
+      {
+       minTmp = min;
+       //              maxTmp = delta;
+      }
+    if (maxTmp>max)
+      {
+       maxTmp = max;
+      }
+    mqtSlider->SetRange(minTmp,maxTmp);
+    RefreshLabels();
+  }
+  //-------------------------------------------------------------------------
+
+
+
+  //-------------------------------------------------------------------------
+  void SliderWidget::OnSliderTrack(qtScrollEvent& event)
+  {
+    if(reactiveOnTrack)
+    {
+    // When user releases the slider 
+    // we update the output of the box
+    
+    mBox->bbSetOutputOut( mqtSlider->GetValue() );
+    mBox->bbSetInputIn( mqtSlider->GetValue() );
+    // and signal that the output has changed
+       mBox->bbSignalOutputModification(std::string("Out"));    
+    }
+    RefreshLabels();
+  }
+  //-------------------------------------------------------------------------
+
+
+  //-------------------------------------------------------------------------
+  void SliderWidget::OnSliderRelease(qtScrollEvent& event)
+  {
+    // When user releases the slider 
+    // we update the output of the box
+    mBox->bbSetOutputOut( mqtSlider->GetValue() );
+    mBox->bbSetInputIn( mqtSlider->GetValue() );
+    // and signal that the output has changed
+       mBox->bbSignalOutputModification(std::string("Out"));
+  }
+  //-------------------------------------------------------------------------
+  
+
+  //-------------------------------------------------------------------------
+  void SliderWidget::RefreshLabels()
+  {
+    qtString strValue;
+    if (label_vertical!=NULL)
+      {
+       strValue.Printf( _T("%d"), mqtSlider->GetValue() );
+       label_vertical->SetLabel(strValue);
+      }
+    if (label_min!=NULL)
+      {
+       strValue.Printf( _T("%d"), mqtSlider->GetMin() );
+       label_min->SetLabel(strValue);
+      }
+    if (label_max!=NULL)
+      {
+       strValue.Printf( _T("%d"), mqtSlider->GetMax() );
+       label_max->SetLabel(strValue);
+      }  
+  }
+  //-------------------------------------------------------------------------
+  
+
+  //-------------------------------------------------------------------------
+  void SliderWidget::SetRange(int min, int max)
+  {
+    this->min = min;
+    this->max = max;
+    mqtSlider->SetRange(min,max);
+    RefreshLabels();
+  }
+  //-------------------------------------------------------------------------
+
+  */
+
+
+  //--------------------------------------------------------------------------
+  //-------------------------------------------------------------------------
+  // QtBlackBox implementation
+  //--------------------------------------------------------------------------
+  //--------------------------------------------------------------------------
+
+  //--------------------------------------------------------------------------
+  BBTK_BLACK_BOX_IMPLEMENTATION(Slider,bbtk::QtBlackBox);
+  BBTK_ADD_BLACK_BOX_TO_PACKAGE(qt,Slider);
+  
+  //--------------------------------------------------------------------------
+  void Slider::bbUserConstructor() 
+  { 
+    bbSetInputIn(0);
+    bbSetInputMin(0);
+    bbSetInputMax(500);
+    bbSetOutputOut(0);
+    bbSetInputOrientation("HORIZONTAL");
+    bbSetInputChangeResolution(false);
+    bbSetInputLabel(true);
+    bbSetInputReactiveOnTrack(false);    
+  }
+  //--------------------------------------------------------------------------
+  
+  //--------------------------------------------------------------------------
+  void Slider::Process() 
+  {
+    bbtkDebugMessage("process",3,
+                    "Slider "<<bbGetName()<<" input="
+                    <<bbGetInputIn()<<std::endl);
+   
+    bbSetOutputOut( bbGetInputIn() );
+    if (bbGetOutputWidget()!=0)
+      {
+       ((QSlider*)bbGetOutputWidget())->setValue(bbGetInputIn());
+      }
+  }
+  //--------------------------------------------------------------------------
+
+  //--------------------------------------------------------------------------
+  void Slider::CreateWidget(QWidget* parent)
+  {
+
+     Qt::Orientation orientation;
+    if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"0|H|HORIZONTAL")
+       ==true)  
+      { orientation = Qt::Horizontal; }
+    if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"1|V|VERTICAL")
+       ==true)    
+      { orientation = Qt::Vertical ; }
+    
+    
+    //    std::cout << "bbGetQtParent = "<<bbGetQtParent()<<std::endl;
+    QSlider *w =  new QSlider(parent);
+    w->setOrientation(orientation);
+    w->setMinimum( bbGetInputMin() );
+    w->setMaximum( bbGetInputMax() );
+    w->setSliderPosition ( bbGetInputIn() );
+    
+    if (bbGetInputReactiveOnTrack()) 
+      w->setTracking(true);
+    else 
+      w->setTracking(false);
+
+    connect(w,SIGNAL(valueChanged(int)),this,SLOT(OnValueChanged(int)));
+
+    w->setSizePolicy( QSizePolicy(QSizePolicy::Expanding,
+                                 QSizePolicy::Expanding) );
+
+    bbSetOutputWidget( w );
+  }
+  //--------------------------------------------------------------------------
+
+  //--------------------------------------------------------------------------
+  void Slider::OnValueChanged(int v)
+  {
+    std::cout << "OnValueChanged "<<v<<std::endl;
+    bbSetOutputOut( v ); 
+    bbSetInputIn( v );
+    // and signal that the output has changed
+    bbSignalOutputModification(std::string("Out"));
+
+  }
+  //--------------------------------------------------------------------------
+
+
+} //namespace bbqt
+
+#endif // USE_QT
+
+
diff --git a/packages/qt/src/bbqtQSlider.h b/packages/qt/src/bbqtQSlider.h
new file mode 100644 (file)
index 0000000..55fffc4
--- /dev/null
@@ -0,0 +1,129 @@
+/*=========================================================================                                                                               
+  Program:   bbtk
+  Module:    $RCSfile: bbqtQSlider.h,v $
+  Language:  C++
+  Date:      $Date: 2009/04/08 07:56:33 $
+  Version:   $Revision: 1.1 $
+=========================================================================*/
+
+/* ---------------------------------------------------------------------
+
+* Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
+* Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux
+*
+*  This software is governed by the CeCILL-B license under French law and 
+*  abiding by the rules of distribution of free software. You can  use, 
+*  modify and/ or redistribute the software under the terms of the CeCILL-B 
+*  license as circulated by CEA, CNRS and INRIA at the following URL 
+*  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html 
+*  or in the file LICENSE.txt.
+*
+*  As a counterpart to the access to the source code and  rights to copy,
+*  modify and redistribute granted by the license, users are provided only
+*  with a limited warranty  and the software's author,  the holder of the
+*  economic rights,  and the successive licensors  have only  limited
+*  liability. 
+*
+*  The fact that you are presently reading this means that you have had
+*  knowledge of the CeCILL-B license and that you accept its terms.
+* ------------------------------------------------------------------------ */                                                                         
+
+/**
+ * \file 
+ * \brief Short description in one line
+ * 
+ * Long description which 
+ * can span multiple lines
+*/
+
+/**
+ * \class bbqt::Slider
+ * \brief 
+
+ * \class bbqt::SliderWidget
+ * \brief 
+ */
+
+#ifdef USE_QT
+
+// Prevents multiple inclusions : use symbols of the form
+// __FILENAME_INCLUDED__ 
+// where FILENAME must be replaced by the actual file name
+#ifndef __bbqtSlider_h_INCLUDED__
+#define __bbqtSlider_h_INCLUDED__
+
+// Include qtBlackBox definition
+#include "bbtkQtBlackBox.h"
+
+#include "bbqt_EXPORT.h"
+
+#include <QSlider>
+
+// Namespace of the package "qt" is "bbqt" 
+// Namespace associated to packages should be of the form :
+// bbPACKAGENAME
+namespace bbqt
+{
+  
+   
+
+  
+  //------------------------------------------------------------------------
+  // The black box
+  class bbqt_EXPORT Slider : public QObject,
+                            public bbtk::QtBlackBox
+  {
+    Q_OBJECT
+    
+    BBTK_BLACK_BOX_INTERFACE(Slider,bbtk::QtBlackBox);
+    BBTK_DECLARE_INPUT(In,int);
+    BBTK_DECLARE_INPUT(Min,int);
+    BBTK_DECLARE_INPUT(Max,int);
+    BBTK_DECLARE_INPUT(Label,bool);
+    BBTK_DECLARE_INPUT(Title,std::string); 
+    BBTK_DECLARE_INPUT(Orientation,std::string);
+    BBTK_DECLARE_INPUT(ChangeResolution,bool);
+    BBTK_DECLARE_INPUT(ReactiveOnTrack,bool);    
+    BBTK_DECLARE_OUTPUT(Out,int);
+    BBTK_PROCESS(Process);
+    BBTK_CREATE_WIDGET(CreateWidget);
+    void Process();
+    void CreateWidget(QWidget*);
+
+  public slots:
+    void OnValueChanged(int);
+
+
+  protected:
+    virtual void bbUserConstructor();
+
+    //   QSlider* mSlider;
+  };
+  //=================================================================
+  //=================================================================
+  // the black box description
+  BBTK_BEGIN_DESCRIBE_BLACK_BOX(Slider,bbtk::QtBlackBox);
+  BBTK_NAME("QSlider");
+  BBTK_AUTHOR("laurent.guigues@creatis.insa-lyon.fr");
+  // Already inserted for any QtBlackBox  BBTK_CATEGORY("widget");
+  BBTK_DESCRIPTION("Slider widget (QSlider)");
+  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,"");
+  BBTK_INPUT(Slider,Label,"Show slider labels ? (default FALSE) ",bool,"");
+  BBTK_INPUT(Slider,Title,"Title shown above the slider (default '') ", std::string,"");
+  BBTK_INPUT(Slider,Orientation, "Orientation : (default H)  0=H=HORIZONTAL, 1=V=VERTICAL ",std::string,"");
+  BBTK_INPUT(Slider,ChangeResolution, "Can the user change the resolution of the slider ? (default FALSE) ",bool,"");
+  BBTK_INPUT(Slider,ReactiveOnTrack, "Slider sends info when track moves (default : FALSE)",bool,"");  
+  BBTK_OUTPUT(Slider,Out,"Current position of the slider",int,"");
+  BBTK_END_DESCRIBE_BLACK_BOX(Slider);
+  //=================================================================
+  
+
+
+} //namespace bbqt
+
+#endif  //__bbtkqtSlider_h_INCLUDED__
+
+#endif //USE_QT
diff --git a/packages/qt/src/bbqtQSlider.h~ b/packages/qt/src/bbqtQSlider.h~
new file mode 100644 (file)
index 0000000..3ca8981
--- /dev/null
@@ -0,0 +1,120 @@
+/*=========================================================================                                                                               
+  Program:   bbtk
+  Module:    $RCSfile: bbqtQSlider.h~,v $
+  Language:  C++
+  Date:      $Date: 2009/04/08 07:56:33 $
+  Version:   $Revision: 1.1 $
+=========================================================================*/
+
+/* ---------------------------------------------------------------------
+
+* Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
+* Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux
+*
+*  This software is governed by the CeCILL-B license under French law and 
+*  abiding by the rules of distribution of free software. You can  use, 
+*  modify and/ or redistribute the software under the terms of the CeCILL-B 
+*  license as circulated by CEA, CNRS and INRIA at the following URL 
+*  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html 
+*  or in the file LICENSE.txt.
+*
+*  As a counterpart to the access to the source code and  rights to copy,
+*  modify and redistribute granted by the license, users are provided only
+*  with a limited warranty  and the software's author,  the holder of the
+*  economic rights,  and the successive licensors  have only  limited
+*  liability. 
+*
+*  The fact that you are presently reading this means that you have had
+*  knowledge of the CeCILL-B license and that you accept its terms.
+* ------------------------------------------------------------------------ */                                                                         
+
+/**
+ * \file 
+ * \brief Short description in one line
+ * 
+ * Long description which 
+ * can span multiple lines
+*/
+
+/**
+ * \class bbqt::Slider
+ * \brief 
+
+ * \class bbqt::SliderWidget
+ * \brief 
+ */
+
+#ifdef USE_QT
+
+// Prevents multiple inclusions : use symbols of the form
+// __FILENAME_INCLUDED__ 
+// where FILENAME must be replaced by the actual file name
+#ifndef __bbqtSlider_h_INCLUDED__
+#define __bbqtSlider_h_INCLUDED__
+
+// Include qtBlackBox definition
+#include "bbtkQtBlackBox.h"
+
+#include "bbqt_EXPORT.h"
+
+
+// Namespace of the package "qt" is "bbqt" 
+// Namespace associated to packages should be of the form :
+// bbPACKAGENAME
+namespace bbqt
+{
+  
+   
+
+  
+  //------------------------------------------------------------------------
+  // The black box
+  class bbqt_EXPORT Slider : public bbtk::QtBlackBox
+  {
+    
+    BBTK_BLACK_BOX_INTERFACE(Slider,bbtk::QtBlackBox);
+    BBTK_DECLARE_INPUT(In,int);
+    BBTK_DECLARE_INPUT(Min,int);
+    BBTK_DECLARE_INPUT(Max,int);
+    BBTK_DECLARE_INPUT(Label,bool);
+    BBTK_DECLARE_INPUT(Title,std::string);
+    BBTK_DECLARE_INPUT(Orientation,std::string);
+    BBTK_DECLARE_INPUT(ChangeResolution,bool);
+    BBTK_DECLARE_INPUT(ReactiveOnTrack,bool);    
+    BBTK_DECLARE_OUTPUT(Out,int);
+    BBTK_PROCESS(Process);
+    BBTK_CREATE_WIDGET(CreateWidget);
+    void Process();
+    void CreateWidget(QWidget*);
+
+  protected:
+    virtual void bbUserConstructor();
+  };
+  //=================================================================
+  //=================================================================
+  // the black box description
+  BBTK_BEGIN_DESCRIBE_BLACK_BOX(Slider,bbtk::QtBlackBox);
+  BBTK_NAME("Slider");
+  BBTK_AUTHOR("laurent.guigues@creatis.insa-lyon.fr");
+  // Already inserted for any QtBlackBox  BBTK_CATEGORY("widget");
+  BBTK_DESCRIPTION("Slider widget (QSlider)");
+  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,"");
+  BBTK_INPUT(Slider,Label,"Show slider labels ? (default FALSE) ",bool,"");
+  BBTK_INPUT(Slider,Title,"Title shown above the slider (default '') ", std::string,"");
+  BBTK_INPUT(Slider,Orientation, "Orientation : (default H)  0=H=HORIZONTAL, 1=V=VERTICAL ",std::string,"");
+  BBTK_INPUT(Slider,ChangeResolution, "Can the user change the resolution of the slider ? (default FALSE) ",bool,"");
+  BBTK_INPUT(Slider,ReactiveOnTrack, "Slider sends info when track moves (default : FALSE)",bool,"");  
+  BBTK_OUTPUT(Slider,Out,"Current position of the slider",int,"");
+  BBTK_END_DESCRIBE_BLACK_BOX(Slider);
+  //=================================================================
+  
+
+
+} //namespace bbqt
+
+#endif  //__bbtkqtSlider_h_INCLUDED__
+
+#endif //USE_QT