]> Creatis software - bbtk.git/commitdiff
No longer 'Categories', only 'Kinds'!
authorjean-pierre roux <jean-pierre.roux@creatis.insa-lyon.fr>
Tue, 5 Feb 2008 11:07:42 +0000 (11:07 +0000)
committerjean-pierre roux <jean-pierre.roux@creatis.insa-lyon.fr>
Tue, 5 Feb 2008 11:07:42 +0000 (11:07 +0000)
kernel/src/bbtkBlackBoxDescriptor.cxx
kernel/src/bbtkBlackBoxDescriptor.h
kernel/src/bbtkExecuter.cxx
kernel/src/bbtkExecuter.h
kernel/src/bbtkInterpreter.cxx
kernel/src/bbtkMessageManager.cxx
kernel/src/bbtkPackage.cxx
kernel/src/bbtkTranscriptor.h
kernel/src/bbtkUserBlackBoxMacros.h
kernel/src/bbtkVirtualExec.h
packages/wx/bbs/boxes/bbDoubleSlider.bbs

index 004deb4ca96d961d5cddba629dc72a4f2e161577..cde4b519f6130a5640568d82c7e00b52a47ecab3 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkBlackBoxDescriptor.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/02/04 13:02:57 $
-  Version:   $Revision: 1.4 $
+  Date:      $Date: 2008/02/05 11:07:42 $
+  Version:   $Revision: 1.5 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -35,7 +35,7 @@ namespace bbtk
       mDescription(""), 
       mAuthor(""),
       mKeyword(""),
-      mCategory(STANDARD),
+      mKind(STANDARD),
       mPackage(NULL)
   {
     bbtkDebugMessage("Core",9,
index 259aa2f2d86f03139d9be98ff809c3397cda9860..0604f9c02f8ee0f20780ad38c0514a095e16270c 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkBlackBoxDescriptor.h,v $
   Language:  C++
-  Date:      $Date: 2008/01/30 09:28:15 $
-  Version:   $Revision: 1.2 $
+  Date:      $Date: 2008/02/05 11:07:42 $
+  Version:   $Revision: 1.3 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -51,14 +51,14 @@ namespace bbtk
     typedef std::map<std::string, InputDescriptor*> InputDescriptorMapType;
     /// The type of dictionnary of outputs= map of output descriptors pointers 
     typedef std::map<std::string, OutputDescriptor*> OutputDescriptorMapType;
-    /// The categories of black box
+    /// The kinds of black box
     typedef enum
     {
       STANDARD,
       ADAPTOR,
       DEFAULT_ADAPTOR
     }
-    Category;
+    Kind;
 
     /// Default ctor
     BlackBoxDescriptor(); 
@@ -86,8 +86,8 @@ namespace bbtk
     /// Returns the Package to which the box belongs
     const Package* GetPackage() const { return mPackage; }
     
-    /// Returns the category of box 
-    Category GetCategory() const { return mCategory; }
+    /// Returns the kind of box 
+    Kind GetKind() const { return mKind; }
 
     /// Prints help on the black box
     virtual void GetHelp(bool full=true) const;
@@ -121,8 +121,8 @@ namespace bbtk
     /// Sets the Package to which the box belongs
     void SetPackage(Package *package) { mPackage = package; }
     
-    /// Sets the category of box 
-    void SetCategory(Category category) { mCategory = category; }
+    /// Sets the kind of box 
+    void SetKind(Kind kind) { mKind = kind; }
 
     /* 
    virtual void InsertHTMLGraph( std::ofstream& s, int detail, int level, 
@@ -155,8 +155,8 @@ namespace bbtk
     std::string mAuthor;
     /// The keyword of the black box
     std::string mKeyword;    
-    /// The category of box
-    Category mCategory;
+    /// The kind of box
+    Kind mKind;
     /// The Package to which the box belongs
     Package *mPackage;
     /// The inputs 
index bd715119fffa4b453dc59b9308bd339e19b36632..e925a1fd57b10c46309251af5c1ab625c452a6d0 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkExecuter.cxx,v $ $
   Language:  C++
-  Date:      $Date: 2008/01/30 09:28:15 $
-  Version:   $Revision: 1.4 $
+  Date:      $Date: 2008/02/05 11:07:42 $
+  Version:   $Revision: 1.5 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
  *  \brief class Executer: level 0 of script execution (code)
  */
 
-#include "bbtkExecuter.h" 
+#include "bbtkExecuter.h"
 #include "bbtkMessageManager.h"
 #include "bbtkFactory.h"
 #include "bbtkUtilities.h"
-
 #include <fstream>
 
 #ifdef _USE_WXWIDGETS_
@@ -40,7 +39,7 @@ namespace bbtk
 /**
  *  
  */
-  Executer::Executer() 
+  Executer::Executer()
     : mPackage(0),
       mRoot(0),
       mNoExecMode(false),
@@ -52,7 +51,7 @@ namespace bbtk
     Reset();
     bbtkDebugDecTab("Core",9);
   } 
-  
+
 /**
  *  
  */
@@ -121,8 +120,8 @@ namespace bbtk
   
   void Executer::BeginPackage (const std::string &name)
   {
-     bbtkDebugMessageInc("Core",9,"Executer::BeginPackage(\""<<name<<"\")" 
-                        <<std::endl);  
+     bbtkDebugMessageInc("Core",9,"Executer::BeginPackage(\""<<name<<"\")"
+                        <<std::endl);
      Package* p;
      try 
       {
@@ -137,7 +136,7 @@ namespace bbtk
                        BBTK_STRINGIFY_SYMBOL(BBTK_VERSION));
        InsertPackage(p);
       }
-     mOpenPackage.push_back(p); 
+     mOpenPackage.push_back(p);
   }
 
   void Executer::EndPackage()
