Manta Interactive Ray Tracer Development Mailing List

Text archives Help


[MANTA] r1202 - in trunk: . Core Core/Util Engine/Control Engine/Renderers Interface StandAlone include


Chronological Thread 
  • From: cgribble@sci.utah.edu
  • To: manta@sci.utah.edu
  • Subject: [MANTA] r1202 - in trunk: . Core Core/Util Engine/Control Engine/Renderers Interface StandAlone include
  • Date: Tue, 3 Oct 2006 15:00:13 -0600 (MDT)

Author: cgribble
Date: Tue Oct  3 15:00:01 2006
New Revision: 1202

Removed:
   trunk/Core/Util/RayDump.cc
   trunk/Core/Util/RayDump.h
   trunk/include/UseRayDump.h.CMakeTemplate
Modified:
   trunk/CMakeLists.txt
   trunk/Core/CMakeLists.txt
   trunk/Engine/Control/RTRT.cc
   trunk/Engine/Control/RTRT.h
   trunk/Engine/Renderers/Raytracer.cc
   trunk/Interface/Context.h
   trunk/Interface/MantaInterface.h
   trunk/StandAlone/manta.cc
   trunk/include/CMakeLists.txt
Log:
Backing out changes related to PABST ray dumps

Modified: trunk/CMakeLists.txt
==============================================================================
--- trunk/CMakeLists.txt        (original)
+++ trunk/CMakeLists.txt        Tue Oct  3 15:00:01 2006
@@ -48,7 +48,6 @@
 FORCE_ADD_CXX_FLAGS("-DSCI_NOPERSISTENT")
 
 SET(USE_STATS_COLLECTOR 0 CACHE BOOL "Enable stats collection")
-SET(USE_RAYDUMP 0 CACHE BOOL "Enable ray dump")
 
 
###############################################################################
 
###############################################################################

Modified: trunk/Core/CMakeLists.txt
==============================================================================
--- trunk/Core/CMakeLists.txt   (original)
+++ trunk/Core/CMakeLists.txt   Tue Oct  3 15:00:01 2006
@@ -62,11 +62,6 @@
      Util/ThreadStorage.h
      Util/ThreadStorage.cc)
 
-IF(${USE_RAYDUMP_DEF})
-  SET(CORE_SOURCES ${CORE_SOURCES}
-      Util/RayDump.h
-      Util/RayDump.cc)
-ENDIF(${USE_RAYDUMP_DEF})
 
 ADD_LIBRARY (Manta_Core ${CORE_SOURCES})
 

Modified: trunk/Engine/Control/RTRT.cc
==============================================================================
--- trunk/Engine/Control/RTRT.cc        (original)
+++ trunk/Engine/Control/RTRT.cc        Tue Oct  3 15:00:01 2006
@@ -458,19 +458,11 @@
     if(!firstFrame){
       for(int index = 0;index < static_cast<int>(channels.size());index++){
         Channel* channel = channels[index];
-#ifdef USE_RAYDUMP
-        if (!forest)
-          cerr<<"1 Setting forest too late!\n";
-#endif
         RenderContext myContext(this, index, proc, workersAnimAndImage,
                                 &animFrameState,
                                 currentLoadBalancer, currentPixelSampler,
                                 currentRenderer, currentShadowAlgorithm,
-                                channel->camera, scene, thread_storage
-#ifdef USE_RAYDUMP
-                                , forest
-#endif
-                                );
+                                channel->camera, scene, thread_storage );
         currentImageTraverser->setupFrame(myContext);
       }
     }
@@ -554,10 +546,6 @@
         
         for(int index = 0;index < static_cast<int>(channels.size());index++){
           Channel* channel = channels[index];
-#ifdef USE_RAYDUMP
-        if (!forest)
-          cerr<<"2 Setting forest too late!\n";
-#endif
           RenderContext myContext(this, index, proc, workersAnimAndImage,
                                   &animFrameState,
                                   currentLoadBalancer,
@@ -566,11 +554,7 @@
                                   currentShadowAlgorithm,
                                   channel->camera,
                                   scene,
-                                  thread_storage
-#ifdef USE_RAYDUMP
-                                  , forest
-#endif
-                                  );
+                                  thread_storage );
 
           currentImageTraverser->setupFrame(myContext);
         }
