Commit c25bea93 authored by hrchilds's avatar hrchilds
Browse files

Update from February 24, 2004

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@183 18c085ea-50e0-402c-830e-de6fd14e8384
parent b55be6fa
......@@ -684,6 +684,10 @@ class MakeMovie:
# mode to be enabled so keyframe animations that change the view actually
# save images that have a keyframed view.
#
# Brad Whitlock, Tue Feb 24 11:57:39 PDT 2004
# If there was a problem when trying to set the animation frame,
# try and draw the plots again.
#
###########################################################################
def GenerateFrames(self):
......@@ -711,8 +715,18 @@ class MakeMovie:
# Save an image for each frame in the animation.
self.numFrames = 0
i = 0
drawThePlots = 0
while(i < AnimationGetNFrames()):
AnimationSetFrame(i)
if(AnimationSetFrame(i) == 0):
drawThePlots = 1
print "There was an error when trying to set the "\
"animation frame to %d. VisIt will now try to redraw the plots." % i
if(drawThePlots):
if(DrawPlots() == 0):
print "VisIt could not draw plots for frame %d. "\
"You should investigate the file used for that frame." % i
else:
drawThePlots = 0
self.SaveImage(self.numFrames, ext)
self.numFrames = self.numFrames + 1
i = i + self.frameStep
......
#!/usr/local/apps/bin/python
###############################################################################
# Program: converttextfile
#
# Purpose: This program converts UNIX text files to Windows text files and
# can be used in lieu of the cp command in the shell.
#
# Programmer: Brad Whitlock
# Date: Tue Feb 24 08:58:21 PDT 2004
#
# Modifications:
#
###############################################################################
import sys
if(len(sys.argv) < 3):
print "Usage: %s src dest\n" % sys.argv[0]
sys.exit(-1)
#
# Determine the names of the files involved.
#
srcFile = sys.argv[1]
destFile = sys.argv[2]
if(destFile == "."):
pos = srcFile.rfind("/")
if(pos >= 0):
destFile = srcFile[pos + 1:]
else:
print "Copying to the same file!";
sys.exit(-1)
#
# Read in all of the source lines
#
lines = ()
try:
f = open(srcFile, "rt")
lines = f.readlines()
f.close()
except IOError:
print "%s could not be opened." % srcFile
sys.exit(-1)
#
# Write out all of the lines with extra Windows end of line characters
#
try:
f = open(destFile, "wb")
for line in lines:
f.write("%s" % line[:-1])
f.write("%c" % 13)
f.write("%c" % 10)
f.close()
except IOError:
print "Could not write to %s." % destFile
#
# We're done. Exit now.
#
sys.exit(0)
......@@ -23,6 +23,12 @@
# Brad Whitlock, Thu Jan 8 11:15:13 PDT 2004
# I added BUILD_NOTES.txt.
#
# Brad Whitlock, Tue Feb 24 09:00:27 PDT 2004
# I changed the script so some files are copied using converttextfile, which
# copies text files but also converts the end of line from UNIX to Windows.
# This allows me to use the UNIX config files but make them Windows friendly
# when creating the Windows distribution.
#
#------------------------------------------------------------------------------
if(`pwd` != "/data_vobs/VisIt") then
......@@ -162,8 +168,8 @@ foreach configdir (Debug Release)
# Copy the makemovie script to the right bin dir.
cp $VISITSRC/bin/makemovie.py bin/$configdir
# Copy the host config files to the right bin dir.
cp $VISITSRC/clearcase_bin/visit-config-open bin/$configdir
cp $VISITSRC/clearcase_bin/visit-config-closed bin/$configdir
$SCRIPTDIR/converttextfile $SCRIPTDIR/visit-config-open bin/$configdir/visit-config-open.ini
$SCRIPTDIR/converttextfile $SCRIPTDIR/visit-config-closed bin/$configdir/visit-config-closed.ini
mkdir bin/$configdir/help
cp $VISITSRC/help/*.{html,helpml} bin/$configdir/help
mkdir bin/$configdir/databases
......
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.
......@@ -63,14 +63,16 @@ ConfigManager::~ConfigManager()
// Creation: Fri Sep 29 17:17:58 PST 2000
//
// Modifications:
//
// Brad Whitlock, Mon Feb 23 16:29:41 PST 2004
// Write text file.
//
// ****************************************************************************
void
ConfigManager::WriteBack(DataNode *root)
{
// Try to open the output file.
if((fp = fopen("WRITEBACK", "wb")) == 0)
if((fp = fopen("WRITEBACK", "wt")) == 0)
return;
// Write the output file to stdout for now.
......@@ -1216,6 +1218,10 @@ ConfigManager::ReadField(DataNode *parentNode, const std::string &tagName,
// Brad Whitlock, Wed Apr 23 09:20:11 PDT 2003
// I made it possible to use different system config files on Windows.
//
// Brad Whitlock, Mon Feb 23 16:28:31 PST 2004
// I changed how the config file names are determined on Windows so
// they can be opened in Notepad by double-clicking.
//
// ****************************************************************************
char *
......@@ -1229,19 +1235,8 @@ ConfigManager::GetDefaultConfigFile(const char *filename, const char *home)
// "config" as the default filename.
if(filename == 0)
{
#if defined(_WIN32)
// Try and get the system config filename from the environment settings.
configFileName = getenv("VISITSYSTEMCONFIG");
if(configFileName != 0)
filenameLength = strlen(configFileName);
else
{
#endif
filenameLength = 14;
configFileName = "config";
#if defined(_WIN32)
}
#endif
filenameLength = 7;
configFileName = "config";
}
else
{
......@@ -1263,19 +1258,19 @@ ConfigManager::GetDefaultConfigFile(const char *filename, const char *home)
GetUserName(username, &namelen);
retval = new char[strlen(realhome) + namelen + 5 + filenameLength + 2 + 7];
sprintf(retval, "%s\\%s for %s", realhome, configFileName, username);
sprintf(retval, "%s\\%s for %s.ini", realhome, configFileName, username);
}
else
{
// System config.
retval = new char[strlen(realhome) + filenameLength + 2 + 7];
sprintf(retval, "%s\\%s", realhome, configFileName);
sprintf(retval, "%s\\%s.ini", realhome, configFileName);
}
}
else
{
retval = new char[filenameLength + 1];
strcpy(retval, configFileName);
sprintf(retval, "%s.ini", configFileName);
}
#else
// The file it is assumed to be in the home directory unless the home
......@@ -1314,13 +1309,36 @@ ConfigManager::GetDefaultConfigFile(const char *filename, const char *home)
// Creation: Tue Feb 19 12:33:06 PDT 2002
//
// Modifications:
//
// Brad Whitlock, Mon Feb 23 15:53:34 PST 2004
// I added logic to try and determine the name of the appropriate config
// file.
//
// ****************************************************************************
char *
ConfigManager::GetSystemConfigFile(const char *filename)
{
return GetDefaultConfigFile(filename, "VISITHOME");
const char *sysConfigName = filename;
//
// If no system config file name was given, check the VISITSYSTEMCONFIG
// environment variable if we're on Windows. Otherwise, just use the
// name "config".
//
if(sysConfigName == 0)
{
#if defined(_WIN32)
// Try and get the system config filename from the environment settings.
sysConfigName = getenv("VISITSYSTEMCONFIG");
#endif
// If we still don't have the name of a system config file, use
// the name "config".
if(sysConfigName == 0)
sysConfigName = "config";
}
return GetDefaultConfigFile(sysConfigName, "VISITHOME");
}
// ****************************************************************************
......
......@@ -4,10 +4,11 @@
#ifndef BJHASH_H
#define BJHASH_H
#include <utility_exports.h>
namespace BJHash
{
unsigned int Hash(unsigned char *k, unsigned int length, unsigned int initval);
UTILITY_API unsigned int Hash(unsigned char *k, unsigned int length, unsigned int initval);
unsigned int Mask(int n);
}
......
......@@ -2852,6 +2852,9 @@ avtGenericDatabase::HasInvariantSIL(void) const
//
// Mark C. Miller, Mon Feb 9 15:41:57 PST 2004
// Added call to new interface method, ActivateTimestep
//
// Mark C. Miller, Mon Feb 23 20:38:47 PST 2004
// Made call to ActivateTimestep accept the timestep as an argument
//
// ****************************************************************************
......@@ -2905,7 +2908,7 @@ avtGenericDatabase::ReadDataset(avtDatasetCollection &ds, vector<int> &domains,
// Some file formats may need to engage in global communication when
// changing time-steps. Provide that opportunity here
//
Interface->ActivateTimestep();
Interface->ActivateTimestep(ts);
//
// Iterate through each of the domains and do material selection as we go.
......
......@@ -175,6 +175,25 @@ avtFileFormat::FreeUpResources(void)
<< "define how to do that." << endl;
}
// ****************************************************************************
// Method: avtFileFormat::ActivateTimestep
//
// Purpose:
// Defines an implementation of ActivateTimestep that does nothing -- this
// is for file formats that don't need to do anything special when a new
// timestep is encountered.
//
// Programmer: Mark C. Miller
// Creation: February 23, 2004
//
// ****************************************************************************
void
avtFileFormat::ActivateTimestep(void)
{
debug1 << "Asked " << GetType() << " to activate timestep, but it did not "
<< "define how to do that." << endl;
}
// ****************************************************************************
// Method: avtFileFormat::PopulateIOInformation
......
......@@ -60,6 +60,7 @@ class DATABASE_API avtFileFormat
avtFileFormat();
virtual ~avtFileFormat();
virtual void ActivateTimestep(void);
virtual void FreeUpResources(void);
void SetDatabaseMetaData(avtDatabaseMetaData *);
void RegisterDatabaseMetaData(avtDatabaseMetaData *);
......@@ -84,8 +85,6 @@ class DATABASE_API avtFileFormat
virtual void RegisterVariableList(const char *,
const std::vector<CharStrRef> &) {;};
virtual void ActivateTimestep(void) {;};
protected:
avtVariableCache *cache;
avtDatabaseMetaData *metadata;
......
......@@ -323,25 +323,3 @@ avtFileFormatInterface::CanCacheVariable(const char *var_name)
return true;
}
// ****************************************************************************
// Method: avtFileFormatInterface::ActivateTimestep
//
// Purpose: Provide a guarenteed collective entry point to a file format
// to prepare for a change in timestep
//
// Programmer: Mark C. Miller
// Creation: February 9, 2004
//
// ****************************************************************************
void
avtFileFormatInterface::ActivateTimestep(void)
{
int nFormats = GetNumberOfFileFormats();
for (int i = 0 ; i < nFormats ; i++)
{
avtFileFormat *ff = GetFormat(i);
ff->ActivateTimestep();
}
}
......@@ -37,7 +37,72 @@ class avtVariableCache;
// Silo files for multiple time steps. This interface then would worry
// about making those multiple time steps appear to the database while
// the Silo files can worry only about one time step at a time.
//
//
// MCM, Added 23Feb04
//
// Two classes go hand-in-hand here; the FormatInterface classes and
// the Format classes. Every FormatInterface HAS A (sometimes more than
// one) Format object. avtFileFormatInterface is the base class for
// for FormatInterface objects while avtFileFormat is the base class
// for Format objects.
//
// In VisIt, the abstract FormatInterface supports the notion that a mesh
// is composed of various pieces (called domains) at various timesteps.
// The general request for data from VisIt through the FormatInterface to a
// plugin looks something like GetData(int domainNumber, int timeStep).
// Of course, not all real file formats that Visit reads from actually
// support either the notions of pieces of mesh or of time. Consequently,
// there are four basic FormatInterface classes defined by VisIt derived
// from avtFileFormatInterface. These four derived classes are used to
// distinguish how the FormatInterface operates on one of many domains
// and/or timesteps. The four FormatInterfaces are...
//
// 1) single-timestep, single-domain (STSD)
// 2) single-timestep, multiple-domain (STMD)
// 3) multiple-timestep, single-domain (MTSD)
// 4) multiple-timestep, multiple-domain (MTMD)
//
// For example, an STSD FormatInterface supports the notion of only a single
// timestep and a single domain. It will only ever recieve requests from VisIt
// of the form GetData(). Note that the timeStep and domainNumber arguments
// are not present because the FormatInterface cannot interpret them.
// Note also that this DOES NOT IMPLY that one cannot handle time-varying
// and/or multiple domain data through an STSD FormatInterface. Every
// FormatInterface object HAS A Format object, one or more. An STSD
// FormatInterface in fact has many Format objects, one for each timestep
// and each domain. Each of these Format objects handles one timestep
// and one domain. The STSDFormatInterface is responsible for selecting
// which among the many domains and which among the many timesteps for
// a given operation. On the other hand, an MTMD FormatInterface has
// a single Format object because all classes derived from an MTMD
// type of FormatInterface support, natively, there own notions of
// domains and timesteps.
//
// Here are some rules of thumb to use in deciding where to implement
// new functionality.
//
// 1) Don't define new funtions in any of the FormatInterface objects as
// pure virtual, UNLESS ABSOLUTELY NECESSARY. The effect of introducing
// pure virtual functions to the FormatInterface is that ALL derived
// classes (e.g. the database plugins) ARE REQUIRED to implement them.
// All the plugins would have to be updated.
//
// 2) Don't define new functions in any of the FormatInterface objects
// as non-virtual because it means the derived classes (e.g. the
// database plugins) won't be able to override the behavior if needed.
// If there is functionality needed in the FormatInterface that
// shall never be allowed to be overridden in the plugins, then it
// should probably by implemented in the base classes for the Format
// and FormatInterface.
//
// 3) If the interface to the new functionality is not FormatInterface
// specific (e.g. it has no formal arguments for time or domain),
// you can probably get by with implementing it in the base classes,
// avtFileFormat and avtFileFormatInterface. Of course, it should still
// be virtual so plugins can override it. Otherwise, you should
// implement it in BOTH the bases classes and the FormatInterface
// specific classes.
//
// Programmer: Hank Childs
// Creation: February 22, 2001
//
......@@ -86,6 +151,9 @@ class avtVariableCache;
// Mark C. Miller, Mon Feb 9 16:00:10 PST 2004
// Added method, ActivateTimestep
//
// Mark C. Miller, Mon Feb 23 20:38:47 PST 2004
// Added ts argument to ActivateTimestep and made it pure virtual
//
// ****************************************************************************
class DATABASE_API avtFileFormatInterface
......@@ -104,6 +172,7 @@ class DATABASE_API avtFileFormatInterface
virtual void SetDatabaseMetaData(avtDatabaseMetaData *,int=0) = 0;
virtual void FreeUpResources(int, int) = 0;
virtual void ActivateTimestep(int ts) = 0;
bool HasInvariantMetaData(void);
bool HasInvariantSIL(void);
......@@ -120,7 +189,6 @@ class DATABASE_API avtFileFormatInterface
void SetCache(avtVariableCache *);
void TurnMaterialSelectionOff(void);
void TurnMaterialSelectionOn(const char *);
void ActivateTimestep(void);
protected:
virtual int GetNumberOfFileFormats(void) = 0;
......
......@@ -32,6 +32,9 @@ class vtkDataArray;
// Brad Whitlock, Mon Oct 13 14:17:30 PST 2003
// Added a method to get the times.
//
// Mark C. Miller, Mon Feb 23 20:38:47 PST 2004
// Added method, ActivateTimestep
//
// ****************************************************************************
class DATABASE_API avtMTMDFileFormat : public avtFileFormat
......@@ -54,6 +57,9 @@ class DATABASE_API avtMTMDFileFormat : public avtFileFormat
virtual vtkDataArray *GetVar(int, int, const char *) = 0;
virtual vtkDataArray *GetVectorVar(int, int, const char *);
virtual void ActivateTimestep(int ts)
{ avtFileFormat::ActivateTimestep(); };
protected:
char *filename;
};
......
......@@ -253,4 +253,20 @@ avtMTMDFileFormatInterface::FreeUpResources(int, int)
format->FreeUpResources();
}
// ****************************************************************************
// Method: avtMTMDFileFormatInterface::ActivateTimestep
//
// Purpose: Notify the format of our intention to read data for a given
// timestep. This gives the format an opportunity to do whatever
// parallel collective work it might need to for the given timestep
//
// Programmer: Mark C. Miller
// Creation: February 23, 2004
//
// ****************************************************************************
void
avtMTMDFileFormatInterface::ActivateTimestep(int ts)
{
format->ActivateTimestep(ts);
}
......@@ -28,6 +28,9 @@
// Brad Whitlock, Wed May 14 09:24:22 PDT 2003
// Added an optional timeState argument to SetDatabaseMetaData.
//
// Mark C. Miller, Mon Feb 23 20:38:47 PST 2004
// Added ActivateTimestep method
//
// ****************************************************************************
class DATABASE_API avtMTMDFileFormatInterface : public avtFileFormatInterface
......@@ -47,6 +50,8 @@ class DATABASE_API avtMTMDFileFormatInterface : public avtFileFormatInterface
virtual void SetDatabaseMetaData(avtDatabaseMetaData *,int=0);
virtual void FreeUpResources(int, int);
virtual void ActivateTimestep(int ts);
protected:
avtMTMDFileFormat *format;
......
......@@ -44,6 +44,9 @@ class vtkDataArray;
// Brad Whitlock, Mon Oct 13 14:14:21 PST 2003
// Added a method to get the times.
//
// Mark C. Miller, Mon Feb 23 20:38:47 PST 2004
// Added method, ActivateTimestep
//
// ****************************************************************************
class DATABASE_API avtMTSDFileFormat : public avtFileFormat
......@@ -66,6 +69,9 @@ class DATABASE_API avtMTSDFileFormat : public avtFileFormat
virtual vtkDataArray *GetVar(int, const char *) = 0;
virtual vtkDataArray *GetVectorVar(int, const char *);
virtual void ActivateTimestep(int ts)
{ avtFileFormat::ActivateTimestep(); };
protected:
char **filenames;
int nFiles;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment