]> Creatis software - bbtk.git/commitdiff
*** empty log message ***
authorguigues <guigues>
Tue, 22 Apr 2008 14:30:25 +0000 (14:30 +0000)
committerguigues <guigues>
Tue, 22 Apr 2008 14:30:25 +0000 (14:30 +0000)
17 files changed:
kernel/src/bbtkBlackBox.cxx
kernel/src/bbtkBlackBox.h
kernel/src/bbtkBlackBoxInputConnector.cxx
kernel/src/bbtkBlackBoxInputConnector.h
kernel/src/bbtkBlackBoxOutputConnector.cxx
kernel/src/bbtkBlackBoxOutputConnector.h
kernel/src/bbtkComplexBlackBox.cxx
kernel/src/bbtkComplexBlackBox.h
kernel/src/bbtkConnection.cxx
kernel/src/bbtkMessageManager.cxx
kernel/src/bbtkWx.cxx
kernel/src/bbtkWxBlackBox.cxx
kernel/src/bbtkWxBlackBox.h
kernel/src/bbtkWxGUIConsole.cxx
kernel/src/bbtkWxGUIHtmlBrowser.cxx
kernel/src/bbtkWxGUIScriptingInterface.cxx
kernel/src/bbtkWxGUITextEditor.cxx

index ae56fd4beb0a3adc978f22e65090b3c25f2625ab..1f59e6bdae6f18d99f17e15b88f01f8f70784ef6 100644 (file)
@@ -3,8 +3,8 @@
 Program:   bbtk
 Module:    $RCSfile: bbtkBlackBox.cxx,v $
 Language:  C++
-Date:      $Date: 2008/04/22 08:29:09 $
-Version:   $Revision: 1.13 $
+Date:      $Date: 2008/04/22 14:30:25 $
+Version:   $Revision: 1.14 $
                                                                                 
 Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
 l'Image). All rights reserved. See doc/license.txt or
@@ -602,7 +602,7 @@ namespace bbtk
  
   //=========================================================================
   /// Connects the input <name> to the connection c
