Commit 938f46e6 authored by hrchilds's avatar hrchilds
Browse files

Update from July 28, 2004

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@289 18c085ea-50e0-402c-830e-de6fd14e8384
parent 7ba295d7
......@@ -2269,20 +2269,35 @@ avtDataAttributes::GetVariableName(int index) const
// Creation: Tue Jul 20 16:36:00 PST 2004
//
// Modifications:
// Kathleen Bonnell, Tue Jul 27 14:44:20 PDT 2004
// Allow retrieval by varname.
//
// ****************************************************************************
const std::string &
avtDataAttributes::GetVariableUnits(void) const
avtDataAttributes::GetVariableUnits(const char *varname) const
{
if (activeVariable < 0)
if (varname == NULL)
{
string reason = "Attempting to retrieve non-existent"
" active variable.\n";
EXCEPTION1(ImproperUseException, reason);
if (activeVariable < 0)
{
string reason = "Attempting to retrieve non-existent"
" active variable.\n";
EXCEPTION1(ImproperUseException, reason);
}
return variables[activeVariable].varunits;
}
else
{
int index = VariableNameToIndex(varname);
if (index < 0 || index >= variables.size())
{
EXCEPTION2(BadIndexException, index, variables.size());
}
return variables[activeVariable].varunits;
return variables[index].varunits;
}
}
// ****************************************************************************
......@@ -2316,6 +2331,7 @@ avtDataAttributes::GetVariableUnits(int index) const
return variables[index].varunits;
}
// ****************************************************************************
// Method: avtDataAttributes::GetNumberOfVariables
//
......
......@@ -222,7 +222,7 @@ class PIPELINE_API avtDataAttributes
const std::string &GetVariableName(void) const;
const std::string &GetVariableName(int) const;
const std::string &GetVariableUnits(void) const;
const std::string &GetVariableUnits(const char * = NULL) const;
const std::string &GetVariableUnits(int) const;
int GetNumberOfVariables(void) const;
void SetActiveVariable(const char *);
......
......@@ -202,6 +202,10 @@ avtDataObjectQuery::GetNFilters()
// Kathleen Bonnell, Fri Jul 11 16:33:16 PDT 2003
// Retrieve units.
//
// Kathleen Bonnell, Wed Jul 28 08:26:05 PDT 2004
// Removed unit retrieval. Derived types can set it themselves, as some
// want var-units others want mesh-units.
//
// ****************************************************************************
void
......@@ -212,8 +216,6 @@ avtDataObjectQuery::ChangedInput()
// don't like the input.
//
VerifyInput();
units = GetInput()->GetInfo().GetAttributes().GetXUnits();
}
......
......@@ -56,6 +56,9 @@ typedef void (*ProgressCallback)(void *, const char *, const char *,int,int);
// Kathleen Bonnell, Thu Jun 24 07:45:47 PDT 2004
// Added intVector and string arguments to PerformQueryInTime.
//
// Kathleen Bonnell, Wed Jul 28 08:26:05 PDT 2004
// Added Set/GetUnits.
//
// ****************************************************************************
class QUERY_API avtDataObjectQuery : public virtual avtDataObjectSink
......@@ -84,6 +87,8 @@ class QUERY_API avtDataObjectQuery : public virtual avtDataObjectSink
virtual void SetTimeVarying(bool val) { timeVarying = val;};
void SetSILRestriction(const SILRestrictionAttributes *);
std::string &GetUnits(void) { return units; };
void SetUnits(const std::string &_units) { units = _units;};
protected:
static InitializeProgressCallback
......
......@@ -11,7 +11,7 @@
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Jul 7 07:43:01 PDT 2004
// Creation: Wed Jul 28 08:58:20 PDT 2004
//
// Modifications:
//
......@@ -33,7 +33,7 @@ MinMaxInfo::MinMaxInfo() : AttributeSubject("iifFss")
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Jul 7 07:43:01 PDT 2004
// Creation: Wed Jul 28 08:58:20 PDT 2004
//
// Modifications:
//
......@@ -63,7 +63,7 @@ MinMaxInfo::MinMaxInfo(const MinMaxInfo &obj) : AttributeSubject("iifFss")
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Jul 7 07:43:01 PDT 2004
// Creation: Wed Jul 28 08:58:20 PDT 2004
//
// Modifications:
//
......@@ -83,7 +83,7 @@ MinMaxInfo::~MinMaxInfo()
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Jul 7 07:43:01 PDT 2004
// Creation: Wed Jul 28 08:58:20 PDT 2004
//
// Modifications:
//
......@@ -114,7 +114,7 @@ MinMaxInfo::operator = (const MinMaxInfo &obj)
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Jul 7 07:43:01 PDT 2004
// Creation: Wed Jul 28 08:58:20 PDT 2004
//
// Modifications:
//
......@@ -148,7 +148,7 @@ MinMaxInfo::operator == (const MinMaxInfo &obj) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Jul 7 07:43:01 PDT 2004
// Creation: Wed Jul 28 08:58:20 PDT 2004
//
// Modifications:
//
......@@ -169,7 +169,7 @@ MinMaxInfo::operator != (const MinMaxInfo &obj) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Jul 7 07:43:01 PDT 2004
// Creation: Wed Jul 28 08:58:20 PDT 2004
//
// Modifications:
//
......@@ -190,7 +190,7 @@ MinMaxInfo::TypeName() const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Jul 7 07:43:01 PDT 2004
// Creation: Wed Jul 28 08:58:20 PDT 2004
//
// Modifications:
//
......@@ -218,7 +218,7 @@ MinMaxInfo::CopyAttributes(const AttributeGroup *atts)
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Jul 7 07:43:01 PDT 2004
// Creation: Wed Jul 28 08:58:20 PDT 2004
//
// Modifications:
//
......@@ -244,7 +244,7 @@ MinMaxInfo::CreateCompatible(const std::string &tname) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Jul 7 07:43:01 PDT 2004
// Creation: Wed Jul 28 08:58:20 PDT 2004
//
// Modifications:
//
......@@ -271,7 +271,7 @@ MinMaxInfo::NewInstance(bool copy) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Jul 7 07:43:01 PDT 2004
// Creation: Wed Jul 28 08:58:20 PDT 2004
//
// Modifications:
//
......@@ -429,7 +429,7 @@ MinMaxInfo::SelectMatName()
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Jul 7 07:43:01 PDT 2004
// Creation: Wed Jul 28 08:58:20 PDT 2004
//
// Modifications:
//
......@@ -459,7 +459,7 @@ MinMaxInfo::GetFieldName(int index) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Jul 7 07:43:01 PDT 2004
// Creation: Wed Jul 28 08:58:20 PDT 2004
//
// Modifications:
//
......@@ -489,7 +489,7 @@ MinMaxInfo::GetFieldType(int index) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Jul 7 07:43:01 PDT 2004
// Creation: Wed Jul 28 08:58:20 PDT 2004
//
// Modifications:
//
......@@ -519,7 +519,7 @@ MinMaxInfo::GetFieldTypeName(int index) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Jul 7 07:43:01 PDT 2004
// Creation: Wed Jul 28 08:58:20 PDT 2004
//
// Modifications:
//
......@@ -631,3 +631,34 @@ MinMaxInfo::TransformCoord(const avtMatrix *trans)
}
}
// ****************************************************************************
// Method: MinMaxInfo::EquivalentForOutput
//
// Purpose:
// Determine equivalency for output purposes (matname not considered).
//
// Programmer: Kathleen Bonnell
// Creation: July 28, 2004
//
// Modifications:
//
// ****************************************************************************
bool
MinMaxInfo::EquivalentForOutput(const MinMaxInfo &obj) const
{
int i;
// Compare the coord arrays.
bool coord_equal = true;
for(i = 0; i < 3 && coord_equal; ++i)
coord_equal = (coord[i] == obj.coord[i]);
// Create the return value
return ((elementNum == obj.elementNum) &&
(domain == obj.domain) &&
(value == obj.value) &&
coord_equal &&
(type == obj.type));
}
......@@ -56,3 +56,37 @@ MinMaxInfo::TransformCoord(const avtMatrix *trans)
}
}
Function: EquivalentForOutput
Declaration: bool EquivalentForOutput (const MinMaxInfo &obj) const;
Definition:
// ****************************************************************************
// Method: MinMaxInfo::EquivalentForOutput
//
// Purpose:
// Determine equivalency for output purposes (matname not considered).
//
// Programmer: Kathleen Bonnell
// Creation: July 28, 2004
//
// Modifications:
//
// ****************************************************************************
bool
MinMaxInfo::EquivalentForOutput(const MinMaxInfo &obj) const
{
int i;
// Compare the coord arrays.
bool coord_equal = true;
for(i = 0; i < 3 && coord_equal; ++i)
coord_equal = (coord[i] == obj.coord[i]);
// Create the return value
return ((elementNum == obj.elementNum) &&
(domain == obj.domain) &&
(value == obj.value) &&
coord_equal &&
(type == obj.type));
}
......@@ -14,7 +14,7 @@
// Notes: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Jul 7 07:43:01 PDT 2004
// Creation: Wed Jul 28 08:58:20 PDT 2004
//
// Modifications:
//
......@@ -71,6 +71,7 @@ public:
// User-defined methods
void Initialize(const float, const std::string &);
void TransformCoord(const avtMatrix *trans);
bool EquivalentForOutput (const MinMaxInfo &obj) const;
private:
int elementNum;
int domain;
......
......@@ -19,6 +19,8 @@
</Function>
<Function name="TransformCoord" user="true" member="true">
</Function>
<Function name="EquivalentForOutput" user="true" member="true">
</Function>
<Include file="header" quoted="false">
avtMatrix.h
</Include>
......
......@@ -182,6 +182,9 @@ avtMinMaxQuery::PreExecute()
// nodal: connected geometry only, entire mesh
// zonal: per-zone quantities, per-material zonal quantities.
//
// Kathleen Bonnell, Tue Jul 27 09:53:01 PDT 2004
// Store the value per material, even if not mixed.
//
// ****************************************************************************
void
......@@ -343,11 +346,15 @@ avtMinMaxQuery::Execute(vtkDataSet *ds, const int dom)
matInfo = mat->ExtractCellMatInfo(elNum);
for (i = 0; i < matInfo.size(); ++i)
{
matNames.push_back(matInfo[i].name);
if (matInfo[i].mix_index != -1)
{
matNames.push_back(matInfo[i].name);
matValues.push_back(mv->GetBuffer()[matInfo[i].mix_index]);
}
else
{
matValues.push_back(val);
}
}
matInfo.clear();
}
......@@ -508,11 +515,13 @@ avtMinMaxQuery::PostExecute(void)
int nMin = 0, nMax = 0;
if (minInfo1.GetElementNum() != -1)
nMin++;
if ((minInfo2.GetElementNum() != -1) && (minInfo1 != minInfo2))
if ((minInfo2.GetElementNum() != -1) &&
(!minInfo1.EquivalentForOutput(minInfo2)))
nMin++;
if (maxInfo1.GetElementNum() != -1)
nMax++;
if ((maxInfo2.GetElementNum() != -1) && (maxInfo1 != maxInfo2))
if ((maxInfo2.GetElementNum() != -1) &&
(!maxInfo1.EquivalentForOutput(maxInfo2)))
nMax++;
nMin = (nMin == 0 ? nMin : (nMax > nMin ? nMax : nMin));
......
......@@ -89,3 +89,28 @@ avtTotalRevolvedSurfaceAreaQuery::ApplyFilters(avtDataObject_p inData)
}
// ****************************************************************************
// Method: avtTotalRevolvedSurfaceAreaQuery::VerifyInput
//
// Purpose:
// Now that we have an input, we can determine what the units are
// and tell the base class.
//
// Programmer: Kathleen Bonnell
// Creation: July 27, 2004
//
// Modifications:
//
// ****************************************************************************
void
avtTotalRevolvedSurfaceAreaQuery::VerifyInput(void)
{
//
// We want to do this in addition to what the base class does, so call the
// base class' version of this method as well.
//
avtSummationQuery::VerifyInput();
SetUnits(GetInput()->GetInfo().GetAttributes().GetXUnits());
}
......@@ -24,6 +24,10 @@ class avtRevolvedSurfaceArea;
// Programmer: Hank Childs
// Creation: March 18, 2003
//
// Modifications:
// Kathleen Bonnell, Wed Jul 28 08:35:22 PDT 2004
// Added VerifyInput.
//
// ****************************************************************************
class QUERY_API avtTotalRevolvedSurfaceAreaQuery : public avtSummationQuery
......@@ -39,6 +43,7 @@ class QUERY_API avtTotalRevolvedSurfaceAreaQuery : public avtSummationQuery
protected:
virtual avtDataObject_p ApplyFilters(avtDataObject_p);
virtual void VerifyInput(void);
avtRevolvedSurfaceArea *surface_area;
virtual int GetNFilters() { return 1; };
......
......@@ -102,3 +102,28 @@ avtTotalRevolvedVolumeQuery::ApplyFilters(avtDataObject_p inData)
}
// ****************************************************************************
// Method: avtTotalRevolvedVolumeQuery::VerifyInput
//
// Purpose:
// Now that we have an input, we can determine what the units are
// and tell the base class.
//
// Programmer: Kathleen Bonnell
// Creation: July 27, 2004
//
// Modifications:
//
// ****************************************************************************
void
avtTotalRevolvedVolumeQuery::VerifyInput(void)
{
//
// We want to do this in addition to what the base class does, so call the
// base class' version of this method as well.
//
avtSummationQuery::VerifyInput();
SetUnits(GetInput()->GetInfo().GetAttributes().GetXUnits());
}
......@@ -26,6 +26,10 @@ class avtRevolvedVolume;
// Programmer: Kathleen Bonnell
// Creation: September 30, 2002
//
// Modifications:
// Kathleen Bonnell, Wed Jul 28 08:35:22 PDT 2004
// Added VerifyInput.
//
// ****************************************************************************
class QUERY_API avtTotalRevolvedVolumeQuery : public avtSummationQuery
......@@ -41,6 +45,7 @@ class QUERY_API avtTotalRevolvedVolumeQuery : public avtSummationQuery
protected:
virtual avtDataObject_p ApplyFilters(avtDataObject_p);
virtual void VerifyInput(void);
avtRevolvedVolume *volume;
virtual int GetNFilters() { return 1; };
......
......@@ -86,6 +86,10 @@ avtTotalSurfaceAreaQuery::~avtTotalSurfaceAreaQuery()
// Programmer: Kathleen Bonnell
// Creation: October 22, 2002
//
// Modifications:
// Kathleen Bonnell, Wed Jul 28 08:26:05 PDT 2004
// Retrieve units from dataAttributes to be used in output.
//
// ****************************************************************************
void
......@@ -102,6 +106,7 @@ avtTotalSurfaceAreaQuery::VerifyInput()
EXCEPTION2(InvalidDimensionsException, "Surface Area query",
"2D or 3D surface");
}
SetUnits(GetInput()->GetInfo().GetAttributes().GetXUnits());
}
......
......@@ -74,6 +74,10 @@ avtTotalVolumeQuery::~avtTotalVolumeQuery()
// Programmer: Kathleen Bonnell
// Creation: October 22, 2002
//
// Modifications:
// Kathleen Bonnell, Wed Jul 28 08:26:05 PDT 2004
// Retrieve units from dataAttributes to be used in output.
//
// ****************************************************************************
void
......@@ -90,6 +94,7 @@ avtTotalVolumeQuery::VerifyInput()
{
EXCEPTION2(InvalidDimensionsException, "Volume query", "3D surface");
}
SetUnits(GetInput()->GetInfo().GetAttributes().GetXUnits());
}
......
......@@ -5,6 +5,7 @@
#include <avtVariableSummationQuery.h>
#include <avtTerminatingSource.h>
#include <BadIndexException.h>
using std::string;
......@@ -45,6 +46,10 @@ avtVariableSummationQuery::~avtVariableSummationQuery()
// Programmer: Hank Childs
// Creation: February 3, 2004
//
// Modifications:
// Kathleen Bonnell, Wed Jul 28 08:26:05 PDT 2004
// Retrieve variable's units, if available.
//
// ****************************************************************************
void
......@@ -59,10 +64,24 @@ avtVariableSummationQuery::VerifyInput(void)
avtDataSpecification_p dspec = GetInput()->GetTerminatingSource()
->GetFullDataSpecification();
avtDataAttributes &dataAtts = GetInput()->GetInfo().GetAttributes();
string varname = dspec->GetVariable();
SetVariableName(varname);
SumGhostValues(false);
SetSumType(varname);
TRY
{
//
// Set the base class units to be used in output.
//
SetUnits(dataAtts.GetVariableUnits(varname.c_str()));
}
CATCH(BadIndexException)
{
; // do nothing;
}
ENDTRY
}
......@@ -10,6 +10,8 @@
#include <avtVMetricArea.h>
#include <avtVMetricVolume.h>
#include <BadIndexException.h>
using std::string;
......@@ -176,3 +178,40 @@ avtWeightedVariableSummationQuery::ApplyFilters(avtDataObject_p inData)
}
// ****************************************************************************
// Method: avtWeightedVariableSummationQuery::VerifyInput
//
// Purpose:
// Now that we have an input, we can determine what the variable units
// are and tell the base class about it.
//
// Programmer: Kathleen Bonnell
// Creation: July 28, 2004
//
// Modifications:
//
// ****************************************************************************
void
avtWeightedVariableSummationQuery::VerifyInput(void)
{
//
// We want to do this in addition to what the base class does, so call the
// base class' version of this method as well.
//
avtSummationQuery::VerifyInput();
TRY
{
//
// Set the base class units to be used in output.
//
SetUnits(GetInput()->GetInfo().GetAttributes().GetVariableUnits());
}
CATCH(BadIndexException)
{
; // do nothing;
}
ENDTRY
}
......@@ -24,6 +24,10 @@ class avtVMetricVolume;
// Programmer: Hank Childs
// Creation: February 3, 2004
//
// Modifications:
// Kathleen Bonnell, Wed Jul 28 08:50:51 PDT 2004
// Added VerifyInput.
//
// ****************************************************************************
class QUERY_API avtWeightedVariableSummationQuery : public avtSummationQuery
......@@ -42,6 +46,7 @@ class QUERY_API avtWeightedVariableSummationQuery : public avtSummationQuery
virtual avtDataObject_p ApplyFilters(avtDataObject_p);
virtual int GetNFilters(void) { return 2; };
virtual void VerifyInput(void);
};
...