@@ -631,18 +615,10 @@
         Channel* channel = channels[index];
         long renderFrame = 
renderFrameState.frameNumber%channel->pipelineDepth;
         Image* image = channel->images[renderFrame];
-#ifdef USE_RAYDUMP
-        if (!forest)
-          cerr<<"3 Setting forest too late!\n";
-#endif
         RenderContext myContext(this, index, proc, workersRendering, 
&renderFrameState,
                                 currentLoadBalancer, currentPixelSampler,
                                 currentRenderer, currentShadowAlgorithm,
-                                channel->camera, scene, thread_storage
-#ifdef USE_RAYDUMP
-                                , forest
-#endif
-                                );
+                                channel->camera, scene, thread_storage );
         currentImageTraverser->renderImage(myContext, image);
       }
     }
@@ -1588,11 +1564,7 @@
   RenderContext render_context(this, channel_index, workersRendering, 0, 0,
                                currentLoadBalancer, currentPixelSampler,
                                currentRenderer, currentShadowAlgorithm,
-                               channel->camera, scene, thread_storage
-#ifdef USE_RAYDUMP
-                               , forest
-#endif
-                               );
+                               channel->camera, scene, thread_storage );
 
   // Send this to the renderer.
   currentRenderer->traceEyeRays( render_context, result_rays );

Modified: trunk/Engine/Control/RTRT.h
==============================================================================
--- trunk/Engine/Control/RTRT.h (original)
+++ trunk/Engine/Control/RTRT.h Tue Oct  3 15:00:01 2006
@@ -12,7 +12,6 @@
 #include <Core/Thread/Semaphore.h>
 #include <Core/Thread/Runnable.h>
 #include <Core/Util/ThreadStorage.h>
-#include <UseRayDump.h>
 #include <map>
 #include <set>
 #include <vector>
@@ -150,11 +149,8 @@
     // Transactions
     virtual void addTransaction(TransactionBase* );
                
-    // Debug
-#ifdef USE_RAYDUMP
-    void setRayForest(RayForest* forest_) { forest = forest_; }
-#endif
-    virtual void shootOneRay( Color &result_color, RayPacket &result_rays, 
Real image_x, Real image_y, int channel_index );
+               // Debug:
+               virtual void shootOneRay( Color &result_color, RayPacket 
&result_rays, Real image_x, Real image_y, int channel_index );
   
        
        protected:
@@ -326,10 +322,6 @@
     Scene* readMOScene(const string& name, const vector<string>& args,
                        bool printErrors);
     void readMOStack(const string& name, const vector<string>& args, bool 
printErrors );
-
-#ifdef USE_RAYDUMP
-    RayForest* forest;
-#endif
   };
 }
 

Modified: trunk/Engine/Renderers/Raytracer.cc
==============================================================================
--- trunk/Engine/Renderers/Raytracer.cc (original)
+++ trunk/Engine/Renderers/Raytracer.cc Tue Oct  3 15:00:01 2006
@@ -8,7 +8,6 @@
 #include <Interface/RayPacket.h>
 #include <Interface/Scene.h>
 #include <Core/Util/Assert.h>
-#include <UseRayDump.h>
 #include <iostream>
 using namespace std;
 
@@ -43,23 +42,6 @@
 {
   ASSERT(rays.getFlag(RayPacket::HaveImageCoordinates));
   context.camera->makeRays(rays);
-#ifdef USE_RAYDUMP
-  int size=rays.end() - rays.begin();
-  for (int i = rays.begin(); i<rays.end(); ++i) {
-    Vector origin=rays.getOrigin(i);
-    Vector direction=rays.getDirection(i);
-    // How to get a unique id for each ray across packets?
-    long long int id=context.forest->trees.size();
-
-    RayInfo ray;
-    ray.setOrigin(origin.x(), origin.y(), origin.z());
-    ray.setDirection(direction.x(), direction.y(), direction.z());
-    ray.setRayID(id);
-    ray.setParentID(static_cast<long long int>(-1));
-    ray.type = RayInfo::PrimaryRay;
-    context.forest->addChild(new RayTree(ray));
-  }
-#endif
   rays.initializeImportance();
   traceRays(context, rays);
 }

