Manta Interactive Ray Tracer Development Mailing List

Text archives Help


[MANTA] r416 - in branches/newpipeline: . Engine/Control Engine/Display Interface StandAlone UserInterface


Chronological Thread 
  • From: sparker@sci.utah.edu
  • To: manta@sci.utah.edu
  • Subject: [MANTA] r416 - in branches/newpipeline: . Engine/Control Engine/Display Interface StandAlone UserInterface
  • Date: Thu, 30 Jun 2005 14:01:38 -0600 (MDT)

Author: sparker
Date: Thu Jun 30 14:01:31 2005
New Revision: 416

Added:
   branches/newpipeline/Interface/MantaInterface.cc
      - copied, changed from r362, trunk/Interface/RTRTInterface.cc
   branches/newpipeline/Interface/MantaInterface.h
      - copied, changed from r362, trunk/Interface/RTRTInterface.h
   branches/newpipeline/Interface/Pipeline.h
   branches/newpipeline/Interface/PipelineComponent.h
Removed:
   branches/newpipeline/Interface/ImageTraverser.cc
   branches/newpipeline/Interface/ImageTraverser.h
   branches/newpipeline/Interface/RTRTInterface.cc
   branches/newpipeline/Interface/RTRTInterface.h
Modified:
   branches/newpipeline/Engine/Control/RTRT.cc
   branches/newpipeline/Engine/Display/NullDisplay.h
   branches/newpipeline/Interface/CMakeLists.txt
   branches/newpipeline/StandAlone/manta.cc
   branches/newpipeline/TODO
   branches/newpipeline/UserInterface/PromptUI.cc
   branches/newpipeline/UserInterface/PromptUI.h
   branches/newpipeline/UserInterface/XWindowUI.cc
   branches/newpipeline/UserInterface/XWindowUI.h
