Text archives Help
- From: abe@sci.utah.edu
- To: manta@sci.utah.edu
- Subject: [MANTA] r420 - in branches/itanium2: Engine/Control UserInterface
- Date: Sun, 3 Jul 2005 14:26:05 -0600 (MDT)
Author: abe
Date: Sun Jul 3 14:26:01 2005
New Revision: 420
Added:
branches/itanium2/UserInterface/NullUI.h
Modified:
branches/itanium2/Engine/Control/RTRT.cc
branches/itanium2/Engine/Control/RTRT.h
branches/itanium2/Engine/Control/RTRT_register.cc
branches/itanium2/UserInterface/CMakeLists.txt
branches/itanium2/UserInterface/XWindowUI.cc
Log:
Added a NullUI class for benchmarks.
M UserInterface/XWindowUI.cc
M UserInterface/CMakeLists.txt
A UserInterface/NullUI.h
Added a Null user interface which won't connect to a X11 server. Useful for
doing lots of batched benchmarks.
M Engine/Control/RTRT.cc
M Engine/Control/RTRT.h
M Engine/Control/RTRT_register.cc
Registered class..
Modified: branches/itanium2/Engine/Control/RTRT.cc
==============================================================================
--- branches/itanium2/Engine/Control/RTRT.cc (original)
+++ branches/itanium2/Engine/Control/RTRT.cc Sun Jul 3 14:26:01 2005
@@ -621,56 +621,84 @@
void RTRT::setupPipelines(int numProcs)
{
+ // Total number of channels.
int numChannels = static_cast<int>(channels.size());
- SetupContext globalcontext(this, numChannels, 0, numProcs,
+
+ // Create a setup context.
+ SetupContext globalcontext(this, numChannels, 0, numProcs,
currentLoadBalancer, currentPixelSampler,
currentRenderer);
+
+ // Setup the image traverser.
currentImageTraverser->setupBegin(globalcontext, numChannels);
- for(vector<SetupCallback*>::iterator iter = setupCallbacks.begin();
- iter != setupCallbacks.end(); iter++)
- (*iter)->setupBegin(globalcontext, numChannels);
+
+ // Proceess setup callbacks.
+ for(vector<SetupCallback*>::iterator iter = setupCallbacks.begin(); iter
!= setupCallbacks.end(); iter++)
+ (*iter)->setupBegin(globalcontext, numChannels);
+
+ // Setup each channel.
for(int index = 0;index < static_cast<int>(channels.size());index++){
Channel* channel = channels[index];
SetupContext context(this, index, numChannels, 0, numProcs,
channel->stereo, channel->xres, channel->yres,
currentLoadBalancer, currentPixelSampler,
currentRenderer);
+
+ // Setup the channel iteratively, until context.isChanged()
is false.
int iteration = 100;
do {
context.setChanged(false);
context.clearMasterWindow();
- for(vector<SetupCallback*>::iterator iter = setupCallbacks.begin();
- iter != setupCallbacks.end(); iter++)
+
+ // Call setup callbacks.
+ for(vector<SetupCallback*>::iterator iter = setupCallbacks.begin();
iter != setupCallbacks.end(); iter++)
(*iter)->setupDisplayChannel(context);
+
+ // Setup the image display.
channel->display->setupDisplayChannel(context);
+
+ // Setup the image traverser.
currentImageTraverser->setupDisplayChannel(context);
+
} while(context.isChanged() && --iteration > 0);
+
+ // Check to for errors.
if(!iteration)
throw InternalError("Pipeline/resolution negotiation failed");
context.getResolution(channel->stereo, channel->xres, channel->yres);
- if(channel->xres <= 0)
+
+ if(channel->xres <= 0)
throw IllegalValue<int>("Resolution should be positive",
channel->xres);
if(channel->yres <= 0)
throw IllegalValue<int>("Resolution should be positive",
channel->yres);
-
if(context.getMinDepth() > context.getMaxDepth())
throw InternalError("Pipeline depth negotiation failed");
+
int depth = context.getMinDepth();
if(depth == 1 && context.getMaxDepth() > 1)
depth = 2; // Prefer double-buffering
- cerr << "RTRT::setupPipelines:: depth = "<< depth << "\n";
- channel->pipelineDepth = depth;
+
+ cerr << "RTRT::setupPipelines:: depth = "<< depth << "\n";
+
+ // Set the pipeline depth.
+ channel->pipelineDepth = depth;
unsigned long osize = channel->images.size();
for(unsigned long i=depth;i<osize;i++)
delete channel->images[i];
+
+ // Zero pointers to images.
for(unsigned long i=osize;i<static_cast<unsigned long>(depth);i++)
channel->images[i]=0;
+
+ // Specify the number of frames needed for the entire
pipeline.
channel->images.resize(depth);
}
}
void RTRT::resizeImages(long frame)
{
+
+
for(ChannelListType::iterator iter = channels.begin();
iter != channels.end(); iter++){
Channel* channel = *iter;
@@ -784,6 +812,10 @@
list.push_back(iter->first);
return list;
}
+
+void RTRT::setPixelSampler( PixelSampler *sampler_ ) {
+ currentPixelSampler = sampler_;
+};
bool RTRT::selectPixelSampler(const string& spec)
{
Modified: branches/itanium2/Engine/Control/RTRT.h
==============================================================================
--- branches/itanium2/Engine/Control/RTRT.h (original)
+++ branches/itanium2/Engine/Control/RTRT.h Sun Jul 3 14:26:01 2005
@@ -66,6 +66,7 @@
virtual listType listLoadBalancers() const;
// PixelSamplers
+ virtual void setPixelSampler( PixelSampler *sampler_ );
virtual bool selectPixelSampler(const string& spec);
virtual void registerComponent(const string& name, PixelSamplerCreator
creator);
virtual listType listPixelSamplers() const;
Modified: branches/itanium2/Engine/Control/RTRT_register.cc
==============================================================================
--- branches/itanium2/Engine/Control/RTRT_register.cc (original)
+++ branches/itanium2/Engine/Control/RTRT_register.cc Sun Jul 3 14:26:01
2005
@@ -34,6 +34,7 @@
#include <Model/Groups/Group.h>
#include <UserInterface/PromptUI.h>
#include <UserInterface/XWindowUI.h>
+#include <UserInterface/NullUI.h>
@@ -95,6 +96,7 @@
rtrt->registerComponent("zoom", &ZoomIdleMode::create);
// Register user interfaces
+ rtrt->registerComponent("null", &NullUI::create);
rtrt->registerComponent("prompt", &PromptUI::create);
rtrt->registerComponent("X", &XWindowUI::create);
Modified: branches/itanium2/UserInterface/CMakeLists.txt
==============================================================================
--- branches/itanium2/UserInterface/CMakeLists.txt (original)
+++ branches/itanium2/UserInterface/CMakeLists.txt Sun Jul 3 14:26:01
2005
@@ -3,6 +3,7 @@
PromptUI.h
PromptUI.cc
XWindowUI.h
- XWindowUI.cc)
+ XWindowUI.cc
+ NullUI.h)
TARGET_LINK_LIBRARIES(Manta_UserInterface Manta_Core Manta_Interface)
TARGET_LINK_LIBRARIES(Manta_UserInterface ${X11_LIBRARIES})
Added: branches/itanium2/UserInterface/NullUI.h
==============================================================================
--- (empty file)
+++ branches/itanium2/UserInterface/NullUI.h Sun Jul 3 14:26:01 2005
@@ -0,0 +1,35 @@
+
+
+#ifndef Manta_UserInterface_NullUI_h
+#define Manta_UserInterface_NullUI_h
+
+
+#include <Interface/UserInterface.h>
+#include <Core/Thread/Runnable.h>
+
+#include <sgi_stl_warnings_off.h>
+#include <vector>
+#include <string>
+#include <sgi_stl_warnings_on.h>
+
+namespace Manta {
+
+ class RTRTInterface;
+
+ // This class implements a null user interface which should be used
for
+ // benchmarking.
+ class NullUI : public UserInterface {
+ public:
+ NullUI() { }
+ virtual ~NullUI() { }
+
+ // Call this function when you want the User interface to startup
+ virtual void startup() { /* Does nothing. */ };
+
+ static UserInterface* create(const vector<string>& args,
RTRTInterface *rtrt_int) {
+ return new NullUI();
+ }
+ };
+}
+
+#endif
Modified: branches/itanium2/UserInterface/XWindowUI.cc
==============================================================================
--- branches/itanium2/UserInterface/XWindowUI.cc (original)
+++ branches/itanium2/UserInterface/XWindowUI.cc Sun Jul 3 14:26:01
2005
@@ -272,7 +272,7 @@
KeyEventCallbackType* press,
KeyEventCallbackType* release)
{
- cerr << description << ": " << (void*)key << '\n';
+ // cerr << description << ": " << (void*)key << '\n';
if(key == 0)
throw InternalError("tried to register invalid key: "+description);
@@ -294,7 +294,7 @@
const string& description,
MouseEventCallbackType* event)
{
- cerr << description << ": " << button << '\n';
+ // cerr << description << ": " << button << '\n';
for(vector<MouseTab>::iterator iter = mouse.begin();
iter != mouse.end(); iter++){
if(button == iter->button && state == iter->state)
@@ -311,7 +311,7 @@
void XWindowUI::changeResolution(int, int, int channel,
int new_xres, int new_yres)
{
- cerr << "Resolution: " << new_xres << " " << new_yres << endl;
+ // cerr << "Resolution: " << new_xres << " " << new_yres << endl;
rtrt_interface->changeResolution(channel, new_xres, new_yres, true);
}
- [MANTA] r420 - in branches/itanium2: Engine/Control UserInterface, abe, 07/03/2005
Archive powered by MHonArc 2.6.16.