Commit 4401f597 authored by hrchilds's avatar hrchilds

Update from February 23, 2005

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@418 18c085ea-50e0-402c-830e-de6fd14e8384
parent a20a9062
......@@ -67,12 +67,16 @@ void avtEnzoFileFormat::Grid::Print()
// Programmer: Jeremy Meredith
// Creation: January 3, 2005
//
// Modifications:
// Jeremy Meredith, Wed Feb 23 15:18:48 PST 2005
// May have multiple root grids; identify by parentID==0, not by ID==1.
//
// ****************************************************************************
void avtEnzoFileFormat::Grid::DetermineExtentsInParent(vector<Grid> &grids)
{
Grid &p = grids[parentID];
if (ID != 1)
if (parentID != 0)
{
Grid &p = grids[parentID];
minLogicalExtentsInParent[0] = int(.5 + double(p.zdims[0]) * (minSpatialExtents[0] - p.minSpatialExtents[0])/(p.maxSpatialExtents[0] - p.minSpatialExtents[0]));
minLogicalExtentsInParent[1] = int(.5 + double(p.zdims[1]) * (minSpatialExtents[1] - p.minSpatialExtents[1])/(p.maxSpatialExtents[1] - p.minSpatialExtents[1]));
minLogicalExtentsInParent[2] = int(.5 + double(p.zdims[2]) * (minSpatialExtents[2] - p.minSpatialExtents[2])/(p.maxSpatialExtents[2] - p.minSpatialExtents[2]));
......@@ -112,14 +116,18 @@ void avtEnzoFileFormat::Grid::DetermineExtentsInParent(vector<Grid> &grids)
// Programmer: Jeremy Meredith
// Creation: January 3, 2005
//
// Modifications:
// Jeremy Meredith, Wed Feb 23 15:18:48 PST 2005
// May have multiple root grids; identify by parentID==0, not by ID==1.
//
// ****************************************************************************
void
avtEnzoFileFormat::Grid::DetermineExtentsGlobally(int numLevels,
vector<Grid> &grids)
{
Grid &p = grids[parentID];
if (ID != 1)
if (parentID != 0)
{
Grid &p = grids[parentID];
minLogicalExtentsGlobally[0] = int((p.minLogicalExtentsGlobally[0] + minLogicalExtentsInParent[0])*refinementRatio[0]);
minLogicalExtentsGlobally[1] = int((p.minLogicalExtentsGlobally[1] + minLogicalExtentsInParent[1])*refinementRatio[1]);
minLogicalExtentsGlobally[2] = int((p.minLogicalExtentsGlobally[2] + minLogicalExtentsInParent[2])*refinementRatio[2]);
......@@ -610,6 +618,9 @@ avtEnzoFileFormat::FreeUpResources(void)
// Hank Childs, Thu Jan 13 15:31:08 PST 2005
// Generate domain nesting object.
//
// Jeremy Meredith, February 23, 2005
// May have more than one root-level grid. Unify extents over all of them.
//
// ****************************************************************************
void
......@@ -628,12 +639,25 @@ avtEnzoFileFormat::PopulateDatabaseMetaData(avtDatabaseMetaData *md)
mesh->topologicalDimension = 3;
mesh->spatialDimension = 3;
mesh->hasSpatialExtents = true;
mesh->minSpatialExtents[0] = grids[1].minSpatialExtents[0];
mesh->minSpatialExtents[1] = grids[1].minSpatialExtents[1];
mesh->minSpatialExtents[2] = grids[1].minSpatialExtents[2];
mesh->maxSpatialExtents[0] = grids[1].maxSpatialExtents[0];
mesh->maxSpatialExtents[1] = grids[1].maxSpatialExtents[1];
mesh->maxSpatialExtents[2] = grids[1].maxSpatialExtents[2];
// now loop over all level zero grids
for (int g = 2 ; grids[g].parentID == 0 ; g++)
{
for (int j = 0 ; j < 3 ; j++)
{
if (grids[g].minSpatialExtents[j] < mesh->minSpatialExtents[j])
mesh->minSpatialExtents[j] = grids[g].minSpatialExtents[j];
if (grids[g].maxSpatialExtents[j] > mesh->maxSpatialExtents[j])
mesh->maxSpatialExtents[j] = grids[g].maxSpatialExtents[j];
}
}
// spoof a group/domain mesh
mesh->numBlocks = numGrids;
mesh->blockTitle = "Grids";
......
......@@ -67,18 +67,78 @@ ExodusCommonPluginInfo::GetDefaultExtensions()
//
// Returns: A Exodus database from list.
//
// Programmer: meredith -- generated by xml2info
// Creation: Tue Feb 22 14:38:36 PST 2005
// Programmer: Jeremy Meredith
// Creation: August 27, 2002
//
// Modifications:
//
// Hank Childs, Tue Feb 25 13:56:42 PST 2003
// Account for .EXODUS, .nemesis, and .NEMESIS.
//
// Hank Childs, Thu Jul 22 11:29:31 PDT 2004
// Register the file list
// ****************************************************************************
avtDatabase *
ExodusCommonPluginInfo::SetupDatabase(const char *const *list,
int nList, int nBlock)
{
string file1 = list[0];
bool containsManyFiles = false;
if (nList == 1 &&
file1.length() > 7 && file1.substr(file1.length()-7,7)==".exodus")
containsManyFiles = true;
if (nList == 1 &&
file1.length() > 7 && file1.substr(file1.length()-7,7)==".EXODUS")
containsManyFiles = true;
if (nList == 1 &&
file1.length() > 8 && file1.substr(file1.length()-8,8)==".nemesis")
containsManyFiles = true;
if (nList == 1 &&
file1.length() > 8 && file1.substr(file1.length()-8,8)==".NEMESIS")
containsManyFiles = true;
if (containsManyFiles)
{
const char *filename = list[0];
char **reallist = NULL;
int listcount = 0;
avtDatabase::GetFileListFromTextFile(filename, reallist, listcount);
avtDatabase *rv = ExodusCommonPluginInfo::SetupDatabase(reallist,
listcount,-1);
//
// Clean up memory
//
for (int i = 0 ; i < listcount ; i++)
{
delete [] reallist[i];
}
delete [] reallist;
return rv;
}
//
// We don't want to register the file list with every Exodus file format,
// because that list can get big. Instead, register a list statically
// with the format. It will return an index and then tell each new
// instance that it should use this index.
//
int fileListId = -1;
if (!containsManyFiles)
{
fileListId = avtExodusFileFormat::RegisterFileList(list, nList);
}
avtMTSDFileFormat **ffl = new avtMTSDFileFormat*[nList];
for (int i = 0 ; i < nList ; i++)
{
ffl[i] = new avtExodusFileFormat(list[i]);
avtExodusFileFormat *exo = new avtExodusFileFormat(list[i]);
if (!containsManyFiles)
exo->SetFileList(fileListId);
ffl[i] = exo;
}
avtMTSDFileFormatInterface *inter
= new avtMTSDFileFormatInterface(ffl, nList);
......
......@@ -52,8 +52,13 @@ KullLiteCommonPluginInfo::GetDefaultExtensions()
//
// Returns: A KullLite database from list.
//
// Programmer: meredith -- generated by xml2info
// Creation: Tue Feb 22 14:39:46 PST 2005
// Programmer: childs -- generated by xml2info
// Creation: Mon Mar 22 09:17:37 PDT 2004
//
// Modifications:
// Brad Whitlock, Thu Oct 9 14:25:58 PST 2003
// Fixed a memory leak that can happen if the file format decides not to
// actually open the file.
//
// ****************************************************************************
avtDatabase *
......@@ -62,9 +67,23 @@ KullLiteCommonPluginInfo::SetupDatabase(const char *const *list,
{
avtSTMDFileFormat **ffl = new avtSTMDFileFormat*[nList];
for (int i = 0 ; i < nList ; i++)
ffl[i] = 0;
TRY
{
for (int i = 0 ; i < nList ; i++)
ffl[i] = new avtKullLiteFileFormat(list[i]);
}
CATCH(VisItException)
{
ffl[i] = new avtKullLiteFileFormat(list[i]);
for (int i = 0 ; i < nList ; i++)
delete ffl[i];
delete [] ffl;
RETHROW;
}
ENDTRY
avtSTMDFileFormatInterface *inter
= new avtSTMDFileFormatInterface(ffl, nList);
return new avtGenericDatabase(inter);
......
# Copyright 2000 - 2004
# Copyright 2000 - 2005
# The Regents of the University of California.
# All rights reserved.
#
......@@ -138,6 +138,9 @@
# Jeremy Meredith, February 16, 2005
# Changed captilization of Tecplot.
#
# Brad Whitlock, Tue Feb 22 19:22:24 PST 2005
# Added TFT reader.
#
##############################################################################
@SET_MAKE@
......@@ -155,7 +158,7 @@ PDB=KullLite PDB
SAF=SAF
SAMPLES=Rect Hex
REQUIRED=ANALYZE BOV CMAT Curve2D Dune EnSight Image Lines OVERFLOW \
PLOT2D PLOT3D Point3D SAR STL Silo SimDB Spheral Tecplot Vista VTK WavefrontOBJ
PLOT2D PLOT3D Point3D SAR STL Silo SimDB Spheral TFT Tecplot Vista VTK WavefrontOBJ
VISUS=ViSUS
OPTIONAL=
......
......@@ -51,20 +51,43 @@ PixieCommonPluginInfo::GetDefaultExtensions()
//
// Returns: A Pixie database from list.
//
// Programmer: meredith -- generated by xml2info
// Creation: Tue Feb 22 14:42:22 PST 2005
// Programmer: whitlocb -- generated by xml2info
// Creation: Fri Aug 13 14:31:41 PST 2004
//
// Modifications:
// Brad Whitlock, Fri Aug 13 18:47:12 PST 2004
// Added some exception handline so the file formats are deleted if
// if creating one of them causes an exception to be generated.
//
// ****************************************************************************
avtDatabase *
PixieCommonPluginInfo::SetupDatabase(const char *const *list,
int nList, int nBlock)
{
avtMTSDFileFormat **ffl = new avtMTSDFileFormat*[nList];
for (int i = 0 ; i < nList ; i++)
ffl[i] = 0;
TRY
{
ffl[i] = new avtPixieFileFormat(list[i]);
for (int i = 0 ; i < nList ; i++)
ffl[i] = new avtPixieFileFormat(list[i]);
}
CATCH(VisItException)
{
for (int i = 0 ; i < nList ; i++)
{
if(ffl[i] != 0)
delete ffl[i];
}
delete [] ffl;
RETHROW;
}
ENDTRY
avtMTSDFileFormatInterface *inter
= new avtMTSDFileFormatInterface(ffl, nList);
= new avtMTSDFileFormatInterface(ffl, nList);
return new avtGenericDatabase(inter);
}
<?xml version="1.0"?>
<Plugin name="TFT" type="database" label="TFT" version="1.0" enabled="true" dbtype="STSD" haswriter="false">
<Extensions>
dat
DAT
Dat
tft
TFT
Tft
</Extensions>
<Attribute persistent="false">
</Attribute>
</Plugin>
#include <TFTPluginInfo.h>
#include <avtTFTFileFormat.h>
#include <avtSTSDFileFormatInterface.h>
#include <avtGenericDatabase.h>
// ****************************************************************************
// Method: TFTCommonPluginInfo::GetDatabaseType
//
// Purpose:
// Returns the type of a TFT database.
//
// Programmer: whitlocb -- generated by xml2info
// Creation: Wed Feb 23 09:25:08 PDT 2005
//
// ****************************************************************************
DatabaseType
TFTCommonPluginInfo::GetDatabaseType()
{
return DB_TYPE_STSD;
}
// ****************************************************************************
// Method: TFTCommonPluginInfo::GetDefaultExtensions
//
// Purpose:
// Returns the default extensions for a TFT database.
//
// Programmer: whitlocb -- generated by xml2info
// Creation: Wed Feb 23 09:25:08 PDT 2005
//
// ****************************************************************************
std::vector<std::string>
TFTCommonPluginInfo::GetDefaultExtensions()
{
std::vector<std::string> defaultExtensions;
defaultExtensions.push_back("dat");
defaultExtensions.push_back("DAT");
defaultExtensions.push_back("Dat");
defaultExtensions.push_back("tft");
defaultExtensions.push_back("TFT");
defaultExtensions.push_back("Tft");
return defaultExtensions;
}
// ****************************************************************************
// Method: TFTCommonPluginInfo::SetUpTFTDatabase
//
// Purpose:
// Sets up a TFT database.
//
// Arguments:
// list A list of file names.
// nList The number of timesteps in list.
// nBlocks The number of blocks in the list.
//
// Returns: A TFT database from list.
//
// Programmer: whitlocb -- generated by xml2info
// Creation: Wed Feb 23 09:25:08 PDT 2005
//
// ****************************************************************************
avtDatabase *
TFTCommonPluginInfo::SetupDatabase(const char *const *list,
int nList, int nBlock)
{
avtSTSDFileFormat ***ffl = new avtSTSDFileFormat**[nList];
int nTimestep = nList / nBlock;
for (int i = 0 ; i < nTimestep ; i++)
{
ffl[i] = new avtSTSDFileFormat*[nBlock];
for (int j = 0 ; j < nBlock ; j++)
{
ffl[i][j] = new avtTFTFileFormat(list[i*nBlock + j]);
}
}
avtSTSDFileFormatInterface *inter
= new avtSTSDFileFormatInterface(ffl, nTimestep, nBlock);
return new avtGenericDatabase(inter);
}
#include <TFTPluginInfo.h>
#if defined(__APPLE__)
#define GetEngineInfo TFT_GetEngineInfo
#endif
// ****************************************************************************
// Function: GetEngineInfo
//
// Purpose:
// Return a new EnginePluginInfo for the TFT database.
//
// Programmer: whitlocb -- generated by xml2info
// Creation: Wed Feb 23 09:25:08 PDT 2005
//
// ****************************************************************************
extern "C" EngineDatabasePluginInfo* GetEngineInfo()
{
return new TFTEnginePluginInfo;
}
// ****************************************************************************
// Method: TFTCommonPluginInfo::GetWriter
//
// Purpose:
// Sets up a TFT writer.
//
// Returns: A TFT writer.
//
// Programmer: whitlocb -- generated by xml2info
// Creation: Wed Feb 23 09:25:08 PDT 2005
//
// ****************************************************************************
avtDatabaseWriter *
TFTEnginePluginInfo::GetWriter(void)
{
return NULL;
}
#include <TFTPluginInfo.h>
#if defined(__APPLE__)
#define GetMDServerInfo TFT_GetMDServerInfo
#endif
// ****************************************************************************
// Function: GetMDServerInfo
//
// Purpose:
// Return a new MDServerPluginInfo for the TFT database.
//
// Programmer: whitlocb -- generated by xml2info
// Creation: Wed Feb 23 09:25:08 PDT 2005
//
// ****************************************************************************
extern "C" MDServerDatabasePluginInfo* GetMDServerInfo()
{
return new TFTMDServerPluginInfo;
}
// this makes compilers happy... remove if we ever have functions here
void TFTMDServerPluginInfo::dummy()
{
}
// ************************************************************************* //
// File: TFTPluginInfo.C
// ************************************************************************* //
#include <TFTPluginInfo.h>
#if defined(__APPLE__)
#define GetGeneralInfo TFT_GetGeneralInfo
#endif
// ****************************************************************************
// Function: GetGeneralInfo
//
// Purpose:
// Return a new GeneralPluginInfo for the TFT database.
//
// Programmer: whitlocb -- generated by xml2info
// Creation: Wed Feb 23 09:25:08 PDT 2005
//
// ****************************************************************************
extern "C" GeneralDatabasePluginInfo* GetGeneralInfo()
{
return new TFTGeneralPluginInfo;
}
// ****************************************************************************
// Method: TFTGeneralPluginInfo::GetName
//
// Purpose:
// Return the name of the database plugin.
//
// Returns: A pointer to the name of the database plugin.
//
// Programmer: whitlocb -- generated by xml2info
// Creation: Wed Feb 23 09:25:08 PDT 2005
//
// ****************************************************************************
char *
TFTGeneralPluginInfo::GetName() const
{
return "TFT";
}
// ****************************************************************************
// Method: TFTGeneralPluginInfo::GetVersion
//
// Purpose:
// Return the version of the database plugin.
//
// Returns: A pointer to the version of the database plugin.
//
// Programmer: whitlocb -- generated by xml2info
// Creation: Wed Feb 23 09:25:08 PDT 2005
//
// ****************************************************************************
char *
TFTGeneralPluginInfo::GetVersion() const
{
return "1.0";
}
// ****************************************************************************
// Method: TFTGeneralPluginInfo::GetID
//
// Purpose:
// Return the id of the database plugin.
//
// Returns: A pointer to the id of the database plugin.
//
// Programmer: whitlocb -- generated by xml2info
// Creation: Wed Feb 23 09:25:08 PDT 2005
//
// ****************************************************************************
char *
TFTGeneralPluginInfo::GetID() const
{
return "TFT_1.0";
}
// ****************************************************************************
// Method: TFTGeneralPluginInfo::EnabledByDefault
//
// Purpose:
// Return true if this plugin should be enabled by default; false otherwise.
//
// Returns: true/false
//
// Programmer: whitlocb -- generated by xml2info
// Creation: Wed Feb 23 09:25:08 PDT 2005
//
// ****************************************************************************
bool
TFTGeneralPluginInfo::EnabledByDefault() const
{
return true;
}
// ****************************************************************************
// Method: TFTGeneralPluginInfo::HasWriter
//
// Purpose:
// Return true if this plugin has a database writer.
//
// Returns: true/false
//
// Programmer: whitlocb -- generated by xml2info
// Creation: Wed Feb 23 09:25:08 PDT 2005
//
// ****************************************************************************
bool
TFTGeneralPluginInfo::HasWriter() const
{
return false;
}
// ****************************************************************************
// TFTPluginInfo.h
// ****************************************************************************
#ifndef TFT_PLUGIN_INFO_H
#define TFT_PLUGIN_INFO_H
#include <DatabasePluginInfo.h>
#include <database_plugin_exports.h>
class avtDatabase;
class avtDatabaseWriter;
// ****************************************************************************
// Class: TFTDatabasePluginInfo
//
// Purpose:
// Classes that provide all the information about the TFT plugin.
// Portions are separated into pieces relevant to the appropriate
// components of VisIt.
//
// Programmer: whitlocb -- generated by xml2info
// Creation: Wed Feb 23 09:25:08 PDT 2005
//
// Modifications:
//
// ****************************************************************************
class TFTGeneralPluginInfo : public virtual GeneralDatabasePluginInfo
{
public:
virtual char *GetName() const;
virtual char *GetVersion() const;
virtual char *GetID() const;
virtual bool EnabledByDefault() const;
virtual bool HasWriter() const;
};
class TFTCommonPluginInfo : public virtual CommonDatabasePluginInfo, public virtual TFTGeneralPluginInfo
{
public:
virtual DatabaseType GetDatabaseType();
virtual std::vector<std::string> GetDefaultExtensions();
virtual avtDatabase *SetupDatabase(const char * const *list,
int nList, int nBlock);
};
class TFTMDServerPluginInfo : public virtual MDServerDatabasePluginInfo, public virtual TFTCommonPluginInfo
{
public:
// this makes compilers happy... remove if we ever have functions here
virtual void dummy();
};
class TFTEnginePluginInfo : public virtual EngineDatabasePluginInfo, public virtual TFTCommonPluginInfo
{
public:
virtual avtDatabaseWriter *GetWriter(void);
};
#endif
This diff is collapsed.
// ************************************************************************* //
// avtTFTFileFormat.h //
// ************************************************************************* //
#ifndef AVT_TFT_FILE_FORMAT_H
#define AVT_TFT_FILE_FORMAT_H
#include <avtSTSDFileFormat.h>
#include <visitstream.h>
#include <string>
#include <map>
// ****************************************************************************
// Class: avtTFTFileFormat
//
// Purpose:
// Reads in TFT files as a plugin to VisIt.
//
// Programmer: Brad Whitlock
// Creation: Tue Feb 22 16:04:15 PST 2005
//
// Modifications:
//
// ****************************************************************************
class avtTFTFileFormat : public avtSTSDFileFormat
{
public:
avtTFTFileFormat(const char *filename);
virtual ~avtTFTFileFormat();
//
// These are used to declare what the current time and cycle are for the
// file. These should only be defined if the file format knows what the
// time and/or cycle is.
//
virtual bool ReturnsValidTime() const;
virtual double GetTime(void);
virtual const char *GetType(void) { return "TFT"; };
virtual void FreeUpResources(void);
virtual void ActivateTimestep(void);
virtual vtkDataSet *GetMesh(const char *);
virtual vtkDataArray *GetVar(const char *);
protected:
void Initialize();
virtual void PopulateDatabaseMetaData(avtDatabaseMetaData *);
class CurveData
{
public:
CurveData();
virtual ~CurveData();
bool Read(ifstream &, bool &, float &);
std::string GetLine(ifstream &);
std::string StripExcess(const std::string &input);
void GetLabelsAndUnits(const std::string &, std::string &,
std::string &);
std::string title;
std::string subtitle;
std::string xLabel;
std::string xUnits;
std::string yLabel;
std::string yUnits;
int nPoints;
float *data;
float xmin;
float xmax;
float ymin;
float ymax;
};
typedef std::map<std::string, CurveData *> CurveDataMap;
CurveDataMap variables;
bool initialized;
bool hasValidTime;
float time;
};
#endif
......@@ -51,20 +51,44 @@ VistaCommonPluginInfo::GetDefaultExtensions()
//
// Returns: A Vista database from list.
//
// Programmer: meredith -- generated by xml2info
// Creation: Tue Feb 22 14:49:31 PST 2005
// Programmer: miller -- generated by xml2info
// Creation: Tue Feb 17 19:19:06 PST 2004
//
// Modifications:
//
// Mark C. Miller, Wed Jul 14 09:37:43 PDT 2004
// Modified to support variety of Vista file formats from different codes
//
// ****************************************************************************
avtDatabase *
VistaCommonPluginInfo::SetupDatabase(const char *const *list,
int nList, int nBlock)
{
avtSTMDFileFormat **ffl = new avtSTMDFileFormat*[nList