Log:
Very partially implemented pipeline branch (doesn't work)


Modified: branches/newpipeline/Engine/Control/RTRT.cc
==============================================================================
--- branches/newpipeline/Engine/Control/RTRT.cc (original)
+++ branches/newpipeline/Engine/Control/RTRT.cc Thu Jun 30 14:01:31 2005
@@ -8,8 +8,6 @@
 #include <Interface/Context.h>
 #include <Interface/IdleMode.h>
 #include <Interface/Image.h>
-#include <Interface/ImageDisplay.h>
-#include <Interface/ImageTraverser.h>
 #include <Interface/Light.h>
 #include <Interface/LightSet.h>
 #include <Interface/LoadBalancer.h>

Modified: branches/newpipeline/Engine/Display/NullDisplay.h
==============================================================================
--- branches/newpipeline/Engine/Display/NullDisplay.h   (original)
+++ branches/newpipeline/Engine/Display/NullDisplay.h   Thu Jun 30 14:01:31 
2005
@@ -2,7 +2,6 @@
 #ifndef Manta_Engine_NullDisplay_h
 #define Manta_Engine_NullDisplay_h
 
-#include <Interface/ImageDisplay.h>
 #include <sgi_stl_warnings_off.h>
 #include <string>
 #include <vector>
@@ -10,7 +9,7 @@
 
 namespace Manta {
   using namespace std;
-  class NullDisplay : public ImageDisplay {
+  class NullDisplay : public PipelineStage {
   public:
     NullDisplay(const vector<string>& args);
     virtual ~NullDisplay();

Modified: branches/newpipeline/Interface/CMakeLists.txt
==============================================================================
--- branches/newpipeline/Interface/CMakeLists.txt       (original)
+++ branches/newpipeline/Interface/CMakeLists.txt       Thu Jun 30 14:01:31 
2005
@@ -5,17 +5,15 @@
         Camera.cc
         IdleMode.cc
         Image.cc
-        ImageDisplay.cc
-        ImageTraverser.cc
         Light.cc
         LightSet.cc
         LoadBalancer.cc
+        MantaInterface.cc
         Material.cc
         Object.cc
         PixelSampler.cc
         Primitive.cc
         Renderer.cc
-        RTRTInterface.cc
         SetupCallback.cc
         ShadowAlgorithm.cc
         TexCoordMapper.cc

Copied: branches/newpipeline/Interface/MantaInterface.cc (from r362, 
trunk/Interface/RTRTInterface.cc)
==============================================================================
--- trunk/Interface/RTRTInterface.cc    (original)
+++ branches/newpipeline/Interface/MantaInterface.cc    Thu Jun 30 14:01:31 
2005
@@ -1,13 +1,13 @@
 
-#include <Interface/RTRTInterface.h>
+#include <Interface/MantaInterface.h>
 
 using namespace Manta;
 
-RTRTInterface::RTRTInterface()
+MantaInterface::MantaInterface()
 {
 }
 
-RTRTInterface::~RTRTInterface()
+MantaInterface::~MantaInterface()
 {
 }
 

Copied: branches/newpipeline/Interface/MantaInterface.h (from r362, 
trunk/Interface/RTRTInterface.h)
==============================================================================
--- trunk/Interface/RTRTInterface.h     (original)
+++ branches/newpipeline/Interface/MantaInterface.h     Thu Jun 30 14:01:31 
2005
@@ -1,6 +1,6 @@
 
-#ifndef Manta_Interface_RTRTInterface_H
-#define Manta_Interface_RTRTInterface_H
+#ifndef Manta_Interface_MantaInterface_h
+#define Manta_Interface_MantaInterface_h
 
 #include <Interface/Callback.h>
 #include <Interface/Transaction.h>
@@ -10,114 +10,13 @@
 #include <sgi_stl_warnings_on.h>
 
 namespace Manta {
-
-  using namespace std;
-
-  class Camera;
-  class Group;
-  class IdleMode;
-  class ImageDisplay;
-  class Image;
-  class ImageTraverser;
-  class LoadBalancer;
-  class PixelSampler;
-  class Renderer;
-  class Scene;
   class SetupCallback;
-  class ShadowAlgorithm;
-  class UserInterface;
 
-  class RTRTInterface {
+  class MantaInterface {
   public:
 
-    virtual ~RTRTInterface();
-
-    typedef vector<string> listType;
-
-    // Image Displays (opengl, file, mpeg, etc.)
-    typedef ImageDisplay* (*ImageDisplayCreator)(const vector<string>& args);
-    virtual int createChannel(const string& modespec, Camera* camera,
-                             bool stereo, int xres, int yres) = 0;
-    virtual void registerComponent(const string& name, ImageDisplayCreator 
display) = 0;
-    virtual listType listImageDisplays() const = 0;
-    virtual Camera* getCamera(int channel) const = 0;
-    virtual void getResolution(int channel, bool& stereo, int& xres, int& 
yres) = 0;
-    // You can change the resolution of the rendered image without
-    // having to change the pipeline.  If you want the pipeline
-    // changed, then set this parameter to true.
-    virtual void changeResolution(int channel, int xres, int yres,
-                                  bool changePipeline) = 0;
-
-    // Image Traversers
-    typedef ImageTraverser* (*ImageTraverserCreator)(const vector<string>& 
args);
-    virtual bool selectImageTraverser(const string& spec) = 0;
-    virtual void registerComponent(const string& name, ImageTraverserCreator 
creator) = 0;
-    virtual listType listImageTraversers() const = 0;
-
-    // Image Types (rgb, rgba, float, etc.)
-    typedef Image* (*ImageCreator)(const vector<string>& args,
-                                  bool stereo, int xres, int yres);
-    virtual bool selectImageType(const string& spec) = 0;
-    virtual void registerComponent(const string& name, ImageCreator creator) 
= 0;
-    virtual listType listImageTypes() const = 0;
-
-    // Load Balancers
-    typedef LoadBalancer* (*LoadBalancerCreator)(const vector<string>& args);
-    virtual bool selectLoadBalancer(const string& spec) = 0;
-    virtual void registerComponent(const string& name, LoadBalancerCreator 
creator) = 0;
-    virtual listType listLoadBalancers() const = 0;
-
-    // PixelSamplers
-    typedef PixelSampler* (*PixelSamplerCreator)(const vector<string>& args);
-    virtual bool selectPixelSampler(const string& spec) = 0;
-    virtual void registerComponent(const string& name, PixelSamplerCreator 
creator) = 0;
-    virtual listType listPixelSamplers() const = 0;
-
-    // Renderers
-    typedef Renderer* (*RendererCreator)(const vector<string>& args);
-    virtual bool selectRenderer(const string& spec) = 0;
-    virtual void registerComponent(const string& name, RendererCreator 
creator) = 0;
-    virtual listType listRenderers() const = 0;
-
-    // Shadow Algorithms
-    typedef ShadowAlgorithm* (*ShadowAlgorithmCreator)(const vector<string>& 
args);
-    virtual bool selectShadowAlgorithm(const string& spec) = 0;
-    virtual void registerComponent(const string& name, 
ShadowAlgorithmCreator creator) = 0;
-    virtual listType listShadowAlgorithms() const = 0;
-
-    // Idle modes
-    typedef IdleMode* (*IdleModeCreator)(const vector<string>& args);
-    virtual bool addIdleMode(const string& spec) = 0;
-    virtual void registerComponent(const string& name, IdleModeCreator 
creator) = 0;
-    virtual listType listIdleModes() const = 0;
-
-    // Camera
-    typedef Camera* (*CameraCreator)(const vector<string>& args);
-    virtual Camera* createCamera(const string& spec) = 0;
-    virtual void registerComponent(const string& name, CameraCreator 
creator) = 0;
-    virtual listType listCameras() const = 0;
-
-    // Scenes
-    virtual bool haveScene() = 0;
-    virtual void setScene(Scene* scene) = 0;
-    virtual bool readScene(const string& sceneSpec) = 0;
-    virtual void setScenePath(const string& path) = 0;
-
-    typedef Group* (*GroupCreator)(const vector<string>& args);
-    virtual Group* makeGroup(const string& groupSpec) = 0;
-    virtual void registerObject(const string& name, GroupCreator creator) = 
0;
-    virtual listType listGroups() const = 0;
+    virtual ~MantaInterface();
 
-    // Callbacks
-    enum Whence {
-      Absolute, Relative
-    };
-    virtual void addOneShotCallback(Whence whence, long frame,
-                                   CallbackBase_2Data<int, int>* callback) = 
0;
-    virtual void registerSetupCallback(SetupCallback*) = 0;
-    virtual void registerSerialAnimationCallback(CallbackBase_3Data<int, 
int, bool&>*) = 0;
-    virtual void registerParallelAnimationCallback(CallbackBase_3Data<int, 
int, bool&>*) = 0;
-    
     // Settings
     enum TimeMode {
       RealTime, FixedRate, Static, FixedSamplingRate
@@ -128,23 +27,34 @@
     virtual void changeNumWorkers(int) = 0;
     virtual TValue<int>& numWorkers() = 0;
 
-    // Control
-    virtual void beginRendering(bool blockUntilFinished) = 0;
+    // Free-run rendering
+    enum RenderingMode {
+      FreeRun,
+      SingleFrame
+    };
+    virtual void beginRendering(RenderingMode mode, bool blockUntilFinished) 
= 0;
     virtual void blockUntilFinished() = 0;
-
-    // Control
     virtual void finish() = 0;
 
-    // User Interfaces
-    typedef UserInterface* (*UserInterfaceCreator)(const vector<string>& 
args,
-                                                  RTRTInterface 
*rtrt_interface);
-    virtual UserInterface* createUserInterface(const string& spec) = 0;
-    virtual void registerComponent(const string& name, UserInterfaceCreator 
creator) = 0;
-    virtual listType listUserInterfaces() const = 0;
+    // Frame-at-a-time interface
+    virtual void beginSingleFrameRendering();
+    virtual void triggerSingleFrame(...) = 0;
 
     // Query functions
-    virtual bool queryState(const string& what, vector<string>& results) = 0;
+#if 0
+    virtual bool queryState(const std::string& what, 
std::vector<std::string>& results) = 0;
+#endif
 
+    // Callbacks
+    enum Whence {
+      Absolute, Relative
+    };
+    virtual void addOneShotCallback(Whence whence, long frame,
+                                   CallbackBase_2Data<int, int>* callback) = 
0;
+    virtual void registerSetupCallback(SetupCallback*) = 0;
+    virtual void registerSerialAnimationCallback(CallbackBase_3Data<int, 
int, bool&>*) = 0;
+    virtual void registerParallelAnimationCallback(CallbackBase_3Data<int, 
int, bool&>*) = 0;
+    
     // Transactions
     virtual void addTransaction(TransactionBase*) = 0;
     template<class T, class Op>
@@ -158,13 +68,13 @@
       }
 
   protected:
-    RTRTInterface();
+    MantaInterface();
 
   private:
-    RTRTInterface(const RTRTInterface&);
-    RTRTInterface& operator=(const RTRTInterface&);
+    MantaInterface(const MantaInterface&);
+    MantaInterface& operator=(const MantaInterface&);
   };
-  RTRTInterface* createRTRT();
+  MantaInterface* createMantaEngine();
 }
 
 #endif

Added: branches/newpipeline/Interface/Pipeline.h
==============================================================================
--- (empty file)
+++ branches/newpipeline/Interface/Pipeline.h   Thu Jun 30 14:01:31 2005
@@ -0,0 +1,34 @@
+
+#ifndef Manta_Interface_Pipeline_h
+#define Manta_Interface_Pipeline_h
+
+namespace Manta {
+
+  class Image;
+  class RenderContext;
+  class SetupContext;
+
+  class Pipeline {
+  public:
+    Pipeline();
+    Pipeline(const Pipeline&);
+    Pipeline& operator=(const Pipeline&);
+    ~Pipeline();
+   void finalize();
+   void setActive(bool);
+   dedicated resources
+
+   void addAndConnectComponent(PipelineComponent*);
+   void addComponent(int stage, PipelineComponent*);
+   void connectComponents(PipelineComponent*, PipelineComponent*, 
PayloadFactory*);
+
+   void setRenderComponents(RenderComponents*);
+  private:
+    struct Stage {
+      vector<PipelineComponent*> components;
+    };
+    vector<Stage*> stages;
+  };
+}
+
+#endif

Added: branches/newpipeline/Interface/PipelineComponent.h
==============================================================================
--- (empty file)
+++ branches/newpipeline/Interface/PipelineComponent.h  Thu Jun 30 14:01:31 
2005
@@ -0,0 +1,26 @@
+
+#ifndef Manta_Interface_PipelineStage_h
+#define Manta_Interface_PipelineStage_h
+
+namespace Manta {
+
+  class Image;
+  class RenderContext;
+  class SetupContext;
+
+  class PipelineStage {
+  public:
+    virtual ~PipelineStage();
+    virtual void setupBegin(const SetupContext&, int numChannels) = 0;
+    virtual void setupDisplayChannel(const SetupContext&, ChannelInfo&) = 0;
+    virtual void setupFrame(const RenderContext& context) = 0;
+    virtual void performPipelineStage(const RenderContext& context, 
PipelineData* input, PipelineData* output) = 0;
+  protected:
+    PipelineStage();
+  private:
+    PipelineStage(const PipelineStage&);
+    PipelineStage& operator=(const PipelineStage&);
+  };
+}
+
+#endif

Modified: branches/newpipeline/StandAlone/manta.cc
==============================================================================
--- branches/newpipeline/StandAlone/manta.cc    (original)
+++ branches/newpipeline/StandAlone/manta.cc    Thu Jun 30 14:01:31 2005
@@ -1,5 +1,5 @@
 
-#include <Interface/RTRTInterface.h>
+#include <Interface/MantaInterface.h>
 #include <Core/Color/ColorDB.h>
 #include <Core/Util/Args.h>
 #include <Interface/Callback.h>
@@ -25,11 +25,11 @@
 
 Scene* createDefaultScene();
 
-void printList(ostream& out, const RTRTInterface::listType& list, int 
spaces=0)
+void printList(ostream& out, const MantaInterface::listType& list, int 
spaces=0)
 {
   for(int i=0;i<spaces;i++)
     out << ' ';
-  for(RTRTInterface::listType::const_iterator iter = list.begin();
+  for(MantaInterface::listType::const_iterator iter = list.begin();
       iter != list.end(); ++iter){
     if(iter != list.begin())
       out << ", ";
@@ -38,7 +38,7 @@
   out << "\n";
 }
 
-void usage(RTRTInterface* rtrt)
+void usage(MantaInterface* engine)
 {
   cerr << "Usage: manta [options]\n";
   cerr << "Valid options are:\n";
@@ -71,18 +71,18 @@
 
 class BenchHelper {
 public:
-  BenchHelper(RTRTInterface* rtrt, long numFrames);
+  BenchHelper(MantaInterface* rtrt, long numFrames);
   void start(int, int);
   void stop(int, int);
 
 private:
-  RTRTInterface* rtrt;
+  MantaInterface* engine;
   double startTime;
   long numFrames;
 };
 
-BenchHelper::BenchHelper(RTRTInterface* rtrt, long numFrames)
-  : rtrt(rtrt), numFrames(numFrames)
+BenchHelper::BenchHelper(MantaInterface* engine, long numFrames)
+  : engine(engine), numFrames(numFrames)
 {
 }
 
@@ -96,7 +96,7 @@
   double dt = Time::currentSeconds()-startTime;
   double fps = static_cast<double>(numFrames)/dt;
   cout << "Benchmark completed in " << dt << " seconds (" << numFrames << " 
frames, " << fps << " frames per second)\n";
-  rtrt->finish();
+  engine->finish();
   delete this;
 }
 
@@ -114,27 +114,17 @@
     args.push_back(argv[i]);
 
   try {
-    RTRTInterface* rtrt = createRTRT();
+    MantaInterface* engine = createMantaEngine();
     if(getenv("MANTA_SCENEPATH"))
       rtrt->setScenePath(getenv("MANTA_SCENEPATH"));
     else
       rtrt->setScenePath(".:../scenes");
     rtrt->changeNumWorkers(1);
+    * factory = ????;
+
+    Pipeline* pipeline = createDefaultPipeline();
     if(!rtrt->selectImageType("rgba8"))
       throw InternalError("default image not found");
-    if(!rtrt->selectLoadBalancer("workqueue"))
-      throw InternalError("default load balancer not found");
-    if(!rtrt->selectImageTraverser("tiled"))
-      throw InternalError("default image traverser not found");
-    if(!rtrt->selectPixelSampler("singlesample"))
-      throw InternalError("default pixel sampler not found");
-    if(!rtrt->selectRenderer("raytracer"))
-      throw InternalError("default renderer not found");
-    if(!rtrt->selectShadowAlgorithm("hard"))
-      throw InternalError("default shadow algorithm not found");
-    Camera* currentCamera = rtrt->createCamera("pinhole(-eye 3 3 2 -lookat 0 
0 0.3 -up 0 0 1 -fov 60)");
-    if(!currentCamera)
-      throw InternalError("cannot create default camera");
     int xres = 512, yres = 512;
     bool channelCreated=false;
     bool haveUI = false;
@@ -143,7 +133,7 @@
     for(int i=0;i<argc;i++){
       string arg = args[i];
       if(arg == "-help"){
-       usage(rtrt);
+       usage(engine);
       } else if(arg == "-bench"){
        long numFrames = 100;
        long warmup = 10;
@@ -161,6 +151,7 @@
        string s;
        if(!getStringArg(i, args, s))
          usage(rtrt);
+        pl->setCamera(factory->createCamera(s));
        currentCamera = rtrt->createCamera(s);
        if(!currentCamera){
          cerr << "Error creating camera: " << s << ", available cameras 
are:\n";
@@ -171,7 +162,7 @@
         string s;
         if(!getStringArg(i, args, s))
           usage(rtrt);
-        if(!rtrt->addIdleMode(s)){
+        if(!manta->addIdleMode(s)){
           cerr << "Invalid idle mode: " << s << ", available idle modes 
are:\n";
           printList(cerr, rtrt->listIdleModes());
           exit(1);
@@ -264,14 +255,17 @@
        string s;
        if(!getStringArg(i, args, s))
          usage(rtrt);
-       UserInterface* ui = rtrt->createUserInterface(s);
-       if(!ui){
-         cerr << "Unknown user interface: " << s << ", available user 
interfaces are:\n";
-         printList(cerr, rtrt->listUserInterfaces());
-         exit(1);
-       }
-       ui->startup();
-       haveUI = true;
+        if(s == "null"){
+        } else {
+          UserInterface* ui = rtrt->createUserInterface(s);
+          if(!ui){
+            cerr << "Unknown user interface: " << s << ", available user 
interfaces are:\n";
+            printList(cerr, rtrt->listUserInterfaces());
+            exit(1);
+          }
+          ui->startup();
+        }
+        haveUI = true;
       } else {
        cerr << "Unknown argument: " << arg << '\n';
        usage(rtrt);
@@ -285,14 +279,14 @@
        exit(1);
       }
       ui->startup();
-    } 
-    if(!channelCreated){
-      rtrt->createChannel("opengl", currentCamera, false, xres, yres);
     }
-    if(!rtrt->haveScene()){
-      rtrt->setScene(createDefaultScene());
+    if(!pipelineSet){
+      manta->setPipeline(pl);
     }
-    rtrt->beginRendering(true);
+    if(!manta->haveScene()){
+      manta->setScene(createDefaultScene());
+    }
+    manta->beginRendering(true);
     delete rtrt;
   } catch (SCIRun::Exception& e) {
     cerr << "Caught exception: " << e.message() << '\n';
@@ -362,3 +356,82 @@
   scene->getRenderParameters().maxDepth = 5;
   return scene;
 }
+
+Pipeline* createDefaultPipeline()
+{
+  XWindowUI* ui = new XWindowUI();
+  Pipeline* pl = new Pipline();
+  pl->addStage(new TiledImageTraverser());
+  pl->addAndConnectStage(new OpenGLImageDisplay(ui));
+
+  RenderComponents* rc = new RenderComponents();
+  rc->setCamera(new PinholeCamera());
+  rc->setLoadBalancer(new WorkQueueLoadBalancer());
+  rc->setRenderer(new Raytracer());
+  rc->setShadowAlgorithm(new HardShadows());
+  pl->setRenderComponents(rc);
+
+  PipelineParameters* pp = new PipelineParameters();
+  pp->xres = 512;
+  pp->yres = 512;
+  pp->stereo = false;
+  pl->setPipelineParamters(pp);
+
+  return pl;
+}
+
+Pipeline* createDefaultPipeline2()
+{
+  PipelineComponent* it = factory->createPipelineComponent("tiled");
+  if(!it)
+    throw InternalError("default image traverser not found");
+  
+  RenderParameters* rp = new RenderParameters;
+  if(!(rp->loadBalancer = factory->createLoadBalancer("workqueue")))
+    throw InternalError("default load balancer not found");
+  if(!(rp->pixelSampler = factory->createPixelSampler("singlesample")))
+    throw InternalError("default pixel sampler not found");
+  if(!(rp->renderer = factory->createRenderer("raytracer")))
+    throw InternalError("default renderer not found");
+  if(!(rp->shadowAlgorithm = factory->createShadowAlgorithm("hard")))
+    throw InternalError("default shadow algorithm not found");
+  if(!(rp->camera = factory->createCamera("pinhole(-eye 3 3 2 -lookat 0 0 
0.3 -up 0 0 1 -fov 60)")))
+    throw InternalError("default camera not found");
+    
+
+  PipelineParameters* pp = new PipelineParameters();
+  pp->xres = 512;
+  pp->yres = 512;
+  pp->stereo = false;
+  pl->setPipelineParameters(pp);
+}
+
+Pipeline* createTonemapPipeline()
+{
+  XWindowUI* ui1 = new XWindowUI();
+  XWindowUI* ui2 = new XWindowUI();
+  Pipeline* pl = new Pipline();
+  ImageTraverser* it = new TimedImageTraverser();
+  pl->addStage(it);
+  pl->addAndConnectStage(new TonemapOperator());
+  pl->addAndConnectStage(new OpenGLImageDisplay(ui2));
+  PipelineStall* ps = new PipelineStall();
+  pl->addComponent(ps);
+  pl->connectComponents(it, ps);
+
+  RenderComponents* rc = new RenderComponents();
+  rc->setCamera(new PinholeCamera());
+  rc->setLoadBalancer(new WorkQueueLoadBalancer());
+  rc->setRenderer(new Raytracer());
+  rc->setShadowAlgorithm(new HardShadows());
+  pl->setRenderComponents(rc);
+
+  PipelineParameters* pp = new PipelineParameters();
+  pp->xres = 512;
+  pp->yres = 512;
+  pp->stereo = false;
+  pl->setPipelineParamters(pp);
+
+  return pl;
+}
+#endif

Modified: branches/newpipeline/TODO
==============================================================================
--- branches/newpipeline/TODO   (original)
+++ branches/newpipeline/TODO   Thu Jun 30 14:01:31 2005
@@ -1,6 +1,3 @@
-Point/Vector:
- - double-check const-correctness
-
 Cmake:
  - Class rtrt fix
  - Factories

Modified: branches/newpipeline/UserInterface/PromptUI.cc
==============================================================================
--- branches/newpipeline/UserInterface/PromptUI.cc      (original)
+++ branches/newpipeline/UserInterface/PromptUI.cc      Thu Jun 30 14:01:31 
2005
@@ -1,6 +1,6 @@
 
 #include <UserInterface/PromptUI.h>
-#include <Interface/RTRTInterface.h>
+#include <Interface/MantaInterface.h>
 #include <Core/Util/Args.h>
 #include <Interface/ShadowAlgorithm.h>
 #include <Core/Exceptions/Exception.h>
@@ -19,15 +19,15 @@
 using SCIRun::Thread;
 
 UserInterface* PromptUI::create(const vector<string>& args,
-                               RTRTInterface *rtrt_int) {
-  UserInterface *newUI = new PromptUI(args, rtrt_int);
+                               MantaInterface *engine) {
+  UserInterface *newUI = new PromptUI(args, engine);
   // Probably need to create a thread and start it going.
 
   return newUI;
 }
 
-PromptUI::PromptUI(const vector<string>& args, RTRTInterface *rtrt_int):
-  rtrt_int(rtrt_int)
+PromptUI::PromptUI(const vector<string>& args, MantaInterface *engine):
+  engine(engine)
 {
   cout << "PromptUI::PromptUI created with args = (";
   for(unsigned int i = 0; i < args.size(); i++)
@@ -109,7 +109,7 @@
   }
   string command = args[1];
   vector<string> results;
-  if (rtrt_int->queryState(command, results)) {
+  if (engine->queryState(command, results)) {
     // the command was sucessful
     if (command == "shadows") {
       if (results.size() != 2) {

Modified: branches/newpipeline/UserInterface/PromptUI.h
==============================================================================
--- branches/newpipeline/UserInterface/PromptUI.h       (original)
+++ branches/newpipeline/UserInterface/PromptUI.h       Thu Jun 30 14:01:31 
2005
@@ -14,11 +14,11 @@
 namespace Manta {
   using namespace std;
 
-  class RTRTInterface;
+  class MantaInterface;
   
   class PromptUI: public UserInterface, public SCIRun::Runnable {
   public:
-    PromptUI(const vector<string>& args, RTRTInterface *rtrt_int);
+    PromptUI(const vector<string>& args, MantaInterface *engine);
     virtual ~PromptUI();
 
     virtual void startup();
@@ -26,11 +26,11 @@
     virtual void run();
 
     static UserInterface* create(const vector<string>& args,
-                                RTRTInterface *rtrt_int);
+                                MantaInterface *engine);
 
   protected:
     // This is a pointer to the interface we will use to interact with manta.
-    RTRTInterface *rtrt_int;
+    MantaInterface *engine;
 
     void show(const vector<string>& args);
     

Modified: branches/newpipeline/UserInterface/XWindowUI.cc
==============================================================================
--- branches/newpipeline/UserInterface/XWindowUI.cc     (original)
+++ branches/newpipeline/UserInterface/XWindowUI.cc     Thu Jun 30 14:01:31 
2005
@@ -2,7 +2,7 @@
 #include <Core/Util/Args.h>
 #include <Interface/Camera.h>
 #include <Interface/Context.h>
-#include <Interface/RTRTInterface.h>
+#include <Interface/MantaInterface.h>
 #include <Interface/Transaction.h>
 #include <Interface/XWindow.h>
 #include <Core/Exceptions/ErrnoException.h>
@@ -45,7 +45,7 @@
 using SCIRun::Thread;
 
 UserInterface* XWindowUI::create(const vector<string>& args,
-                                 RTRTInterface *rtrt_interface)
+                                 MantaInterface *rtrt_interface)
 {
   UserInterface *newUI = new XWindowUI(args, rtrt_interface);
   return newUI;
@@ -61,8 +61,8 @@
     ui->removeConnection(fd);
 }
 
-XWindowUI::XWindowUI(const vector<string>& /*args*/, RTRTInterface 
*rtrt_interface)
-  : rtrt_interface(rtrt_interface), xlock("XWindowUI display lock"),
+XWindowUI::XWindowUI(const vector<string>& /*args*/, MantaInterface *engine)
+  : engine(engine), xlock("XWindowUI display lock"),
     xsema("XWindowUI semaphore", 0)
 {
   fov_speed = 10;
@@ -74,8 +74,8 @@
 
   register_default_keys();
   register_default_mouse();
-  rtrt_interface->registerSetupCallback(this);
-  rtrt_interface->registerSerialAnimationCallback(Callback::create(this, 
&XWindowUI::animation_callback));
+  engine->registerSetupCallback(this);
+  engine->registerSerialAnimationCallback(Callback::create(this, 
&XWindowUI::animation_callback));
 
   // Open the display and setup file descriptors for threads
   if(pipe(xpipe) == -1){
@@ -313,7 +313,7 @@
 void XWindowUI::changeResolution(int, int, int channel,
                                  int new_xres, int new_yres)
 {
-  rtrt_interface->changeResolution(channel, new_xres, new_yres, true);
+  engine->changeResolution(channel, new_xres, new_yres, true);
 }
 
 void XWindowUI::printhelp(ostream& out)
@@ -430,8 +430,8 @@
   int value = 1;
   if(key == XStringToKeysym("P"))
     value = -1;
-  rtrt_interface->addTransaction("numWorkers",
-                                rtrt_interface->numWorkers(),
+  engine->addTransaction("numWorkers",
+                                engine->numWorkers(),
                                  changeProcs(value));
 }
 
@@ -444,14 +444,14 @@
     Thread::exitAll(1);
   } else {
     quitting = true;
-    rtrt_interface->finish();
+    engine->finish();
   }
 }
 
 void XWindowUI::autoview(unsigned int, unsigned long, int channel)
 {
-  Camera* camera = rtrt_interface->getCamera(channel);
-  rtrt_interface->addTransaction("autoview",
+  Camera* camera = engine->getCamera(channel);
+  engine->addTransaction("autoview",
                                  Callback::create(camera, &Camera::autoview,
                                                   autoview_fov));
 }
@@ -480,8 +480,8 @@
     else
       scale += 1;
 
-    Camera* camera = rtrt_interface->getCamera(channel);
-    rtrt_interface->addTransaction("scale fov",
+    Camera* camera = engine->getCamera(channel);
+    engine->addTransaction("scale fov",
                                    Callback::create(camera, 
&Camera::scaleFOV,
                                                     scale));
 
@@ -506,8 +506,8 @@
     trans.initWithRotation(to, ias.rotate_from);
     ias.rotate_from = to;
 
-    Camera* camera = rtrt_interface->getCamera(channel);
-    rtrt_interface->addTransaction("rotate",
+    Camera* camera = engine->getCamera(channel);
+    engine->addTransaction("rotate",
                                    Callback::create(camera, 
&Camera::transform,
                                                     trans, Camera::LookAt));
     ias.last_x = mouse_x;
@@ -529,8 +529,8 @@
     double ymotion = -double(ias.last_y-mouse_y)/window->yres;
     Vector translation(xmotion*translate_speed, ymotion*translate_speed, 0);
 
-    Camera* camera = rtrt_interface->getCamera(channel);
-    rtrt_interface->addTransaction("translate",
+    Camera* camera = engine->getCamera(channel);
+    engine->addTransaction("translate",
                                    Callback::create(camera, 
&Camera::translate,
                                                     translation));
     ias.last_x = mouse_x;
@@ -557,8 +557,8 @@
       scale=ymotion;
     scale *= dolly_speed;
 
-    Camera* camera = rtrt_interface->getCamera(channel);
-    rtrt_interface->addTransaction("dolly",
+    Camera* camera = engine->getCamera(channel);
+    engine->addTransaction("dolly",
                                    Callback::create(camera, &Camera::dolly,
                                                     scale));
     ias.last_x = mouse_x;
@@ -706,9 +706,9 @@
       int new_yres = e.xconfigure.height;
       XWindow* window = windows[channel];
       if(new_xres != window->xres || new_yres != window->yres)
-        rtrt_interface->addOneShotCallback(RTRTInterface::Relative, 0,
-                           Callback::create(this, 
&XWindowUI::changeResolution,
-                                            channel, new_xres, new_yres));
+        engine->addOneShotCallback(MantaInterface::Relative, 0,
+                                   Callback::create(this, 
&XWindowUI::changeResolution,
+                                                    channel, new_xres, 
new_yres));
     } // case ConfigureNotify
     break;
   case Expose:

Modified: branches/newpipeline/UserInterface/XWindowUI.h
==============================================================================
--- branches/newpipeline/UserInterface/XWindowUI.h      (original)
+++ branches/newpipeline/UserInterface/XWindowUI.h      Thu Jun 30 14:01:31 
2005
@@ -20,13 +20,13 @@
 namespace Manta {
   using namespace std;
 
-  class RTRTInterface;
+  class MantaInterface;
   class TrackBall;
   class XWindow;
   
   class XWindowUI: public UserInterface, public SetupCallback, public 
SCIRun::Runnable {
   public:
-    XWindowUI(const vector<string>& args, RTRTInterface *rtrt_interface);
+    XWindowUI(const vector<string>& args, MantaInterface *engine);
     virtual ~XWindowUI();
 
     // From UserInterface
@@ -40,7 +40,7 @@
     virtual void run();
 
     static UserInterface* create(const vector<string>& args,
-                                RTRTInterface *rtrt_interface);
+                                MantaInterface *engine);
 
     void addConnection(int fd);
     void removeConnection(int fd);
@@ -81,7 +81,7 @@
     Vector projectToSphere(double x, double y, double radius) const;
 
     // This is a pointer to the interface we will use to interact with manta.
-    RTRTInterface *rtrt_interface;
+    MantaInterface *engine;
     vector<XWindow*> windows;
 
     void lock_x();




  • [MANTA] r416 - in branches/newpipeline: . Engine/Control Engine/Display Interface StandAlone UserInterface, sparker, 06/30/2005

Archive powered by MHonArc 2.6.16.

Top of page