Modified: trunk/Interface/Context.h
==============================================================================
--- trunk/Interface/Context.h   (original)
+++ trunk/Interface/Context.h   Tue Oct  3 15:00:01 2006
@@ -2,8 +2,6 @@
 #ifndef Manta_Interface_Context_h
 #define Manta_Interface_Context_h
 
-#include <UseRayDump.h>
-
 namespace Manta {
   class Camera;
   class FrameState;
@@ -156,11 +154,7 @@
                   LoadBalancer* loadBalancer, PixelSampler* pixelSampler,
                   Renderer* renderer, ShadowAlgorithm* shadowAlgorithm,
                   const Camera* camera, const Scene* scene,
-                  ThreadStorage *storage_allocator_
-#ifdef USE_RAYDUMP
-                  , RayForest* forest_ = 0
-#endif
-                  )
+                  ThreadStorage *storage_allocator_ )
       : rtrt_int(rtrt_int), channelIndex(channelIndex),
         proc(proc), numProcs(numProcs),
         frameState(frameState),
@@ -168,9 +162,6 @@
         renderer(renderer), shadowAlgorithm(shadowAlgorithm),
         camera(camera), scene(scene),
         storage_allocator( storage_allocator_ )
-#ifdef USE_RAYDUMP
-      , forest(forest_)
-#endif
     {
     }
     MantaInterface* rtrt_int;
@@ -186,11 +177,7 @@
     const Scene* scene;
 
     mutable ThreadStorage *storage_allocator;
-
-#ifdef USE_RAYDUMP
-    RayForest* forest;
-#endif
-
+    
   private:
     RenderContext(const RenderContext&);
     RenderContext& operator=(const RenderContext&);

Modified: trunk/Interface/MantaInterface.h
==============================================================================
--- trunk/Interface/MantaInterface.h    (original)
+++ trunk/Interface/MantaInterface.h    Tue Oct  3 15:00:01 2006
@@ -6,7 +6,6 @@
 #include <Interface/Transaction.h>
 #include <SCIRun/Core/Exceptions/Exception.h>
 #include <MantaTypes.h>
-#include <UseRayDump.h>
 
 #include <sgi_stl_warnings_off.h>
 #include <string>
@@ -185,12 +184,9 @@
     }
 
     // Others
-#ifdef USE_RAYDUMP
-    virtual void setRayForest(RayForest* /* forest */) {}
-#endif
 
     // This should only be called from within a transaction called function.
-    virtual void shootOneRay( Color &result_color, RayPacket &result_rays, 
Real image_x, Real image_y, int channel_index ) = 0;
+               virtual void shootOneRay( Color &result_color, RayPacket 
&result_rays, Real image_x, Real image_y, int channel_index ) = 0;
     
   protected:
     MantaInterface();

Modified: trunk/StandAlone/manta.cc
==============================================================================
--- trunk/StandAlone/manta.cc   (original)
+++ trunk/StandAlone/manta.cc   Tue Oct  3 15:00:01 2006
@@ -42,7 +42,6 @@
 #include <Core/Exceptions/UnknownComponent.h>
 #include <Core/Thread/Time.h>
 #include <Core/Util/About.h>
-#include <UseRayDump.h>
 
 // Default scene includes.
 #include <Core/Color/ColorDB.h>
@@ -133,9 +132,6 @@
   cerr << " -renderer S     - Use renderer S, valid renderers are:\n";
   printList(cerr, rtrt->listRenderers(), 2);
   cerr << " -scene S        - Render Scene S\n";
-#ifdef USE_RAYDUMP
-  cerr << " -raydump F      - Dump ray trees to file F\n";
-#endif
   
   Thread::exitAll(1);
 }
