Commit 4e1ceb04 authored by bonnell's avatar bonnell

Make all queries default to ActualData mode for consistency.

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@31032 18c085ea-50e0-402c-830e-de6fd14e8384
parent 1544c67a
......@@ -1169,11 +1169,13 @@ avtMinMaxQuery::FindElement(MinMaxInfo &info)
// Creation: July 26, 2011
//
// Modifications:
// Kathleen Biagas, Thu Jun 8 12:36:29 PDT 2017
// Change the default to 1, for consistency with other queries.
//
// ****************************************************************************
void
avtMinMaxQuery::GetDefaultInputParams(MapNode &params)
{
params["use_actual_data"] = 0;
params["use_actual_data"] = 1;
}
......@@ -82,13 +82,15 @@ avtNumNodesQuery::~avtNumNodesQuery()
// Creation: July 26, 2011
//
// Modifications:
// Kathleen Biagas, Thu Jun 8 12:36:29 PDT 2017
// Change the default to 1, for consistency with other queries.
//
// ****************************************************************************
void
avtNumNodesQuery::GetDefaultInputParams(MapNode &params)
{
params["use_actual_data"] = 0;
params["use_actual_data"] = 1;
}
......
......@@ -83,13 +83,15 @@ avtNumZonesQuery::~avtNumZonesQuery()
// Creation: July 26, 2011
//
// Modifications:
// Kathleen Biagas, Thu Jun 8 12:36:29 PDT 2017
// Change the default to 1, for consistency with other queries.
//
// ****************************************************************************
void
avtNumZonesQuery::GetDefaultInputParams(MapNode &params)
{
params["use_actual_data"] = 0;
params["use_actual_data"] = 1;
}
......
......@@ -80,43 +80,6 @@ QueryAttributes::VarType_FromString(const std::string &s, QueryAttributes::VarTy
return false;
}
//
// Enum conversion methods for QueryAttributes::DataType
//
static const char *DataType_strings[] = {
"ActualData", "OriginalData"};
std::string
QueryAttributes::DataType_ToString(QueryAttributes::DataType t)
{
int index = int(t);
if(index < 0 || index >= 2) index = 0;
return DataType_strings[index];
}
std::string
QueryAttributes::DataType_ToString(int t)
{
int index = (t < 0 || t >= 2) ? 0 : t;
return DataType_strings[index];
}
bool
QueryAttributes::DataType_FromString(const std::string &s, QueryAttributes::DataType &val)
{
val = QueryAttributes::ActualData;
for(int i = 0; i < 2; ++i)
{
if(s == DataType_strings[i])
{
val = (DataType)i;
return true;
}
}
return false;
}
// ****************************************************************************
// Method: QueryAttributes::QueryAttributes
//
......@@ -1225,15 +1188,6 @@ QueryAttributes::GetVariables()
return defaultVars;
}
QueryAttributes::DataType
QueryAttributes::GetDataType() const
{
if (queryInputParams.HasNumericEntry("data_type"))
return (QueryAttributes::DataType)queryInputParams.GetEntry("data_type")->ToInt();
else
return QueryAttributes::ActualData;
}
void
QueryAttributes::Reset()
{
......
......@@ -54,18 +54,6 @@ QueryAttributes::GetVariables()
return defaultVars;
}
Function: GetDataType
Declaration: DataType GetDataType() const;
Definition:
QueryAttributes::DataType
QueryAttributes::GetDataType() const
{
if (queryInputParams.HasNumericEntry("data_type"))
return (QueryAttributes::DataType)queryInputParams.GetEntry("data_type")->ToInt();
else
return QueryAttributes::ActualData;
}
Function: Reset
Declaration: void Reset();
Definition:
......
......@@ -76,11 +76,6 @@ public:
Curve,
Unknown
};
enum DataType
{
ActualData,
OriginalData
};
// These constructors are for objects of this class
QueryAttributes();
......@@ -168,11 +163,6 @@ public:
protected:
static std::string VarType_ToString(int);
public:
static std::string DataType_ToString(DataType);
static bool DataType_FromString(const std::string &, DataType &);
protected:
static std::string DataType_ToString(int);
public:
// Keyframing methods
virtual std::string GetFieldName(int index) const;
......@@ -186,7 +176,6 @@ public:
std::string &GetName();
const stringVector &GetVariables() const;
stringVector &GetVariables();
DataType GetDataType() const;
void Reset();
void PrintSelf(ostream &os);
void SetResultsValue(const double);
......
......@@ -13,10 +13,6 @@
Curve
Unknown
</Enum>
<Enum name="DataType">
ActualData
OriginalData
</Enum>
<Field name="resultsMessage" label="resultsMessage" type="string">
</Field>
<Field name="resultsValue" label="resultsValue" type="doubleVector">
......@@ -58,8 +54,6 @@
</Function>
<Function name="GetVariables2" user="true" member="true">
</Function>
<Function name="GetDataType" user="true" member="true">
</Function>
<Function name="Reset" user="true" member="true">
</Function>
<Function name="PrintSelf" user="true" member="true">
......
......@@ -4942,6 +4942,11 @@ NetworkManager::CloneNetwork(const int id)
// Use the expression node without assuming where it exists in the working
// net node list.
//
// Kathleen Biagas, Fri May 26 12:35:43 PDT 2017
// Default useActualData to true, retrieve the value from QueryInputParams
// if available. Use it as a value to help determine where input is
// gathered from.
//
// ****************************************************************************
void
......@@ -4954,25 +4959,28 @@ NetworkManager::AddQueryOverTimeFilter(QueryOverTimeAttributes *qA,
EXCEPTION1(ImproperUseException, error);
}
bool useActualData = true;
if (qA->GetQueryAtts().GetQueryInputParams().HasNumericEntry("use_actual_data"))
{
useActualData = qA->GetQueryAtts().GetQueryInputParams().GetEntry("use_actual_data")->ToBool();
}
//
// Determine which input the filter should use.
//
avtDataObject_p input;
if (qA->GetQueryAtts().GetName() == "Locate and Pick Zone" ||
qA->GetQueryAtts().GetName() == "Locate and Pick Node" )
if (useActualData ||
qA->GetQueryAtts().GetName() == "Locate and Pick Zone" ||
qA->GetQueryAtts().GetName() == "Locate and Pick Node")
{
input = networkCache[clonedFromId]->GetPlot()->
GetIntermediateDataObject();
}
else if (qA->GetQueryAtts().GetDataType() == QueryAttributes::OriginalData)
{
input = workingNet->GetExpressionNode()->GetOutput();
}
else
{
input = networkCache[clonedFromId]->GetPlot()->
GetIntermediateDataObject();
input = workingNet->GetExpressionNode()->GetOutput();
}
qA->GetQueryAtts().SetPipeIndex(networkCache[clonedFromId]->
GetContract()->GetPipelineIndex());
......
......@@ -282,6 +282,9 @@ QvisQueryWindow::CreateWindowContents()
// Added pickQueryWidget, xRayImageQueryWidget, lineoutQueryWidget,
// hohlraumFluxQueryWidget, timeQueryOptions.
//
// Kathleen Biagas, Thu Jun 8 12:50:13 PDT 2017
// Made the default for dataOpts be 'actual data'.
//
// ****************************************************************************
void
......@@ -383,7 +386,7 @@ QvisQueryWindow::CreateStandardQueryWidget()
dataOpts->addButton(actualData,1);
sLayout->addWidget(actualData, 10, 0);
dataOpts->button(0)->setChecked(true);
dataOpts->button(1)->setChecked(true);
// Add the dump check box options to the argument panel.
dumpIndex = new QCheckBox(tr("Dump Index"), argPanel);
......@@ -959,6 +962,9 @@ QvisQueryWindow::UpdateResults(bool)
// Kevin Griffin, Thu Aug 11 10:53:13 PDT 2016
// Added GUI case for CompactnessVar queries.
//
// Kathleen Biagas, Thu Jun 8 12:49:35 PDT 2017
// Made the default for dataOpts be 'actual data'.
//
// ****************************************************************************
void
......@@ -979,7 +985,7 @@ QvisQueryWindow::UpdateArgumentPanel(const QString &qname)
}
}
// reset a few defaults
dataOpts->button(0)->setChecked(true);
dataOpts->button(1)->setChecked(true);
useGlobal->setChecked(0);
dumpIndex->setChecked(0);
dumpCoordinates->setChecked(0);
......
......@@ -74,9 +74,6 @@ public class QueryAttributes extends AttributeSubject
public final static int VARTYPE_CURVE = 9;
public final static int VARTYPE_UNKNOWN = 10;
public final static int DATATYPE_ACTUALDATA = 0;
public final static int DATATYPE_ORIGINALDATA = 1;
public QueryAttributes()
{
......
......@@ -82,7 +82,7 @@ enhancements and bug-fixes that were added to this release.</p>
<a name="Query_changes"></a>
<p><b><font size="4">Changes to VisIt's picks and queries in version 2.13</font></b></p>
<ul>
<li>Query Change 1</li>
<li>The default for Queries that operate on either <i>Original</i> or <i>Actual</i> data has been changed from <i>Original</i> to <i>Actual</i>. This makes them consistent with all the other queries that only operate on <i>Actual</i> data. Affected Queries include <i>Min</i>, <i>Max</i>, <i>MinMax</i>, <i>NumNodes</i>, <i>NumZones</i> and <i>Spatial Extents</i>. In the GUI, you will notice that the <i>Actual Data</i> button is the one activated by default for these queries, and from the cli, the <i>use_actual_data</i> parameter defaults to 1 if not set explicitly. This will also affect QueryOverTime for any of these queries.</li>
<li>Query Change 2</li>
</ul>
......
......@@ -1125,19 +1125,10 @@ ViewerQueryManager::DatabaseQuery(const MapNode &in_queryParams)
}
int useActualData = 1;
if (queryParams.HasNumericEntry("use_actual_data"))
{
useActualData = queryParams.GetEntry("use_actual_data")->ToInt();
}
else
{
int winType = GetViewerState()->GetQueryList()->GetWindowType(qName);
if (winType == QueryList::ActualData || winType == QueryList::ActualDataVars)
useActualData = 0; // the default for actual/original supported queries
else
useActualData = 1; // the default for actual-data-only queries
}
// ensure we are all on the same page
queryParams["use_actual_data"] = useActualData;
......@@ -3281,6 +3272,7 @@ ViewerQueryManager::HandlePickCache()
handlingCache = false;
}
// ****************************************************************************
// Method: ViewerQueryManager::PointQuery
//
......@@ -3390,7 +3382,7 @@ ViewerQueryManager::PointQuery(const MapNode &queryParams)
win->EnableUpdates();
}
}
if (!vars.empty())
pickAtts->SetVariables(vars);
......@@ -3399,6 +3391,7 @@ ViewerQueryManager::PointQuery(const MapNode &queryParams)
if (queryParams.HasNumericEntry("do_time"))
timeCurve = queryParams.GetEntry("do_time")->ToInt();
timeCurve |= (pickAtts->GetDoTimeCurve() ? 1 : 0);
// A query with time options should override what is set from PickWindow,
// but then PickAtts should be reset, so save what PickAtts currently has
// to reset it later.
......@@ -3486,7 +3479,6 @@ ViewerQueryManager::PointQuery(const MapNode &queryParams)
}
else if (pType == "DomainZone" || pType == "DomainNode")
{
int domain = 0, element = -1;
if (queryParams.HasNumericEntry("use_global_id"))
{
......@@ -3509,7 +3501,7 @@ ViewerQueryManager::PointQuery(const MapNode &queryParams)
preserveCoord = queryParams.GetEntry("preserve_coord")->ToBool();
else
preserveCoord = pickAtts->GetTimePreserveCoord();
if (timeCurve && preserveCoord)
{
// need to determine the coordinate to use, and change
......@@ -5020,7 +5012,6 @@ ViewerQueryManager::PickThroughTime(PICK_POINT_INFO *ppi,
params["domain"] = pickAtts->GetDomain() >= 0 ?
pickAtts->GetDomain() : 0;
params["element"] = pickAtts->GetElementNumber();
params["data_type"] = QueryAttributes::OriginalData;
stringVector pvars = pickAtts->GetVariables();
for (size_t i = 0; i < pvars.size(); ++i)
if (pvars[i] == "default")
......@@ -5706,6 +5697,7 @@ ViewerQueryManager::Query(const MapNode &queryParams)
GetViewerState()->GetQueryAttributes()->Notify();
return;
}
string qName = queryParams.GetEntry("query_name")->AsString();
if (qName.empty())
{
......@@ -5752,7 +5744,7 @@ ViewerQueryManager::Query(const MapNode &queryParams)
DatabaseQuery(queryParams);
}
else if (qtype == QueryList::PointQuery)
{
{
PointQuery(queryParams);
}
else if (qtype == QueryList::LineQuery)
......@@ -5798,7 +5790,7 @@ ViewerQueryManager::GetQueryParameters(const string &qName)
{
// this query does not exist on engine
MapNode params;
params["use_actual_data"] = 0;
params["use_actual_data"] = 1;
string sparams = params.ToXML();
GetViewerState()->GetQueryAttributes()->SetXmlResult(sparams);
GetViewerState()->GetQueryAttributes()->Notify();
......
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