@@ -167,30 +166,29 @@ namespace bbtk
                         <<std::endl);
     // Does current package exist ?
     Package* p;
-
     std::string pname(mOpenDefinition.back().package);
     if (pname.size()>0)
+    {
+      try
       {
-    try 
-      {
-       p = GetGlobalFactory()->GetPackage(pname);
+           p = GetGlobalFactory()->GetPackage(pname);
       }
-    catch (Exception e)
+      catch (Exception e)
       {
-       p = new Package(pname,
+            p = new Package(pname,
                        "",
                        "",
                        "",
                        BBTK_STRINGIFY_SYMBOL(BBTK_VERSION));
-       InsertPackage(p);
-      }
-      }
-    else 
-      {
-       p = mOpenPackage.back();
+           InsertPackage(p);
       }
+    }
+    else
+    {
+          p = mOpenPackage.back();
+    }
     p->RegisterBlackBox(Current());
-    
+
     mOpenDefinition.pop_back();
   }
 
@@ -204,7 +202,7 @@ namespace bbtk
 
   /*
     void Executer::Remove (const std::string &nodeName)
-  { 
+  {
     // Current()->RemoveBlackBox(nodeName);
   }
   */    
@@ -217,9 +215,9 @@ namespace bbtk
                           const std::string &nodeTo, 
                           const std::string &inputLabel)
   {
-    Current()->Connect(nodeFrom, outputLabel, nodeTo, inputLabel); 
+    Current()->Connect(nodeFrom, outputLabel, nodeTo, inputLabel);
   }
-   
+
  /**
  *  
  */ 
@@ -290,9 +288,9 @@ namespace bbtk
        }
 #endif
     }
-    
+
     Current()->DefineInput(name,box,input,help);
-        
+
   }
   
  /**
@@ -305,7 +303,7 @@ namespace bbtk
   {
     Current()->DefineOutput(name,box,output,help);
   }
-  
+
   /**
    *  
    */ 
@@ -412,7 +410,6 @@ namespace bbtk
     bbtkDecTab("Help",1);
  }
 
-
   std::string Executer::ShowGraph(const std::string &nameblackbox, 
                                  const std::string &detailStr, 
                                  const std::string &levelStr,
@@ -421,7 +418,6 @@ namespace bbtk
                                  const std::string &custom_title,
                                  bool system_display )
   {
-
     int detail =       atoi(detailStr.c_str());
     int level  =       atoi(levelStr.c_str());
 
@@ -447,38 +443,38 @@ namespace bbtk
 
        // Creating directory
        std::string command0("mkdir \"" +directory + "\"");
-       system( command0.c_str() );      
+       system( command0.c_str() );
 
        relative_link = false;
       }
 