@@ -177,62 +173,6 @@
   delete this;
 }
 
-#ifdef USE_RAYDUMP
-class RayDumpHelper {
-public:
-  RayDumpHelper(MantaInterface* rtrt, const string& fname);
-  void init(int, int);
-  void quit(int, int);
-       
-private:
-  MantaInterface* rtrt;
-  FILE* raydump_fp;
-  RayForest* forest;
-};
-
-RayDumpHelper::RayDumpHelper(MantaInterface* rtrt, const string& fname)
-  : rtrt(rtrt)
-{
-  // cerr<<"raydump_file = "<<fname<<'\n';
-  raydump_fp = fopen(fname.c_str(), "wb");
-  if (!raydump_fp) {
-    cerr<<"Warning:  failed to open \""<<fname<<"\" for writing\n";
-    raydump_fp = 0;
-    return;
-  }
-
-  cerr<<"Dumping ray trees to \""<<fname<<"\"\n";
-}
-
-void RayDumpHelper::init(int, int)
-{
-  if (raydump_fp) {
-    if (rtrt->numWorkers() > 1) {
-      cerr<<"Warning:  dumping ray trees is not currently thread-safe\n";
-      cerr<<"          changing number of workers to one\n";
-      rtrt->changeNumWorkers(1);
-    }
-
-    // cerr<<"creating a new forest\n";
-    forest = new RayForest();
-    rtrt->setRayForest(forest);
-  }
-}
-
-void RayDumpHelper::quit(int, int)
-{
-  if (forest && raydump_fp) {
-    // cerr<<"dumping ray trees and cleaning up\n";
-    forest->writeToFile(raydump_fp);
-    fclose(raydump_fp);
-    delete forest;
-  }
-
-  rtrt->finish();
-  delete this;
-}
-#endif
-
 int
 main(int argc, char* argv[])
 {
@@ -408,20 +348,6 @@
           if (!getStringArg(i,args,stack_file))
             usage(rtrt);
         }
-#ifdef USE_RAYDUMP
-        else if (arg == "-raydump") {
-          string raydump_file;
-          if (!getStringArg(i, args, raydump_file))
-            usage(rtrt);
-
-          // If dumping rays, run for exactly one frame
-          RayDumpHelper* r = new RayDumpHelper(rtrt, raydump_file);
-          rtrt->addOneShotCallback(MantaInterface::Absolute, 0,
-                                   Callback::create(r, 
&RayDumpHelper::init));
-          rtrt->addOneShotCallback(MantaInterface::Absolute, 1,
-                                   Callback::create(r, 
&RayDumpHelper::quit));
-        }
-#endif
       }
     }
     catch (SCIRun::Exception& e) {

Modified: trunk/include/CMakeLists.txt
==============================================================================
--- trunk/include/CMakeLists.txt        (original)
+++ trunk/include/CMakeLists.txt        Tue Oct  3 15:00:01 2006
@@ -66,17 +66,3 @@
   ${CMAKE_CURRENT_SOURCE_DIR}/UseStatsCollector.h.CMakeTemplate
   ${CMAKE_BINARY_DIR}/include/UseStatsCollector.h
   )
-
-###############################################################################
-## Configure UseRayDump.h
-
-IF(USE_RAYDUMP)
-  SET(USE_RAYDUMP_DEF "1" CACHE INTERNAL "Enable stats collection")
-ELSE(USE_RAYDUMP)
-  SET(USE_RAYDUMP_DEF "0" CACHE INTERNAL "Disable stats collection")
-ENDIF(USE_RAYDUMP)
-
-CONFIGURE_FILE(
-  ${CMAKE_CURRENT_SOURCE_DIR}/UseRayDump.h.CMakeTemplate
-  ${CMAKE_BINARY_DIR}/include/UseRayDump.h
-  )




  • [MANTA] r1202 - in trunk: . Core Core/Util Engine/Control Engine/Renderers Interface StandAlone include, cgribble, 10/03/2006

Archive powered by MHonArc 2.6.16.

Top of page