]> Creatis software - bbtk.git/commitdiff
*** empty log message ***
authorguigues <guigues>
Fri, 12 Dec 2008 12:11:21 +0000 (12:11 +0000)
committerguigues <guigues>
Fri, 12 Dec 2008 12:11:21 +0000 (12:11 +0000)
kernel/src/bbtkComplexBlackBox.cxx
kernel/src/bbtkExecuter.cxx
kernel/src/bbtkExecuter.h
kernel/src/bbtkInterpreter.cxx
kernel/src/bbtkInterpreter.h
kernel/src/bbtkKW.cxx
kernel/src/bbtkTranscriptor.cxx
kernel/src/bbtkTranscriptor.h
kernel/src/bbtkVirtualExec.h
packages/kw/bbs/appli/exampleSlider.bbs [deleted file]
packages/kw/bbs/appli/kwTour.bbs [moved from packages/kw/bbs/appli/demoKW.bbs with 90% similarity]

index c8fa3df167b8a4b16fcde8833ea096eb54f88d0c..47b983717e5b27d0b34b0c68470ca041fb499862 100644 (file)
@@ -2,8 +2,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkComplexBlackBox.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/12/11 09:50:35 $
-  Version:   $Revision: 1.23 $
+  Date:      $Date: 2008/12/12 12:11:21 $
+  Version:   $Revision: 1.24 $
 =========================================================================*/
 
 /* ---------------------------------------------------------------------
@@ -141,6 +141,24 @@ namespace bbtk
     bbtkDebugMessage("object",3,
                     "==> ComplexBlackBox::~ComplexBlackBox() ["
                     <<bbGetName()<<"]"<<std::endl);
+    
+    Clear();
+    this->bbDesallocateConnectors();
+
+    bbtkDebugMessage("object",3,
+                    "<== ComplexBlackBox::~ComplexBlackBox() ["
+                    <<bbGetName()<<"]"<<std::endl);
+  } 
+  //=======================================================================
+
+  //======================================================================= 
+  ///  Clear
+  void ComplexBlackBox::Clear()
+  {
+    bbtkDebugMessage("object",3,
+                    "==> ComplexBlackBox::Clear() ["
+                    <<bbGetName()<<"]"<<std::endl);
 
     bbtkDebugMessage("object",4,
                     " -> Releasing connections"<<std::endl);
@@ -149,15 +167,11 @@ namespace bbtk
                     " -> Releasing boxes"<<std::endl);
     mBlackBoxMap.clear();
 
-    //    Clear();
-    this->bbDesallocateConnectors();
-
     bbtkDebugMessage("object",3,
-                    "<== ComplexBlackBox::~ComplexBlackBox() ["
+                    "<== ComplexBlackBox::Clear() ["
                     <<bbGetName()<<"]"<<std::endl);
   } 
   //=======================================================================
 
   //=========================================================================
   /// Allocates the i/o connectors of the black box
index af9c62ffb07b5eb8e8dc7c653a0e6a131e94b4e0..0a31ad8c537930adaaf3bda133ae6361ef068254 100644 (file)
@@ -2,8 +2,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkExecuter.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/12/11 15:30:04 $
-  Version:   $Revision: 1.24 $
+  Date:      $Date: 2008/12/12 12:11:21 $
+  Version:   $Revision: 1.25 $
 =========================================================================*/
 
 /* ---------------------------------------------------------------------
@@ -149,6 +149,7 @@ namespace bbtk
   }
   //=======================================================================
 
+
   //=======================================================================
   /// changes the workspace name
   void Executer::SetWorkspaceName( const std::string& n )
@@ -215,6 +216,15 @@ namespace bbtk
   }
   //=======================================================================
 
+  //=======================================================================
+  void Executer::Clear()
+  {
+    bbtkDebugMessageInc("Kernel",9,"Executer::Clear()" <<std::endl);
+    GetCurrentDescriptor()->GetPrototype()->Clear();
+
+  }
+  //=======================================================================
+
   //=======================================================================
   void Executer::EndDefine ()
   {
index 7175c39f495267f28bec308cc6143d66996355c4..922ca0754dbf39a5aae0512d46def83ff843a600 100644 (file)
@@ -2,8 +2,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkExecuter.h,v $
   Language:  C++
-  Date:      $Date: 2008/10/17 08:18:13 $
-  Version:   $Revision: 1.16 $
+  Date:      $Date: 2008/12/12 12:11:21 $
+  Version:   $Revision: 1.17 $
 =========================================================================*/
 
 /* ---------------------------------------------------------------------
@@ -120,6 +120,9 @@ namespace bbtk
     /// Destroys a black box
     void Destroy (const std::string &boxName);
 
+    /// Clears the currently defined ComplexBlackBox
+    void Clear();
+
     /// Connects the output boxOutput to the input boxInput
     void Connect (const std::string &boxfrom,
                  const std::string &output,
index 4b2e86615be05108e85c3ef3b810670b3252edb8..fc5f3f18638104b9d3046cc162c02de60a6c5259 100644 (file)
@@ -2,8 +2,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkInterpreter.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/11/26 12:36:42 $
-  Version:   $Revision: 1.78 $
+  Date:      $Date: 2008/12/12 12:11:21 $
+  Version:   $Revision: 1.79 $
 =========================================================================*/
 
 /* ---------------------------------------------------------------------
@@ -134,6 +134,14 @@ namespace bbtk
     info.help = "Deletes the black box of name <box>";
     mCommandDict[info.keyword] = info;
 
+    info.keyword = "clear";
+    info.argmin = 0;
+    info.argmax = 0;
+    info.code = cClear;
+    info.syntax = "clear";
+    info.help = "Clears the currently defined complex box (deletes all its boxes and connections)";
+    mCommandDict[info.keyword] = info;
+
     info.keyword = "newgui";
     info.argmin = 2;
     info.argmax = 2;
@@ -877,6 +885,10 @@ void Interpreter::InterpretLine( const std::string& line, bool &insideComment )
        Reset();
         break;
 
+     case cClear :  
+       mVirtualExecuter->Clear();
+        break;
+
       case cInclude :
                // if 'source' was given (words.size()==3) then tell to set the 
                // source file name of the current complex box with the full file name included
index 5325e568013ebbb94485bb6da5251a0f036d96f6..490882733c83f4f9ac3b6ed7ac9f9123d4597ca4 100644 (file)
@@ -2,8 +2,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkInterpreter.h,v $
   Language:  C++
-  Date:      $Date: 2008/12/11 15:30:04 $
-  Version:   $Revision: 1.37 $
+  Date:      $Date: 2008/12/12 12:11:21 $
+  Version:   $Revision: 1.38 $
 =========================================================================*/
 
 /* ---------------------------------------------------------------------
@@ -170,6 +170,7 @@ namespace bbtk
     /// The enumeration of command codes == Command name
     typedef enum
     {
+      cClear,
       cNew,
       cDelete,
       cConnect,
index cf88699327d7fbb24cf8db5714a7cf660b1551b9..36874f1306d4cefae4a1721c2fd3489822121ae3 100644 (file)
@@ -2,8 +2,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkKW.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/12/02 08:38:08 $
-  Version:   $Revision: 1.2 $
+  Date:      $Date: 2008/12/12 12:11:21 $
+  Version:   $Revision: 1.3 $
 =========================================================================*/
 
 /* ---------------------------------------------------------------------
@@ -36,7 +36,7 @@
 
 
 //#include "vtkConditionVariable.h"
-#include "vtkMultiThreader.h"
+//#include "vtkMultiThreader.h"
 
 #include <ctime>
 
@@ -53,7 +53,8 @@ namespace bbtk
 
   //=========================================================================
   static vtkKWApplication* mgKWApp = 0;
-  static vtkMultiThreader* mgMultiThreader = 0;  /*
+  //static vtkMultiThreader* mgMultiThreader = 0;  
+  /*
   static vtkKWWindowBase* mgKWTopWindow = 0;
   static vtkKWWindowBase* mgKWTopWindowParent = 0;
   static bool mgKWAutoDestroyTopWindow = true;
index fb047d94b5f2d741b00a7a6bd12d9430c8174fcd..9f59d2896fedf828b3cd9c325072ff015d2fcc09 100644 (file)
@@ -2,8 +2,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkTranscriptor.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/10/17 08:18:14 $
-  Version:   $Revision: 1.14 $
+  Date:      $Date: 2008/12/12 12:11:21 $
+  Version:   $Revision: 1.15 $
 =========================================================================*/
 
 /* ---------------------------------------------------------------------
@@ -138,6 +138,11 @@ namespace bbtk
      m_Fp << "  e->Reset( );" << std::endl;
   }
 
+  void Transcriptor::Clear()
+  {
+     m_Fp << "  e->Clear( );" << std::endl;
+  }
+
   void Transcriptor::SetWorkspaceName( const std::string& name )
   {
   
index c2e995c56141a6e6fd85cdfae78c97de9a9a8185..dba498ba9f91b2e4d3673b1e35141de8efa2d491 100644 (file)
@@ -2,8 +2,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkTranscriptor.h,v $
   Language:  C++
-  Date:      $Date: 2008/10/17 08:18:14 $
-  Version:   $Revision: 1.12 $
+  Date:      $Date: 2008/12/12 12:11:21 $
+  Version:   $Revision: 1.13 $
 =========================================================================*/
 
 /* ---------------------------------------------------------------------
@@ -119,6 +119,9 @@ namespace bbtk
     /// Destroys a black box
     void Destroy (const std::string &boxName);
 
+    /// Clears the currently defined ComplexBlackBox
+    void Clear();
+
     /// Connects the output boxOutput to the input boxInput
     void Connect (const std::string &boxfrom,
                  const std::string &output,
index fd856b816f3f7713cd579684571d6b92c2a137ea..d09ed5aeb4c6a95f816f21599add33f64e09e45a 100644 (file)
@@ -2,8 +2,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkVirtualExec.h,v $
   Language:  C++
-  Date:      $Date: 2008/10/17 08:18:14 $
-  Version:   $Revision: 1.17 $
+  Date:      $Date: 2008/12/12 12:11:21 $
+  Version:   $Revision: 1.18 $
 =========================================================================*/
 
 /* ---------------------------------------------------------------------
@@ -127,6 +127,9 @@ namespace bbtk
     /// Destroys a black box
     virtual void Destroy (const std::string &boxName) = 0;
 
+    /// Clears the currently defined ComplexBlackBox
+    virtual void Clear() = 0;
+
     /// Connects the output boxOutput to the input boxInput
     virtual void Connect (const std::string &boxfrom,
                  const std::string &output,
diff --git a/packages/kw/bbs/appli/exampleSlider.bbs b/packages/kw/bbs/appli/exampleSlider.bbs
deleted file mode 100644 (file)
index 1eb6e45..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-load kw
-new kwSlider s
-exec s
-#unload kw
similarity index 90%
rename from packages/kw/bbs/appli/demoKW.bbs
rename to packages/kw/bbs/appli/kwTour.bbs
index 41fd2fcc6f8c1277ab34027f165fc0c2ed002fc3..12ed0781c26936cb5ab95e0ccffd8949a948c9ee 100644 (file)
@@ -4,6 +4,7 @@ category "demo"
 
 print "=================================="
 print "A Slider whose output is plugged into an OutputText"
+message echo 2
 
 include kw
 load std
@@ -15,10 +16,12 @@ new kwLayoutSplit window
 connect in.Widget window.Widget1
 connect out.Widget window.Widget2
 exec window
-reset
 
+message echo 0
+clear
 print "=================================="
 print "The kwSlicer widget"
+message echo 2
 
 load kw
 include vtk
@@ -30,8 +33,11 @@ connect r.Out s.In
 exec s
 reset
 
+message echo 0
+clear
 print "=================================="
 print "Using both kw and wx"
+message echo 2
 
 load wx
 load kw