Commit fe9a9846 authored by hrchilds's avatar hrchilds
Browse files

Update from September 25, 2003

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@85 18c085ea-50e0-402c-830e-de6fd14e8384
parent ae448e09
......@@ -121,6 +121,10 @@ avtSourceFromDatabase::~avtSourceFromDatabase()
// Hank Childs, Fri May 16 10:14:40 PDT 2003
// Catch exceptions thrown by the database.
//
// Hank Childs, Thu Sep 25 16:30:09 PDT 2003
// Make sure the variable being sent up to the database is a variable
// contained within that database.
//
// ****************************************************************************
bool
......@@ -129,7 +133,9 @@ avtSourceFromDatabase::FetchDataset(avtDataSpecification_p spec,
{
TRY
{
tree = database->GetOutput(spec, this);
avtDataSpecification_p tmp_spec = new avtDataSpecification(spec,
spec->GetDBVariable());
tree = database->GetOutput(tmp_spec, this);
}
CATCH2(VisItException, e)
{
......@@ -308,11 +314,18 @@ avtSourceFromDatabase::FetchMaterialAuxiliaryData(const char *type, void *args,
// Hank Childs, Thu Jul 26 12:59:02 PDT 2001
// Added logic to set the top set.
//
// Hank Childs, Thu Sep 25 16:27:38 PDT 2003
// If a 'last spec' is available, use its variable.
//
// ****************************************************************************
avtDataSpecification_p
avtSourceFromDatabase::GetFullDataSpecification(void)
{
const char *acting_var = variable;
if (*lastSpec != NULL)
acting_var = lastSpec->GetVariable();
avtSIL *sil = database->GetSIL();
avtSILRestriction_p silr = new avtSILRestriction(sil);
......@@ -323,7 +336,7 @@ avtSourceFromDatabase::GetFullDataSpecification(void)
string mesh = md->MeshForVar(variable);
silr->SetTopSet(mesh.c_str());
return new avtDataSpecification(variable, timestep, silr);
return new avtDataSpecification(acting_var, timestep, silr);
}
......
......@@ -257,10 +257,9 @@ avtExpressionEvaluatorFilter::PerformRestriction(avtPipelineSpecification_p spec
// Set up the data spec.
it = real_list.begin();
if (haveActiveVariable)
newds = new avtDataSpecification(ds, ds->GetVariable());
else
newds = new avtDataSpecification(ds, (*it++).c_str());
newds = new avtDataSpecification(ds);
if (!haveActiveVariable)
newds->SetDBVariable((*it).c_str());
newds->RemoveAllSecondaryVariables();
for ( ; it != real_list.end() ; it++)
......
......@@ -141,6 +141,8 @@ class PIPELINE_API avtDataValidity
{ return queryable; }
void ErrorOccurred(void) { errorOccurred = true; };
void ResetErrorOccurred(void)
{ errorOccurred = false; };
bool HasErrorOccurred(void) { return errorOccurred; };
void SetErrorMessage(std::string &s)
{ errorString = s; };
......
......@@ -2,7 +2,6 @@
// avtDataSpecification.C //
// ************************************************************************* //
#include <avtDataSpecification.h>
#include <avtSILRestrictionTraverser.h>
......@@ -65,6 +64,9 @@ using std::vector;
// Jeremy Meredith, Mon Sep 15 17:12:16 PDT 2003
// Added a flag for the material interface algorithm to use.
//
// Hank Childs, Thu Sep 25 08:28:28 PDT 2003
// Set the db variable.
//
// ****************************************************************************
avtDataSpecification::avtDataSpecification(const char *var, int ts,
......@@ -92,6 +94,13 @@ avtDataSpecification::avtDataSpecification(const char *var, int ts,
variable = new char[strlen(var)+1];
strcpy(variable, var);
//
// Assume the 'db' variable is the input variable. If this is not true,
// it will be corrected later.
//
db_variable = new char[strlen(var)+1];
strcpy(db_variable, var);
}
......@@ -143,6 +152,9 @@ avtDataSpecification::avtDataSpecification(const char *var, int ts,
// Jeremy Meredith, Mon Sep 15 17:12:16 PDT 2003
// Added a flag for the material interface algorithm to use.
//
// Hank Childs, Thu Sep 25 08:28:28 PDT 2003
// Set the db variable.
//
// ****************************************************************************
avtDataSpecification::avtDataSpecification(const char *var, int ts, int ch)
......@@ -169,6 +181,13 @@ avtDataSpecification::avtDataSpecification(const char *var, int ts, int ch)
variable = new char[strlen(var)+1];
strcpy(variable, var);
//
// Assume the 'db' variable is the input variable. If this is not true,
// it will be corrected later.
//
db_variable = new char[strlen(var)+1];
strcpy(db_variable, var);
}
......@@ -187,12 +206,16 @@ avtDataSpecification::avtDataSpecification(const char *var, int ts, int ch)
// Hank Childs, Thu Sep 6 15:39:36 PDT 2001
// Initialized variable to NULL.
//
// Hank Childs, Thu Sep 25 08:28:28 PDT 2003
// Initialized db_variable to NULL.
//
// ****************************************************************************
avtDataSpecification::avtDataSpecification(avtDataSpecification_p spec,
avtSILRestriction_p silr)
{
variable = NULL;
db_variable = NULL;
(*this) = **spec;
sil.useRestriction = true;
sil.silr = silr;
......@@ -209,12 +232,18 @@ avtDataSpecification::avtDataSpecification(avtDataSpecification_p spec,
// Programmer: Hank Childs
// Creation: June 5, 2001
//
// Modifications:
//
// Hank Childs, Thu Sep 25 08:28:28 PDT 2003
// Initialized db_variable to NULL.
//
// ****************************************************************************
avtDataSpecification::avtDataSpecification(avtDataSpecification_p spec,
int cdi)
{
variable = NULL;
db_variable = NULL;
(*this) = **spec;
sil.useRestriction = false;
sil.dataChunk = cdi;
......@@ -236,19 +265,32 @@ avtDataSpecification::avtDataSpecification(avtDataSpecification_p spec,
// Hank Childs, Mon Jan 14 14:23:22 PST 2002
// Fix memory leak.
//
// Hank Childs, Thu Sep 25 08:28:28 PDT 2003
// Handle the db_variable as well.
//
// ****************************************************************************
avtDataSpecification::avtDataSpecification(avtDataSpecification_p spec,
const char *name)
{
variable = NULL;
db_variable = NULL;
(*this) = **spec;
if (variable != NULL)
{
delete [] variable;
}
if (db_variable != NULL)
{
delete [] db_variable;
}
variable = new char[strlen(name)+1];
strcpy(variable, name);
db_variable = new char[strlen(name)+1];
strcpy(db_variable, name);
}
......@@ -261,11 +303,17 @@ avtDataSpecification::avtDataSpecification(avtDataSpecification_p spec,
// Programmer: Hank Childs
// Creation: June 7, 2002
//
// Modifications:
//
// Hank Childs, Thu Sep 25 08:28:28 PDT 2003
// Initialized db_variable to NULL.
//
// ****************************************************************************
avtDataSpecification::avtDataSpecification(avtDataSpecification_p spec)
{
variable = NULL;
db_variable = NULL;
(*this) = **spec;
}
......@@ -320,6 +368,9 @@ avtDataSpecification::avtDataSpecification(avtDataSpecification_p spec)
// Jeremy Meredith, Mon Sep 15 17:12:16 PDT 2003
// Added a flag for the material interface algorithm to use.
//
// Hank Childs, Thu Sep 25 08:28:28 PDT 2003
// Handle db_variable.
//
// ****************************************************************************
avtDataSpecification &
......@@ -329,11 +380,19 @@ avtDataSpecification::operator=(const avtDataSpecification &spec)
{
delete [] variable;
}
if (db_variable != NULL)
{
delete [] db_variable;
}
timestep = spec.timestep;
variable = new char[strlen(spec.variable)+1];
strcpy(variable, spec.variable);
db_variable = new char[strlen(spec.db_variable)+1];
strcpy(db_variable, spec.db_variable);
sil.useRestriction = spec.sil.useRestriction;
if (sil.useRestriction)
{
......@@ -421,6 +480,9 @@ avtDataSpecification::operator=(const avtDataSpecification &spec)
// Jeremy Meredith, Mon Sep 15 17:12:16 PDT 2003
// Added a flag for the material interface algorithm to use.
//
// Hank Childs, Thu Sep 25 08:28:28 PDT 2003
// Compare db_variable.
//
// ****************************************************************************
bool
......@@ -438,6 +500,10 @@ avtDataSpecification::operator==(const avtDataSpecification &ds)
{
return false;
}
if (strcmp(db_variable, ds.db_variable) != 0)
{
return false;
}
if (!(sil == ds.sil))
{
......@@ -538,6 +604,11 @@ avtDataSpecification::operator==(const avtDataSpecification &ds)
// Programmer: Hank Childs
// Creation: May 19, 2001
//
// Modifications:
//
// Hank Childs, Thu Sep 25 08:28:28 PDT 2003
// Destruct db_variable.
//
// ****************************************************************************
avtDataSpecification::~avtDataSpecification()
......@@ -547,6 +618,38 @@ avtDataSpecification::~avtDataSpecification()
delete [] variable;
variable = NULL;
}
if (db_variable != NULL)
{
delete [] db_variable;
db_variable = NULL;
}
}
// ****************************************************************************
// Method: avtDataSpecification::SetDBVariable
//
// Purpose:
// Sets the variable that is known to be good on the database.
//
// Programmer: Hank Childs
// Creation: September 25, 2003
//
// ****************************************************************************
void
avtDataSpecification::SetDBVariable(const char *v)
{
if (db_variable != NULL)
{
delete [] db_variable;
db_variable = NULL;
}
if (v != NULL)
{
db_variable = new char[strlen(v)+1];
strcpy(db_variable, v);
}
}
......
......@@ -89,6 +89,9 @@ typedef ref_ptr<avtDataSpecification> avtDataSpecification_p;
// Jeremy Meredith, Fri Sep 5 15:14:22 PDT 2003
// Added flag to use new MIR algorithm.
//
// Hank Childs, Thu Sep 25 08:28:28 PDT 2003
// Allow the setting of a "db" variable.
//
// ****************************************************************************
class PIPELINE_API avtDataSpecification
......@@ -114,9 +117,12 @@ class PIPELINE_API avtDataSpecification
avtSILSpecification &GetSIL(void) { return sil; };
avtSILRestriction_p GetRestriction(void);
const char *GetDBVariable(void) {return db_variable;};
void SetDBVariable(const char *);
void AddSecondaryVariable(const char *);
void RemoveSecondaryVariable(const char *);
void RemoveAllSecondaryVariables() {secondaryVariables.clear();};
void RemoveAllSecondaryVariables()
{ secondaryVariables.clear(); };
bool HasSecondaryVariable(const char *);
const std::vector<CharStrRef> &
GetSecondaryVariables(void)
......@@ -207,6 +213,14 @@ class PIPELINE_API avtDataSpecification
avtSILSpecification sil;
std::vector<CharStrRef> secondaryVariables;
// db_variable is the name of a variable that exists in the database.
// variable is the active variable that will be drawn. Typically,
// db_variable and variable are the same. But they differ when variable
// is an expression, for example.
// Note: if you set up a db_variable, it must still be added as a
// secondary variable.
char *db_variable;
bool needZones;
bool needNodes;
bool mayRequireZones;
......
......@@ -153,6 +153,9 @@ avtTerminatingSource::GetMaterialAuxiliaryData(const char *type, void *args,
// Hank Childs, Mon Aug 13 15:23:08 PDT 2001
// Made call to update progress.
//
// Hank Childs, Thu Sep 25 08:12:27 PDT 2003
// Reset the 'ErrorOccurred' field.
//
// ****************************************************************************
bool
......@@ -163,6 +166,8 @@ avtTerminatingSource::Update(avtPipelineSpecification_p spec)
UpdateProgress(0, 0, "avtTerminatingSource", "Retrieving data.");
}
avtDataSpecification_p data = BalanceLoad(spec);
if (!ArtificialPipeline())
GetOutput()->GetInfo().GetValidity().ResetErrorOccurred();
bool rv = FetchData(data);
if (!ArtificialPipeline())
{
......
......@@ -30,11 +30,9 @@ if test -z "$VTK"; then
fi
##
## If QTDIR is not set, use VisIt's Qt.
## Use VisIt's Qt.
##
if test -z "$QTDIR"; then
QTDIR=$VISITHOME/qt/current/redhat_6
fi
QTDIR=$VISITHOME/qt/current/redhat_6
##
## Use VisIt's Python.
......
......@@ -30,11 +30,9 @@ if test -z "$VTK"; then
fi
##
## If QTDIR is not set, use VisIt's Qt.
## Use VisIt's Qt.
##
if test -z "$QTDIR"; then
QTDIR=$VISITHOME/qt/current/redhat_6
fi
QTDIR=$VISITHOME/qt/current/redhat_6
##
## Use VisIt's Python.
......
......@@ -30,11 +30,9 @@ if test -z "$VTK"; then
fi
##
## If QTDIR is not set, use VisIt's Qt.
## Use VisIt's Qt.
##
if test -z "$QTDIR"; then
QTDIR=$VISITHOME/qt/current/redhat_6
fi
QTDIR=$VISITHOME/qt/current/redhat_6
##
## Use VisIt's Python.
......
......@@ -30,11 +30,9 @@ if test -z "$VTK"; then
fi
##
## If QTDIR is not set, use VisIt's Qt.
## Use VisIt's Qt.
##
if test -z "$QTDIR"; then
QTDIR=$VISITHOME/qt/current/redhat_6
fi
QTDIR=$VISITHOME/qt/current/redhat_6
##
## Use VisIt's Python.
......
......@@ -30,11 +30,9 @@ if test -z "$VTK"; then
fi
##
## If QTDIR is not set, use VisIt's Qt.
## Use VisIt's Qt.
##
if test -z "$QTDIR"; then
QTDIR=$VISITHOME/qt/current/redhat_6
fi
QTDIR=$VISITHOME/qt/current/redhat_6
##
## Use VisIt's Python.
......
......@@ -30,11 +30,9 @@ if test -z "$VTK"; then
fi
##
## If QTDIR is not set, use VisIt's Qt.
## Use VisIt's Qt.
##
if test -z "$QTDIR"; then
QTDIR=$VISITHOME/qt/current/redhat_6
fi
QTDIR=$VISITHOME/qt/current/redhat_6
##
## Use VisIt's Python.
......
......@@ -30,11 +30,9 @@ if test -z "$VTK"; then
fi
##
## If QTDIR is not set, use VisIt's Qt.
## Use VisIt's Qt.
##
if test -z "$QTDIR"; then
QTDIR=$VISITHOME/qt/current/redhat_6
fi
QTDIR=$VISITHOME/qt/current/redhat_6
##
## Use VisIt's Python.
......
......@@ -127,6 +127,10 @@ QvisThresholdWindow::CreateWindowContents()
//
// Modifications:
//
// Hank Childs, Thu Sep 25 09:16:09 PDT 2003
// Allow for "min" and "max" to be valid values in the lbound and ubound
// windows.
//
// ****************************************************************************
void
......@@ -150,11 +154,17 @@ QvisThresholdWindow::UpdateWindow(bool doAll)
amount->setButton(atts->GetAmount());
break;
case 1: //lbound
temp.sprintf("%g", atts->GetLbound());
if (atts->GetLbound() == -1e+37)
temp = "min";
else
temp.sprintf("%g", atts->GetLbound());
lbound->setText(temp);
break;
case 2: //ubound
temp.sprintf("%g", atts->GetUbound());
if (atts->GetUbound() == +1e+37)
temp = "max";
else
temp.sprintf("%g", atts->GetUbound());
ubound->setText(temp);
break;
case 3: //variable
......@@ -177,6 +187,10 @@ QvisThresholdWindow::UpdateWindow(bool doAll)
//
// Modifications:
//
// Hank Childs, Thu Sep 25 09:16:09 PDT 2003
// Allow for "min" and "max" to be valid values in the lbound and ubound
// windows.
//
// ****************************************************************************
void
......@@ -195,20 +209,25 @@ QvisThresholdWindow::GetCurrentValues(int which_widget)
if(which_widget == 1 || doAll)
{
temp = lbound->displayText().simplifyWhiteSpace();
okay = !temp.isEmpty();
if(okay)
if (temp.latin1() == QString("min"))
atts->SetUbound(-1e+37);
else
{
double val = temp.toDouble(&okay);
atts->SetLbound(val);
}
okay = !temp.isEmpty();
if(okay)
{
double val = temp.toDouble(&okay);
atts->SetLbound(val);
}
if(!okay)
{
msg.sprintf("The value of lbound was invalid. "
"Resetting to the last good value of %g.",
atts->GetLbound());
Message(msg);
atts->SetLbound(atts->GetLbound());
if(!okay)
{
msg.sprintf("The value of lbound was invalid. "
"Resetting to the last good value of %g.",
atts->GetLbound());
Message(msg);
atts->SetLbound(atts->GetLbound());
}
}
}
......@@ -216,20 +235,25 @@ QvisThresholdWindow::GetCurrentValues(int which_widget)
if(which_widget == 2 || doAll)
{
temp = ubound->displayText().simplifyWhiteSpace();
okay = !temp.isEmpty();
if(okay)
{
double val = temp.toDouble(&okay);
atts->SetUbound(val);
}
if(!okay)
if (temp.latin1() == QString("max"))
atts->SetUbound(1e+37);
else
{
msg.sprintf("The value of ubound was invalid. "
"Resetting to the last good value of %g.",
atts->GetUbound());
Message(msg);
atts->SetUbound(atts->GetUbound());
okay = !temp.isEmpty();
if(okay)
{
double val = temp.toDouble(&okay);
atts->SetUbound(val);
}
if(!okay)
{
msg.sprintf("The value of ubound was invalid. "
"Resetting to the last good value of %g.",
atts->GetUbound());
Message(msg);
atts->SetUbound(atts->GetUbound());
}
}
}
......
......@@ -9,10 +9,10 @@
Some
</Field>
<Field name="lbound" label="Lower bound" type="double">
0.000000
-1e37
</Field>
<Field name="ubound" label="Upper bound" type="double">
0.000000
+1e37
</Field>
<Field name="variable" label="variable" type="string">
default
......
......@@ -47,7 +47,7 @@ ThresholdAttributes::Amount_FromString(const std::string &s, ThresholdAttributes
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Jul 23 13:22:56 PST 2003
// Creation: Thu Sep 25 09:13:06 PDT 2003
//
// Modifications:
//
......@@ -56,8 +56,8 @@ ThresholdAttributes::Amount_FromString(const std::string &s, ThresholdAttributes
ThresholdAttributes::ThresholdAttributes() : AttributeSubject("idds")
{
amount = Some;
lbound = 0;
ubound = 0;