-    
+
     Package* p;
-    try 
-      {
-       p = GetGlobalFactory()->GetPackage(nameblackbox);
-      }
+    try
+    {
+          p = GetGlobalFactory()->GetPackage(nameblackbox);
+    }
     catch (Exception e)
-      {
-       p = mPackage;
-      }
+    {
+          p = mPackage;
+    }
     // Generating documentation-help of workspace
     p->SetDocURL(filename_rootHtml);
     p->SetDocRelativeURL(simplefilename_rootHtml);
 
     p->CreateHtmlPage(filename_rootHtml,"bbi","user package",custom_header,custom_title,detail,level,relative_link);
-    
+
     std::string page = filename_rootHtml;
     /*
     try 
-      {
-       ShowGraphTypes(nameblackbox);
-      }
-    catch (bbtk::Exception a) 
-      {
-       std::cout <<"EXC"<<std::endl;
-       page = ShowGraphInstances(nameblackbox,detail,level,system_display);
-      }
+    {
+         ShowGraphTypes(nameblackbox);
+    }
+    catch (bbtk::Exception a)
+    {
+         std::cout <<"EXC"<<std::endl;
+         page = ShowGraphInstances(nameblackbox,detail,level,system_display);
+    }
     */
     return page;
   }
@@ -490,13 +486,13 @@ namespace bbtk
 
     BlackBox* blackbox=NULL;
     if (nameblackbox==".")
-      {
-       blackbox=Current()->GetPrototype();
-      } 
+    {
+         blackbox=Current()->GetPrototype();
+    }
     else 
-      {
-       blackbox = Current()->GetPrototype()->bbFindBlackBox(nameblackbox);
-      }
+    {
+         blackbox = Current()->GetPrototype()->bbFindBlackBox(nameblackbox);
+    }
     
     std::string page;
 
@@ -554,7 +550,6 @@ namespace bbtk
       }
     return page;
   }
