Commit 45765032 authored by hrchilds's avatar hrchilds
Browse files

Update from December 2, 2003

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@134 18c085ea-50e0-402c-830e-de6fd14e8384
parent d5de4392
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -268,6 +268,21 @@ Init::GetComponentName(void)
return (const char *) componentName;
}
// ****************************************************************************
// Function: Init::IsComponent
//
// Purpose: Tests name of component against name passed as argument
//
// ****************************************************************************
bool
Init::IsComponent(const char *compName)
{
if (strcmp(compName, Init::GetComponentName()) == 0)
return true;
else
return false;
}
// ****************************************************************************
// Function: Init::GetExecutableName
//
......
......@@ -30,6 +30,7 @@ namespace Init
MISC_API void SetComponentName(const char *);
MISC_API const char * GetExecutableName();
MISC_API const char * GetComponentName();
MISC_API bool IsComponent(const char *);
MISC_API void ComponentIssueError(const char *);
MISC_API void ComponentRegisterErrorFunction(ErrorFunction, void *);
}
......
......@@ -1040,7 +1040,7 @@ NetworkManager::GetOutput(bool respondWithNullData, bool calledForRender)
// compute this network's cell count if we haven't already
if (globalCellCounts[netId] == -1)
{
bool polysOnly = false;
bool polysOnly = true;
int localCellCount = writer->GetInput()->GetNumberOfCells(polysOnly);
int totalCellCount;
#ifdef PARALLEL
......
......@@ -18,6 +18,7 @@
#include <BadHostException.h>
#include <ChangeDirectoryException.h>
#include <CouldNotConnectException.h>
#include <DebugStream.h>
#include <GetFileListException.h>
#include <HostProfileList.h>
#include <HostProfile.h>
......@@ -243,10 +244,14 @@ private:
// Brad Whitlock, Fri Oct 10 15:05:15 PST 2003
// I added the recentPathsRemoval window.
//
// Brad Whitlock, Tue Dec 2 16:31:02 PST 2003
// Initialized currentVirtualDatabaseDefinition.
//
// ****************************************************************************
QvisFileSelectionWindow::QvisFileSelectionWindow(const char *winCaption) :
QvisDelayedWindowSimpleObserver(winCaption), intermediateFileList()
QvisDelayedWindowSimpleObserver(winCaption), intermediateFileList(),
currentVirtualDatabaseDefinition()
{
fs = 0;
profiles = 0;
......@@ -1628,6 +1633,10 @@ QvisFileSelectionWindow::setEnabled(bool val)
// Brad Whitlock, Mon Oct 13 11:25:26 PDT 2003
// Added code to hide the recent paths removal window.
//
// Brad Whitlock, Tue Dec 2 16:27:02 PST 2003
// I added code to make sure that the virtual database definition is
// different before deciding to reopen it on the viewer.
//
// ****************************************************************************
void
......@@ -1654,8 +1663,31 @@ QvisFileSelectionWindow::okClicked()
if(intermediateFileList[i].IsVirtual() &&
fileServer->GetOpenFile() == intermediateFileList[i])
{
viewer->ReOpenDatabase(intermediateFileList[i].FullName().c_str(),
false);
//
// Get the virtual file definition and compare it to the
// definition that we obtained when we brought up the window.
//
stringVector dbDef =
fileServer->GetVirtualFileDefinition(intermediateFileList[i]);
if(dbDef == currentVirtualDatabaseDefinition)
{
debug1 << "QvisFileSelectionWindow::okClicked: The virtual "
<< "database definition for "
<< intermediateFileList[i].FullName().c_str()
<< " did not change. No reopen is required."
<< endl;
}
else
{
debug1 << "QvisFileSelectionWindow::okClicked: The virtual "
<< "database definition for "
<< intermediateFileList[i].FullName().c_str()
<< " changed! Reopen is required."
<< endl;
viewer->ReOpenDatabase(
intermediateFileList[i].FullName().c_str(), false);
}
break;
}
}
......@@ -2300,6 +2332,17 @@ QvisFileSelectionWindow::refreshFiles()
void
QvisFileSelectionWindow::show()
{
//
// Get the virtual file definition for the currently open file. We have to
// do this so we can compare the virtual file definition before we do
// anything with the definition after we've done something in order to
// prevent reopening the virtual database any more often than we need to
// reopen it. Files that are not virtual return an empty definition.
//
currentVirtualDatabaseDefinition =
fileServer->GetVirtualFileDefinition(fileServer->GetOpenFile());
// Show the window.
QvisDelayedWindowSimpleObserver::show();
refreshFiles();
}
......
......@@ -72,6 +72,9 @@ class QvisRecentPathRemovalWindow;
// Brad Whitlock, Fri Oct 10 14:43:31 PST 2003
// I added a push button to open a window to remove recent paths.
//
// Brad Whitlock, Tue Dec 2 16:30:37 PST 2003
// I added currentVirtualDatabaseDefinition.
//
// ****************************************************************************
class GUI_API QvisFileSelectionWindow : public QvisDelayedWindowSimpleObserver
......@@ -158,6 +161,7 @@ private:
QPixmap *databasePixmap;
QualifiedFilenameVector intermediateFileList;
stringVector currentVirtualDatabaseDefinition;
};
#endif
......@@ -2836,15 +2836,19 @@ QvisGUIApplication::InitializeFileServer(DataNode *guiNode)
// Creation: Mon Jun 23 10:43:58 PDT 2003
//
// Modifications:
//
// Brad Whitlock, Tue Dec 2 16:47:35 PST 2003
// Added code to compare virtual file definitions before reopening the
// open database.
//
// ****************************************************************************
void
QvisGUIApplication::RefreshFileList()
{
// Save the current host and path.
std::string oldHost(fileServer->GetHost());
std::string oldPath(fileServer->GetPath());
// Save the current host and path and virtual file definition.
std::string oldHost(fileServer->GetHost());
std::string oldPath(fileServer->GetPath());
stringVector dbDef(fileServer->GetVirtualFileDefinition(fileServer->GetOpenFile()));
//
// Create a list of hosts,paths for which we must get a new list of files.
......@@ -2903,9 +2907,20 @@ QvisGUIApplication::RefreshFileList()
//
for(i = 0; i < refreshedFiles.size(); ++i)
{
if(refreshedFiles[i].IsVirtual() && refreshedFiles[i] == fileServer->GetOpenFile())
if(refreshedFiles[i].IsVirtual() &&
refreshedFiles[i] == fileServer->GetOpenFile())
{
viewer->ReOpenDatabase(refreshedFiles[i].FullName().c_str(), false);
// Get the new virtual file definiton.
stringVector newDef(
fileServer->GetVirtualFileDefinition(fileServer->GetOpenFile()));
// If the virtual file definitions are different then reopen the
// database on the viewer so that plots are reexecuted.
if(dbDef != newDef)
{
viewer->ReOpenDatabase(refreshedFiles[i].FullName().c_str(),
false);
}
break;
}
}
......
No preview for this file type
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -174,12 +174,13 @@ avtVolumeRenderer::Render(vtkDataSet *ds)
vtkRectilinearGrid *grid = (vtkRectilinearGrid*)ds;
vtkDataArray *data = NULL;
vtkDataArray *opac = NULL;
GetScalars(grid, data, opac);
bool haveScalars = GetScalars(grid, data, opac);
rendererImplementation->Render(grid, data, opac, view, atts,
vmin, vmax, vsize,
omin, omax, osize,
gx, gy, gz, gmn);
if (haveScalars)
rendererImplementation->Render(grid, data, opac, view, atts,
vmin, vmax, vsize,
omin, omax, osize,
gx, gy, gz, gmn);
}
......@@ -232,7 +233,8 @@ avtVolumeRenderer::Initialize(vtkDataSet *ds)
vtkRectilinearGrid *grid = (vtkRectilinearGrid*)ds;
vtkDataArray *data = NULL;
vtkDataArray *opac = NULL;
GetScalars(grid, data, opac);
if (!GetScalars(grid, data, opac))
return;
int dims[3];
grid->GetDimensions(dims);
......@@ -549,7 +551,7 @@ avtVolumeRenderer::SetAtts(const AttributeGroup *a)
// Do a better job of locating the variable.
//
// ****************************************************************************
void
bool
avtVolumeRenderer::GetScalars(vtkDataSet *ds, vtkDataArray *&data,
vtkDataArray *&opac)
{
......@@ -578,7 +580,7 @@ avtVolumeRenderer::GetScalars(vtkDataSet *ds, vtkDataArray *&data,
}
if (data == NULL)
{
EXCEPTION0(ImproperUseException);
return false;
}
//
......@@ -624,6 +626,8 @@ avtVolumeRenderer::GetScalars(vtkDataSet *ds, vtkDataArray *&data,
}
opac->Register(NULL);
}
return true;
}
// ****************************************************************************
......
......@@ -67,7 +67,7 @@ class avtVolumeRenderer : public avtCustomRenderer
float omin,omax,osize;
float *gx, *gy, *gz, *gm, *gmn;
void GetScalars(vtkDataSet*,vtkDataArray*&,vtkDataArray *&);
bool GetScalars(vtkDataSet*,vtkDataArray*&,vtkDataArray *&);
void GetRange(vtkDataArray *, float &, float &);
};
......
......@@ -970,53 +970,105 @@ ViewerEngineManager::ExternalRender(std::vector<const char*> pluginIDsList,
bool& shouldTurnOffScalableRendering,
std::vector<avtImage_p>& imgList)
{
bool retval = true;
int engineIndex;
// container for per-engine vector of plot ids
std::map<std::string,std::vector<int> > perEnginePlotIds;
// send per-plot RPCs
for (int i = 0; i < plotIdsList.size(); i++)
TRY
{
if (!UpdatePlotAttributes(hostsList[i].c_str(),pluginIDsList[i],
plotIdsList[i],attsList[i]))
return false;
perEnginePlotIds[hostsList[i]].push_back(plotIdsList[i]);
}
// send per-plot RPCs
for (int i = 0; i < plotIdsList.size(); i++)
{
if (!UpdatePlotAttributes(hostsList[i].c_str(),pluginIDsList[i],
plotIdsList[i],attsList[i]))
{
retval = false;
char msg[200];
SNPRINTF(msg,200,"Unsuccessful attempt to update plot attributes "
"for plot ID %d, (%d of %d)",
plotIdsList[i], i, plotIdsList.size());
EXCEPTION1(VisItException, msg);
}
perEnginePlotIds[hostsList[i]].push_back(plotIdsList[i]);
}
int numEnginesToRender = perEnginePlotIds.size();
bool sendZBuffer = numEnginesToRender > 1 ? true : false;
int numEnginesToRender = perEnginePlotIds.size();
bool sendZBuffer = numEnginesToRender > 1 ? true : false;
// send per-engine RPCs
std::map<std::string,std::vector<int> >::iterator pos;
for (pos = perEnginePlotIds.begin(); pos != perEnginePlotIds.end(); pos++)
{
if (!SetWinAnnotAtts(pos->first.c_str(), &winAtts, &annotAtts))
return false;
avtDataObjectReader_p rdr = GetDataObjectReader(sendZBuffer, pos->first.c_str(), pos->second);
// send per-engine RPCs
std::map<std::string,std::vector<int> >::iterator pos;
for (pos = perEnginePlotIds.begin(); pos != perEnginePlotIds.end(); pos++)
{
int engineIndex = GetEngineIndex(pos->first.c_str());
if (*rdr == NULL)
return false;
if (!SetWinAnnotAtts(pos->first.c_str(), &winAtts, &annotAtts))
{
retval = false;
char msg[200];
SNPRINTF(msg,200,"Unsuccessful attempt to update window attributes "
"for engine %s", pos->first.c_str());
EXCEPTION1(VisItException, msg);
}
// check to see if engine decided that SR mode is no longer necessary
if (rdr->InputIs(AVT_NULL_IMAGE_MSG))
{
shouldTurnOffScalableRendering = true;
break;
}
avtDataObjectReader_p rdr = GetDataObjectReader(sendZBuffer, pos->first.c_str(), pos->second);
if (*rdr == NULL)
{
retval = false;
char msg[200];
SNPRINTF(msg,200,"obtained null data reader for rendered image "
"for engine %s", pos->first.c_str());
EXCEPTION1(VisItException, msg);
}
// do some magic to update the network so we don't need the reader anymore
avtDataObject_p tmpDob = rdr->GetOutput();
avtPipelineSpecification_p spec =
tmpDob->GetTerminatingSource()->GetGeneralPipelineSpecification();
tmpDob->Update(spec);
// check to see if engine decided that SR mode is no longer necessary
if (rdr->InputIs(AVT_NULL_IMAGE_MSG))
{
shouldTurnOffScalableRendering = true;
break;
}
// do some magic to update the network so we don't need the reader anymore
avtDataObject_p tmpDob = rdr->GetOutput();
avtPipelineSpecification_p spec =
tmpDob->GetTerminatingSource()->GetGeneralPipelineSpecification();
tmpDob->Update(spec);
// put the resultant image in the returned list
avtImage_p img;
CopyTo(img,tmpDob);
imgList.push_back(img);
}
// put the resultant image in the returned list
avtImage_p img;
CopyTo(img,tmpDob);
imgList.push_back(img);
}
CATCH(LostConnectionException)
{
#ifndef VIEWER_MT
EndEngineExecute();
#endif
// Remove the specified engine from the list of engines.
RemoveFailedEngine(engineIndex);
UpdateEngineList();
}
CATCH(VisItException)
{
#ifndef VIEWER_MT
EndEngineExecute();
#endif
// Send a message to the client to clear the status for the
// engine that had troubles.
ClearStatus(engines[engineIndex]->hostName);
return true;
//
// Let calling method handle this exception.
//
RETHROW;
}
ENDTRY
return retval;
}
// ****************************************************************************
......
......@@ -1728,6 +1728,34 @@ ViewerPlotList::RealizePlots()
animation->UpdateFrame();
}
// ****************************************************************************
// Method: ViewerPlotList::SetErrorFlagAllPlots()
//
// Purpose:
// Indicate all plots are in error
//
// Programmer: Mark C. Miller
// Creation: Novembedr 25, 2003
//
// ****************************************************************************
void
ViewerPlotList::SetErrorFlagAllPlots(bool errorFlag)
{
//
// Loop through the list setting the realized flag for each plot.
//
for (int i = 0; i < nPlots; i++)
{
plots[i].plot->SetErrorFlag(errorFlag);
}
UpdatePlotList();
UpdateSILRestrictionAtts();
}
// ****************************************************************************
// Method: ViewerPlotList::SetPlotVar
//
......
......@@ -213,6 +213,7 @@ class VIEWER_API ViewerPlotList
void DeletePlot(ViewerPlot *, bool);
void HideActivePlots();
void RealizePlots();
void SetErrorFlagAllPlots(bool errorFlag);
void SetPlotVar(const char *variable);
void SetPlotAtts(const int plotType);
void SetPlotOperatorAtts(const int operatorType, bool applyToAll = false);
......
......@@ -37,6 +37,7 @@ using std::string;
#include <ViewerToolbar.h>
#include <ViewerSubject.h>
#include <ViewerWindowManager.h>
#include <VisItException.h>
#include <VisWindow.h>
#include <DebugStream.h>
......@@ -5845,63 +5846,89 @@ ViewerWindow::ExternalRenderCallback(void *data, avtDataObject_p& dob)
// see if we can skip the external render because nothing has changed
bool canSkip = win->CanSkipExternalRender(thisRequest);
// ok, we actually have to do a render
if (!canSkip && (thisRequest.plotIdsList.size() > 0))
TRY
{
ViewerEngineManager *eMgr = ViewerEngineManager::Instance();
bool shouldTurnOffScalableRendering = false;
std::vector<avtImage_p> imgList;
// let the engine manager do the render
bool requestSuccess = eMgr->ExternalRender(thisRequest.pluginIDsList,
thisRequest.hostsList,
thisRequest.plotIdsList,
thisRequest.attsList,
thisRequest.winAtts,
thisRequest.annotAtts,
shouldTurnOffScalableRendering,
imgList);
// return noting if the request failed
if (!requestSuccess)
// ok, we actually have to do a render
if (!canSkip && (thisRequest.plotIdsList.size() > 0))
{
dob = NULL;
return;
}
ViewerEngineManager *eMgr = ViewerEngineManager::Instance();
bool shouldTurnOffScalableRendering = false;
std::vector<avtImage_p> imgList;
// let the engine manager do the render
bool requestSuccess = eMgr->ExternalRender(thisRequest.pluginIDsList,
thisRequest.hostsList,
thisRequest.plotIdsList,
thisRequest.attsList,
thisRequest.winAtts,
thisRequest.annotAtts,
shouldTurnOffScalableRendering,
imgList);
// return noting if the request failed
if (!requestSuccess)
{
dob = NULL;
return;
}
// send an SR mode change message, if necessary
if (shouldTurnOffScalableRendering)
{
win->SendScalableRenderingModeChangeMessage(false);
dob = NULL;
return;
}
// send an SR mode change message, if necessary
if (shouldTurnOffScalableRendering)
{
win->SendScalableRenderingModeChangeMessage(false);
dob = NULL;
return;
}
// composite images from different engines as necessary
if (imgList.size() > 1)
{
avtWholeImageCompositer imageCompositer;
int numRows = thisRequest.winAtts.GetSize()[1];
int numCols = thisRequest.winAtts.GetSize()[0];
imageCompositer.SetOutputImageSize(numRows, numCols);
for (int i = 0; i < imgList.size(); i++)
imageCompositer.AddImageInput(imgList[i], 0, 0);
imageCompositer.Execute();
dob = imageCompositer.GetOutput();
}
else
CopyTo(dob, imgList[0]);
// composite images from different engines as necessary
if (imgList.size() > 1)
{
avtWholeImageCompositer imageCompositer;
int numRows = thisRequest.winAtts.GetSize()[1];
int numCols = thisRequest.winAtts.GetSize()[0];
imageCompositer.SetOutputImageSize(numRows, numCols);
for (int i = 0; i < imgList.size(); i++)
imageCompositer.AddImageInput(imgList[i], 0, 0);
imageCompositer.Execute();
dob = imageCompositer.GetOutput();
}
else
CopyTo(dob, imgList[0]);
{
if (thisRequest.plotIdsList.size() == 0)
dob = NULL;
}
// only update last request if this request wasn't empty
if (thisRequest.plotIdsList.size() > 0)
win->UpdateLastExternalRenderRequest(thisRequest);
}
else
CATCH2(VisItException, e)
{
if (thisRequest.plotIdsList.size() == 0)
dob = NULL;
char message[500];
//
// Add as much information to the message as we can,
// including plot name, exception type and exception
// message.
//
SNPRINTF(message, 500, "%s: (%s)\n%s",
"Scalable Render Request Failed",
e.GetExceptionType().c_str(),
e.GetMessage().c_str());
Error(message);
// Indicate that all plots in this window are in error
win->GetAnimation()->GetPlotList()->SetErrorFlagAllPlots(true);
// finally, make sure we return a "blank" image
dob = NULL;
}
// only update last request if this request wasn't empty
if (thisRequest.plotIdsList.size() > 0)
win->UpdateLastExternalRenderRequest(thisRequest);
ENDTRY
}
......@@ -5902,6 +5902,10 @@ ViewerWindowManager::CreateNode(DataNode *parentNode, bool detailed)