Manta Interactive Ray Tracer Development Mailing List

Text archives Help


[MANTA] r922 - in trunk/fox/afr_demo/Engine: Control ImageTraversers


Chronological Thread 
  • From: abhinav@sci.utah.edu
  • To: manta@sci.utah.edu
  • Subject: [MANTA] r922 - in trunk/fox/afr_demo/Engine: Control ImageTraversers
  • Date: Thu, 9 Feb 2006 19:24:23 -0700 (MST)

Author: abhinav
Date: Thu Feb  9 19:24:21 2006
New Revision: 922

Modified:
   trunk/fox/afr_demo/Engine/Control/AFRPipeline.cc
   trunk/fox/afr_demo/Engine/ImageTraversers/GSTAFRImageTraverser.cc
Log:
added imagedisplay to the inner loop that refreshes image after every chunk.



Modified: trunk/fox/afr_demo/Engine/Control/AFRPipeline.cc
==============================================================================
--- trunk/fox/afr_demo/Engine/Control/AFRPipeline.cc    (original)
+++ trunk/fox/afr_demo/Engine/Control/AFRPipeline.cc    Thu Feb  9 19:24:21 
2006
@@ -55,6 +55,7 @@
 #include <Interface/SetupCallback.h>
 #include <Interface/UserInterface.h>
 #include <Interface/ShadowAlgorithm.h>
+#include <Model/Cameras/AFRCamera.h>
 #include <Core/Containers/StringUtil.h>
 #include <Core/Exceptions/IllegalValue.h>
 #include <Core/Exceptions/InternalError.h>
@@ -347,18 +348,18 @@
   else
   {
      current_samples = currentImageTraverser->getSamplesDone();
+      switch(timeMode){
+         case RealTime:
+            animFrameState.frameTime = SCIRun::Time::currentSeconds() * 
timeScale;
+            break;
+         case FixedRate:
+            animFrameState.frameTime = static_cast<double>(current_samples) 
/ fixed_sampling_rate;
+            break;
+         case Static:
+            break;
+      }
+      animFrameState.frameTime -= allThreadInitTime;
   }
-  switch(timeMode){
-    case RealTime:
-      animFrameState.frameTime = SCIRun::Time::currentSeconds() * timeScale;
-      break;
-    case FixedRate:
-      animFrameState.frameTime = static_cast<double>(current_samples) / 
fixed_sampling_rate;
-      break;
-    case Static:
-      break;
-  }
-  animFrameState.frameTime -= allThreadInitTime;
   //cout << "time: " << animFrameState.frameTime << endl;
   return animFrameState.frameTime;
 }
@@ -615,34 +616,21 @@
         sampling_rate = delta_samples / delta_time;
 
         currentImageTraverser->setSamplingRate( (unsigned int)sampling_rate 
);
-        
-        DisplayContext myContext(proc, workersAnimAndImage);
-
-
         
//////////////////////////////////////////////////////////////////////////
         // Debug window refresh.
-        if(proc == debug_proc) {
+        /*if(proc == debug_proc) {
 
           // I think that the debug window should be a property of the 
pipeline,
           // or greater application, not the image traverser.
           if (debug_window) {
             debug_window->display_stats( myContext, currentImageTraverser, 
currentImageTraverser->getNumThreads(), getCurrentTime() );
-          }
-        }
-
+        }*/
+        //}
 
-        
////////////////////////////////////////////////////////////////////////
-        // Image Display
-        channel->display->displayImage(myContext,
-                                       image/*,
-                                              
(current_samples-last_samples)*/);
         last_samples = current_samples;
-        
       }
-      
-      // std::cout << "Total samples: " << 
currentImageTraverser->getSamplesDone() << std::endl;
     }
-  
+
     /////////////////////////////////////////////////////////////////////////
     // Pre-render callbacks
     doParallelPreRenderCallbacks(proc, workersRendering);
@@ -654,8 +642,7 @@
     /////////////////////////////////////////////////////////////////////////
     /////////////////////////////////////////////////////////////////////////
     int inner_iterations = 0;
-    //cout << "looping: " << SCIRun::Time::currentSeconds() 
-    //     << ", inner_loop_time = " << inner_loop_time << endl;
+
     double itertime=0;
     begin_time=getCurrentTime();
     if(innerloopcalls==0)
@@ -663,8 +650,7 @@
     else
       end_time += inner_loop_time;
     innerloopcalls++;
-    //for (double begin_time=getCurrentTime();
-    //     (getCurrentTime()-begin_time)<inner_loop_time;)
+    
     do
     {
       // cout << "inner loop, iter# " << inner_iterations << endl;
@@ -694,16 +680,17 @@
         
///////////////////////////////////////////////////////////////////////
         
///////////////////////////////////////////////////////////////////////
         currentImageTraverser->masterTask( myContext, afr_context, image, 
getCurrentTime() );
+        if(proc == 0)
+        {
+          DisplayContext myDisplayContext(proc, workersAnimAndImage);
+          channel->display->displayImage(myDisplayContext, image);
+        }
       }
-      //itertime = getCurrentTime()-begin_time;
-      //begin_time += itertime;
     } // End of inner loop.
     while(getCurrentTime()<end_time);
     for(int index = 0;index < static_cast<int>(channels.size());index++)
     {
       Channel* channel = channels[index];
-      //long renderFrame = 
renderFrameState.frameNumber%channel->pipelineDepth;
-      //Image* image = channel->images[renderFrame];
       RenderContext myContext(this, index, proc, workersRendering, 
&renderFrameState,
                               currentLoadBalancer, currentPixelSampler,
                               currentRenderer, currentShadowAlgorithm,
@@ -712,7 +699,6 @@
       if(allThreadInitDone||innerloopcalls==1) 
currentImageTraverser->write_Tile_and_Camera(myContext, getCurrentTime());
       currentImageTraverser->outputStats(myContext.proc, afr_context);
     }
-    //if(proc==0) cout << "innerloopcalls = " << innerloopcalls << endl;
   } // End of outer loop.
 }
 

Modified: trunk/fox/afr_demo/Engine/ImageTraversers/GSTAFRImageTraverser.cc
==============================================================================
--- trunk/fox/afr_demo/Engine/ImageTraversers/GSTAFRImageTraverser.cc   
(original)
+++ trunk/fox/afr_demo/Engine/ImageTraversers/GSTAFRImageTraverser.cc   Thu 
Feb  9 19:24:21 2006
@@ -757,7 +757,7 @@
     int masterchunkindex = chunkindex[masterID];
     chunkindex[masterID] = (masterchunkindex==0)? 1 : 0;
     image->setValid( true );
-    
+    //cout << "calling image set valid " << endl;
     // process sample queues
     int count = 0;
     if(!afterupdateonly)




  • [MANTA] r922 - in trunk/fox/afr_demo/Engine: Control ImageTraversers, abhinav, 02/09/2006

Archive powered by MHonArc 2.6.16.

Top of page