]> Creatis software - bbtk.git/commitdiff
BUG 1546 Temporary Picker Sync
authorEduardo Davila <Eduardo.Davila@creatis.insa-lyon.fr>
Thu, 26 Jul 2012 08:28:29 +0000 (08:28 +0000)
committerEduardo Davila <Eduardo.Davila@creatis.insa-lyon.fr>
Thu, 26 Jul 2012 08:28:29 +0000 (08:28 +0000)
FEAUTURE  1544 BoxProcessMode new mode Manual

FEAUTURE  new version v0_9_7

kernel/cmake/BBTKVersion.cmake
kernel/src/bbtkAtomicBlackBoxDescriptor.cxx
kernel/src/bbtkBlackBox.cxx
kernel/src/bbtkBlackBox.h
packages/vtk/src/bbvtkTemporalPicker.cxx

index da59a828ab5f53fadcaff4536a0b30cf515c0c27..29a5a932745f0d5ffcf66ff942aed43440c097d4 100644 (file)
@@ -3,7 +3,7 @@
 SET(BBTK_VERSION_DATE "19/03/2010")
 SET(BBTK_MAJOR_VERSION 0)
 SET(BBTK_MINOR_VERSION 9)
-SET(BBTK_BUILD_VERSION 6)
+SET(BBTK_BUILD_VERSION 7)
 SET(BBTK_VERSION 
   "${BBTK_MAJOR_VERSION}.${BBTK_MINOR_VERSION}.${BBTK_BUILD_VERSION}")
 # Now in bbtkConfigure.h file (cf. core/src)
index d1bb205664728413a8194e3bad98981e0ab6acb4..e31cca495e38a833b13c66deb529b07904ebba2b 100644 (file)
@@ -2,8 +2,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkAtomicBlackBoxDescriptor.cxx,v $
   Language:  C++
-  Date:      $Date: 2009/05/28 08:12:05 $
-  Version:   $Revision: 1.4 $
+  Date:      $Date: 2012/07/26 08:28:31 $
+  Version:   $Revision: 1.5 $
 =========================================================================*/
 
 /* ---------------------------------------------------------------------
@@ -47,7 +47,7 @@ namespace bbtk
        bbtk::AtomicBlackBoxInputDescriptor
        (typeid(AtomicBlackBoxDescriptor),
        "BoxProcessMode",
-       "Sets the processing mode of the box (Pipeline | Always | Reactive)",
+       "Sets the processing mode of the box (Pipeline | Always | Reactive | Manual)",
        "",
        new bbtk::AtomicBlackBoxTGetFunctor<BlackBox,std::string,std::string>(&BlackBox::bbGetInputBoxProcessMode), 
        new bbtk::AtomicBlackBoxTSetFunctor<BlackBox,std::string,std::string>(&BlackBox::bbSetInputBoxProcessMode) ) );
index dfdf6e5df63861b3c353e71d6e289b6e20ffdedd..a249bfc79f9193fadebce4d7d02e4aa71054c0bc 100644 (file)
@@ -2,8 +2,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkBlackBox.cxx,v $
   Language:  C++
-  Date:      $Date: 2011/07/22 17:42:50 $
-  Version:   $Revision: 1.54 $
+  Date:      $Date: 2012/07/26 08:28:31 $
+  Version:   $Revision: 1.55 $
 =========================================================================*/
 
 /* ---------------------------------------------------------------------
@@ -109,6 +109,7 @@ namespace bbtk
     bbmExecuting(false),
     bbmName(name),
     bbmBoxProcessMode("Pipeline"),
+       bbLetRecursiveExecuteManualMode(false),
     bbmParent()
     
   {
@@ -135,6 +136,7 @@ namespace bbtk
     bbmExecuting(false),
     bbmName(name), 
     bbmBoxProcessMode(from.bbmBoxProcessMode),
+       bbLetRecursiveExecuteManualMode(false),
     bbmParent()
     
   {
@@ -378,13 +380,19 @@ namespace bbtk
         (p == "F") || (p == "f") ||
         (p == "Flash") || (p == "flash") ) return Flash;
     */