-  
 
 void Executer::ShowRelations(const std::string &nameblackbox, const std::string &detailStr, const std::string &levelStr)
   {
@@ -584,12 +579,12 @@ void Executer::ShowRelations(const std::string &nameblackbox, const std::string
 
   /*
   /// sets the level of message
-  void Executer::Message(const std::string &category, 
+  void Executer::Message(const std::string &kind,
                          const std::string& level)
   {
     int l;
     sscanf(level.c_str(),"%d",&l);
-    bbtk::MessageManager::SetMessageLevel(category,l);
+    bbtk::MessageManager::SetMessageLevel(kind,l);
   }
   */
 
index 47935ae4b5d8bbc5e3ec64d1d22bece112209f85..a7455d967c0053c4cff4a297d39a883f1b967296 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkExecuter.h,v $ $
   Language:  C++
-  Date:      $Date: 2008/01/30 09:28:15 $
-  Version:   $Revision: 1.4 $
+  Date:      $Date: 2008/02/05 11:07:42 $
+  Version:   $Revision: 1.5 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -23,7 +23,7 @@
  *  \class bbtk::Executer 
  *  \brief class Executer: level 0 of script execution 
  */
-  
 #ifndef __bbtkExecuter_h__
 #define __bbtkExecuter_h__
 
@@ -46,7 +46,7 @@ namespace bbtk
     /// Constructor
     Executer();
 
-    /// 
+    ///
     //  void SetFactory(Factory* f);
       
     /// Destructor
@@ -122,9 +122,9 @@ namespace bbtk
     ///Adds the authorName to the Box author list
     void Author(const std::string &authorName);
 
-    ///Adds the categories to the Box keyword list
+    ///Adds the Keywords to the Box keyword list
     void Keyword(const std::string &keyword);
-    
+
     /// The description string which explains what does the ComplexBox
     void Description(const std::string & d);
 
@@ -148,7 +148,7 @@ namespace bbtk
 
       void Reset();
 
-  //  static const std::string& GetObjectDescription() 
+  //  static const std::string& GetObjectDescription();
   //  { static std::string s("Executer"); return s; }
 
   protected:
@@ -189,7 +189,7 @@ namespace bbtk
     /// only contains the root when outside a define/endefine block
     std::deque<CBBDefinition> mOpenDefinition;
 
-   /// The stack of current working package
+    /// The stack of current working package
     /// (is a stack for nested definitions)
     std::deque<Package*> mOpenPackage;
 
index 6d7b994a1e35193a47a5448d1ba6b1a57d36b283..d5f08d28d644f82a03b86a4d5b2ec15de1e4e3c7 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkInterpreter.cxx,v $ $
   Language:  C++
-  Date:      $Date: 2008/02/05 09:38:31 $
-  Version:   $Revision: 1.21 $
+  Date:      $Date: 2008/02/05 11:07:42 $
+  Version:   $Revision: 1.22 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -216,9 +216,8 @@ Interpreter* Interpreter::mGlobalInterpreter = NULL;
     info.argmin = 0;
     info.argmax = 2;
     info.code = cMessage;
-    info.syntax = "message <category> <level>";
-    info.help = "Sets the level of the category of messages <category> to <level>.\n  If category='All' then sets the level for all categories. If no category nor level is passed then prints info on available categories of messages and their current level.";
-    mCommandDict[info.keyword] = info;
+    info.syntax = "message <kind> <level>";
+    info.help = "Sets the level of the kind of messages <kind> to <level>.\n  If kind='All' then sets the level for all kinds. If no kind nor level is passed then prints info on available kinds of messages and their current level.";  mCommandDict[info.keyword] = info;
 
     info.keyword = "include";
     info.argmin = 1;
index ff2c39356add19cfbc5c6e4530a250398de58ee1..eede31b5e0b7d244c1b01f41af6844283b7c8fb8 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkMessageManager.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/01/22 15:02:00 $
-  Version:   $Revision: 1.1 $
+  Date:      $Date: 2008/02/05 11:07:42 $
+  Version:   $Revision: 1.2 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -144,7 +144,7 @@ namespace bbtk
   {
     bbtkMessage("Help",1,"================ Messages =================" 
                << bbtkendl);
-    bbtkMessage("Help",1, "Category");
+    bbtkMessage("Help",1, "Kind");
     for (int k=0;
         k<(int)(GetInstance()->mMaxMessageLength-8);
         k++) {
index 7b50aefd251f3e9ef3503a424fc8c3de3623a6d4..c37a2a1c71020086974e0d7fb6d9aee96dafffe1 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkPackage.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/01/30 12:14:43 $
-  Version:   $Revision: 1.2 $
+  Date:      $Date: 2008/02/05 11:07:42 $
+  Version:   $Revision: 1.3 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See doc/license.txt or
@@ -157,7 +157,7 @@ namespace bbtk
     d->SetPackage(this);
     
     // If it is a default adaptor, also register it in the adaptors map
-    if ( d->GetCategory() == BlackBoxDescriptor::DEFAULT_ADAPTOR) 
+    if ( d->GetKind() == BlackBoxDescriptor::DEFAULT_ADAPTOR) 
       {
        TypeInfo typein = d->GetInputDescriptor("In")->GetTypeInfo();
        TypeInfo typeout = d->GetOutputDescriptor("Out")->GetTypeInfo();
@@ -257,7 +257,7 @@ namespace bbtk
   {
     unsigned int lmax = 0;
     std::vector<std::string> names;
-    std::vector<std::string> categs;
+    std::vector<std::string> kinds;
     std::vector<std::string> descrs;
 
     BlackBoxMapType::const_iterator i;
@@ -266,25 +266,25 @@ namespace bbtk
         ++i) 
       {
        if ( adaptors || 
-            ( i->second->GetCategory() == BlackBoxDescriptor::STANDARD) ) 
+            ( i->second->GetKind() == BlackBoxDescriptor::STANDARD) ) 
          {
            std::string name("  ");
            name += i->second->GetTypeName();
            names.push_back(name);
 
-           std::string categ;
-           if ( i->second->GetCategory() == BlackBoxDescriptor::ADAPTOR )
+           std::string kind;
+           if ( i->second->GetKind() == BlackBoxDescriptor::ADAPTOR )
              {
-               categ = std::string("[A]");
+               kind = std::string("[A]");
              }
-           else if ( i->second->GetCategory() == 
+           else if ( i->second->GetKind() == 
                      BlackBoxDescriptor::DEFAULT_ADAPTOR )
              {
-               categ = std::string("[DA]");
+               kind = std::string("[DA]");
              }
-           categs.push_back(categ);
+           kinds.push_back(kind);
 
-           unsigned int l = name.size()+categ.size();
+           unsigned int l = name.size()+kind.size();
            if (l>lmax) lmax = l;
 
            std::string descr;
@@ -301,7 +301,7 @@ namespace bbtk
     std::string offs;
     offs.append(lmax+3,' ');
     std::vector<std::string>::iterator ni,ci,di;
-    for (ni = names.begin(), ci = categs.begin(), di = descrs.begin();
+    for (ni = names.begin(), ci = kinds.begin(), di = descrs.begin();
         ni != names.end(); ++ni, ++ci, ++di)
       {
        std::string space;
@@ -331,11 +331,11 @@ namespace bbtk
         i!=mBlackBoxMap.end();
         ++i) 
       {
-       if ( i->second->GetCategory() != BlackBoxDescriptor::STANDARD ) 
+       if ( i->second->GetKind() != BlackBoxDescriptor::STANDARD ) 
          {
            bbtkMessage("Help",1,
                        "  "<<i->second->GetTypeName());
-           if ( i->second->GetCategory() == 
+           if ( i->second->GetKind() == 
                 BlackBoxDescriptor::DEFAULT_ADAPTOR )
              {
                bbtkMessage("Help",1,
@@ -527,7 +527,7 @@ namespace bbtk
     BlackBoxMapType::const_iterator i;
     for (i=mBlackBoxMap.begin(); i!=mBlackBoxMap.end(); ++i) 
       {
-       if ( i->second->GetCategory() != BlackBoxDescriptor::STANDARD) 
+       if ( i->second->GetKind() != BlackBoxDescriptor::STANDARD) 
          continue;
        
        std::string name = i->second->GetTypeName();
@@ -561,7 +561,7 @@ namespace bbtk
        s << "<p><TABLE cellspacing=0  cellpadding=3>\n";
        for (i=mBlackBoxMap.begin(); i!=mBlackBoxMap.end();++i) 
          {
-           if ( i->second->GetCategory() == BlackBoxDescriptor::STANDARD) 
+           if ( i->second->GetKind() == BlackBoxDescriptor::STANDARD) 
              continue;
     
            std::string name = i->second->GetTypeName();
index 5ab590a956df924e2fbb9414be54f324ca0c3b6b..82c95dafff346d1d747955cd512b51dc3f337944 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkTranscriptor.h,v $ $
   Language:  C++
-  Date:      $Date: 2008/01/22 17:00:17 $
-  Version:   $Revision: 1.1 $
+  Date:      $Date: 2008/02/05 11:07:42 $
+  Version:   $Revision: 1.2 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
  */
  
 #ifndef __bbtkTranscriptor_h__
-#define __bbtkTranscriptor_h__ 
+#define __bbtkTranscriptor_h__
 
 #include "bbtkVirtualExec.h"
 
+#include "bbtkSystem.h"
+#include "bbtkComplexBlackBox.h"
+#include "bbtkFactory.h"
+#include <string>
+#include <deque>
 #include <iostream>
 
 namespace bbtk
@@ -37,11 +42,11 @@ namespace bbtk
   class /*BBTK_EXPORT*/ Transcriptor : public VirtualExec
   {
 
-  public:  
+  public:
 
     /// Constructor
     Transcriptor(std::string filename);
-      
+
     /// Destructor
     ~Transcriptor( );
     
@@ -54,20 +59,26 @@ namespace bbtk
     //void SetNoExecMode(bool b) { mNoExecMode = b; }
     void SetNoExecMode(bool b)
     {
-       m_Fp << "e->SetNoExecMode(true);" << std::endl;      
-    }    
+       m_Fp << "e->SetNoExecMode(true);" << std::endl;
+    }
 
     bool GetNoExecMode() const { return mNoExecMode; }
     /*
-    bool GetNoExecMode() const 
+    bool GetNoExecMode() const
     {
       // cannot compile, since ethos is 'const' !
-      //m_Fp << "e->GetNoExecMode(true);" << std::endl;      
+      //m_Fp << "e->GetNoExecMode(true);" << std::endl;
     }
     */
     /// Sets the mode of dialog of the executer for Root inputs 
     void SetDialogMode(DialogModeType t) { mDialogMode = t; }
 
+    /// Starts a package block 
+    void BeginPackage (const std::string &name );
+
+    /// Ends a package block
+    void EndPackage ();
+
     /// Starts the definition of a new ComplexBlackBox in package pack
     /// scriptfilename is the file from which the def is read
     void Define (const std::string &name,
@@ -117,9 +128,12 @@ namespace bbtk
     /// changes the workspace name
     void SetWorkspaceName( const std::string& n );
 
-    ///Adds the authorName to the Box's author list
+    ///Adds the authorName to the Box author list
     void Author(const std::string &authorName);
 
+    ///Adds the Keywords to the Box keyword list
+    void Keyword(const std::string &keyword);
+
     /// The description string which explains what does the ComplexBox
     void Description(const std::string & d);
 
@@ -143,7 +157,7 @@ namespace bbtk
 
       void Reset();
 
-  //  static const std::string& GetObjectDescription() 
+  //  static const std::string& GetObjectDescription()
   //  { static std::string s("Executer"); return s; }
 
   protected:
@@ -151,10 +165,11 @@ namespace bbtk
   private:
 
     /// Gets the current working black box 
-    ComplexBlackBoxDescriptor* Current() { return mCurrent.back().box; }
+    ComplexBlackBoxDescriptor* Current() 
+       { return mOpenDefinition.back().box; }
     
     /// Returns true when we are inside a define/endefine block
-    //    bool InDefinitionBlock() { return (mCurrent.size()>1); }
+    //    bool InDefinitionBlock() { return (mOpenDefinition.size()>1); }
 
     //==================================================================
     // ATTRIBUTES
@@ -168,7 +183,7 @@ namespace bbtk
     /// The root ComplexBlackBox, in which operations are done when outside a define/endefine block
     /// Its name in bbi is 'workspace'  
     ComplexBlackBoxDescriptor* mRoot;
-    
+
     /// Struct that stores info on user defined complex black boxes
     struct CBBDefinition
     {
@@ -181,7 +196,11 @@ namespace bbtk
     /// The stack of current working ComplexBlackBox
     /// (is a stack for nested definitions)
     /// only contains the root when outside a define/endefine block
-    std::deque<CBBDefinition> mCurrent;
+    std::deque<CBBDefinition> mOpenDefinition;
+
+    /// The stack of current working package
+    /// (is a stack for nested definitions)
+    std::deque<Package*> mOpenPackage;
 
     /// flag which is true when we are inside a Define/EndDefine block
     //    bool mDefineFlag;
@@ -196,8 +215,8 @@ namespace bbtk
     DialogModeType mDialogMode;
     
     /// File Pointer, to hold generated C++ code.
-   // std::ofstream *m_Fp;
-   std::ofstream m_Fp;
+    // std::ofstream *m_Fp;
+    std::ofstream m_Fp;
   };
 }
 #endif
index 2ff7aed90366949a269363f2d88b57b21ac2e6a4..a69372acfb23ba94967895cd92e45a742732b954 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkUserBlackBoxMacros.h,v $
   Language:  C++
-  Date:      $Date: 2008/01/30 09:28:16 $
-  Version:   $Revision: 1.3 $
+  Date:      $Date: 2008/02/05 11:07:43 $
+  Version:   $Revision: 1.4 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
 //============================================================================
 
 //============================================================================
-/// Declares the category of a UserBlackBox (to be put inside the UBB description block)
-//#define BBTK_CATEGORY(CATEGORY) SetCategory(CATEGORY)
+/// Declares the kind of a UserBlackBox (to be put inside the UBB description block)
+//#define BBTK_KIND(KIND) SetKind(KIND)
 //============================================================================
 
 //============================================================================
 /// Declares that the UserBlackBox is an adaptor (to be put inside the UBB description block)
-#define BBTK_ADAPTOR() SetCategory(bbtk::BlackBoxDescriptor::ADAPTOR)
+#define BBTK_ADAPTOR() SetKInd(bbtk::BlackBoxDescriptor::ADAPTOR)
 //============================================================================
 
 //============================================================================
 /// Declares that the UserBlackBox is the default adaptor of the package (to be put inside the UBB description block)
-#define BBTK_DEFAULT_ADAPTOR() SetCategory(bbtk::BlackBoxDescriptor::DEFAULT_ADAPTOR)
+#define BBTK_DEFAULT_ADAPTOR() SetKind(bbtk::BlackBoxDescriptor::DEFAULT_ADAPTOR)
 //============================================================================
 
 //============================================================================
index 42217a7a1c88b3c53f7fa39121b34da6ab76891c..6a744012f1692f50a8266963ab600585956d5afe 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkVirtualExec.h,v $ $
   Language:  C++
-  Date:      $Date: 2008/01/30 09:28:16 $
-  Version:   $Revision: 1.4 $
+  Date:      $Date: 2008/02/05 11:07:43 $
+  Version:   $Revision: 1.5 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -40,24 +40,14 @@ namespace bbtk
   {
 
   public:
-    typedef enum 
+    typedef enum
     {
        NoDialog,
        TextDialog,
        GraphicalDialog
     }
     DialogModeType;
-    
-/*
-    /// Constructor
-    VirtualExec();
-
-    /// 
-    //  void SetFactory(Factory* f);
-      
-    /// Destructor
-    virtual ~VirtualExec() = 0;
-*/    
+
     /// Sets the inputs of the workspace : 
     virtual void SetInputs(const std::map<std::string,std::string>& m) = 0;
 
@@ -119,7 +109,7 @@ namespace bbtk
              const std::string &input, 
              const std::string &value) = 0;
 
-   /// gets the output of the box
+    /// gets the output of the box
     virtual std::string Get (const std::string &box, 
                     const std::string &output) = 0;
 
@@ -147,17 +137,17 @@ namespace bbtk
                          const std::string &custom_title,
                          bool system_display = true) = 0;
 
-       /// Generate a HTML with a gif file with the actual pipeline (Graphviz-dot needed). Returns the file path
+   /// Generate a HTML with a gif file with the actual pipeline (Graphviz-dot needed). Returns the file path
     virtual std::string ShowGraphInstances(const std::string &nameblackbox, int detail, int level, bool system_display=true) = 0;
 
-/// Description of the actual pipeline
+   /// Description of the actual pipeline
        virtual void ShowRelations(const std::string &nameblackbox, const std::string &detailStr, const std::string &levelStr) = 0;
 
        virtual void Reset() = 0;
-/*
+
+
   //  static const std::string& GetObjectDescription() = 0;
   //  { static std::string s("VirtualExec"); return s; }
-*/
   protected:
 
   private:
@@ -180,7 +170,7 @@ namespace bbtk
     /// The root ComplexBlackBox, in which operations are done when outside a define/endefine block
     /// Its name in bbi is 'workspace'  
     ComplexBlackBoxDescriptor* mRoot;
-    
+
     /// Struct that stores info on user defined complex black boxes
     struct CBBDefinition
     {
@@ -193,7 +183,11 @@ namespace bbtk
     /// The stack of current working ComplexBlackBox
     /// (is a stack for nested definitions)
     /// only contains the root when outside a define/endefine block
-    std::deque<CBBDefinition> mCurrent;
+    std::deque<CBBDefinition> mOpenDefinition;
+
+   /// The stack of current working package
+    /// (is a stack for nested definitions)
+    std::deque<Package*> mOpenPackage;
 
     /// flag which is true when we are inside a Define/EndDefine block
     //    bool mDefineFlag;
index 7fe08c61fcc0d91130e44740ef35a009eed8c7c5..65ad3c921c9228fab5ce410a6fecb54b95fde424 100644 (file)
@@ -1,5 +1,6 @@
 define DoubleSlider
  description "test object"
+ keyword "box;wx;slider"
  author "laurent.guigues at creatis.insa-lyon.fr"
 new Slider slider1
 new Slider slider2