-  void BlackBox::bbConnectInput( const std::string& name, Connection::Pointer c)
+  void BlackBox::bbConnectInput( const std::string& name, Connection* c)
   {
     bbtkDebugMessage("connection",2,
                        "==> BlackBox::bbConnectInput(\""
@@ -631,7 +631,7 @@ namespace bbtk
 
   //=========================================================================  
   /// Connects the output <name> to the connection c
-  void BlackBox::bbConnectOutput( const std::string& name, Connection::Pointer c)
+  void BlackBox::bbConnectOutput( const std::string& name, Connection* c)
   {
     bbtkDebugMessage("connection",2,
                     "==> BlackBox::bbConnectOutput(\""<<name<<"\","
@@ -656,7 +656,7 @@ namespace bbtk
 
   //=========================================================================
   /// Disconnects the input <name> from the connection c
-  void BlackBox::bbDisconnectInput( const std::string& name, Connection::Pointer c)
+  void BlackBox::bbDisconnectInput( const std::string& name, Connection* c)
   {
 
     bbtkDebugMessage("connection",2,
@@ -691,7 +691,7 @@ namespace bbtk
 
   //=========================================================================
   /// Disconnects the output <name> from the connection c
-  void BlackBox::bbDisconnectOutput( const std::string& name, Connection::Pointer c)
+  void BlackBox::bbDisconnectOutput( const std::string& name, Connection* c)
   {
     bbtkDebugMessage("connection",2,
                     "==> BlackBox::bbDisconnectOutput(\""<<name
@@ -951,21 +951,21 @@ namespace bbtk
        {
          if (i->second)
            {
-             Connection::Pointer con = i->second->GetConnection();
+             Connection* con = i->second->GetConnection();
              if (con!=NULL){
-               BlackBox::Pointer a=con->GetBlackBoxFrom();
-               BlackBox::Pointer b=con->GetBlackBoxTo();
+               BlackBox::Pointer a=con->GetOriginalBlackBoxFrom();
+               BlackBox::Pointer b=con->GetOriginalBlackBoxTo();
                fprintf(ff,"  ");
                a->bbWriteDotInputOutputName(ff,false,detail,level);
                if (detail==1)
                  {
-                   fprintf(ff,":%s",con->GetBlackBoxFromOutput().c_str());
+                   fprintf(ff,":%s",con->GetOriginalBlackBoxFromOutput().c_str());
                  }
                fprintf(ff,"->");
                b->bbWriteDotInputOutputName(ff,true,detail,level);
                if (detail==1)
                  {
-                   fprintf(ff,":%s",con->GetBlackBoxToInput().c_str());
+                   fprintf(ff,":%s",con->GetOriginalBlackBoxToInput().c_str());
                  }
                fprintf(ff,"%s\n",";");
              }  // if con
@@ -1012,11 +1012,11 @@ namespace bbtk
        ivalue.push_back(bbGetInputAsString(i->first));
        if (ivalue.back().size()>valuelmax) valuelmax = ivalue.back().size();
        std::string s("");
-       Connection::Pointer con = i->second->GetConnection();
+       Connection* con = i->second->GetConnection();
        if (con!=0){
-         s = con->GetBlackBoxFrom()->bbGetName();
+         s = con->GetOriginalBlackBoxFrom()->bbGetName();
          s += ".";
-         s += con->GetBlackBoxFromOutput();
+         s += con->GetOriginalBlackBoxFromOutput();
        }  // if con
        iconn.push_back(s);
       }
@@ -1031,15 +1031,15 @@ namespace bbtk
        ovalue.push_back(bbGetOutputAsString(o->first));
        if (ovalue.back().size()>valuelmax) valuelmax = ovalue.back().size();
        std::vector<std::string> ss;
-       const std::vector<Connection::WeakPointer>& con 
+       const std::vector<Connection*>& con 
          = o->second->GetConnectionVector();
-       std::vector<Connection::WeakPointer>::const_iterator c;
+       std::vector<Connection*>::const_iterator c;
        for (c=con.begin();c!=con.end();++c) 
          {
            std::string s;
-           s = (*c).lock()->GetBlackBoxTo()->bbGetName();
+           s = (*c)->GetOriginalBlackBoxTo()->bbGetName();
            s += ".";
-           s += (*c).lock()->GetBlackBoxToInput();
+           s += (*c)->GetOriginalBlackBoxToInput();
            ss.push_back(s);
        }  // if con
        oconn.push_back(ss);
index d5f06710ffda4b87718702077d48b425c4f0edd2..48509a1930ac2e48a768f432e2e85f888611f36d 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkBlackBox.h,v $
   Language:  C++
-  Date:      $Date: 2008/04/21 12:43:05 $
-  Version:   $Revision: 1.7 $
+  Date:      $Date: 2008/04/22 14:30:25 $
+  Version:   $Revision: 1.8 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See doc/license.txt or
@@ -43,6 +43,7 @@ namespace bbtk
   struct Void { Void(int = 0) {} };
   
   class Factory;
+  class Connection;
 
   class BBTK_EXPORT BlackBox : public Object
   {
@@ -66,7 +67,6 @@ namespace bbtk
     virtual BlackBox::Pointer bbClone(const std::string& name) = 0;
 
     /// User overloadable destruction method of a black box
-    /// UNUSED FOR THE MOMENT
     virtual void bbUserDelete();
 
     /// Returns the Name of the Type of the BlackBox
@@ -83,8 +83,6 @@ namespace bbtk
     /// Returns the name with the name of the parent prepended if any
     virtual std::string bbGetNameWithParent() const;
     
-    /// Sets the parent of the BlackBox
-    void bbSetParent(BlackBox::Pointer p) { bbmParent = p; }
     /// Returns the parent of the BlackBox, i.e the BlackBox that contains it (0 if none)
     BlackBox::Pointer bbGetParent() const { return bbmParent.lock(); }
 
@@ -146,18 +144,6 @@ bool reaction = true);
     ///  Sets the data of the output called <name>
     virtual void bbSetOutput( const std::string &name, Data data) = 0;
 
-    /// Connects the input <name> to the connection c
-    virtual void bbConnectInput( const std::string& name, 
-                                Connection::Pointer c);
-    /// Connects the output <name> to the connection c
-    virtual void bbConnectOutput( const std::string& name, 
-                                 Connection::Pointer c);
-    /// Disconnects the input <name> from the connection c
-    virtual void bbDisconnectInput( const std::string& name, 
-                                   Connection::Pointer c);
-    /// Disconnects the output <name> from the connection c
-    virtual void bbDisconnectOutput( const std::string& name, 
-                                    Connection::Pointer c);
 
     ///  Returns the input connectors map
     InputConnectorMapType&  bbGetInputConnectorMap() 
@@ -267,6 +253,27 @@ bool reaction = true);
     void bbSetStatus( IOStatus t) { bbmStatus = t; } 
     //==================================================================
     
+  private:
+    friend class Connection;
+    friend class ComplexBlackBox;
+
+    /// Sets the parent of the BlackBox
+    void bbSetParent(BlackBox::Pointer p) { bbmParent = p; }
+    
+
+    /// Connects the input <name> to the connection c
+    virtual void bbConnectInput( const std::string& name, 
+                                Connection* c);
+    /// Connects the output <name> to the connection c
+    virtual void bbConnectOutput( const std::string& name, 
+                                 Connection* c);
+    /// Disconnects the input <name> from the connection c
+    virtual void bbDisconnectInput( const std::string& name, 
+                                   Connection* c);
+    /// Disconnects the output <name> from the connection c
+    virtual void bbDisconnectOutput( const std::string& name, 
+                                    Connection* c);
+
 
  
     /// @name Pipeline processing methods
@@ -291,7 +298,7 @@ bool reaction = true);
     /// - calls bbProcess which is the user callback which does the actual processing
     /// - calls bbUpdateChildren
     /// - calls bbShowWidget which shows the widget associated to the box (if any)
-  public:
+  protected:
     virtual IOStatus bbBackwardUpdate(Connection::Pointer caller) = 0;
     //==================================================================
 
@@ -348,7 +355,7 @@ bool reaction = true);
     /// which means execute in response to an input change 
     virtual bool bbCanReact() const;
     
-    
+  protected:  
     static void bbGlobalAddToExecutionList( BlackBox::Pointer b );
     static void bbGlobalProcessExecutionList();
 
index 1bbde7331d0a0d202ed8821a029a4b9e2cb8d5df..46dfec6dc77ebcb9108e971a631c6efcf54fc8c9 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkBlackBoxInputConnector.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/04/18 12:59:15 $
-  Version:   $Revision: 1.3 $
+  Date:      $Date: 2008/04/22 14:30:25 $
+  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
@@ -27,7 +27,7 @@
 namespace bbtk
 {
   BlackBoxInputConnector::BlackBoxInputConnector(BlackBox::Pointer b)  
-    : mBox(b), mConnection(), mStatus(MODIFIED)
+    : mBox(b), mConnection(0), mStatus(MODIFIED)
   {
     bbtkDebugMessage("Kernel",9,"BlackBoxInputConnector::BlackBoxInputConnector()"<<std::endl);
   }
@@ -39,17 +39,17 @@ namespace bbtk
     bbtkDebugDecTab("Kernel",9);
   }
   
-  void BlackBoxInputConnector::SetConnection(Connection::Pointer c) 
+  void BlackBoxInputConnector::SetConnection(Connection* c) 
   { 
     bbtkDebugMessage("Kernel",9,"BlackBoxInputConnector::SetConnection("<<c<<")"<<std::endl);
     mConnection = c; 
   }
   
-  void BlackBoxInputConnector::UnsetConnection(Connection::Pointer c) 
+  void BlackBoxInputConnector::UnsetConnection(Connection* c) 
   { 
     bbtkDebugMessage("Kernel",9,"BlackBoxInputConnector::UnsetConnection("
                     <<c<<")"<<std::endl);
-    mConnection.reset();
+    mConnection = 0; //.reset();
   }
   
   IOStatus BlackBoxInputConnector::BackwardUpdate()
@@ -57,9 +57,9 @@ namespace bbtk
     bbtkDebugMessageInc("Process",4,"BlackBoxInputConnector::BackwardUpdate()"
                        <<std::endl);
 
-    if (mConnection.lock()) 
+    if (mConnection) //.lock()) 
       {
-       IOStatus s = mConnection.lock()->BackwardUpdate();
+       IOStatus s = mConnection->BackwardUpdate();
        mStatus = s;
       }
     else 
index 788fb4a12cd64d8240a42f2a81ebbcf2f3b3c670..c897313f97bf9af40e73c32a7eaf7c77a6ec942a 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkBlackBoxInputConnector.h,v $
   Language:  C++
-  Date:      $Date: 2008/04/18 12:59:15 $
-  Version:   $Revision: 1.2 $
+  Date:      $Date: 2008/04/22 14:30:25 $
+  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
@@ -46,17 +46,17 @@ namespace bbtk
     /// Dtor
     ~BlackBoxInputConnector();    
     /// Sets a connection
-    void SetConnection(Connection::Pointer c);
+    void SetConnection(Connection* c);
     /// Unsets the connection 
     /// The parameter is USELESS today but would be useful if we allow multiple connections on inputs
-    void UnsetConnection(Connection::Pointer c);
+    void UnsetConnection(Connection* c);
   
     IOStatus BackwardUpdate();
 
     /// Returns the connection plugged into this input (const)
-    Connection::Pointer GetConnection() const { return mConnection.lock(); }
+    Connection* GetConnection() const { return mConnection; }
     /// Returns true iff a connection is connected to it
-    bool IsConnected() const { return (mConnection.lock() != 0); }
+    bool IsConnected() const { return (mConnection != 0); }
     /// Returns the status of the input (UPTODATE | MODIFIED)
     const IOStatus& GetStatus() const { return mStatus; }
     ///
@@ -65,7 +65,7 @@ namespace bbtk
     /// 
     BlackBoxWeakPointer mBox;
     /// The connection plugged into the input
-    Connection::WeakPointer mConnection;
+    Connection* mConnection;
     /// The status of the input (UPTODATE | MODIFIED)
     IOStatus mStatus;
   };
index af6bf5f21ed88febf007ea7e523d198dcf525aa7..35dd02454c05431c62b10d68bfafbf3be6b39b92 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkBlackBoxOutputConnector.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/04/18 12:59:15 $
-  Version:   $Revision: 1.4 $
+  Date:      $Date: 2008/04/22 14:30:25 $
+  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,18 +40,21 @@ namespace bbtk
     bbtkDebugMessage("Kernel",9,
                     "==> BlackBoxOutputConnector::~BlackBoxOutputConnector()"
                     <<std::endl);
+    /*
     ConnectionVector::iterator i;
     for (i=mConnection.begin();
         i!=mConnection.end();
         ++i)
       (*i) = Connection::WeakPointer();
+    */
+    mConnection.clear();
     bbtkDebugMessage("Kernel",9,
                     "<== BlackBoxOutputConnector::~BlackBoxOutputConnector()"
                     <<std::endl);
   }
 
   ///
-  void BlackBoxOutputConnector::SetConnection(Connection::Pointer c)
+  void BlackBoxOutputConnector::SetConnection(Connection* c)
   {
     bbtkDebugMessage("Kernel",9,"BlackBoxOutputConnector::SetConnection("
                     <<c<<")"<<std::endl);
@@ -61,7 +64,7 @@ namespace bbtk
 
 
   ///
-  void BlackBoxOutputConnector::UnsetConnection(Connection::Pointer c)
+  void BlackBoxOutputConnector::UnsetConnection(Connection* c)
   {
     bbtkDebugMessageInc("Kernel",9,"BlackBoxOutputConnector::UnsetConnection("
                     <<c<<")"<<std::endl);
@@ -74,12 +77,12 @@ namespace bbtk
     //    c->Check();
     //Connection::WeakPointer w(c);
     ConnectionVector::iterator i;
-    //      = find(mConnection.begin(),mConnection.end(),c);
+    //  = find(mConnection.begin(),mConnection.end(),c);
     for (i=mConnection.begin();
         i!=mConnection.end();
         ++i)
       {
-       if (i->lock()==c) break;
+       if (*i==c) break;
       }
     if (i==mConnection.end())
       {
@@ -100,7 +103,7 @@ namespace bbtk
     ConnectionVector::iterator i;
     for (i=mConnection.begin();i!=mConnection.end();++i) 
       {
-       (*i).lock()->SetModifiedStatus();
+       (*i)->SetModifiedStatus();
       }
     
     bbtkDebugDecTab("Process",5);
index 1ec2c361aa2f68236660423c18fcb733d6b2e43a..52b48237023d0ddbf3bf3fc04af6b3f5621728c4 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkBlackBoxOutputConnector.h,v $
   Language:  C++
-  Date:      $Date: 2008/04/18 12:59:15 $
-  Version:   $Revision: 1.2 $
+  Date:      $Date: 2008/04/22 14:30:25 $
+  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
@@ -42,11 +42,11 @@ namespace bbtk
      
     BlackBoxOutputConnector();
     ~BlackBoxOutputConnector();
-    void SetConnection(Connection::Pointer c);
-    void UnsetConnection(Connection::Pointer c);
+    void SetConnection(Connection* c);
+    void UnsetConnection(Connection* c);
     //IOStatus Update();
     void SetModifiedStatus();
-    typedef std::vector<Connection::WeakPointer> ConnectionVector;
+    typedef std::vector<Connection*> ConnectionVector;
     const ConnectionVector& GetConnectionVector() const { return mConnection; }
     
   private:
index f4bc7dd3c42e0dae46d454e1f18ecd6d383d2ed1..d15a45cc726c94b137be1158e8c17c4a2b3d2dee 100644 (file)
@@ -3,8 +3,8 @@
 Program:   bbtk
 Module:    $RCSfile: bbtkComplexBlackBox.cxx,v $
 Language:  C++
-Date:      $Date: 2008/04/22 08:29:09 $
-Version:   $Revision: 1.14 $
+Date:      $Date: 2008/04/22 14:30:25 $
+Version:   $Revision: 1.15 $
                                                                                 
 Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
 l'Image). All rights reserved. See Doc/License.txt or
@@ -132,16 +132,9 @@ namespace bbtk
                     " -> Releasing boxes"<<std::endl);
     mBlackBoxMap.clear();
 
-    /*    
     //    Clear();
     this->bbDesallocateConnectors();
-    if (mLockedDescriptor) 
-      {
-       bbtkMessage("object",3," --> Releasing descriptor"<<std::endl);
-       mLockedDescriptor.reset();                                      
-       if (!mDescriptor.expired()) BlackBoxDescriptor::Release(mDescriptor);
-      }
-    */
+
     bbtkDebugMessage("object",3,
                     "<== ComplexBlackBox::~ComplexBlackBox() ["
                     <<bbGetName()<<"]"<<std::endl);
@@ -157,7 +150,7 @@ namespace bbtk
                        "ComplexBlackBox::bbAllocateConnectors() ["
                        <<bbGetFullName()<<"]"
                        <<std::endl);   
-    /*
+    
     // Input connectors
     const BlackBoxDescriptor::InputDescriptorMapType& imap 
       = bbGetDescriptor()->GetInputDescriptorMap(); 
@@ -175,7 +168,6 @@ namespace bbtk
          ->bbGetInputConnectorMap()[ d->GetInput() ];
        
        bbGetInputConnectorMap()[i->second->GetName()] = c;
-//new BlackBoxInputConnector();
       }                                                                        
 
     // Output connectors
@@ -195,11 +187,8 @@ namespace bbtk
          ->bbGetOutputConnectorMap()[ d->GetOutput() ];
 
        bbGetOutputConnectorMap()[o->second->GetName()] = c;
-       //new BlackBoxOutputConnector();
       }
-
-*/
-
+    
     bbtkDebugDecTab("Kernel",8);  
   }
   //=========================================================================
@@ -217,11 +206,9 @@ namespace bbtk
     // but by the internal boxes. Hence **DO NOT** desallocate !
     // just clear the maps to avoid that 
     // BlackBox::bbDesallocateConnectors delete the connectors
-    /*
-   bbGetInputConnectorMap().clear();
+    bbGetInputConnectorMap().clear();
     bbGetOutputConnectorMap().clear();
-    */
+
     bbtkDebugDecTab("Kernel",8);  
 
   }
@@ -324,11 +311,12 @@ namespace bbtk
        bbtkInternalError("ComplexBlackBox::bbBackwardUpdate called with caller=0");
       }
 
+    /*
     std::cout << "CBB BUP : "<<caller->GetBlackBoxFrom()->bbGetFullName()
              <<"."<<caller->GetBlackBoxFromOutput()<<"----"
              <<caller->GetOriginalBlackBoxFrom()->bbGetFullName()
              <<"."<<caller->GetOriginalBlackBoxFromOutput()<<std::endl;
-      
+    */
       
 
 
@@ -479,7 +467,7 @@ namespace bbtk
 
   //=========================================================================
   /// Connects the input <name> to the connection c
-  void ComplexBlackBox::bbConnectInput( const std::string& name, Connection::Pointer c)
+  void ComplexBlackBox::bbConnectInput( const std::string& name, Connection* c)
   {
     bbtkDebugMessage("connection",2,
                     "==> ComplexBlackBox::bbConnectInput(\""
@@ -512,7 +500,7 @@ namespace bbtk
 
   //=========================================================================  
   /// Connects the output <name> to the connection c
-  void ComplexBlackBox::bbConnectOutput( const std::string& name, Connection::Pointer c)
+  void ComplexBlackBox::bbConnectOutput( const std::string& name, Connection* c)
   {
     bbtkDebugMessage("connection",2,
                     "==> ComplexBlackBox::bbConnectOutput(\""
@@ -1042,21 +1030,21 @@ namespace bbtk
        {
          if (ii->second)
            {
-             Connection::Pointer con = ii->second->GetConnection();
+             Connection* con = ii->second->GetConnection();
              if (con!=NULL){
-               BlackBox::Pointer a=con->GetBlackBoxFrom();
-               BlackBox::Pointer b=con->GetBlackBoxTo();
+               BlackBox::Pointer a=con->GetOriginalBlackBoxFrom();
+               BlackBox::Pointer b=con->GetOriginalBlackBoxTo();
                fprintf(ff,"  ");
                a->bbWriteDotInputOutputName(ff,false,detail,level);
                if (detail==1)
                  {
-                   fprintf(ff,":%s",con->GetBlackBoxFromOutput().c_str());
+                   fprintf(ff,":%s",con->GetOriginalBlackBoxFromOutput().c_str());
                  }
                fprintf(ff,"->");
                b->bbWriteDotInputOutputName(ff,true,detail,level);
                if (detail==1)
                  {
-                   fprintf(ff,":%s",con->GetBlackBoxToInput().c_str());
+                   fprintf(ff,":%s",con->GetOriginalBlackBoxToInput().c_str());
                  }
                fprintf(ff,"%s\n",";");
              } // if con
index 3a5d8fb7c5ccbfdddd83c1eaa89ed9e336b21cf6..7be6b041e4e1f509daec099388550c29dc9a3d1c 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkComplexBlackBox.h,v $
   Language:  C++
-  Date:      $Date: 2008/04/18 12:59:15 $
-  Version:   $Revision: 1.3 $
+  Date:      $Date: 2008/04/22 14:30:25 $
+  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
@@ -78,11 +78,9 @@ namespace bbtk
                                      bool setModified = true);
 
      /// Connects the input <name> to the connection c
-    virtual void bbConnectInput( const std::string& name, 
-                                Connection::Pointer c);
+    virtual void bbConnectInput( const std::string& name, Connection* c);
     /// Connects the output <name> to the connection c
-    virtual void bbConnectOutput( const std::string& name, 
-                                 Connection::Pointer c);
+    virtual void bbConnectOutput( const std::string& name, Connection* c);
 
     BlackBox::Pointer bbGetBlackBox( const std::string& name );
 
index 507c6f09b893cea991cf0bb5a2220267209d7293..5f26be0b7b3beb7f7f0bb98a1968dfa0c354af55 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkConnection.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/04/22 08:29:09 $
-  Version:   $Revision: 1.9 $
+  Date:      $Date: 2008/04/22 14:30:25 $
+  Version:   $Revision: 1.10 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See doc/license.txt or
@@ -142,9 +142,9 @@ Connection::Connection(BlackBox::Pointer from, const std::string& output,
     mOutput = mOriginalOutput = output;
 
      // Lock this pointer !!!
-    Pointer p = MakePointer(this,true);
-    from->bbConnectOutput(output,p);
-    to->bbConnectInput(input,p);
+    //Pointer p = MakePointer(this,true);
+    from->bbConnectOutput(output,this);
+    to->bbConnectInput(input,this);
 
     
     bbtkDebugMessage("connection",1,"<== Connection::Connection(\""
@@ -168,12 +168,11 @@ Connection::Connection(BlackBox::Pointer from, const std::string& output,
                     <<GetFullName()<<"]"<<std::endl);
 
     if (mAdaptor) mAdaptor.reset();
-    mOriginalFrom.reset();
-    mOriginalTo.reset();
     if (mFrom!=0) 
       {
-       mFrom->bbDisconnectOutput(mOutput,
-                                 GetThisPointer<Connection>());
+       mFrom->bbDisconnectOutput(mOutput,this);
+       //                                GetThisPointer<Connection>());
+       mFrom.reset();
       }
     else 
       {
@@ -181,15 +180,14 @@ Connection::Connection(BlackBox::Pointer from, const std::string& output,
       }
     if (mTo!=0) 
       {
-       mTo->bbDisconnectInput(mInput,
-                              GetThisPointer<Connection>());
+       mTo->bbDisconnectInput(mInput,this);//   GetThisPointer<Connection>());
+       mTo.reset();
       }
     else 
       {
        bbtkInternalError("Connection::~Connection() : invalid final box pointer");
       }
-   mFrom.reset();
-    mTo.reset();
+
 
     bbtkDebugMessage("object",2,
                     "<== Connection::~Connection() ["
@@ -422,18 +420,19 @@ Connection::Connection(BlackBox::Pointer from, const std::string& output,
        bbtkMessage("debug",2," - From : Output '"<<mOutput
                    <<"' is in OutputConnectorMap"<<std::endl);
 
-        std::vector< Connection::WeakPointer >::const_iterator j;
+        std::vector< Connection* >::const_iterator j;
+       /*
        for (j  = i->second->GetConnectionVector().begin();
             j != i->second->GetConnectionVector().end();
             ++j)
          {
-           if ((*j).lock()==GetThisPointer<Connection>()) break;
+           if ((*j)==this) break;
          }
-       /*
+       */
        j = find(i->second->GetConnectionVector().begin(),
                 i->second->GetConnectionVector().end(),
-                GetThisPointer<Connection>());
-       */
+                this);
+       
        if (j==i->second->GetConnectionVector().end())
          {
            bbtkError("** Checking Connection "<<(void*)this
index c3c07f3acbe670aac30f141b98177385b8d73aee..31c486bb1fac0579a62944db1bb30849f195608b 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkMessageManager.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/04/22 08:29:09 $
-  Version:   $Revision: 1.7 $
+  Date:      $Date: 2008/04/22 14:30:25 $
+  Version:   $Revision: 1.8 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -65,7 +65,7 @@ namespace bbtk
     mMessageLevel[key] = 0;
     mMessageHelp[key] = "Data related messages";
     if (mMaxMessageLength<key.length()) mMaxMessageLength = key.length();
-    key = "Wx";
+    key = "wx";
     mMessageLevel[key] = 0;
     mMessageHelp[key] = "Widgets related messages";
     if (mMaxMessageLength<key.length()) mMaxMessageLength = key.length();
index 7ad8ad02785220d05bd598b69704a43d20ec1321..e186c7923a6b8342a768dcc99996ed0164c9324e 100644 (file)
@@ -21,19 +21,19 @@ namespace bbtk
   void Wx::ResetCursor() 
   {
     if (!GetTopWindow()) return;
-    bbtkDebugMessage("Wx",9,"wx::ResetCursor()"<<std::endl);
+    bbtkDebugMessage("wx",9,"wx::ResetCursor()"<<std::endl);
     while (wxIsBusy()) ::wxEndBusyCursor();
   }
   void Wx::BeginBusyCursor() 
   {
     if (!GetTopWindow()) return;
-    bbtkDebugMessage("Wx",9,"wx::BeginBusyCursor()"<<std::endl);
+    bbtkDebugMessage("wx",9,"wx::BeginBusyCursor()"<<std::endl);
     ::wxBeginBusyCursor();
   }
   void Wx::EndBusyCursor()
   {
     if (!GetTopWindow()) return;
-    bbtkDebugMessage("Wx",9,"wx::EndBusyCursor()"<<std::endl);
+    bbtkDebugMessage("wx",9,"wx::EndBusyCursor()"<<std::endl);
     ::wxEndBusyCursor();
   }
   
index b278488f23c0968d458130c1a9ca612ff0b5db39..be78a7ec853e3ef2197eee8218b4d9a80d4e7ae8 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkWxBlackBox.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/04/21 12:43:05 $
-  Version:   $Revision: 1.13 $
+  Date:      $Date: 2008/04/22 14:30:25 $
+  Version:   $Revision: 1.14 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -51,11 +51,11 @@ namespace bbtk
   WxBlackBoxWindow::WxBlackBoxWindow(WxBlackBox::Pointer box)
     : mBox(box), mShown(false)
   {
-    bbtkDebugMessage("Wx",9,"WxBlackBoxWindow::WxBlackBoxWindow("<<
-                    mBox->bbGetFullName()<<")"<<std::endl);
-    mBox->bbSetWindow(this);
+    bbtkDebugMessage("wx",9,"WxBlackBoxWindow::WxBlackBoxWindow("<<
+                    mBox.lock()->bbGetFullName()<<")"<<std::endl);
+    mBox.lock()->bbSetWindow(this);
     Wx::IncNbWindowsAlive();
-    bbtkDebugMessage("Wx",5," -> Number of windows alive = "
+    bbtkDebugMessage("wx",5," -> Number of windows alive = "
                     <<Wx::GetNbWindowsAlive()<<std::endl);
   }
   //=========================================================================
@@ -63,15 +63,19 @@ namespace bbtk
   //=========================================================================
   WxBlackBoxWindow::~WxBlackBoxWindow()
   {
-    bbtkDebugMessage("Wx",9,"WxBlackBoxWindow::~WxBlackBoxWindow() ["<<
-                    mBox->bbGetFullName()<<"]"<<std::endl);
+    bbtkDebugMessage("wx",9,"WxBlackBoxWindow::~WxBlackBoxWindow() "
+                    <<this<<std::endl);
     bbHide();
-    mBox->bbSetWindow(0);
     Wx::DecNbWindowsAlive();
-    bbtkDebugMessage("Wx",5," -> Number of windows alive = "
+    if (!mBox.expired())
+      {
+       mBox.lock()->bbSetWindow(0);
+      }
+    else 
+      {
+      }
+    bbtkDebugMessage("wx",5," -> Number of windows alive = "
                     <<Wx::GetNbWindowsAlive()<<std::endl);
-     
-
   }
   //========================================================================= 
 
@@ -80,11 +84,10 @@ namespace bbtk
   void WxBlackBoxWindow::bbShow()
   {
     if (bbIsShown()) return;
-    bbtkDebugMessage("Wx",9,"WxBlackBoxWindow::bbShow() ["<<
-                    mBox->bbGetFullName()<<"]"<<std::endl);
+    bbtkDebugMessage("wx",9,"WxBlackBoxWindow::bbShow()"<<std::endl);
     Wx::IncNbWindowsShown();
     mShown = true;
-    bbtkDebugMessage("Wx",5," -> Number of windows shown = "
+    bbtkDebugMessage("wx",5," -> Number of windows shown = "
                     <<Wx::GetNbWindowsShown()<<std::endl);
   }
   //=========================================================================
@@ -93,11 +96,10 @@ namespace bbtk
   void WxBlackBoxWindow::bbHide()
   {
     if (!bbIsShown()) return;
-    bbtkDebugMessage("Wx",9,"WxBlackBoxWindow::bbHide() ["<<
-                    mBox->bbGetFullName()<<"]"<<std::endl);
+    bbtkDebugMessage("wx",9,"WxBlackBoxWindow::bbHide()"<<std::endl);
     Wx::DecNbWindowsShown();
     mShown = false;
-    bbtkDebugMessage("Wx",5," -> Number of windows shown = "
+    bbtkDebugMessage("wx",5," -> Number of windows shown = "
                     <<Wx::GetNbWindowsShown()<<std::endl);
   }
   //=========================================================================
@@ -128,7 +130,7 @@ namespace bbtk
                wxCAPTION  
                )
   {
-    bbtkDebugMessage("Wx",9,"WxBlackBoxDialog::WxBlackBoxDialog("<<
+    bbtkDebugMessage("wx",9,"WxBlackBoxDialog::WxBlackBoxDialog("<<
                     bbGetBlackBox()->bbGetFullName()<<","<<parent<<","
                     <<title<<",size)"<<std::endl);
     // Insert the widget into the window
@@ -145,7 +147,7 @@ namespace bbtk
   //=========================================================================
   void WxBlackBoxDialog::bbShow()
   { 
-    bbtkDebugMessage("Wx",5,"WxBlackBoxDialog::bbShow() ["
+    bbtkDebugMessage("wx",5,"WxBlackBoxDialog::bbShow() ["
                     <<bbGetBlackBox()->bbGetFullName()<<"]"<<std::endl);
     WxBlackBoxWindow::bbShow();
     SetReturnCode( wxDialog::ShowModal() ); 
@@ -155,8 +157,7 @@ namespace bbtk
   //=========================================================================
   void WxBlackBoxDialog::bbHide()
   {
-    bbtkDebugMessage("Wx",9,"WxBlackBoxDialog::bbHide() ["<<
-                    bbGetBlackBox()->bbGetFullName()<<"]"<<std::endl);
+    bbtkDebugMessage("wx",9,"WxBlackBoxDialog::bbHide()"<<std::endl);
     WxBlackBoxWindow::bbHide();
     Hide();
   }
@@ -195,7 +196,7 @@ namespace bbtk
               wxCAPTION  
               )
   {
-    bbtkDebugMessage("Wx",9,"WxBlackBoxFrame::WxBlackBoxFrame("<<
+    bbtkDebugMessage("wx",9,"WxBlackBoxFrame::WxBlackBoxFrame("<<
                     bbGetBlackBox()->bbGetFullName()<<","<<parent<<","
                     <<title<<",size)"<<std::endl);
     // Insert the widget into the window
@@ -220,7 +221,7 @@ namespace bbtk
   //=========================================================================
   void WxBlackBoxFrame::bbShow() 
   { 
-    bbtkDebugMessage("Wx",5,"WxBlackBoxFrame::bbShow("
+    bbtkDebugMessage("wx",5,"WxBlackBoxFrame::bbShow("
                     <<bbGetBlackBox()->bbGetFullName()<<")"<<std::endl);
     WxBlackBoxWindow::bbShow();
     wxFrame::Show();
@@ -228,7 +229,7 @@ namespace bbtk
     // to synchronize wxvtkRenderWindowInteractor objects
     // (force wx objects creation **NOW**)
     wxFrame::Update();
-    bbGetBlackBox()->bbUserOnShow();
+    if (bbGetBlackBox()) bbGetBlackBox()->bbUserOnShow();
     //    wxFrame::SetFocus();
   }
   //=========================================================================
@@ -236,86 +237,13 @@ namespace bbtk
   //=========================================================================
   void WxBlackBoxFrame::bbHide()
   {
-    bbtkDebugMessage("Wx",9,"WxBlackBoxFrame::bbHide() ["<<
-                    bbGetBlackBox()->bbGetFullName()<<"]"<<std::endl);
+    bbtkDebugMessage("wx",9,"WxBlackBoxFrame::bbHide()"<<std::endl);
     WxBlackBoxWindow::bbHide();
     wxFrame::Hide();
-    bbGetBlackBox()->bbUserOnHide();
-  }
-  //=========================================================================
-
-
-
-  //=========================================================================
-  // WxBlackBoxDialogWrapper
-  //=========================================================================
-  /*
-  //=========================================================================
-  WxBlackBoxDialogWrapper::WxBlackBoxDialogWrapper(WxBlackBox* box,
-                                                  wxDialog *wrapped) 
-    : WxBlackBoxWindow(box),
-      mWrapped(wrapped) 
-  {
-    bbtkDebugMessage("Wx",9,
-                    "WxBlackBoxDialogWrapper::WxBlackBoxDialogWrapper("
-                    <<bbGetBlackBox()->bbGetFullName()<<","<<wrapped
-                    <<")"<<std::endl);
-  }
-  //=========================================================================
-
-  //=========================================================================
-  WxBlackBoxDialogWrapper::~WxBlackBoxDialogWrapper()
-  {
-  }
-  //=========================================================================
-
-  //=========================================================================
-  void WxBlackBoxDialogWrapper::bbShow() 
-  {  
-    bbtkDebugMessage("Wx",5,"WxBlackBoxDialogWrapper::bbShow("
-                    <<bbGetBlackBox()->bbGetFullName()<<")"<<std::endl);
-    WxBlackBoxWindow::bbShow();
-    int i = mWrapped->ShowModal();
-    // For Windows :
-    mWrapped->SetReturnCode( i ); 
-  }
-  //=========================================================================
-
-  //=========================================================================
-  void WxBlackBoxDialogWrapper::bbHide()
-  {
-    bbtkDebugMessage("Wx",9,"WxBlackBoxDialogWrapper::bbHide() ["<<
-                    bbGetBlackBox()->bbGetFullName()<<"]"<<std::endl);
-    WxBlackBoxWindow::bbHide();
-    mWrapped->Hide();
+    if (bbGetBlackBox()) bbGetBlackBox()->bbUserOnHide();
   }
   //=========================================================================
 
-  */
-
-  /*    
-  //=========================================================================
-  // WxBlackBoxWidget
-  //=========================================================================
-
-  //=========================================================================
-  WxBlackBoxWidget::WxBlackBoxWidget( WxBlackBox* box)
-  : mBox(box)
-  {
-    bbtkDebugMessage("Wx",9,"WxBlackBoxWidget::WxBlackBoxWidget("<<box->bbGetFullName()<<")"<<std::endl);
-    mBox->bbSetWidget(this);
-  }
-  //=========================================================================
-
-  //=========================================================================
-  WxBlackBoxWidget::~WxBlackBoxWidget()
-  {
-    bbtkDebugMessage("Wx",9,"WxBlackBoxWidget::~WxBlackBoxWidget("<<mBox->bbGetFullName()<<")"<<std::endl);
-    mBox->bbSetWidget(0);
-    //bbtkDebugMessage("Wx",9,"EO WxBlackBoxWidget::~WxBlackBoxWidget("<<mBox->bbGetFullName()<<")"<<std::endl);
-  }
-  //=========================================================================
-  */
 
 
 
@@ -330,11 +258,10 @@ namespace bbtk
     :
     mBox(box),
     mWindow(widget)
-                                                           //    mDead(false)
   { 
-    bbtkDebugMessage("Wx",9,"WxBlackBoxWidgetEventHandler::WxBlackBoxWidgetEventHandler("<<mBox->bbGetFullName()<<")"<<std::endl);
+    bbtkDebugMessage("wx",9,"WxBlackBoxWidgetEventHandler::WxBlackBoxWidgetEventHandler("<<mBox.lock()->bbGetFullName()<<")"<<std::endl);
 
-    mBox->bbSetWidgetEventHandler(this);
+    mBox.lock()->bbSetWidgetEventHandler(this);
 
     Connect (  mWindow->GetId(),
               wxEVT_DESTROY,
@@ -350,22 +277,22 @@ namespace bbtk
   //=========================================================================
   WxBlackBoxWidgetEventHandler::~WxBlackBoxWidgetEventHandler()
   {
-    bbtkDebugMessage("Wx",9,
-                    "WxBlackBoxWidgetEventHandler::~WxBlackBoxWidgetEventHandler("
-                    <<mBox->bbGetFullName()<<")"<<std::endl);
-     mBox->bbSetWidgetEventHandler(0);   
+    if (mBox.expired()) return;
+    bbtkDebugMessage("wx",9,
+                    "WxBlackBoxWidgetEventHandler::~WxBlackBoxWidgetEventHandler() ["
+                    <<mBox.lock()->bbGetFullName()<<"]"<<std::endl);
+     mBox.lock()->bbSetWidgetEventHandler(0);   
   }
   //=========================================================================
 
   //=========================================================================
   void WxBlackBoxWidgetEventHandler::OnWindowDestroy(wxWindowDestroyEvent&)
   {
-    bbtkDebugMessage("Wx",9,"WxBlackBoxWidgetEventHandler::OnWindowDestroy() ["
-                    <<mBox->bbGetFullName()<<"]"<<std::endl);
-    mBox->bbSetOutputWidget(0);
-    mBox->bbSetModifiedStatus();
-    //mDead = true;
-    //delete this;
+    if (mBox.expired()) return;
+    bbtkDebugMessage("wx",9,"WxBlackBoxWidgetEventHandler::OnWindowDestroy() ["
+                    <<mBox.lock()->bbGetFullName()<<"]"<<std::endl);
+    mBox.lock()->bbSetOutputWidget(0);
+    mBox.lock()->bbSetModifiedStatus();
   }
   //=========================================================================
 
@@ -375,46 +302,6 @@ namespace bbtk
 
 
 
-  /*
-  //=========================================================================
-  wxWindow* WxParentToChildData::GetWindowInWhichToInsert( const BlackBox* b)
-    const
-  {
-    bbtkDebugMessageInc("Kernel",9,"WxParentToChildData::GetWindowInWhichToInsert("<<b->bbGetFullName()<<")"<<std::endl);
-    
-    BlackBox::InputConnectorMapType::const_iterator i = b->bbGetInputConnectorMap().find("WinParent");
-    if (i==b->bbGetInputConnectorMap().end())
-      {
-       bbtkError("WxParentToChildData::GetWindowInWhichToInsert : the box "
-                 <<b->bbGetFullName()
-                 <<" does not have any 'Parent' input ?!?");
-      }
-    Connection* c = i->second->GetConnection();
-    if (!c) 
-      {
-       bbtkDebugMessage("Kernel",9,
-                        "-> The input 'Parent' of the box "
-                        <<b->bbGetFullName()
-                        <<" is not connected."<<std::endl);
-       return 0;
-      }
-    
-    std::map< Connection*, wxWindow *>::const_iterator j 
-      = mConnectionToWindowMap.find(c);
-
-    if (j==mConnectionToWindowMap.end())
-      {
-       bbtkError("WxParentToChildData::GetWindowInWhichToInsert("
-                 <<b->bbGetFullName()
-                 <<") no window provided by parent ?!?");
-      }
-
-    bbtkDebugDecTab("Kernel",9);
-    return j->second;
-  }
-  //=========================================================================
-  */
-  
   //=========================================================================
   // WxBlackBox
   //=========================================================================
@@ -447,12 +334,12 @@ namespace bbtk
   //=========================================================================
   void WxBlackBox::bbUserDestructor()
   {
-    bbtkDebugMessage("Kernel",9,"WxBlackBox::bbUserDestructor()"<<std::endl);
+    bbtkDebugMessage("wx",9,"==> WxBlackBox::bbUserDestructor() ["<<bbGetFullName()<<"]"<<std::endl);
     if (bbGetWindow()) {
       delete bbGetWindow();
-      //      bbSetWindow(0);
+      bbSetWindow(0);
     }
-    bbtkDebugMessage("Kernel",9,"EO WxBlackBox::bbUserDestructor()"<<std::endl);
+    bbtkDebugMessage("wx",9,"<== WxBlackBox::bbUserDestructor() ["<<bbGetFullName()<<"]"<<std::endl);
   }
   //=========================================================================
   
@@ -463,7 +350,7 @@ namespace bbtk
   { 
     if (bbGetOutputWidget() && bbGetOutputWidget()->IsDead()) 
       {
-       bbtkDebugMessage("Wx",9,"WxBlackBox::bbGetWidget() ["<<
+       bbtkDebugMessage("wx",9,"WxBlackBox::bbGetWidget() ["<<
                         bbGetFullName()<<"] : Widget is dead : deleting it"
                         <<std::endl);
        delete bbGetOutputWidget();
@@ -514,7 +401,7 @@ namespace bbtk
                         "-> Output 'Widget' connected : transfering execution to parent"
                         <<std::endl);
        
-       i->second->GetConnectionVector().front().lock()
+       i->second->GetConnectionVector().front() //.lock()
          ->GetBlackBoxTo()->bbExecute(force);
 
       }
@@ -567,7 +454,7 @@ namespace bbtk
            else 
              {
                bbSetUpdateTransferedToParent(true);
-               i->second->GetConnectionVector().front().lock()
+               i->second->GetConnectionVector().front() //.lock()
                  ->GetBlackBoxTo()->bbExecute(false);
              }
          }
@@ -734,8 +621,8 @@ namespace bbtk
     if ( i->second->GetConnectionVector().size() != 0 ) 
       {
        return boost::static_pointer_cast<WxBlackBox>
-         (i->second->GetConnectionVector().front().lock()->GetBlackBoxTo())
-         ->bbGetContainingWindow();
+         (i->second->GetConnectionVector().front() //.lock()
+          ->GetBlackBoxTo())->bbGetContainingWindow();
       }
     return 0;
   }
index 619632306e42a3fc23676fef1a1f609a3ea5d6f9..9b22db3c6d65bb079b2c3b77f21fb9d7526ef2ff 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkWxBlackBox.h,v $
   Language:  C++
-  Date:      $Date: 2008/04/21 12:43:05 $
-  Version:   $Revision: 1.12 $
+  Date:      $Date: 2008/04/22 14:30:25 $
+  Version:   $Revision: 1.13 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -193,7 +193,6 @@ namespace bbtk
     void bbSetUpdateTransferedToParent(bool b) 
     { bbmUpdateTransferedToParent = b; }
 
-
   };
   //=================================================================
  
@@ -252,11 +251,11 @@ namespace bbtk
     virtual void bbShow();
     virtual void bbHide();
     bool bbIsShown() { return mShown; }
-    virtual WxBlackBox::Pointer bbGetBlackBox() { return mBox; }
+    virtual WxBlackBox::Pointer bbGetBlackBox() { return mBox.lock(); }
     virtual wxDialog* bbGetDialog() { return 0; } 
     virtual wxFrame* bbGetFrame() { return 0; } 
   private:
-    WxBlackBox::Pointer mBox;
+    WxBlackBox::WeakPointer mBox;
     bool mShown;
   };
   //==================================================================
@@ -310,7 +309,7 @@ namespace bbtk
     //bool IsDead() { return mDead; }
 
   private:
-    WxBlackBox::Pointer mBox;
+    WxBlackBox::WeakPointer mBox;
     wxWindow* mWindow;
     //bool mDead;
   };  
index a4d4299144b6067fbe87626fe27f4bcb86bfc276..3659fa97f2711159291a614f0d97e57cc443733c 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkWxGUIConsole.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/04/18 12:59:16 $
-  Version:   $Revision: 1.6 $
+  Date:      $Date: 2008/04/22 14:30:25 $
+  Version:   $Revision: 1.7 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -67,6 +67,7 @@ namespace bbtk
        mInterpreter = bbtk::Interpreter::New();
     mInterpreter->SetUser(this);
     mInterpreter->SetCommandLine(true);
+    mInterpreter->SetThrow(false);
     //==============
     // Menu
     wxInitAllImageHandlers();
index 8fd20ab8aabc346ed71a6460097e2a09ad93a926..6e474755eedae40cdc0c38055617dfa7c8aeed7b 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkWxGUIHtmlBrowser.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/03/25 06:22:53 $
-  Version:   $Revision: 1.4 $
+  Date:      $Date: 2008/04/22 14:30:25 $
+  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
@@ -180,8 +180,6 @@ namespace bbtk
   //========================================================================
   bool WxGUIHtmlBrowser::GoTo(std::string& file)
   { 
-    //  std::cout << "goto"<<std::endl;
-
     bool r = mwxHtmlWindow->LoadPage(std2wx(file));
     UpdateURL();
     return r;
@@ -191,7 +189,6 @@ namespace bbtk
   //========================================================================
   void WxGUIHtmlBrowser::OnBackButton(wxCommandEvent& )
   {
-    //    std::cout << "back"<<std::endl;
     mwxHtmlWindow->HistoryBack();
     UpdateURL();
   }
@@ -200,7 +197,6 @@ namespace bbtk
   //========================================================================
   void WxGUIHtmlBrowser::OnForwardButton(wxCommandEvent& )
   {
-    //    std::cout << "forward"<<std::endl;
     mwxHtmlWindow->HistoryForward();
     UpdateURL();
   }
index b7745ad0d43c0997ebcc10052f4abdf30d32508b..fb9c681cdf8217fcdcf8d360ae809a229c395d62 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkWxGUIScriptingInterface.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/04/18 12:59:16 $
-  Version:   $Revision: 1.5 $
+  Date:      $Date: 2008/04/22 14:30:25 $
+  Version:   $Revision: 1.6 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -295,7 +295,7 @@ namespace bbtk
        commandStr = "gedit ";
 #endif 
        commandStr = commandStr + configFile;
-       std::cout << "system: " << commandStr << std::endl;
+       //      std::cout << "system: " << commandStr << std::endl;
        system ( commandStr.c_str() );
   }
   //================================================================
@@ -337,7 +337,7 @@ namespace bbtk
     std::string strappli="gnome-open ";
 #endif
     std::string strcommand = strappli +default_temp_dir+"/temp_dir/workspace_workspacePrototype.png";
-       std::cout << "system: " << strcommand << std::endl;
+    // std::cout << "system: " << strcommand << std::endl;
     system ( strcommand.c_str() );
 
   }
@@ -383,7 +383,6 @@ namespace bbtk
   //================================================================  
   bool WxGUIScriptingInterface::WxGUIHtmlBrowserUserOnLinkClicked(const std::string& target)
   {
-    std::cout << "OnLink"<<std::endl; 
     size_t s = target.length();
     if ((s>3) && (target[s-1]=='s')
        && (target[s-2]=='b')
index b489c32c0119dad0cd5f937d7908c851356a4bfa..2d309d5c3ca5aa851f8cbe3bc0b64219a5e049af 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkWxGUITextEditor.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/04/04 08:04:05 $
-  Version:   $Revision: 1.8 $
+  Date:      $Date: 2008/04/22 14:30:25 $
+  Version:   $Revision: 1.9 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -171,8 +171,8 @@ namespace bbtk
   //================================================================
   void WxGUITextEditorPage::Load(const std::string& filename)
   {
-    std::cout << "-------------- LOAD ---------------"<<std::endl;
-    std::cout << "'" << filename << "'"<<std::endl;
+    //    std::cout << "-------------- LOAD ---------------"<<std::endl;
+    //    std::cout << "'" << filename << "'"<<std::endl;
     //std::string oldFilename = mFilename;
     mName = filename;
     mAskFilename = false;
@@ -183,7 +183,7 @@ namespace bbtk
   //================================================================
   void WxGUITextEditorPage::Save(const std::string& filter)
   {
-    std::cout << "-------------- SAVE ---------------"<<std::endl;
+    //    std::cout << "-------------- SAVE ---------------"<<std::endl;
     if (mAskFilename)
       {
        wxFileDialog* fd = new wxFileDialog(this,_T("Save file"),_T(""),
@@ -198,12 +198,12 @@ namespace bbtk
          }
        else 
          {
-           std::cout << "-------------- CANCELLED ---------------"
-                     <<std::endl;
+           //      std::cout << "-------------- CANCELLED ---------------"
+           //                <<std::endl;
            return;
          } 
       }
-    std::cout << "file [" << mName << "]" <<std::endl;
+    //    std::cout << "file [" << mName << "]" <<std::endl;
     mwxInputText->SaveFile(std2wx(mName));
     mwxInputText->SetModified(false);
   }
@@ -216,7 +216,7 @@ namespace bbtk
       mUser(user),
       mFileNameFilter("*.*")
   {
-    std::cout << "WxGUITextEditor::WxGUITextEditor"<<std::endl;
+    //    std::cout << "WxGUITextEditor::WxGUITextEditor"<<std::endl;
     //    mInterpreter = new bbtk::Interpreter();
     //mInterpreter->SetWxGUITextEditor(this);
     //  mInterpreter->SetCommandLine(true);
@@ -360,7 +360,7 @@ namespace bbtk
   } 
   void WxGUITextEditor::Open()
   {
-    std::cout << "-------------- OPEN ---------------"<<std::endl;
+    //    std::cout << "-------------- OPEN ---------------"<<std::endl;
 
     wxFileDialog* fd = new wxFileDialog(this,_T("Open file"),_T(""),
                                        _T(""),std2wx(mFileNameFilter),
@@ -375,7 +375,7 @@ namespace bbtk
       }
     else 
       {
-       std::cout << "-------------- CANCELLED ---------------"<<std::endl;
+       //      std::cout << "-------------- CANCELLED ---------------"<<std::endl;
       }
   }
   //================================================================  
@@ -398,7 +398,7 @@ namespace bbtk
   //================================================================  
   bool WxGUITextEditor::CloseCurrentPage()
   {
-    std::cout << "-------------- CLOSE ---------------"<<std::endl;
+    //    std::cout << "-------------- CLOSE ---------------"<<std::endl;
     if (mwxNotebook->GetPageCount()==0) return true;
     if (GetCurrentPage()->IsModified()) 
       {
@@ -468,7 +468,7 @@ namespace bbtk
   //================================================================  
   void WxGUITextEditor::OnPageClose(wxAuiNotebookEvent& evt)
   {
-    std::cout << "-------------- CLOSE ---------------"<<std::endl;
+    //    std::cout << "-------------- CLOSE ---------------"<<std::endl;
     if (!CloseCurrentPage()) evt.Veto();
 
     /*
@@ -558,7 +558,7 @@ namespace bbtk
   }
   void WxGUITextEditor::New()
   {
-    std::cout << "-------------- NEW ---------------" << std::endl;
+    ///    std::cout << "-------------- NEW ---------------" << std::endl;
     NewPage("");
     UpdateInfo();
   }