Text archives Help
- From: abe@sci.utah.edu
- To: manta@sci.utah.edu
- Subject: [MANTA] r443 - in branches/itanium2: Engine/Control Engine/Display Image Model/Groups Model/MiscObjects StandAlone UserInterface
- Date: Wed, 27 Jul 2005 13:30:16 -0600 (MDT)
Author: abe
Date: Wed Jul 27 13:30:11 2005
New Revision: 443
Modified:
branches/itanium2/Engine/Control/RTRT.cc
branches/itanium2/Engine/Display/OpenGLDisplay.cc
branches/itanium2/Image/TGAFile.cc
branches/itanium2/Model/Groups/BVH.cc
branches/itanium2/Model/MiscObjects/Difference.cc
branches/itanium2/StandAlone/manta.cc
branches/itanium2/UserInterface/XWindowUI.cc
Log:
Added __FILE__ and __LINE__ in about a million places (or maybe seven).
M Image/TGAFile.cc
M StandAlone/manta.cc
M UserInterface/XWindowUI.cc
M Model/Groups/BVH.cc
M Model/MiscObjects/Difference.cc
M Engine/Control/RTRT.cc
M Engine/Display/OpenGLDisplay.cc
Modified: branches/itanium2/Engine/Control/RTRT.cc
==============================================================================
--- branches/itanium2/Engine/Control/RTRT.cc (original)
+++ branches/itanium2/Engine/Control/RTRT.cc Wed Jul 27 13:30:11 2005
@@ -160,7 +160,7 @@
{
runningLock.lock();
if(running)
- throw InvalidState("renderLoop started while it is already running");
+ throw InvalidState("renderLoop started while it is already running",
__FILE__, __LINE__ );
running=true;
runningLock.unlock();
@@ -172,7 +172,7 @@
scene->getObject()->preprocess(context);
if(!currentImageCreator)
- throw InvalidState("Image type was not selected");
+ throw InvalidState("Image type was not selected", __FILE__, __LINE__ );
#if NOTFINISHED
check for existence of other components;
@@ -664,7 +664,7 @@
// Check to for errors.
if(!iteration)
- throw InternalError("Pipeline/resolution negotiation failed");
+ throw InternalError("Pipeline/resolution negotiation failed",
__FILE__, __LINE__ );
context.getResolution(channel->stereo, channel->xres, channel->yres);
if(channel->xres <= 0)
@@ -672,7 +672,7 @@
if(channel->yres <= 0)
throw IllegalValue<int>("Resolution should be positive",
channel->yres);
if(context.getMinDepth() > context.getMaxDepth())
- throw InternalError("Pipeline depth negotiation failed");
+ throw InternalError("Pipeline depth negotiation failed", __FILE__,
__LINE__ );
int depth = context.getMinDepth();
if(depth == 1 && context.getMaxDepth() > 1)
Modified: branches/itanium2/Engine/Display/OpenGLDisplay.cc
==============================================================================
--- branches/itanium2/Engine/Display/OpenGLDisplay.cc (original)
+++ branches/itanium2/Engine/Display/OpenGLDisplay.cc Wed Jul 27 13:30:11
2005
@@ -92,12 +92,12 @@
// Open the display and make sure it has opengl
dpy = XOpenDisplay(NULL);
if(!dpy)
- throw InternalError("Error opening display");
+ throw InternalError("Error opening display", __FILE__, __LINE__ );
int error, event;
if ( !glXQueryExtension( dpy, &error, &event) ) {
XCloseDisplay(dpy);
dpy=0;
- throw InternalError("GL extension NOT available!\n");
+ throw InternalError("GL extension NOT available!\n", __FILE__, __LINE__
);
}
int screen=DefaultScreen(dpy);
@@ -121,7 +121,7 @@
vi = glXChooseVisual(dpy, screen, &attribList[0]);
if(!vi){
// Cannot find anything suitable
- throw InternalError("Error selecting OpenGL visual");
+ throw InternalError("Error selecting OpenGL visual", __FILE__,
__LINE__ );
}
}
@@ -175,7 +175,7 @@
XFree(vi);
if(!glXMakeCurrent(dpy, win, cx))
- throw InternalError("glXMakeCurrent failed!\n");
+ throw InternalError("glXMakeCurrent failed!\n", __FILE__, __LINE__ );
glClearColor(.05, .1, .2, 0);
glClear(GL_COLOR_BUFFER_BIT);
@@ -185,13 +185,13 @@
// Get the fonts. You need to call this with a current GL context.
fontInfo = XHelper::getX11Font(dpy);
if (!fontInfo)
- throw InternalError("getX11Font failed!\n");
+ throw InternalError("getX11Font failed!\n", __FILE__, __LINE__ );
fontbase = XHelper::getGLFont(fontInfo);
if (fontbase == 0)
- throw InternalError("getGLFont failed!\n");
+ throw InternalError("getGLFont failed!\n", __FILE__, __LINE__ );
if(!glXMakeCurrent(dpy, None, NULL))
- throw InternalError("glXMakeCurrent failed!\n");
+ throw InternalError("glXMakeCurrent failed!\n", __FILE__, __LINE__ );
}
void OpenGLDisplay::displayImage(const DisplayContext& context,
@@ -213,7 +213,7 @@
if(!madeCurrent){
if(!glXMakeCurrent(dpy, win, cx))
- throw InternalError("glXMakeCurrent failed!\n");
+ throw InternalError("glXMakeCurrent failed!\n", __FILE__, __LINE__ );
madeCurrent=true;
}
bool stereo;
@@ -284,7 +284,7 @@
glDrawPixels(xres, yres, GL_RGB, GL_FLOAT, si->getRaw(0));
}
} else {
- throw InternalError("Unknown image type in OpenGLDisplay");
+ throw InternalError("Unknown image type in OpenGLDisplay", __FILE__,
__LINE__ );
}
display_frame_rate(1.0/(currentTime-last_frame_time));
Modified: branches/itanium2/Image/TGAFile.cc
==============================================================================
--- branches/itanium2/Image/TGAFile.cc (original)
+++ branches/itanium2/Image/TGAFile.cc Wed Jul 27 13:30:11 2005
@@ -39,7 +39,7 @@
{
ofstream out( filename.c_str(), ios::out | ios::binary );
if ( !out )
- throw InternalError( "Couldn't open TGA file for writing: " + filename
);
+ throw InternalError( "Couldn't open TGA file for writing: " +
filename, __FILE__, __LINE__ );
out.put( 0 ); // ID length: 0
out.put( 0 ); // Color map type: None
out.put( 2 ); // Image type: uncompressed, true-color
image
@@ -125,7 +125,7 @@
++buffer;
}
} else {
- throw InternalError( "Unknown image type in writeTGA()" );
+ throw InternalError( "Unknown image type in writeTGA()", __FILE__,
__LINE__ );
}
}
@@ -152,14 +152,14 @@
{
ifstream in( filename.c_str(), ios::in | ios::binary );
if ( !in )
- throw InternalError( "Couldn't open TGA file for reading: " + filename
);
+ throw InternalError( "Couldn't open TGA file for reading: " +
filename, __FILE__, __LINE__ );
int id_length = in.get();
int color_map_type = in.get();
if ( color_map_type != 0 )
- throw InternalError( "Color map TGA files currently unsupported" );
+ throw InternalError( "Color map TGA files currently unsupported",
__FILE__, __LINE__ );
int image_type = in.get();
if ( image_type != 2 )
- throw InternalError( "Only uncompressed true-color TGA files currently
supported" );
+ throw InternalError( "Only uncompressed true-color TGA files currently
supported", __FILE__, __LINE__ );
int color_map_first_entry_index = readShort( in );
int color_map_length = readShort( in );
int color_map_entry_size = in.get();
@@ -198,7 +198,7 @@
}
return si;
}
- throw InternalError( "Unhandled pixel depth and alpha for TGA files" );
+ throw InternalError( "Unhandled pixel depth and alpha for TGA files",
__FILE__, __LINE__ );
}
}
Modified: branches/itanium2/Model/Groups/BVH.cc
==============================================================================
--- branches/itanium2/Model/Groups/BVH.cc (original)
+++ branches/itanium2/Model/Groups/BVH.cc Wed Jul 27 13:30:11 2005
@@ -263,7 +263,7 @@
delete [] objValues;
}
else {
- throw InternalError("Unknown build mode: "+buildMode);
+ throw InternalError("Unknown build mode: "+buildMode, __FILE__, __LINE__
);
}
@@ -281,12 +281,12 @@
if(node->left > 0){
stack[nstack++] = node->left;
if(nstack >= MAXDEPTH)
- throw InternalError("Depth of BVH exceeds maximum depth:
"+to_string(MAXDEPTH)+", must change MAXDEPTH in "+__FILE__);
+ throw InternalError("Depth of BVH exceeds maximum depth:
"+to_string(MAXDEPTH)+", must change MAXDEPTH in "+__FILE__, __FILE__,
__LINE__ );
}
if(node->right > 0){
stack[nstack++] = node->right;
if(nstack >= MAXDEPTH)
- throw InternalError("Depth of BVH exceeds maximum depth:
"+to_string(MAXDEPTH)+", must change MAXDEPTH in "+__FILE__);
+ throw InternalError("Depth of BVH exceeds maximum depth:
"+to_string(MAXDEPTH)+", must change MAXDEPTH in "+__FILE__, __FILE__,
__LINE__ );
}
}
Modified: branches/itanium2/Model/MiscObjects/Difference.cc
==============================================================================
--- branches/itanium2/Model/MiscObjects/Difference.cc (original)
+++ branches/itanium2/Model/MiscObjects/Difference.cc Wed Jul 27 13:30:11
2005
@@ -9,7 +9,7 @@
Difference::Difference(Object* object1, Object* object2)
: object1(object1), object2(object2)
{
- throw InternalError("Difference not yet implemented");
+ throw InternalError("Difference not yet implemented", __FILE__, __LINE__ );
}
Difference::~Difference()
Modified: branches/itanium2/StandAlone/manta.cc
==============================================================================
--- branches/itanium2/StandAlone/manta.cc (original)
+++ branches/itanium2/StandAlone/manta.cc Wed Jul 27 13:30:11 2005
@@ -122,20 +122,20 @@
rtrt->setScenePath(".:../scenes");
rtrt->changeNumWorkers(1);
if(!rtrt->selectImageType("rgba8"))
- throw InternalError("default image not found");
+ throw InternalError("default image not found", __FILE__, __LINE__ );
if(!rtrt->selectLoadBalancer("workqueue"))
- throw InternalError("default load balancer not found");
+ throw InternalError("default load balancer not found", __FILE__,
__LINE__ );
if(!rtrt->selectImageTraverser("tiled"))
- throw InternalError("default image traverser not found");
+ throw InternalError("default image traverser not found", __FILE__,
__LINE__ );
if(!rtrt->selectPixelSampler("singlesample"))
- throw InternalError("default pixel sampler not found");
+ throw InternalError("default pixel sampler not found", __FILE__,
__LINE__ );
if(!rtrt->selectRenderer("raytracer"))
- throw InternalError("default renderer not found");
+ throw InternalError("default renderer not found", __FILE__, __LINE__ );
if(!rtrt->selectShadowAlgorithm("hard"))
- throw InternalError("default shadow algorithm not found");
+ throw InternalError("default shadow algorithm not found", __FILE__,
__LINE__ );
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");
+ throw InternalError("cannot create default camera", __FILE__, __LINE__
);
int xres = 512, yres = 512;
bool channelCreated=false;
bool haveUI = false;
Modified: branches/itanium2/UserInterface/XWindowUI.cc
==============================================================================
--- branches/itanium2/UserInterface/XWindowUI.cc (original)
+++ branches/itanium2/UserInterface/XWindowUI.cc Wed Jul 27 13:30:11
2005
@@ -77,13 +77,13 @@
// Open the display and setup file descriptors for threads
if(pipe(xpipe) == -1){
- throw ErrnoException("XWindowUI pipe", errno);
+ throw ErrnoException( "XWindowUI pipe", errno, __FILE__, __LINE__ );
}
dpy = XOpenDisplay(NULL);
if(!dpy)
- throw InternalError("XOpenDisplay failed");
+ throw InternalError("XOpenDisplay failed", __FILE__, __LINE__ );
if(XAddConnectionWatch(dpy, connection_watch,
reinterpret_cast<XPointer>(this)) == 0)
- throw InternalError("XAddConnectionWatch failed");
+ throw InternalError("XAddConnectionWatch failed", __FILE__, __LINE__ );
if(xfds.size() == 0){
// XAddConnectionWatch must be broken. To fix it, we look at the
@@ -91,7 +91,7 @@
// file descriptors are between the two.
int tmp_pipe[2];
if(pipe(tmp_pipe) == -1)
- throw ErrnoException("XWindowUI pipe2", errno);
+ throw ErrnoException("XWindowUI pipe2", errno, __FILE__, __LINE__ );
for(int i=xpipe[1]+1; i<tmp_pipe[0];i++)
addConnection(i);
}
@@ -171,14 +171,14 @@
}
int s = select(max+1, &readfds, 0, 0, 0);
if(s == -1)
- throw ErrnoException("XWindowUI select", errno);
+ throw ErrnoException("XWindowUI select", errno, __FILE__, __LINE__ );
if(FD_ISSET(xpipe[0], &readfds)){
// Process the pipe...
int token;
ssize_t s = read(xpipe[0], &token, sizeof(token));
if(s != sizeof(token))
- throw ErrnoException("XWindowUI read pipe", errno);
+ throw ErrnoException("XWindowUI read pipe", errno, __FILE__, __LINE__
);
switch(token){
case TOKEN_NOOP:
break;
@@ -188,7 +188,7 @@
xlock.lock();
break;
default:
- throw InternalError("XWindowUI::Unknown token in pipe");
+ throw InternalError("XWindowUI::Unknown token in pipe", __FILE__,
__LINE__ );
}
}
bool have_some = false;
@@ -223,7 +223,7 @@
int token = TOKEN_LOCK;
ssize_t s = write(xpipe[1], &token, sizeof(int));
if(s != sizeof(int)){
- throw ErrnoException("XWindowUI write 3", errno);
+ throw ErrnoException("XWindowUI write 3", errno, __FILE__, __LINE__ );
}
xlock.lock();
}
@@ -274,12 +274,12 @@
{
// cerr << description << ": " << (void*)key << '\n';
if(key == 0)
- throw InternalError("tried to register invalid key: "+description);
+ throw InternalError("tried to register invalid key: "+description,
__FILE__, __LINE__ );
for(vector<KeyTab>::iterator iter = keys.begin();
iter != keys.end(); iter++){
if(key == iter->key && state == iter->state)
- throw InternalError("Two functions mapped to the same key:
"+description+" and "+iter->description);
+ throw InternalError("Two functions mapped to the same key:
"+description+" and "+iter->description, __FILE__, __LINE__ );
}
KeyTab entry;
entry.key = key;
@@ -298,7 +298,7 @@
for(vector<MouseTab>::iterator iter = mouse.begin();
iter != mouse.end(); iter++){
if(button == iter->button && state == iter->state)
- throw InternalError("Two functions mapped to the same mouse button:
"+description+" and "+iter->description);
+ throw InternalError("Two functions mapped to the same mouse button:
"+description+" and "+iter->description, __FILE__, __LINE__ );
}
MouseTab entry;
entry.state = state;
- [MANTA] r443 - in branches/itanium2: Engine/Control Engine/Display Image Model/Groups Model/MiscObjects StandAlone UserInterface, abe, 07/27/2005
Archive powered by MHonArc 2.6.16.