Commit d6c709f4 authored by hrchilds's avatar hrchilds
Browse files

Update from April 14, 2004

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@220 18c085ea-50e0-402c-830e-de6fd14e8384
parent ae84ced5
......@@ -67,6 +67,9 @@
# I removed multi-format2.py, operators.py, and gradient.py tests
# from scalable,parallel skip
#
# Mark C. Miller, Tue Apr 13 08:16:51 PDT 2004
# Removed sil.py and samrai.py from parallel skip list
#
# ----------------------------------------------------------------------------
# list of users who want email every night with the log file
......@@ -194,9 +197,7 @@ curdate=`date +%Y-%m-%d-%p%I%M`
modes="serial parallel scalable,parallel"
# set list of tests/modes to skip
skipList="parallel:tests/databases/samrai.py \
parallel:tests/hybrid/sil.py \
parallel:tests/rendering/volume.py \
skipList="parallel:tests/rendering/volume.py \
scalable,parallel:tests/hybrid/lineout.py \
scalable,parallel:tests/rendering/volume.py"
......
......@@ -33,6 +33,7 @@ namespace Init
MISC_API bool IsComponent(const char *);
MISC_API void ComponentIssueError(const char *);
MISC_API void ComponentRegisterErrorFunction(ErrorFunction, void *);
MISC_API const char *const CatchAllMeshName = "for active plot";
}
#endif
......
......@@ -29,7 +29,7 @@ bool UTILITY_API WildcardStringMatch(const char *p, const char *s);
bool UTILITY_API WildcardStringMatch(const std::string &p, const std::string &s);
bool UTILITY_API NumericStringCompare(const std::string &str1, const std::string &str2);
std::vector<std::string> UTILITY_API SplitValues(const string &buff,
std::vector<std::string> UTILITY_API SplitValues(const std::string &buff,
char delim);
inline char *C_strdup(char const * const);
......
#include <VariableMenuPopulator.h>
#include <Init.h>
#include <avtDatabaseMetaData.h>
#include <avtSIL.h>
#include <PlotPluginInfo.h>
......@@ -122,6 +123,10 @@ VariableMenuPopulator::ClearDatabaseName()
// I added code to check the name of the database that we're using against
// the name of the database that we've used before.
//
// Mark C. Miller, Wed Apr 14 10:51:23 PDT 2004
// I added code to include the catch-all mesh name in the list of meshes
// when the plugin has activiated this feature
//
// ****************************************************************************
bool
......@@ -168,6 +173,8 @@ VariableMenuPopulator::PopulateVariableLists(const std::string &dbName,
const avtMeshMetaData *mmd = md->GetMesh(i);
meshVars[mmd->name] = mmd->validVariable;
}
if (md->GetUseCatchAllMesh())
meshVars[Init::CatchAllMeshName] = true;
for (i = 0; i < md->GetNumScalars(); ++i)
{
const avtScalarMetaData *smd = md->GetScalar(i);
......
......@@ -3079,10 +3079,13 @@ avtDefaultPlotMetaData::Print(ostream &out, int indent) const
// Jeremy Meredith, Tue Mar 30 09:53:19 PST 2004
// Added simulation information.
//
// Mark C. Miller, Tue Mar 30 14:36:17 PST 2004
// Added bool for catch-all mesh
//
// ****************************************************************************
avtDatabaseMetaData::avtDatabaseMetaData()
: AttributeSubject("ssbddibss*i*i*i*d*a*a*a*a*a*a*a*a*a*aba*bsi")
: AttributeSubject("ssbddibss*i*i*i*d*a*a*a*a*a*a*a*a*a*aba*bsib")
{
hasTemporalExtents = false;
minTemporalExtents = 0.;
......@@ -3093,6 +3096,7 @@ avtDatabaseMetaData::avtDatabaseMetaData()
isSimulation = false;
simHost = "";
simPort = 0;
useCatchAllMesh = false;
}
......@@ -3140,10 +3144,13 @@ avtDatabaseMetaData::avtDatabaseMetaData()
// Jeremy Meredith, Tue Mar 30 09:53:19 PST 2004
// Added simulation information.
//
// Mark C. Miller, Tue Mar 30 14:36:17 PST 2004
// Added bool for catch-all mesh
//
// ****************************************************************************
avtDatabaseMetaData::avtDatabaseMetaData(const avtDatabaseMetaData &rhs)
: AttributeSubject("ssbddibss*i*i*i*d*a*a*a*a*a*a*a*a*a*aba*bsi")
: AttributeSubject("ssbddibss*i*i*i*d*a*a*a*a*a*a*a*a*a*aba*bsib")
{
databaseName = rhs.databaseName;
fileFormat = rhs.fileFormat;
......@@ -3153,6 +3160,7 @@ avtDatabaseMetaData::avtDatabaseMetaData(const avtDatabaseMetaData &rhs)
numStates = rhs.numStates;
isVirtualDatabase = rhs.isVirtualDatabase;
mustRepopulateOnStateChange = rhs.mustRepopulateOnStateChange;
useCatchAllMesh = rhs.useCatchAllMesh;
timeStepPath = rhs.timeStepPath;
timeStepNames = rhs.timeStepNames;
cyclesAreAccurate = rhs.cyclesAreAccurate;
......@@ -3233,6 +3241,9 @@ avtDatabaseMetaData::avtDatabaseMetaData(const avtDatabaseMetaData &rhs)
// Jeremy Meredith, Tue Mar 30 09:53:19 PST 2004
// Added simulation information.
//
// Mark C. Miller, Tue Mar 30 14:36:17 PST 2004
// Added bool for catch-all mesh
//
// ****************************************************************************
const avtDatabaseMetaData &
......@@ -3246,6 +3257,7 @@ avtDatabaseMetaData::operator=(const avtDatabaseMetaData &rhs)
numStates = rhs.numStates;
isVirtualDatabase = rhs.isVirtualDatabase;
mustRepopulateOnStateChange = rhs.mustRepopulateOnStateChange;
useCatchAllMesh = rhs.useCatchAllMesh;
timeStepPath = rhs.timeStepPath;
timeStepNames = rhs.timeStepNames;
cyclesAreAccurate = rhs.cyclesAreAccurate;
......@@ -4563,6 +4575,9 @@ avtDatabaseMetaData::GetSpeciesOnMesh(std::string mesh) const
// Hank Childs, Fri Mar 5 11:21:06 PST 2004
// Print file format.
//
// Mark C. Miller, Tue Mar 30 14:36:17 PST 2004
// Added useCatchAllMesh
//
// ****************************************************************************
void
......@@ -4581,6 +4596,9 @@ avtDatabaseMetaData::Print(ostream &out, int indent) const
out << "MetaData" << (mustRepopulateOnStateChange ? " IS " : " is NOT ") <<
"repopulated on state changes" << endl;
Indent(out, indent);
out << "useCatchAllMesh: " << useCatchAllMesh << endl;
Indent(out, indent);
if (hasTemporalExtents)
{
......@@ -4859,6 +4877,7 @@ avtDatabaseMetaData::SelectAll()
Select(25, (void*)&isSimulation);
Select(26, (void*)&simHost);
Select(27, (void*)&simPort);
Select(28, (void*)&useCatchAllMesh);
}
// *******************************************************************
......
......@@ -364,6 +364,8 @@ class DBATTS_API avtDatabaseMetaData : public AttributeSubject
std::string simHost;
int simPort;
bool useCatchAllMesh;
std::string timeStepPath;
stringVector timeStepNames;
intVector cycles;
......@@ -398,9 +400,14 @@ public:
void SetTemporalExtents(double, double);
void SetMustRepopulateOnStateChange(bool mode)
{ mustRepopulateOnStateChange = mode; };
{ mustRepopulateOnStateChange = mode; };
bool GetMustRepopulateOnStateChange(void) const
{ return mustRepopulateOnStateChange; };
{ return mustRepopulateOnStateChange; };
bool GetUseCatchAllMesh(void) const
{ return useCatchAllMesh; };
void SetUseCatchAllMesh(bool useIt)
{ useCatchAllMesh = useIt; };
void SetIsVirtualDatabase(bool val) { isVirtualDatabase = val; };
bool GetIsVirtualDatabase() const { return isVirtualDatabase; };
......
......@@ -73,6 +73,9 @@ using std::vector;
// Hank Childs, Wed Feb 18 09:36:38 PST 2004
// Added the "all materials" list to the Initialize call.
//
// Hank Childs, Wed Apr 14 07:50:31 PDT 2004
// Do not force names to have material numbers encoded in them.
//
// ****************************************************************************
avtMaterial::avtMaterial(int nMats, const int *mats, char **names,
......@@ -95,7 +98,7 @@ avtMaterial::avtMaterial(int nMats, const int *mats, char **names,
if (names == NULL)
sprintf(name, "%d", mats[i]);
else
sprintf(name, "%d %s", mats[i], names[i]);
sprintf(name, "%s", names[i]);
matnames.push_back(name);
}
matnames.push_back("bad material");
......
......@@ -268,6 +268,11 @@ avtQueryFactory::CreateQuery(const QueryAttributes *qa)
// Programmer: Kathleen Bonnell
// Creation: March 30, 2004
//
// Modifications:
//
// Hank Childs, Wed Apr 14 07:48:12 PDT 2004
// Allow for surface area to have multiple aliases.
//
// ****************************************************************************
avtDataObjectQuery *
......@@ -277,7 +282,8 @@ avtQueryFactory::CreateTimeQuery(const QueryAttributes *qa)
bool actualData = qa->GetDataType() == QueryAttributes::ActualData;
avtDataObjectQuery *query = NULL;
if (qname == "Surface area")
if (qname == "Surface area" || qname == "2D area" ||
qname == "3D surface area")
{
query = new avtTotalSurfaceAreaQuery();
}
......
......@@ -278,6 +278,10 @@ avtLocateCellQuery::Execute(vtkDataSet *ds, const int dom)
// Use pickAtts insteead of queryAtts.
// Specify the bounds for cellLocator to use when doing spatial decomp.
//
// Kathleen Bonnell, Wed Apr 14 10:26:19 PDT 2004
// Initialize variables to protect against possible incorrect values
// being returned.
//
// ****************************************************************************
int
......@@ -289,6 +293,7 @@ avtLocateCellQuery::LocatorFindCell(vtkDataSet *ds, float &dist, float *isect)
}
float *rayPt1 = pickAtts.GetRayPoint1();
float *rayPt2 = pickAtts.GetRayPoint2();
dist = -1;
vtkVisItCellLocator *cellLocator = vtkVisItCellLocator::New();
cellLocator->SetIgnoreGhosts(true);
......@@ -303,8 +308,8 @@ avtLocateCellQuery::LocatorFindCell(vtkDataSet *ds, float &dist, float *isect)
cellLocator->SetUserBounds(pickAtts.GetPlotBounds());
cellLocator->BuildLocator();
float pcoords[3], ptLine[3];
int subId, success;
float pcoords[3] = {0., 0., 0.}, ptLine[3] = {0., 0., 0.};
int subId = 0, success = 0;
vtkIdType foundCell;
if (rayPt1[0] == rayPt2[0] &&
......@@ -313,7 +318,7 @@ avtLocateCellQuery::LocatorFindCell(vtkDataSet *ds, float &dist, float *isect)
{
cellLocator->FindClosestPoint(rayPt1, ptLine, foundCell,
subId, dist);
if (foundCell >= 0)
if (foundCell >= 0 && dist >= 0)
{
success = 1;
isect[0] = rayPt1[0];
......
......@@ -23,6 +23,8 @@
using std::string;
using std::map;
static const char meshesDirName[] = "meshes/";
// valid chracters in a variable name
static const int validChars[128] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0 - 15
......@@ -397,6 +399,10 @@ LEOSFileReader::BuildVarInfoMap()
// Mark C. Miller, Mon Mar 8 20:18:06 PST 2004
// Made it skip an "unknown" variable and return false if tryHardLevel < 1
//
// Mark C. Miller, Wed Apr 14 10:51:23 PDT 2004
// I modified how mesh names were constructed to now prepend a directory
// name.
//
// ****************************************************************************
bool
......@@ -432,7 +438,8 @@ LEOSFileReader::AddVariableAndMesh(avtDatabaseMetaData *md, const char *matDirNa
else
meshBaseName = string(matName) + "_" + string(matForm);
string mdVarName = meshBaseName + '/' + string(varName);
string mdMeshName = mdVarName + "_mesh";
string mdMeshName;
mdMeshName = meshesDirName + mdVarName;
// if we're really trying hard, just read the variable info from file
// and put it into the eosVarInfoMap
......@@ -939,6 +946,12 @@ LEOSFileReader::ReadFileAndPopulateMetaData(avtDatabaseMetaData *md)
// Programmer: Mark C. Miller
// Creation: February 10, 2004
//
// Modifications:
//
// Mark C. Miller, Wed Apr 14 10:51:23 PDT 2004
// A added code to activate the catch-all mesh feature when there are more
// than 5 materials
//
// ****************************************************************************
void
......@@ -961,6 +974,14 @@ LEOSFileReader::PopulateDatabaseMetaData(avtDatabaseMetaData *md)
if (s != 0)
tryHardLevel = atoi(s);
//
// LEOS databases can have a very large number of meshes and
// variables. If the count of materials is large enough,
// we turn on the catch-all mesh feature
//
if (numTopDirs > 5)
md->SetUseCatchAllMesh(true);
//
// if "master/contents" exists, its faster to use that.
//
......@@ -981,6 +1002,7 @@ LEOSFileReader::PopulateDatabaseMetaData(avtDatabaseMetaData *md)
// If we get here, we have to do it the hard way
//
ReadFileAndPopulateMetaData(md);
}
// ****************************************************************************
......@@ -1002,6 +1024,11 @@ LEOSFileReader::PopulateDatabaseMetaData(avtDatabaseMetaData *md)
// Brad Whitlock, Fri Mar 5 10:43:53 PDT 2004
// Fixed for the Windows compiler.
//
// Mark C. Miller, Wed Apr 14 10:51:23 PDT 2004
// Since I now prepend mesh names with a directory name, I added code to
// remove directory prepended here. I also added code to fix a problem
// where it would attempt to read the Ny dimensioin of a 1D variable.
//
// ****************************************************************************
vtkDataSet *
......@@ -1014,11 +1041,10 @@ LEOSFileReader::GetMesh(int state, const char *var)
char tmpStr[256];
string::size_type n;
// string off the "_mesh" from end of the variable name and
// compute the full variable name (e.g. "mat/eos-var") and the
// variable name
strcpy(tmpStr,var);
tmpStr[strlen(tmpStr)-5] = 0;
// strip of preceding "meshes/" from the beginning of the name
// name and compute the full variable name
// (e.g. "mat/eos-var") and the variable name
strcpy(tmpStr, var + sizeof(meshesDirName)-1);
string fullVarName = tmpStr;
n = fullVarName.find('/');
string varName(fullVarName,n+1,string::npos);
......@@ -1077,18 +1103,23 @@ LEOSFileReader::GetMesh(int state, const char *var)
}
else if (i == 1)
{
// set name of PDB symbol containing size to read
sprintf(tmpStr, "/%s%s/%s", matDirName.c_str(), varName.c_str(),
varInfoFromFile.ySize.c_str());
// read the size
if (!pdb->GetInteger(tmpStr, &size))
if (varInfoFromFile.ndims == 2)
{
EXCEPTION1(InvalidVariableException, var);
// set name of PDB symbol containing size to read
sprintf(tmpStr, "/%s%s/%s", matDirName.c_str(), varName.c_str(),
varInfoFromFile.ySize.c_str());
// read the size
if (!pdb->GetInteger(tmpStr, &size))
{
EXCEPTION1(InvalidVariableException, var);
}
sprintf(tmpStr, "/%s%s/%s", matDirName.c_str(), varName.c_str(),
varInfoFromFile.yName.c_str());
}
sprintf(tmpStr, "/%s%s/%s", matDirName.c_str(), varName.c_str(),
varInfoFromFile.yName.c_str());
else
size = 1;
}
// Default number of components for an array is 1.
......@@ -1157,6 +1188,10 @@ LEOSFileReader::GetMesh(int state, const char *var)
// Brad Whitlock, Fri Mar 5 10:47:02 PDT 2004
// Fixed for the Windows compiler.
//
// Mark C. Miller, Wed Apr 14 10:51:23 PDT 2004
// I fixed a problem where it would attempt to read the Ny dimension of
// a 1D variable
//
// ****************************************************************************
vtkDataArray *
......@@ -1220,7 +1255,8 @@ LEOSFileReader::GetVar(int state, const char *var)
sprintf(tmpStr, "/%s%s/%s", matDirName.c_str(), varName.c_str(),
varInfoFromFile.ySize.c_str());
// read the size
if (!pdb->GetInteger(tmpStr, &Ny))
Ny = 1;
if ((varInfoFromFile.ndims == 2) && !pdb->GetInteger(tmpStr, &Ny))
{
EXCEPTION1(InvalidVariableException, var);
}
......
......@@ -1851,6 +1851,12 @@ avtSAMRAIFileFormat::GetAuxiliaryData(const char *var, int patch,
// Programmer: Walter Herrera Jimenez
// Creation: June 19, 2003
//
// Modifications:
//
// Hank Childs, Wed Apr 14 08:02:14 PDT 2004
// Back out undocumented changes made by Mark Miller with adding material
// numbers to material names.
//
// ****************************************************************************
void
......@@ -1902,11 +1908,7 @@ avtSAMRAIFileFormat::PopulateDatabaseMetaData(avtDatabaseMetaData *md)
// re-format the material names for avt's API
vector<string> matnames;
for (i = 0; i < num_mats; i++)
{
char tmpName[1024];
sprintf(tmpName, "%d %s", i, mat_names[i].c_str());
matnames.push_back(tmpName);
}
matnames.push_back(mat_names[i]);
// add the material object
avtMaterialMetaData *mmd = new avtMaterialMetaData("materials", mesh_name,
......
......@@ -5499,6 +5499,9 @@ avtSiloFileFormat::GetExternalFacelist(int dom, const char *mesh)
// Hank Childs, Fri Feb 13 17:18:04 PST 2004
// Add the domain to the material constructor.
//
// Hank Childs, Wed Apr 14 07:52:48 PDT 2004
// Attach the material number to the material name.
//
// ****************************************************************************
avtMaterial *
......@@ -5512,9 +5515,29 @@ avtSiloFileFormat::CalcMaterial(DBfile *dbfile, char *matname, int dom)
char dom_string[128];
sprintf(dom_string, "Domain %d", dom);
//
// If we have material names, create a new set of material names that have
// the material number encoded.
//
char **matnames = NULL;
char *buffer = NULL;
if (silomat->matnames != NULL)
{
int nmat = silomat->nmat;
matnames = new char*[nmat];
buffer = new char[nmat*128];
for (int i = 0 ; i < nmat ; i++)
{
matnames[i] = buffer + 128*i;
sprintf(matnames[i], "%d %s", silomat->matnos[i],
silomat->matnames[i]);
}
}
avtMaterial *mat = new avtMaterial(silomat->nmat,
silomat->matnos,
silomat->matnames,
matnames,
silomat->ndims,
silomat->dims,
silomat->major_order,
......@@ -5527,6 +5550,10 @@ avtSiloFileFormat::CalcMaterial(DBfile *dbfile, char *matname, int dom)
dom_string);
DBFreeMaterial(silomat);
if (matnames != NULL)
delete [] matnames;
if (buffer != NULL)
delete [] buffer;
return mat;
}
......
......@@ -629,6 +629,9 @@ RPCExecutor<StartPickRPC>::Execute(StartPickRPC *rpc)
// Jeremy Meredith, Thu Jul 10 11:37:48 PDT 2003
// Made the engine an object.
//
// Mark C. Miller, Wed Apr 14 16:41:32 PDT 2004
// Added code to pass extents type string to SetWindowAttributes
//
// ****************************************************************************
template<>
void
......@@ -644,7 +647,7 @@ RPCExecutor<SetWinAnnotAttsRPC>::Execute(SetWinAnnotAttsRPC *rpc)
{
avtColorTables::Instance()->SetColorTables(rpc->GetWindowAtts().
GetColorTables());
netmgr->SetWindowAttributes(rpc->GetWindowAtts());
netmgr->SetWindowAttributes(rpc->GetWindowAtts(),rpc->GetExtentTypeString());
netmgr->SetAnnotationAttributes(rpc->GetAnnotationAtts());
rpc->SendReply();
}
......
......@@ -1539,14 +1539,23 @@ NetworkManager::Render(intVector plotIds, bool getZBuffer, bool do3DAnnotsOnly)
// Hank Childs, Sat Nov 15 14:59:47 PST 2003
// Make sure vis window gets specular options.
//
// Mark C. Miller, Wed Apr 14 16:41:32 PDT 2004
// Added argument for extents type string and code to set extents type
// on the VisWindow
//
// ****************************************************************************
void
NetworkManager::SetWindowAttributes(const WindowAttributes &atts)
NetworkManager::SetWindowAttributes(const WindowAttributes &atts,
const std::string& extstr)
{
// do nothing if nothing changed
if (windowAttributes == atts)
if ((windowAttributes == atts) && (extentTypeString == extstr))
return;
avtExtentType extType = AVT_UNKNOWN_EXTENT_TYPE;
avtExtentType_FromString(extstr, extType);
viswin->SetViewExtentsType(extType);
// only update size if its different
int s0,s1;
viswin->GetSize(s0,s1);
......@@ -1617,6 +1626,7 @@ NetworkManager::SetWindowAttributes(const WindowAttributes &atts)
viswin->SetImmediateModeRendering(!atts.GetRenderAtts().GetDisplayLists());
windowAttributes = atts;
extentTypeString = extstr;
}
// ****************************************************************************
......
......@@ -144,6 +144,10 @@ class VisWindow;
// Kathleen Bonnell, Wed Mar 31 17:23:01 PST 2004
// Added CloneNetwork and AddQueryOverTimeFilter.
//
// Mark C. Miller, Wed Apr 14 16:41:32 PDT 2004
// Added argument for extents type string to SetWindowAttributes
// Added local variable to store past value for extents type string
//
// ****************************************************************************
class NetworkManager
{
......@@ -179,7 +183,8 @@ class NetworkManager
void UpdatePlotAtts(int, const AttributeGroup *);
void SetWindowAttributes(const WindowAttributes&);
void SetWindowAttributes(const WindowAttributes&,
const std::string&);
void SetAnnotationAttributes(const AnnotationAttributes&,
bool do3DAnnotsOnly = true);
......@@ -218,6 +223,7 @@ class NetworkManager
LoadBalancer *loadBalancer;
WindowAttributes windowAttributes;
AnnotationAttributes annotationAttributes;
std::string extentTypeString;
VisWindow *viswin;
std::vector<int> plotsCurrentlyInWindow;
......
......@@ -476,13 +476,19 @@ EngineProxy::UpdatePlotAttributes(const string &name, int id,
// Programmer: Mark C. Miller
// Creation: 15Jul03
//
// Modifications:
//
// Mark C. Miller Wed Apr 14 16:41:32 PDT 2004
// Added argument for extents type string
//
// ****************************************************************************
void
EngineProxy::SetWinAnnotAtts(const WindowAttributes *winAtts,
const AnnotationAttributes *annotAtts)
const AnnotationAttributes *annotAtts,
const string extStr)
{
setWinAnnotAttsRPC(winAtts,annotAtts);
setWinAnnotAttsRPC(winAtts, annotAtts, extStr);
if (setWinAnnotAttsRPC.GetStatus() == VisItRPC::error)
{
RECONSTITUTE_EXCEPTION(setWinAnnotAttsRPC.GetExceptionType(),
......
......@@ -177,6 +177,9 @@ class StatusAttributes;
// Kathleen Bonnell, Wed Mar 31 17:23:01 PST 2004
// Added CloneNetworkRPC.
//
// Mark C. Miller, Wed Apr 14 16:41:32 PDT 2004
// Added argument for extents type string to SetWinAnnotAtts
//
// ****************************************************************************
class ENGINE_PROXY_API EngineProxy : public RemoteProxyBase
......@@ -227,7 +230,8 @@ public:
void StartPick(const bool, const int);
void SetWinAnnotAtts(const WindowAttributes*,
const AnnotationAttributes*);
const AnnotationAttributes*,
std::string);
avtDataObjectReader_p Render(bool, const intVector&, bool);
avtDataObjectReader_p Execute(bool, void (*waitCB)(void *), void *cbData);
......
......@@ -13,9 +13,14 @@
// Programmer: Mark C. Miller
// Creation: 15Jul03
//
// Modifications: