Commit acf60550 authored by kgriffin's avatar kgriffin

Merge from 2.11RC

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@28989 18c085ea-50e0-402c-830e-de6fd14e8384
parent d690e9cd
......@@ -48,6 +48,8 @@
# Hank Childs, Thu May 12 15:37:21 PDT 2011
# Add avtAverageValueQuery.
#
# Kevin Griffin, Thu Aug 11 10:53:13 PDT 2016
# Add avtGyRadiusQuery.
#****************************************************************************/
SET(ABSTRACT_SOURCES
......@@ -151,6 +153,7 @@ Queries/avtWeightedVariableSummationQuery.C
Queries/avtXRayImageQuery.C
Queries/avtZoneCenterQuery.C
Queries/MinMaxInfo.C
Queries/avtGyRadiusQuery.C
)
IF(VISIT_PYTHON_FILTERS)
......
......@@ -104,6 +104,7 @@
#include <avtZoneCenterQuery.h>
#include <avtIntegralCurveInfoQuery.h>
#include <avtLineSamplerInfoQuery.h>
#include <avtGyRadiusQuery.h>
#include <visit-python-config.h>
#ifdef VISIT_PYTHON_FILTERS
......@@ -345,6 +346,9 @@ avtQueryFactory::Instance()
// Kathleen Biagas, Thu Jan 10 08:43:14 PST 2013
// Use new MapNode method for testing existence of numeric entry.
//
// Kevin Griffin, Thu Aug 11 10:53:13 PDT 2016
// Added the GyRadius Query
//
// ****************************************************************************
avtDataObjectQuery *
......@@ -674,6 +678,11 @@ avtQueryFactory::CreateQuery(const QueryAttributes *qa)
query = new avtLineSamplerInfoQuery();
}
else if (CaseInsenstiveEqual(qname,"GyRadius"))
{
query = new avtGyRadiusQuery();
}
if (query == NULL && !foundAQuery)
{
EXCEPTION1(VisItException, "No query to execute was found. "
......@@ -808,5 +817,10 @@ avtQueryFactory::GetDefaultInputParams(const string &qname)
avtTrajectoryByNode::GetDefaultInputParams(params);
retval = params.ToXML();
}
else if (CaseInsenstiveEqual(qname,"GyRadius"))
{
avtGyRadiusQuery::GetDefaultInputParams(params);
retval = params.ToXML();
}
return retval;
}
This diff is collapsed.
/*****************************************************************************
*
* Copyright (c) 2000 - 2015, Lawrence Livermore National Security, LLC
* Produced at the Lawrence Livermore National Laboratory
* LLNL-CODE-442911
* All rights reserved.
*
* This file is part of VisIt. For details, see https://visit.llnl.gov/. The
* full copyright notice is contained in the file COPYRIGHT located at the root
* of the VisIt distribution or at http://www.llnl.gov/visit/copyright.html.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the disclaimer below.
* - Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the disclaimer (as noted below) in the
* documentation and/or other materials provided with the distribution.
* - Neither the name of the LLNS/LLNL nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL LAWRENCE LIVERMORE NATIONAL SECURITY,
* LLC, THE U.S. DEPARTMENT OF ENERGY OR CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*
*****************************************************************************/
// ************************************************************************* //
// avtGyRadiusQuery.h //
// ************************************************************************* //
#ifndef AVT_GYRADIUS_QUERY_H
#define AVT_GYRADIUS_QUERY_H
#include <query_exports.h>
#include <avtDatasetQuery.h>
#include <avtExpressionEvaluatorFilter.h>
class vtkDataArray;
class vtkDataSet;
class avtCentroidQuery;
// ****************************************************************************
// Class: avtGyRadiusQuery
//
// Purpose:
// A query that performs the following calculation:
// R = sqrt(sum( (Mi*(Ri - Rcm)^2) ) / sum(Mi)), where Mi is the mass of cell
// i and (Ri - Rcm) is the distance of cell i from the center of mass.
//
// Programmer: Kevin Griffin
// Creation: August 9, 2016
//
// Modifications:
//
// ****************************************************************************
class QUERY_API avtGyRadiusQuery : virtual public avtDatasetQuery
{
public:
avtGyRadiusQuery();
virtual ~avtGyRadiusQuery();
virtual const char *GetType(void) { return "avtGyRadiusQuery"; };
virtual const char *GetDescription(void) { return "GyRadius."; };
virtual void SetInputParams(const MapNode &);
static void GetDefaultInputParams(MapNode &);
protected:
virtual void PreExecute(void);
virtual void Execute(vtkDataSet *, const int);
virtual void PostExecute(void);
virtual avtDataObject_p ApplyFilters(avtDataObject_p);
private:
doubleVector centroid;
bool overrideCentroid;
double totalSum;
double totalMass;
bool isZonal;
std::string varName;
avtExpressionEvaluatorFilter *eef;
};
#endif
......@@ -87,20 +87,20 @@ static const char *WindowType_strings[] = {
"ActualDataVars", "LineDistribution", "HohlraumFlux",
"ConnCompSummary", "ShapeletsDecomp", "XRayImage",
"LineSamplerInfo", "IntegralCurveInfo", "Pick",
"Lineout", "Compactness"};
"Lineout", "Compactness", "CompactnessVar"};
std::string
QueryList::WindowType_ToString(QueryList::WindowType t)
{
int index = int(t);
if(index < 0 || index >= 17) index = 0;
if(index < 0 || index >= 18) index = 0;
return WindowType_strings[index];
}
std::string
QueryList::WindowType_ToString(int t)
{
int index = (t < 0 || t >= 17) ? 0 : t;
int index = (t < 0 || t >= 18) ? 0 : t;
return WindowType_strings[index];
}
......@@ -108,7 +108,7 @@ bool
QueryList::WindowType_FromString(const std::string &s, QueryList::WindowType &val)
{
val = QueryList::Basic;
for(int i = 0; i < 17; ++i)
for(int i = 0; i < 18; ++i)
{
if(s == WindowType_strings[i])
{
......
......@@ -56,6 +56,8 @@
// Creation: omitted
//
// Modifications:
// Kevin Griffin, Thu Aug 11 10:53:13 PDT 2016
// Added the CompactnessVar window type.
//
// ****************************************************************************
......@@ -86,7 +88,8 @@ public:
IntegralCurveInfo,
Pick,
Lineout,
Compactness
Compactness,
CompactnessVar
};
enum Groups
{
......
......@@ -956,6 +956,9 @@ QvisQueryWindow::UpdateResults(bool)
// Cyrus Harrison, Thu Jul 17 09:16:39 PDT 2014
// Added GUI case for Compactness queries.
//
// Kevin Griffin, Thu Aug 11 10:53:13 PDT 2016
// Added GUI case for CompactnessVar queries.
//
// ****************************************************************************
void
......@@ -1147,6 +1150,13 @@ QvisQueryWindow::UpdateArgumentPanel(const QString &qname)
textFields[0]->setText("default");
showWidgets[0] = true;
}
else if (winT == QueryList::CompactnessVar)
{
varsLineEdit->setText("default");
labels[0]->setText(tr("Centroid"));
textFields[0]->setText("default");
showWidgets[0] = true;
}
// hide and show the right text widgets.
for(int i = 0; i < 6; ++i)
......@@ -1434,6 +1444,9 @@ QvisQueryWindow::Apply(bool ignore)
// Kathleen Biagas, Thu Jan 12 09:55:40 PST 2012
// For Pick, put time options in a MapNode.
//
// Kevin Griffin, Thu Aug 11 10:53:13 PDT 2016
// Added CompactnessVar query list.
//
// ****************************************************************************
void
......@@ -1609,7 +1622,8 @@ QvisQueryWindow::ExecuteStandardQuery()
if (!pickQueryWidget->GetQueryParameters(queryParams))
noErrors = false;
}
else if(winT == QueryList::Compactness)
else if((winT == QueryList::Compactness) ||
(winT == QueryList::CompactnessVar))
{
string cen_txt = textFields[0]->text().simplified().toStdString();
if(cen_txt != "default")
......
......@@ -31,7 +31,7 @@ enhancements and bug-fixes that were added to this release.</p>
<a name="General_Features"></a>
<p><b><font size="4">General features added in version 2.11</font></b></p>
<ul>
<li></li>
<li>New GyRadius Query</li>
<li></li>
<li></li>
</ul>
......
......@@ -3987,6 +3987,9 @@ GetUniqueVars(const stringVector &vars, const string &activeVar,
// Changed windowtype for Statistics queries to be Basic, as the actual
// code for the queries does not seem to make use of the 'ActualData' flag.
//
// Kevin Griffin, Thu Aug 11 10:53:13 PDT 2016
// Added the GyRadius Query.
//
// ****************************************************************************
void
......@@ -4033,6 +4036,7 @@ ViewerQueryManager::InitializeQueryList()
QueryList::WindowType pick = QueryList::Pick;
QueryList::WindowType line = QueryList::Lineout;
QueryList::WindowType compact = QueryList::Compactness;
QueryList::WindowType compactv = QueryList::CompactnessVar;
QueryList::QueryMode qo = QueryList::QueryOnly;
QueryList::QueryMode qt = QueryList::QueryAndTime;
......@@ -4105,6 +4109,7 @@ ViewerQueryManager::InitializeQueryList()
int MinMaxVars = QUERY_SCALAR_VAR | QUERY_TENSOR_VAR | QUERY_VECTOR_VAR |
QUERY_SYMMETRIC_TENSOR_VAR | QUERY_MATSPECIES_VAR | QUERY_CURVE_VAR;
GetViewerState()->GetQueryList()->AddQuery("GyRadius", dq, vr, compactv, 1, 0, qt, 1, 1);
GetViewerState()->GetQueryList()->AddQuery("MinMax", dq, vr, ad, 1, MinMaxVars, qo);
GetViewerState()->GetQueryList()->AddQuery("Min", dq, vr, ad, 1, MinMaxVars, qt);
GetViewerState()->GetQueryList()->AddQuery("Max", dq, vr, ad, 1, MinMaxVars, qt);
......
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