-    bbtkError(bbGetFullName()<<" : BoxProcessMode value '"<<p
+
+         if ( (p == "3") ||
+          (p == "M") || (p == "m") ||
+          (p == "Manual") || (p == "manual") ) return bbManual;
+         
+         bbtkError(bbGetFullName()<<" : BoxProcessMode value '"<<p
              <<"' unknown. Possible values : "
              <<"'0'/'P'/'p'/'Pipeline'/'pipeline' | "
              <<"'1'/'A'/'a'/'Always'/'always' | "
              <<"'2'/'R'/'r'/'Reactive'/'reactive'"
              //      <<"'3'/'F'/'f'/'Flash'/'flash'"
-             <<std::endl);
+             <<"'3'/'M'/'m'/'Manual'/'manual'"
+                 <<std::endl);
   }
   //=========================================================================
   
@@ -403,7 +411,13 @@ namespace bbtk
   //=========================================================================
 
 
-
+       //=========================================================================
+       bool  BlackBox::bbBoxProcessModeIsManual() const
+       {
+               return (bbGetBoxProcessModeValue() == bbManual);
+       }
+       //=========================================================================
+       
 
   //=========================================================================
   void BlackBox::bbAddOutputObserver(const std::string& output, 
@@ -619,9 +633,22 @@ namespace bbtk
     // If force is true then update is triggered even if the box is UPTODATE
     //    if (force) bbSetModifiedStatus();
 
+       if ( bbBoxProcessModeIsManual() ) 
+       {
+               bbLetRecursiveExecuteManualMode = true;
+    }
+         
+         
     // Calls the main recursive execution method 
     bbRecursiveExecute(Connection::Pointer());
 
+         
+       if ( bbBoxProcessModeIsManual() ) 
+       {
+               bbLetRecursiveExecuteManualMode = false;
+       }
+         
+         
     bbtkBlackBoxDebugMessage("process",2,
                             "<= BlackBox::bbExecute()"
                             <<std::endl);
@@ -682,20 +709,40 @@ namespace bbtk
     this->bbCreateWindow();
     
     // Updates its inputs
-    IOStatus s = bbUpdateInputs();
-    
-    if ( (s != UPTODATE) ||
-        bbBoxProcessModeIsAlways() )
+         
+//       IOStatus s;
+         IOStatus s=UPTODATE;
+//       IOStatus s=OUTOFDATE;
+//       IOStatus s=MODIFIED;
+         
+         
+         if ( ( bbBoxProcessModeIsManual()==false )  || 
+                  ( (bbBoxProcessModeIsManual()==true) && (bbLetRecursiveExecuteManualMode==true) ) )
+         {
+                 s = bbUpdateInputs();
+         }       
+                 
+    if ( (s != UPTODATE) ||  bbBoxProcessModeIsAlways() )
       {
          // Displays the window (WxBlackbox)
          //    bbShowWindow(caller);
 
          // Actual processing (virtual)
-         this->bbProcess();
-       
-       
-         // Update the I/O statuses
-         bbComputePostProcessStatus();
+                 if ( ( bbBoxProcessModeIsManual()==false )  || 
+                          ( (bbBoxProcessModeIsManual()==true)&&(bbLetRecursiveExecuteManualMode==true) ) 
+                        )
+                       {
+                               this->bbProcess();              
+                   } // Manual analysis
+                 
+//EED ups                      if ((bbBoxProcessModeIsManual()==true) && (bbLetRecursiveExecuteManualMode==false))
+//EED ups                      {
+//EED ups                        bbSignalOutputModification(true);
+//EED ups                      }
+                 
+                 
+                 // Update the I/O statuses
+                 bbComputePostProcessStatus();
       }
     else 
       {
@@ -809,7 +856,19 @@ namespace bbtk
     for ( o = bbGetOutputConnectorMap().begin(); 
          o!= bbGetOutputConnectorMap().end(); ++o) 
       {
-       o->second->SetStatus(new_output_status);
+               
+//EED            if  ( ( bbBoxProcessModeIsManual()==false )  || 
+//EED                      ( (bbBoxProcessModeIsManual()==true) && (bbLetRecursiveExecuteManualMode==true) ) 
+//EED                    )
+//EED            {
+                         o->second->SetStatus(new_output_status);
+//EED            }  else  {
+//EED                    if  (( (bbBoxProcessModeIsManual()==true) && (bbLetRecursiveExecuteManualMode==false) )  ) 
+//EED                    {
+//EED                            o->second->SetStatus(UPTODATE);
+//EED                    }
+//EED            } // Manual analysis
+                         
       }
 
     bbtkBlackBoxDebugMessage("process",4,
index 939b5f8d56d9e3138327ae2ba25a40a2005a48bf..8fd1c2e969df77c0a3675807943c07c0546efbbd 100644 (file)
@@ -2,8 +2,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkBlackBox.h,v $
   Language:  C++
-  Date:      $Date: 2011/03/03 14:33:13 $
-  Version:   $Revision: 1.32 $
+  Date:      $Date: 2012/07/26 08:28:31 $
+  Version:   $Revision: 1.33 $
 =========================================================================*/
 
 /* ---------------------------------------------------------------------
@@ -298,7 +298,8 @@ namespace bbtk
      {
       bbPipeline,
       bbAlways,
-      bbReactive
+      bbReactive,
+         bbManual
      }
     BoxProcessModeValue;
     
@@ -308,16 +309,18 @@ namespace bbtk
     virtual bool bbBoxProcessModeIsReactive() const;
     /// Returns true iff the input 'BoxProcessMode' is set to 'Always' (or a synonym)
     virtual bool bbBoxProcessModeIsAlways() const;
+       /// Returns true iff the input 'BoxProcessMode' is set to 'Manual' (or a synonym)
+       virtual bool bbBoxProcessModeIsManual() const;
 
     /// Returns the value of the input 'BoxExecute'
     Void bbGetInputBoxExecute() { return Void(); }
     /// Sets the value of the input 'BoxExecute'
-    void bbSetInputBoxExecute(Void = 0) {}
+         void bbSetInputBoxExecute(Void = 0) {  }
 
     /// Returns the value of the output 'BoxChange'
     Void bbGetOutputBoxChange() { return Void(); }
     /// Sets the value of the output 'BoxChange'
-    void bbSetOutputBoxChange(Void = 0) { }
+    void bbSetOutputBoxChange(Void = 0) {  }
     //@}
     //==================================================================
 
@@ -642,6 +645,7 @@ namespace bbtk
     /// 0 : "Pipeline" mode
     /// 1 : "Always" mode
     /// 2 : "Reactive" mode
+       /// 3 : "Manual" mode
     std::string bbmBoxProcessMode;
     /// The parent of the black box in the ComplexBlackBox hierarchy
     BlackBox::WeakPointer bbmParent;
@@ -655,6 +659,9 @@ namespace bbtk
     ///  Map that contains the input connectors of the black box
     InputConnectorMapType mInputConnectorMap;
     //==================================================================
+         
+         
+         bool bbLetRecursiveExecuteManualMode;
  };
   // Class BlackBox
 
index a5af484804c25a75a32085755328035a8f7b92d3..933e2b2ca78d4d27b7016d4c1eba28f32a528203 100644 (file)
@@ -40,7 +40,9 @@ void TemporalPicker::Process()
                if (bbGetInputPoint().size()>=2)
                {
                        int px=bbGetInputPoint()[0];
-                       int py=bbGetInputPoint()[1]; 
+                       int py=bbGetInputPoint()[1];
+                       int pz=bbGetInputPoint()[2];
+                       
                        if ((px>=0) && (px<sizeX)  && (py>=0) && (py<sizeY) )
                        {
                                int i,j,k;
@@ -75,14 +77,13 @@ void TemporalPicker::Process()
                                        
                                } // for k
                        } // px py
-                       
                } else {// bbGetInputPoint
                        printf("ERROR:  Input:Point is not good defined in TemporalPicker Box..\n ");
                } // bbGetInputPoint
        } else {// bbGetInputIn
                printf("ERROR:  Missing Input:In vtkImageData* in TemporalPicker Box..\n ");
        } // bbGetInputIn
-               
+
        bbSetOutputOut(result);
 }
 //=====