Commit e5cf5487 authored by hrchilds's avatar hrchilds
Browse files

Update from May 18, 2005

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@472 18c085ea-50e0-402c-830e-de6fd14e8384
parent 7b06f7d9
......@@ -50,7 +50,7 @@ DatabaseCorrelation::CorrelationMethod_FromString(const std::string &s, Database
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Feb 3 19:04:13 PST 2004
// Creation: Tue May 17 17:15:22 PST 2005
//
// Modifications:
//
......@@ -71,7 +71,7 @@ DatabaseCorrelation::DatabaseCorrelation() : AttributeSubject("siis*i*d*i*i*d*i*
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Feb 3 19:04:13 PST 2004
// Creation: Tue May 17 17:15:22 PST 2005
//
// Modifications:
//
......@@ -102,7 +102,7 @@ DatabaseCorrelation::DatabaseCorrelation(const DatabaseCorrelation &obj) : Attri
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Feb 3 19:04:13 PST 2004
// Creation: Tue May 17 17:15:22 PST 2005
//
// Modifications:
//
......@@ -122,15 +122,16 @@ DatabaseCorrelation::~DatabaseCorrelation()
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Feb 3 19:04:13 PST 2004
// Creation: Tue May 17 17:15:22 PST 2005
//
// Modifications:
//
// ****************************************************************************
void
DatabaseCorrelation&
DatabaseCorrelation::operator = (const DatabaseCorrelation &obj)
{
if (this == &obj) return *this;
name = obj.name;
numStates = obj.numStates;
method = obj.method;
......@@ -143,6 +144,7 @@ DatabaseCorrelation::operator = (const DatabaseCorrelation &obj)
condensedCycles = obj.condensedCycles;
SelectAll();
return *this;
}
// ****************************************************************************
......@@ -154,7 +156,7 @@ DatabaseCorrelation::operator = (const DatabaseCorrelation &obj)
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Feb 3 19:04:13 PST 2004
// Creation: Tue May 17 17:15:22 PST 2005
//
// Modifications:
//
......@@ -185,7 +187,7 @@ DatabaseCorrelation::operator == (const DatabaseCorrelation &obj) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Feb 3 19:04:13 PST 2004
// Creation: Tue May 17 17:15:22 PST 2005
//
// Modifications:
//
......@@ -206,7 +208,7 @@ DatabaseCorrelation::operator != (const DatabaseCorrelation &obj) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Feb 3 19:04:13 PST 2004
// Creation: Tue May 17 17:15:22 PST 2005
//
// Modifications:
//
......@@ -227,7 +229,7 @@ DatabaseCorrelation::TypeName() const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Feb 3 19:04:13 PST 2004
// Creation: Tue May 17 17:15:22 PST 2005
//
// Modifications:
//
......@@ -255,7 +257,7 @@ DatabaseCorrelation::CopyAttributes(const AttributeGroup *atts)
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Feb 3 19:04:13 PST 2004
// Creation: Tue May 17 17:15:22 PST 2005
//
// Modifications:
//
......@@ -281,7 +283,7 @@ DatabaseCorrelation::CreateCompatible(const std::string &tname) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Feb 3 19:04:13 PST 2004
// Creation: Tue May 17 17:15:22 PST 2005
//
// Modifications:
//
......@@ -308,7 +310,7 @@ DatabaseCorrelation::NewInstance(bool copy) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Feb 3 19:04:13 PST 2004
// Creation: Tue May 17 17:15:22 PST 2005
//
// Modifications:
//
......@@ -342,7 +344,7 @@ DatabaseCorrelation::SelectAll()
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Feb 3 19:04:13 PST 2004
// Creation: Tue May 17 17:15:22 PST 2005
//
// Modifications:
//
......@@ -438,7 +440,7 @@ DatabaseCorrelation::CreateNode(DataNode *parentNode, bool completeSave, bool fo
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Feb 3 19:04:13 PST 2004
// Creation: Tue May 17 17:15:22 PST 2005
//
// Modifications:
//
......@@ -743,7 +745,7 @@ DatabaseCorrelation::SelectCondensedCycles()
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Feb 3 19:04:13 PST 2004
// Creation: Tue May 17 17:15:22 PST 2005
//
// Modifications:
//
......@@ -777,7 +779,7 @@ DatabaseCorrelation::GetFieldName(int index) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Feb 3 19:04:13 PST 2004
// Creation: Tue May 17 17:15:22 PST 2005
//
// Modifications:
//
......@@ -811,7 +813,7 @@ DatabaseCorrelation::GetFieldType(int index) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Feb 3 19:04:13 PST 2004
// Creation: Tue May 17 17:15:22 PST 2005
//
// Modifications:
//
......@@ -845,7 +847,7 @@ DatabaseCorrelation::GetFieldTypeName(int index) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Feb 3 19:04:13 PST 2004
// Creation: Tue May 17 17:15:22 PST 2005
//
// Modifications:
//
......@@ -982,7 +984,7 @@ DatabaseCorrelation::GetCorrelatedTimeStates(int state, intVector &states) const
// Modifications:
// Brad Whitlock, Fri Apr 1 15:17:08 PST 2005
// Fixed a rounding problem.
//
//
// ****************************************************************************
void
......@@ -1333,7 +1335,9 @@ DatabaseCorrelation::GetInverseCorrelatedTimeState(const std::string &db,
// Creation: Sat Jan 31 19:56:11 PST 2004
//
// Modifications:
//
// Brad Whitlock, Wed Apr 14 11:59:47 PDT 2004
// Fixed for Windows compiler.
//
// ****************************************************************************
ostream &
......@@ -1447,3 +1451,44 @@ DatabaseCorrelation::GetCondensedTimeForState(int state) const
return retval;
}
// ****************************************************************************
// Method: DatabaseCorrelation::GetMethodName
//
// Purpose: Returns the correlation method name as a char*
//
// Programmer: Mark C. Miller
// Creation: Tuesday, May 17, 2005
//
// ****************************************************************************
const char*
DatabaseCorrelation::GetMethodName() const
{
return GetMethodNameFromMethod(GetMethod());
}
// ****************************************************************************
// Method: DatabaseCorrelation::GetMethodNameFromMethod
//
// Purpose: Returns the correlation method name as a char*
//
// Programmer: Mark C. Miller
// Creation: Tuesday, May 17, 2005
//
// ****************************************************************************
const char*
DatabaseCorrelation::GetMethodNameFromMethod(int m)
{
CorrelationMethod theMethod = (CorrelationMethod) m;
switch(theMethod)
{
case IndexForIndexCorrelation: return "Index";
case StretchedIndexCorrelation: return "StretchedIndex";
case TimeCorrelation: return "Time";
case CycleCorrelation: return "Cycle";
case UserDefinedCorrelation: return "User Defined";
}
return "Unknown";
}
......@@ -351,7 +351,6 @@ DatabaseCorrelation::AddDatabase(const std::string &database, int nStates,
}
}
Function: UsesDatabase
Declaration: bool UsesDatabase(const std::string &database) const;
Definition:
......@@ -382,7 +381,6 @@ DatabaseCorrelation::UsesDatabase(const std::string &database) const
databaseNames.end();
}
Function: GetNumDatabases
Declaration: int GetNumDatabases() const;
Definition:
......@@ -405,7 +403,6 @@ DatabaseCorrelation::GetNumDatabases() const
return databaseNames.size();
}
Function: GetCorrelatedTimeState
Declaration: int GetCorrelatedTimeState(const std::string &db, int state) const;
Definition:
......@@ -451,7 +448,6 @@ DatabaseCorrelation::GetCorrelatedTimeState(const std::string &db, int state) co
return retval;
}
Function: GetInverseCorrelatedTimeState
Declaration: int GetInverseCorrelatedTimeState(const std::string &db, int state) const;
Definition:
......@@ -503,7 +499,6 @@ DatabaseCorrelation::GetInverseCorrelatedTimeState(const std::string &db,
return retval;
}
Function: OutputOperator
Declaration: ostream& operator << (ostream &os, const DatabaseCorrelation &);
Definition:
......@@ -581,7 +576,6 @@ operator << (ostream &os, const DatabaseCorrelation &correlation)
return os;
}
Function: GetCondensedCycleForState
Declaration: int GetCondensedCycleForState(int state) const;
Definition:
......@@ -615,7 +609,6 @@ DatabaseCorrelation::GetCondensedCycleForState(int state) const
return retval;
}
Function: GetCondensedTimeForState
Declaration: double GetCondensedTimeForState(int state) const;
Definition:
......@@ -648,3 +641,51 @@ DatabaseCorrelation::GetCondensedTimeForState(int state) const
return retval;
}
Function: GetMethodName
Declaration: const char *GetMethodName() const;
Definition:
// ****************************************************************************
// Method: DatabaseCorrelation::GetMethodName
//
// Purpose: Returns the correlation method name as a char*
//
// Programmer: Mark C. Miller
// Creation: Tuesday, May 17, 2005
//
// ****************************************************************************
const char*
DatabaseCorrelation::GetMethodName() const
{
return GetMethodNameFromMethod(GetMethod());
}
Function: GetMethodNameFromMethod
Declaration: static const char *GetMethodNameFromMethod(int m);
Definition:
// ****************************************************************************
// Method: DatabaseCorrelation::GetMethodNameFromMethod
//
// Purpose: Returns the correlation method name as a char*
//
// Programmer: Mark C. Miller
// Creation: Tuesday, May 17, 2005
//
// ****************************************************************************
const char*
DatabaseCorrelation::GetMethodNameFromMethod(int m)
{
CorrelationMethod theMethod = (CorrelationMethod) m;
switch(theMethod)
{
case IndexForIndexCorrelation: return "Index";
case StretchedIndexCorrelation: return "StretchedIndex";
case TimeCorrelation: return "Time";
case CycleCorrelation: return "Cycle";
case UserDefinedCorrelation: return "User Defined";
}
return "Unknown";
}
......@@ -14,7 +14,7 @@
// Notes: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Feb 3 19:04:13 PST 2004
// Creation: Tue May 17 17:15:22 PST 2005
//
// Modifications:
//
......@@ -36,7 +36,7 @@ public:
DatabaseCorrelation(const DatabaseCorrelation &obj);
virtual ~DatabaseCorrelation();
virtual void operator = (const DatabaseCorrelation &obj);
virtual DatabaseCorrelation& operator = (const DatabaseCorrelation &obj);
virtual bool operator == (const DatabaseCorrelation &obj) const;
virtual bool operator != (const DatabaseCorrelation &obj) const;
......@@ -114,6 +114,8 @@ public:
int GetInverseCorrelatedTimeState(const std::string &db, int state) const;
int GetCondensedCycleForState(int state) const;
double GetCondensedTimeForState(int state) const;
const char *GetMethodName() const;
static const char *GetMethodNameFromMethod(int m);
private:
std::string name;
int numStates;
......@@ -127,6 +129,6 @@ private:
intVector condensedCycles;
};
STATE_API ostream& operator << (ostream &os, const DatabaseCorrelation &);
// User-defined functions
ostream& operator << (ostream &os, const DatabaseCorrelation &);
#endif
......@@ -48,7 +48,11 @@
<Function name="GetCondensedCycleForState" user="true" member="true">
</Function>
<Function name="GetCondensedTimeForState" user="true" member="true">
</Function>
</Function>
<Function name="GetMethodName" user="true" member="true">
</Function>
<Function name="GetMethodNameFromMethod" user="true" member="true">
</Function>
<Include file="source" quoted="false">
algorithm
</Include>
......
......@@ -4326,10 +4326,15 @@ avtDatabaseMetaData::SetTemporalExtents(double min, double max)
// Programmer: Hank Childs
// Creation: September 15, 2000
//
// Modifications:
//
// Mark C. Miller, Tue May 17 18:48:38 PDT 2005
// const qualified arg
//
// ****************************************************************************
void
avtDatabaseMetaData::SetCycles(std::vector<int> &c)
avtDatabaseMetaData::SetCycles(const std::vector<int> &c)
{
cycles = c;
}
......@@ -4344,10 +4349,15 @@ avtDatabaseMetaData::SetCycles(std::vector<int> &c)
// Programmer: Hank Childs
// Creation: March 11, 2002
//
// Modifications:
//
// Mark C. Miller, Tue May 17 18:48:38 PDT 2005
// const qualified arg
//
// ****************************************************************************
void
avtDatabaseMetaData::SetTimes(std::vector<double> &t)
avtDatabaseMetaData::SetTimes(const std::vector<double> &t)
{
times = t;
}
......@@ -4464,6 +4474,39 @@ avtDatabaseMetaData::IsCycleAccurate(int ts) const
return (cyclesAreAccurate[ts] != 0 ? true : false);
}
// ****************************************************************************
// Method: avtDatabaseMetaData::AreAllCyclesAccurateAndValid
//
// Purpose: Convenience method for checking if ALL cycles are accurate and
// valid (are monotone increasing and there are numStates of them). If the
// caller doesn't know the expected number of states, it can pass void to
// use the numStates known in avtDatabaseMetaData
//
// Programmer: Mark C. Miller
// Creation: March 16, 2005
//
// ****************************************************************************
bool
avtDatabaseMetaData::AreAllCyclesAccurateAndValid(int expectedNumStates) const
{
int useNumStates = expectedNumStates == -1 ? numStates : expectedNumStates;
if (cyclesAreAccurate.size() != useNumStates)
return false;
if (cyclesAreAccurate.size() != cycles.size())
return false;
for (int i = 0 ; i < useNumStates; i++)
{
if (cyclesAreAccurate[i] == 0)
return false;
if ((i > 0) && (cycles[i] <= cycles[i-1]))
return false;
}
return true;
}
// ****************************************************************************
// Method: avtDatabaseMetaData::SetTimeIsAccurate
......@@ -4533,6 +4576,40 @@ avtDatabaseMetaData::IsTimeAccurate(int ts) const
return (timesAreAccurate[ts] != 0 ? true : false);
}
// ****************************************************************************
// Method: avtDatabaseMetaData::AreAllTimesAccurateAndValid
//
// Purpose: Convenience method to check if all times are accurate and
// monotone increasing. If the caller doesn't know the expected number of
// states, it can pass void (it will default to -1) and the numStates in
// avtDatabaseMetaData will be used
//
// Programmer: Mark C. Miller
// Creation: March 16, 2005
//
// ****************************************************************************
bool
avtDatabaseMetaData::AreAllTimesAccurateAndValid(int expectedNumStates) const
{
int useNumStates = expectedNumStates == -1 ? numStates : expectedNumStates;
if (timesAreAccurate.size() != useNumStates)
return false;
if (timesAreAccurate.size() != times.size())
return false;
for (int i = 0 ; i < useNumStates; i++)
{
if (timesAreAccurate[i] == 0)
return false;
if ((i > 0) && (times[i] <= times[i-1]))
return false;
}
return true;
}
// ****************************************************************************
// Method: avtDatabaseMetaData::SetCycle
......@@ -5531,6 +5608,10 @@ avtDatabaseMetaData::GetSpeciesOnMesh(std::string mesh) const
// Brad Whitlock, Fri Apr 1 15:28:58 PST 2005
// Added labels.
//
// Mark C. Miller, Tue May 17 18:48:38 PDT 2005
// Added code to deal with printing of times and a friendlier format
// for printing of cycles and times
//
// ****************************************************************************
void
......@@ -5573,6 +5654,46 @@ avtDatabaseMetaData::Print(ostream &out, int indent) const
out << "The temporal extents are not set." << endl;
}
Indent(out, indent);
if (times.size() == 0)
{
out << "The times are not set." << endl;
}
else
{
bool shouldPrintTimes = false;
for (int i = 0; i < times.size(); ++i)
{
if (times[i] != (double) cycles[i])
{
shouldPrintTimes = true;
break;
}
}
if (AreAllTimesAccurateAndValid())
out << "All Times are Accurate" << endl;
else
out << "All Times are ***NOT*** Accurate" << endl;
if (shouldPrintTimes)
{
out << "Times: ";
for (int i = 0; i < times.size(); ++i)
{
out << times[i];
if(i < times.size() - 1)
out << ", ";
if((i+1)%20 == 0)
out << endl << " ";
}
}
else
{
out << "Times: Are identical to cycles";
}
out << endl;
}
Indent(out, indent);
if (cycles.size() == 0)
{
......@@ -5580,12 +5701,18 @@ avtDatabaseMetaData::Print(ostream &out, int indent) const
}
else
{
if (AreAllCyclesAccurateAndValid())
out << "All Cycles are Accurate" << endl;
else
out << "All Cycles are ***NOT*** Accurate" << endl;
out << "Cycles: ";
for (int i = 0; i < cycles.size(); ++i)
{
out << cycles[i];
if(i < cycles.size() - 1)
out << ", ";
if((i+1)%20 == 0)
out << endl << " ";
}
out << endl;
}
......
......@@ -477,6 +477,9 @@ public:
// Jeremy Meredith, Thu Apr 28 17:48:21 PDT 2005
// Added a non-const accessor for the simulation info.
//
// Mark C. Miller, Tue May 17 18:48:38 PDT 2005
// const qualified args to SetCycles/SetTimes
// Added AreAllCycles/TimesAccurateAndValid
//----------------------------------------------------------------------------
class DBATTS_API avtDatabaseMetaData : public AttributeSubject
......@@ -560,17 +563,19 @@ public:
const intVector &GetCycles() const { return cycles; };
void SetCycle(int, int);
void SetCycles(intVector &);
void SetCycles(const intVector &);
void SetCycleIsAccurate(bool, int);
void SetCyclesAreAccurate(bool);
bool IsCycleAccurate(int) const;
bool AreAllCyclesAccurateAndValid(int=-1) const;
const doubleVector &GetTimes() const { return times; };
void SetTime(int, double);
void SetTimes(doubleVector &);
void SetTimes(const doubleVector &);
void SetTimeIsAccurate(bool, int);
void SetTimesAreAccurate(bool);
bool IsTimeAccurate(int) const;
bool AreAllTimesAccurateAndValid(int=-1) const;
void SetDatabaseName(const std::string &dsn) {databaseName = dsn;};
const std::string &GetDatabaseName() const { return databaseName; };
......
......@@ -674,10 +674,13 @@ avtDatabase::GetMostRecentTimestep(void) const
// Jeremy Meredith/Hank Childs, Tue Mar 23 12:26:55 PST 2004
// Set the file format with the meta-data.
//
// Mark C. Miller, Tue May 17 18:48:38 PDT 2005
// Added bool to force reading of all cycles and times
//
// ****************************************************************************
void
avtDatabase::GetNewMetaData(int timeState)
avtDatabase::GetNewMetaData(int timeState, bool forceReadAllCyclesTimes)
{
// sanity check: since SIL info is currently embedded in MetaData,
// we cannot have MD invariant but SIL NOT invariant
......@@ -694,7 +697,7 @@ avtDatabase::GetNewMetaData(int timeState)
fname = "";
else
fname = filename;
SetDatabaseMetaData(md, timeState);
SetDatabaseMetaData(md, timeState, forceReadAllCyclesTimes);
md->SetDatabaseName(fname);
md->SetFileFormat(fileFormat);
md->SetMustRepopulateOnStateChange(!MetaDataIsInvariant() ||
......@@ -828,23 +831,47 @@ avtDatabase::AddMeshQualityExpressions(avtDatabaseMetaData *md)