Commit 07c1a17b authored by hrchilds's avatar hrchilds
Browse files

Update from February 20, 2004

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@181 18c085ea-50e0-402c-830e-de6fd14e8384
parent cf8eea2b
......@@ -125,13 +125,13 @@ QueryAttributes::DataType_FromString(const std::string &s, QueryAttributes::Data
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Feb 11 09:37:41 PDT 2004
// Creation: Fri Feb 20 15:56:07 PST 2004
//
// Modifications:
//
// ****************************************************************************
QueryAttributes::QueryAttributes() : AttributeSubject("ss*sFiid*iii*i")
QueryAttributes::QueryAttributes() : AttributeSubject("ss*sFiid*iii*ii")
{
variables.push_back("default");
worldPoint[0] = 0;
......@@ -143,6 +143,7 @@ QueryAttributes::QueryAttributes() : AttributeSubject("ss*sFiid*iii*i")
elementType = Zone;
timeStep = 0;
dataType = ActualData;
pipeIndex = -1;
}
// ****************************************************************************
......@@ -154,13 +155,13 @@ QueryAttributes::QueryAttributes() : AttributeSubject("ss*sFiid*iii*i")
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Feb 11 09:37:41 PDT 2004
// Creation: Fri Feb 20 15:56:07 PST 2004
//
// Modifications:
//
// ****************************************************************************
QueryAttributes::QueryAttributes(const QueryAttributes &obj) : AttributeSubject("ss*sFiid*iii*i")
QueryAttributes::QueryAttributes(const QueryAttributes &obj) : AttributeSubject("ss*sFiid*iii*ii")
{
name = obj.name;
variables = obj.variables;
......@@ -176,6 +177,7 @@ QueryAttributes::QueryAttributes(const QueryAttributes &obj) : AttributeSubject(
timeStep = obj.timeStep;
varTypes = obj.varTypes;
dataType = obj.dataType;
pipeIndex = obj.pipeIndex;
SelectAll();
}
......@@ -189,7 +191,7 @@ QueryAttributes::QueryAttributes(const QueryAttributes &obj) : AttributeSubject(
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Feb 11 09:37:41 PDT 2004
// Creation: Fri Feb 20 15:56:07 PST 2004
//
// Modifications:
//
......@@ -209,7 +211,7 @@ QueryAttributes::~QueryAttributes()
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Feb 11 09:37:41 PDT 2004
// Creation: Fri Feb 20 15:56:07 PST 2004
//
// Modifications:
//
......@@ -232,6 +234,7 @@ QueryAttributes::operator = (const QueryAttributes &obj)
timeStep = obj.timeStep;
varTypes = obj.varTypes;
dataType = obj.dataType;
pipeIndex = obj.pipeIndex;
SelectAll();
}
......@@ -245,7 +248,7 @@ QueryAttributes::operator = (const QueryAttributes &obj)
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Feb 11 09:37:41 PDT 2004
// Creation: Fri Feb 20 15:56:07 PST 2004
//
// Modifications:
//
......@@ -272,7 +275,8 @@ QueryAttributes::operator == (const QueryAttributes &obj) const
(elementType == obj.elementType) &&
(timeStep == obj.timeStep) &&
(varTypes == obj.varTypes) &&
(dataType == obj.dataType));
(dataType == obj.dataType) &&
(pipeIndex == obj.pipeIndex));
}
// ****************************************************************************
......@@ -284,7 +288,7 @@ QueryAttributes::operator == (const QueryAttributes &obj) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Feb 11 09:37:41 PDT 2004
// Creation: Fri Feb 20 15:56:07 PST 2004
//
// Modifications:
//
......@@ -305,7 +309,7 @@ QueryAttributes::operator != (const QueryAttributes &obj) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Feb 11 09:37:41 PDT 2004
// Creation: Fri Feb 20 15:56:07 PST 2004
//
// Modifications:
//
......@@ -326,7 +330,7 @@ QueryAttributes::TypeName() const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Feb 11 09:37:41 PDT 2004
// Creation: Fri Feb 20 15:56:07 PST 2004
//
// Modifications:
//
......@@ -354,7 +358,7 @@ QueryAttributes::CopyAttributes(const AttributeGroup *atts)
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Feb 11 09:37:41 PDT 2004
// Creation: Fri Feb 20 15:56:07 PST 2004
//
// Modifications:
//
......@@ -380,7 +384,7 @@ QueryAttributes::CreateCompatible(const std::string &tname) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Feb 11 09:37:41 PDT 2004
// Creation: Fri Feb 20 15:56:07 PST 2004
//
// Modifications:
//
......@@ -407,7 +411,7 @@ QueryAttributes::NewInstance(bool copy) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Feb 11 09:37:41 PDT 2004
// Creation: Fri Feb 20 15:56:07 PST 2004
//
// Modifications:
//
......@@ -427,6 +431,7 @@ QueryAttributes::SelectAll()
Select(8, (void *)&timeStep);
Select(9, (void *)&varTypes);
Select(10, (void *)&dataType);
Select(11, (void *)&pipeIndex);
}
///////////////////////////////////////////////////////////////////////////////
......@@ -442,7 +447,7 @@ QueryAttributes::SelectAll()
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Feb 11 09:37:41 PDT 2004
// Creation: Fri Feb 20 15:56:07 PST 2004
//
// Modifications:
//
......@@ -525,6 +530,12 @@ QueryAttributes::CreateNode(DataNode *parentNode, bool completeSave, bool forceA
node->AddNode(new DataNode("dataType", DataType_ToString(dataType)));
}
if(completeSave || !FieldsEqual(11, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("pipeIndex", pipeIndex));
}
// Add the node to the parent node.
if(addToParent || forceAdd)
......@@ -544,7 +555,7 @@ QueryAttributes::CreateNode(DataNode *parentNode, bool completeSave, bool forceA
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Feb 11 09:37:41 PDT 2004
// Creation: Fri Feb 20 15:56:07 PST 2004
//
// Modifications:
//
......@@ -612,6 +623,8 @@ QueryAttributes::SetFromNode(DataNode *parentNode)
SetDataType(value);
}
}
if((node = searchNode->GetNode("pipeIndex")) != 0)
SetPipeIndex(node->AsInt());
}
///////////////////////////////////////////////////////////////////////////////
......@@ -697,6 +710,13 @@ QueryAttributes::SetDataType(QueryAttributes::DataType dataType_)
Select(10, (void *)&dataType);
}
void
QueryAttributes::SetPipeIndex(int pipeIndex_)
{
pipeIndex = pipeIndex_;
Select(11, (void *)&pipeIndex);
}
///////////////////////////////////////////////////////////////////////////////
// Get property methods
///////////////////////////////////////////////////////////////////////////////
......@@ -803,6 +823,12 @@ QueryAttributes::GetDataType() const
return DataType(dataType);
}
int
QueryAttributes::GetPipeIndex() const
{
return pipeIndex;
}
///////////////////////////////////////////////////////////////////////////////
// Select property methods
///////////////////////////////////////////////////////////////////////////////
......@@ -856,7 +882,7 @@ QueryAttributes::SelectVarTypes()
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Feb 11 09:37:41 PDT 2004
// Creation: Fri Feb 20 15:56:07 PST 2004
//
// Modifications:
//
......@@ -878,6 +904,7 @@ QueryAttributes::GetFieldName(int index) const
case 8: return "timeStep";
case 9: return "varTypes";
case 10: return "dataType";
case 11: return "pipeIndex";
default: return "invalid index";
}
}
......@@ -891,7 +918,7 @@ QueryAttributes::GetFieldName(int index) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Feb 11 09:37:41 PDT 2004
// Creation: Fri Feb 20 15:56:07 PST 2004
//
// Modifications:
//
......@@ -913,6 +940,7 @@ QueryAttributes::GetFieldType(int index) const
case 8: return FieldType_int;
case 9: return FieldType_intVector;
case 10: return FieldType_enum;
case 11: return FieldType_int;
default: return FieldType_unknown;
}
}
......@@ -926,7 +954,7 @@ QueryAttributes::GetFieldType(int index) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Feb 11 09:37:41 PDT 2004
// Creation: Fri Feb 20 15:56:07 PST 2004
//
// Modifications:
//
......@@ -948,6 +976,7 @@ QueryAttributes::GetFieldTypeName(int index) const
case 8: return "int";
case 9: return "intVector";
case 10: return "enum";
case 11: return "int";
default: return "invalid index";
}
}
......@@ -961,7 +990,7 @@ QueryAttributes::GetFieldTypeName(int index) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Feb 11 09:37:41 PDT 2004
// Creation: Fri Feb 20 15:56:07 PST 2004
//
// Modifications:
//
......@@ -1036,6 +1065,11 @@ QueryAttributes::FieldsEqual(int index_, const AttributeGroup *rhs) const
retval = (dataType == obj.dataType);
}
break;
case 11:
{ // new scope
retval = (pipeIndex == obj.pipeIndex);
}
break;
default: retval = false;
}
......@@ -1069,6 +1103,7 @@ QueryAttributes::Reset()
resultsValue.clear();
resultsValue.push_back(0.);
}
pipeIndex = -1;
SelectAll();
}
......
......@@ -24,6 +24,7 @@ QueryAttributes::Reset()
resultsValue.clear();
resultsValue.push_back(0.);
}
pipeIndex = -1;
SelectAll();
}
......
......@@ -14,7 +14,7 @@
// Notes: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Feb 11 09:37:41 PDT 2004
// Creation: Fri Feb 20 15:56:07 PST 2004
//
// Modifications:
//
......@@ -80,6 +80,7 @@ public:
void SetTimeStep(int timeStep_);
void SetVarTypes(const intVector &varTypes_);
void SetDataType(DataType dataType_);
void SetPipeIndex(int pipeIndex_);
// Property getting methods
const std::string &GetName() const;
......@@ -99,6 +100,7 @@ public:
const intVector &GetVarTypes() const;
intVector &GetVarTypes();
DataType GetDataType() const;
int GetPipeIndex() const;
// Persistence methods
virtual bool CreateNode(DataNode *node, bool completeSave, bool forceAdd);
......@@ -144,6 +146,7 @@ private:
int timeStep;
intVector varTypes;
int dataType;
int pipeIndex;
};
#endif
......@@ -51,6 +51,9 @@
<Field name="dataType" label="dataType" type="enum" subtype="DataType" internal="true">
ActualData
</Field>
<Field name="pipeIndex" label="pipeIndex" type="int" internal="true">
-1
</Field>
<Function name="Reset" user="true" member="true">
</Function>
<Function name="PrintSelf" user="true" member="true">
......
......@@ -16,6 +16,7 @@
#include <vtkMath.h>
#include <vtkPointData.h>
#include <vtkUnsignedIntArray.h>
#include <vtkUnsignedCharArray.h>
#include <avtCallback.h>
#include <avtDataTree.h>
......@@ -1934,3 +1935,90 @@ CGetVariableCentering(avtDataRepresentation &data, void *arg, bool &success)
}
// ****************************************************************************
// Method: CGetNumberOfNodes
//
// Purpose:
// Adds the number of nodes in the vtk input to the passed sum argument.
//
// Arguments:
// data The data from which to calculate number of nodes.
// sum A place to store the cumulative number of nodes.
// <unused>
//
// Notes:
// This method is designed to be used as the function parameter of
// avtDataTree::Iterate.
//
// Programmer: Kathleen Bonnell
// Creation: February 18, 2004
//
// ****************************************************************************
void
CGetNumberOfNodes(avtDataRepresentation &data, void *sum, bool &)
{
int *numNodes = (int*)sum;
if (!data.Valid())
{
EXCEPTION0(NoInputException);
}
vtkDataSet *ds = data.GetDataVTK();
*numNodes += ds->GetNumberOfPoints();
}
// ****************************************************************************
// Method: CGetNumberOfRealZones
//
// Purpose:
// Adds the number of zones in the vtk input to the passed sum argument.
// Counts 'real' and 'ghost' separately.
//
// Arguments:
// data The data from which to calculate number of zones.
// sum A place to store the cumulative number of zones.
// <unused>
//
// Notes:
// This method is designed to be used as the function parameter of
// avtDataTree::Iterate.
//
// Programmer: Kathleen Bonnell
// Creation: February 18, 2004
//
// ****************************************************************************
void
CGetNumberOfRealZones(avtDataRepresentation &data, void *sum, bool &)
{
int *numZones = (int*)sum;
//
// realZones stored in numZones[0]
// ghostZones stored in numZones[1]
//
if (!data.Valid())
{
EXCEPTION0(NoInputException);
}
vtkDataSet *ds = data.GetDataVTK();
vtkUnsignedCharArray *ghosts = (vtkUnsignedCharArray*)
ds->GetCellData()->GetArray("vtkGhostLevels");
int nCells = ds->GetNumberOfCells();
if (ghosts)
{
unsigned char *gptr = ghosts->GetPointer(0);
for (int i = 0; i < nCells; i++)
{
if (gptr[i])
numZones[1]++;
else
numZones[0]++;
}
}
else
{
numZones[0] += nCells;
}
}
......@@ -43,6 +43,9 @@ class vtkDataArray;
// Hank Childs, Thu Jan 22 15:42:54 PST 2004
// Removed unused CSetMapperInput.
//
// Kathleen Bonnell, Wed Feb 18 08:31:26 PST 2004
// Added CGetNumberOfRealZones, CGetNumberOfNodes.
//
// ****************************************************************************
//
......@@ -67,6 +70,8 @@ PIPELINE_API void CLocateZone(avtDataRepresentation &, void *, bool &);
PIPELINE_API void CLocateNode(avtDataRepresentation &, void *, bool &);
PIPELINE_API void CGetArray(avtDataRepresentation &, void *, bool &);
PIPELINE_API void CGetVariableCentering(avtDataRepresentation &, void *, bool &);
PIPELINE_API void CGetNumberOfNodes(avtDataRepresentation &, void *, bool &);
PIPELINE_API void CGetNumberOfRealZones(avtDataRepresentation &, void *, bool &);
PIPELINE_API void GetDataRange(vtkDataSet *, double *, int);
PIPELINE_API void GetDataMagnitudeRange(vtkDataSet *, double *, int);
......
......@@ -572,3 +572,65 @@ avtDatasetExaminer::GetVariableCentering(avtDataset_p &ds, const char *varname)
return args.centering;
}
// ****************************************************************************
// Method: avtDatasetExaminer::GetNumberOfNodes
//
// Purpose:
// Gets the number of nodes in the data tree.
//
// Returns:
// The number of nodes (vertices) in the underlying vtk dataset of the
// avtDataTree.
//
// Programmer: Kathleen Bonnell
// Creation: February 18, 2004
//
// ****************************************************************************
int
avtDatasetExaminer::GetNumberOfNodes(avtDataset_p &ds)
{
avtDataTree_p dataTree = ds->dataTree;
int numNodes = 0;
if (*dataTree != NULL)
{
bool dummy;
dataTree->Traverse(CGetNumberOfNodes, &numNodes, dummy);
}
return numNodes;
}
// ****************************************************************************
// Method: avtDatasetExaminer::GetNumberOfZones
//
// Purpose:
// Gets the number of zones in the data tree.
// Counts 'real' and 'ghost' zones separately.
//
// Returns:
// The number of zones (cells) in the underlying vtk dataset of the
// avtDataTree.
//
// Programmer: Kathleen Bonnell
// Creation: January 04, 2001
//
// ****************************************************************************
void
avtDatasetExaminer::GetNumberOfZones(avtDataset_p &ds, int &nReal, int &nGhost)
{
avtDataTree_p dataTree = ds->dataTree;
int numZones[2] = {0, 0} ;
if (*dataTree != NULL)
{
bool dummy;
dataTree->Traverse(CGetNumberOfRealZones, numZones, dummy);
}
nReal = numZones[0];
nGhost = numZones[1];
}
......@@ -28,12 +28,17 @@ class vtkDataArray;
// Brad Whitlock, Wed Dec 4 11:44:40 PDT 2002
// I added GetDataMagnitudeExtents.
//
// Kathleen Bonnell, Wed Feb 18 08:31:26 PST 2004
// Added GetNumberOfNodes, another GetNumberOfZones.
//
// ****************************************************************************
class PIPELINE_API avtDatasetExaminer
{
public:
static int GetNumberOfNodes(avtDataset_p &);
static int GetNumberOfZones(avtDataset_p &);
static void GetNumberOfZones(avtDataset_p &, int &, int &);
static void GetVariableList(avtDataset_p &, VarList &);
static bool GetSpatialExtents(avtDataset_p &, double *);
static bool GetDataExtents(avtDataset_p &, double *);
......
......@@ -471,6 +471,9 @@ avtPickActor::UpdateView()
// Kathleen Bonnell, Fri Jun 27 16:57:45 PDT 2003
// Translate the glyphActor.
//
// Kathleen Bonnell, Fri Feb 20 12:34:39 PST 2004
// Handle 3D lineSource's Pt1 differently than 2D.
//
// ****************************************************************************
void
......@@ -482,9 +485,18 @@ avtPickActor::Translate(const float vec[3])
newPos[2] *= vec[2];
newPos = lineSource->GetPoint1();
newPos[0] *= vec[0];
newPos[1] *= vec[1];
newPos[2] *= vec[2];
if (mode3D)
{
newPos[0] *= vec[0];
newPos[1] *= vec[1];
newPos[2] *= vec[2];
}
else
{
newPos[0] = attach[0] * vec[0];
newPos[1] = attach[1] * vec[1];
newPos[2] = attach[2] * vec[2];
}
newPos = lineSource->GetPoint2();
newPos[0] *= vec[0];
......
......@@ -62,10 +62,13 @@
# Hank Childs, Fri Feb 6 09:27:08 PST 2004
# Added avtGeneralQuery.
#
# Kathleen Bonnell, ue Feb 10 15:08:58 PST 2004
# Kathleen Bonnell, Tue Feb 10 15:08:58 PST 2004
# Renamed avtPlotMinMaxQuery to avtMinMaxQuery, added
# avtOriginalDataMinMaxQuery, avtActualDataMinMaxQuery.
#
# Kathleen Bonnell, Wed Feb 18 08:31:26 PST 2004
# Added avt*NumNodesQuery, avt*NumZonesQuery,
#
##############################################################################
@SET_MAKE@
......@@ -85,6 +88,8 @@ Abstract_src= \
Queries_src= \
Queries/avtActualDataMinMaxQuery.C \
Queries/avtActualDataNumNodesQuery.C \
Queries/avtActualDataNumZonesQuery.C \
Queries/avtAreaBetweenCurvesQuery.C \
Queries/avtCompactnessQuery.C \
Queries/avtCurvePickQuery.C \
......@@ -95,7 +100,11 @@ Queries_src= \
Queries/avtL2NormQuery.C \
Queries/avtL2NormBetweenCurvesQuery.C \
Queries/avtMinMaxQuery.C \
Queries/avtNumNodesQuery.C \
Queries/avtNumZonesQuery.C \
Queries/avtOriginalDataMinMaxQuery.C \
Queries/avtOriginalDataNumNodesQuery.C \
Queries/avtOriginalDataNumZonesQuery.C \
Queries/avtPickQuery.C \
Queries/avtSummationQuery.C \
Queries/avtTimeQuery.C \
......
// ************************************************************************* //
// avtActualDataNumNodesQuery.C //
// ************************************************************************* //
#include <avtActualDataNumNodesQuery.h>
// ****************************************************************************