]> Creatis software - bbtk.git/blobdiff - kernel/src/bbtkConnection.h
*** empty log message ***
[bbtk.git] / kernel / src / bbtkConnection.h
index 47c8e92a0da593a0e1d9eab6ccb190f7ae642456..f69695f112cb749bb4725909af89a3b75e5fdd77 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkConnection.h,v $
   Language:  C++
-  Date:      $Date: 2008/04/08 06:59:30 $
-  Version:   $Revision: 1.4 $
+  Date:      $Date: 2008/04/09 11:16:57 $
+  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
@@ -75,6 +75,15 @@ namespace bbtk
     virtual void SetModifiedStatus();
     std::string GetFullName() const; 
 
+    /// Returns the original initial black box of the connection
+    BlackBox* GetOriginalBlackBoxFrom() const { return mOriginalFrom; }
+    /// Returns the origianl final black box of the connection
+    BlackBox* GetOriginalBlackBoxTo() const { return mOriginalTo; }
+    /// Returns the original output of the initial black box of the connection
+    const std::string& GetOriginalBlackBoxFromOutput() const { return mOriginalOutput; }
+    /// Returns the original input of the final black box of the connection
+    const std::string& GetOriginalBlackBoxToInput() const { return mOriginalInput; }
+
     /// Returns the initial black box of the connection
     BlackBox* GetBlackBoxFrom() const { return mFrom; }
     /// Returns the final black box of the connection
@@ -84,19 +93,33 @@ namespace bbtk
     /// Returns the input of the final black box of the connection
     const std::string& GetBlackBoxToInput() const { return mInput; }
 
+    /// Sets the initial black box of the connection
+    void SetBlackBoxFrom(BlackBox* b) { mFrom = b; }
+    /// Sets the final black box of the connection
+    void SetBlackBoxTo(BlackBox* b) { mTo = b; }
     /// Sets the output of the initial black box of the connection
     void SetBlackBoxFromOutput(const std::string& o) { mOutput = o; }
+    /// Sets the input of the final black box of the connection
+    void SetBlackBoxToInput(const std::string& o) { mInput = o; }
+
+    /// Checks that the connection is ok (throws error if not)
+    void Check() const;
+    
   protected:
     /// Black box origin of the connection
     BlackBox* mFrom;
+    BlackBox* mOriginalFrom;
     /// Output of mFrom which is connected
     std::string mOutput;
+    std::string mOriginalOutput;
     /// Output connector of mFrom which is connected
     //  BlackBoxOutputConnector* mOutputConnector;
     /// Black box destination of the connection
     BlackBox* mTo;
+    BlackBox* mOriginalTo;
     /// Input of mTo which is connected
     std::string mInput;
+    std::string mOriginalInput;
     /// Input connector of mTo which is connected
     //  BlackBoxInputConnector* mInputConnector;
     /// Adaptor black box if needed