Commit 675b5834 authored by hrchilds's avatar hrchilds

Update from June 30, 2005

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@492 18c085ea-50e0-402c-830e-de6fd14e8384
parent d51c598b
/* XPM */
static const char * layout2x3_xpm[] = {
"13 13 3 1",
". c #000000",
"+ c None",
"# c #ffffff",
"+++++++++++++",
"+++++++++++++",
".............",
".###.###.###.",
".###.###.###.",
".###.###.###.",
".............",
".###.###.###.",
".###.###.###.",
".###.###.###.",
".............",
"+++++++++++++",
"+++++++++++++"};
/* XPM */
static const char * layout4x4_xpm[] = {
"13 13 2 1",
". c #000000",
"+ c #ffffff",
".............",
".++.++.++.++.",
".++.++.++.++.",
".............",
".++.++.++.++.",
".++.++.++.++.",
".............",
".++.++.++.++.",
".++.++.++.++.",
".............",
".++.++.++.++.",
".++.++.++.++.",
"............."};
This diff is collapsed.
......@@ -568,6 +568,7 @@ PickAttributes::PrepareForNewPick()
cellPoint[0] = cellPoint[1] = cellPoint[2] = 0;
nodePoint[0] = nodePoint[1] = nodePoint[2] = 0;
needTransformMessage = false;
ghostType = 0;
if (!incidentElements.empty())
incidentElements.clear();
......
......@@ -15,7 +15,7 @@ class PickVarInfo;
// Notes: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue Dec 28 12:29:43 PDT 2004
// Creation: Tue Jun 28 14:39:58 PST 2005
//
// Modifications:
//
......@@ -132,6 +132,7 @@ public:
void SetGlobalIncidentElements(const intVector &globalIncidentElements_);
void SetElementIsGlobal(bool elementIsGlobal_);
void SetDisplayPickLetter(bool displayPickLetter_);
void SetGhostType(int ghostType_);
// Property getting methods
const stringVector &GetVariables() const;
......@@ -216,6 +217,7 @@ public:
intVector &GetGlobalIncidentElements();
bool GetElementIsGlobal() const;
bool GetDisplayPickLetter() const;
int GetGhostType() const;
// Persistence methods
virtual bool CreateNode(DataNode *node, bool completeSave, bool forceAdd);
......@@ -311,6 +313,7 @@ private:
intVector globalIncidentElements;
bool elementIsGlobal;
bool displayPickLetter;
int ghostType;
};
#endif
......@@ -176,6 +176,9 @@
<Field name="displayPickLetter" label="displayPickLetter" type="bool" internal="false">
true
</Field>
<Field name="ghostType" label="ghostType" type="int" internal="true">
0
</Field>
<Function name="PrintSelf" user="true" member="true">
</Function>
<Function name="CreateOutputString" user="true" member="true">
......
......@@ -48,21 +48,21 @@ RenderingAttributes::GeometryRepresentation_FromString(const std::string &s, Ren
//
static const char *StereoTypes_strings[] = {
"RedBlue", "Interlaced", "CrystalEyes"
};
"RedBlue", "Interlaced", "CrystalEyes",
"RedGreen"};
std::string
RenderingAttributes::StereoTypes_ToString(RenderingAttributes::StereoTypes t)
{
int index = int(t);
if(index < 0 || index >= 3) index = 0;
if(index < 0 || index >= 4) index = 0;
return StereoTypes_strings[index];
}
std::string
RenderingAttributes::StereoTypes_ToString(int t)
{
int index = (t < 0 || t >= 3) ? 0 : t;
int index = (t < 0 || t >= 4) ? 0 : t;
return StereoTypes_strings[index];
}
......@@ -70,7 +70,7 @@ bool
RenderingAttributes::StereoTypes_FromString(const std::string &s, RenderingAttributes::StereoTypes &val)
{
val = RenderingAttributes::RedBlue;
for(int i = 0; i < 3; ++i)
for(int i = 0; i < 4; ++i)
{
if(s == StereoTypes_strings[i])
{
......@@ -128,7 +128,7 @@ RenderingAttributes::TriStateMode_FromString(const std::string &s, RenderingAttr
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Sun Oct 24 07:27:47 PDT 2004
// Creation: Thu Jun 30 14:31:44 PST 2005
//
// Modifications:
//
......@@ -161,7 +161,7 @@ RenderingAttributes::RenderingAttributes() : AttributeSubject("biibibiibffabd"),
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Sun Oct 24 07:27:47 PDT 2004
// Creation: Thu Jun 30 14:31:44 PST 2005
//
// Modifications:
//
......@@ -196,7 +196,7 @@ RenderingAttributes::RenderingAttributes(const RenderingAttributes &obj) : Attri
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Sun Oct 24 07:27:47 PDT 2004
// Creation: Thu Jun 30 14:31:44 PST 2005
//
// Modifications:
//
......@@ -216,15 +216,16 @@ RenderingAttributes::~RenderingAttributes()
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Sun Oct 24 07:27:47 PDT 2004
// Creation: Thu Jun 30 14:31:44 PST 2005
//
// Modifications:
//
// ****************************************************************************
void
RenderingAttributes&
RenderingAttributes::operator = (const RenderingAttributes &obj)
{
if (this == &obj) return *this;
antialiasing = obj.antialiasing;
geometryRepresentation = obj.geometryRepresentation;
displayListMode = obj.displayListMode;
......@@ -241,6 +242,7 @@ RenderingAttributes::operator = (const RenderingAttributes &obj)
shadowStrength = obj.shadowStrength;
SelectAll();
return *this;
}
// ****************************************************************************
......@@ -252,7 +254,7 @@ RenderingAttributes::operator = (const RenderingAttributes &obj)
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Sun Oct 24 07:27:47 PDT 2004
// Creation: Thu Jun 30 14:31:44 PST 2005
//
// Modifications:
//
......@@ -287,7 +289,7 @@ RenderingAttributes::operator == (const RenderingAttributes &obj) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Sun Oct 24 07:27:47 PDT 2004
// Creation: Thu Jun 30 14:31:44 PST 2005
//
// Modifications:
//
......@@ -308,7 +310,7 @@ RenderingAttributes::operator != (const RenderingAttributes &obj) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Sun Oct 24 07:27:47 PDT 2004
// Creation: Thu Jun 30 14:31:44 PST 2005
//
// Modifications:
//
......@@ -329,7 +331,7 @@ RenderingAttributes::TypeName() const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Sun Oct 24 07:27:47 PDT 2004
// Creation: Thu Jun 30 14:31:44 PST 2005
//
// Modifications:
//
......@@ -357,7 +359,7 @@ RenderingAttributes::CopyAttributes(const AttributeGroup *atts)
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Sun Oct 24 07:27:47 PDT 2004
// Creation: Thu Jun 30 14:31:44 PST 2005
//
// Modifications:
//
......@@ -383,7 +385,7 @@ RenderingAttributes::CreateCompatible(const std::string &tname) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Sun Oct 24 07:27:47 PDT 2004
// Creation: Thu Jun 30 14:31:44 PST 2005
//
// Modifications:
//
......@@ -410,7 +412,7 @@ RenderingAttributes::NewInstance(bool copy) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Sun Oct 24 07:27:47 PDT 2004
// Creation: Thu Jun 30 14:31:44 PST 2005
//
// Modifications:
//
......@@ -448,7 +450,7 @@ RenderingAttributes::SelectAll()
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Sun Oct 24 07:27:47 PDT 2004
// Creation: Thu Jun 30 14:31:44 PST 2005
//
// Modifications:
//
......@@ -570,7 +572,7 @@ RenderingAttributes::CreateNode(DataNode *parentNode, bool completeSave, bool fo
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Sun Oct 24 07:27:47 PDT 2004
// Creation: Thu Jun 30 14:31:44 PST 2005
//
// Modifications:
//
......@@ -630,7 +632,7 @@ RenderingAttributes::SetFromNode(DataNode *parentNode)
if(node->GetNodeType() == INT_NODE)
{
int ival = node->AsInt();
if(ival >= 0 && ival < 3)
if(ival >= 0 && ival < 4)
SetStereoType(StereoTypes(ival));
}
else if(node->GetNodeType() == STRING_NODE)
......@@ -893,7 +895,7 @@ RenderingAttributes::SelectSpecularColor()
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Sun Oct 24 07:27:47 PDT 2004
// Creation: Thu Jun 30 14:31:44 PST 2005
//
// Modifications:
//
......@@ -931,7 +933,7 @@ RenderingAttributes::GetFieldName(int index) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Sun Oct 24 07:27:47 PDT 2004
// Creation: Thu Jun 30 14:31:44 PST 2005
//
// Modifications:
//
......@@ -969,7 +971,7 @@ RenderingAttributes::GetFieldType(int index) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Sun Oct 24 07:27:47 PDT 2004
// Creation: Thu Jun 30 14:31:44 PST 2005
//
// Modifications:
//
......@@ -1007,7 +1009,7 @@ RenderingAttributes::GetFieldTypeName(int index) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Sun Oct 24 07:27:47 PDT 2004
// Creation: Thu Jun 30 14:31:44 PST 2005
//
// Modifications:
//
......
......@@ -15,7 +15,7 @@
// Notes: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Sun Oct 24 07:27:47 PDT 2004
// Creation: Thu Jun 30 14:31:44 PST 2005
//
// Modifications:
//
......@@ -34,7 +34,8 @@ public:
{
RedBlue,
Interlaced,
CrystalEyes
CrystalEyes,
RedGreen
};
enum TriStateMode
{
......@@ -49,7 +50,7 @@ public:
RenderingAttributes(const RenderingAttributes &obj);
virtual ~RenderingAttributes();
virtual void operator = (const RenderingAttributes &obj);
virtual RenderingAttributes& operator = (const RenderingAttributes &obj);
virtual bool operator == (const RenderingAttributes &obj) const;
virtual bool operator != (const RenderingAttributes &obj) const;
......
......@@ -9,6 +9,7 @@
RedBlue
Interlaced
CrystalEyes
RedGreen
</Enum>
<Enum name="TriStateMode">
Never
......
......@@ -405,6 +405,9 @@ avtSILRestriction::EnableCorrectnessChecking(void)
// Hank Childs, Thu Nov 14 10:30:56 PST 2002
// Remove access to 'sets' data member to enable SIL matrices.
//
// Hank Childs, Mon Jun 27 16:08:09 PDT 2005
// If we are just re-setting the current top set, treat it as a no-op.
//
// ****************************************************************************
void
......@@ -423,6 +426,12 @@ avtSILRestriction::SetTopSet(int ts)
EXCEPTION0(ImproperUseException);
}
//
// Do we already have this value?
//
if (topSet == ts)
return;
topSet = ts;
//
......
......@@ -1118,20 +1118,22 @@ avtGenericDatabase::ManageMemoryForNonCachableMesh(vtkDataSet *v)
// Mark C. Miller, Tue Apr 5 10:30:16 PDT 2005
// Added support for data type conversion
//
// Hank Childs, Mon Jun 27 16:24:23 PDT 2005
// Added data specification argument.
//
// ****************************************************************************
vtkDataSet *
avtGenericDatabase::GetDataset(const char *varname, int ts, int domain,
const char *matname, const vector<CharStrRef> &vars2nd,
avtSourceFromDatabase *src)
avtDataSpecification_p spec,avtSourceFromDatabase *src)
{
vtkDataSet *rv = NULL;
avtVarType type = GetMetaData(ts)->DetermineVarType(varname);
// get information to control data type
const avtDataSpecification_p dspec = src->GetFullDataSpecification();
bool needNativePrecision = dspec->NeedNativePrecision();
vector<int> admissibleDataTypes = dspec->GetAdmissibleDataTypes();
bool needNativePrecision = spec->NeedNativePrecision();
vector<int> admissibleDataTypes = spec->GetAdmissibleDataTypes();
if (strcmp(matname, "_all") == 0)
{
......@@ -4758,6 +4760,9 @@ avtGenericDatabase::ActivateTimestep(int stateIndex)
// Hank Childs, Tue Feb 15 07:21:10 PST 2005
// Make translations when we have hidden characters.
//
// Hank Childs, Mon Jun 27 16:24:23 PDT 2005
// Add argument to GetDataset.
//
// ****************************************************************************
void
......@@ -4858,7 +4863,8 @@ avtGenericDatabase::ReadDataset(avtDatasetCollection &ds, intVector &domains,
debug5 << "Generic database instructing get for var = "
<< var << ", timestep = " << ts << " domain = "
<< domains[i] << endl;
single_ds = GetDataset(var, ts, domains[i], "_all", vars2nd, src);
single_ds = GetDataset(var, ts, domains[i], "_all", vars2nd,
spec, src);
// Determine if there are mixed vars. If so, force
// material selection if it was requested for mixed vars
......@@ -4942,7 +4948,7 @@ avtGenericDatabase::ReadDataset(avtDatasetCollection &ds, intVector &domains,
<< domains[i] << ", material = "
<< matnames[j].c_str() << endl;
vtkDataSet *ds1 = GetDataset(var, ts, domains[i],
matnames[j].c_str(), vars2nd, src);
matnames[j].c_str(), vars2nd, spec, src);
ds.SetDataset(i, j, ds1);
if (ds1 != NULL)
{
......@@ -5407,6 +5413,9 @@ avtGenericDatabase::CommunicateGhostZonesFromDomainBoundariesFromFile(
// Hank Childs, Sun Mar 13 10:47:59 PST 2005
// Fix memory leak.
//
// Hank Childs, Wed Jun 29 15:24:35 PDT 2005
// Call ResetCachedMembers.
//
// ****************************************************************************
bool
......@@ -5493,6 +5502,11 @@ avtGenericDatabase::CommunicateGhostZonesFromDomainBoundaries(
(spec->NeedZoneNumbers()||spec->NeedStructuredIndices()
? 1: 0));
//
// Don't let cache data members from the last execution affect this one.
//
dbi->ResetCachedMembers();
//
// Exchange Meshes
//
......
......@@ -239,6 +239,10 @@ class PickVarInfo;
//
// Mark C. Miller, Tue May 31 20:12:42 PDT 2005
// Added method SetCycleTimeInDatabaseMetaData
//
// Hank Childs, Mon Jun 27 16:24:23 PDT 2005
// Added argument to GetDataset.
//
// ****************************************************************************
class DATABASE_API avtGenericDatabase : public avtDatasetDatabase
......@@ -287,6 +291,7 @@ class DATABASE_API avtGenericDatabase : public avtDatasetDatabase
vtkDataSet *GetDataset(const char *, int, int, const char *,
const std::vector<CharStrRef> &,
avtDataSpecification_p,
avtSourceFromDatabase *);
vtkDataSet *GetScalarVarDataset(const char *, int, int,
const char *,
......
......@@ -45,6 +45,9 @@ class avtMaterial;
// Added pure virtual methods RequiresCommunication. Added "allDomains"
// argument to CreateGhostNodes.
//
// Hank Childs, Mon Jun 27 16:28:22 PDT 2005
// Added virtual method ResetCachedMembers.
//
// ****************************************************************************
class DATABASE_API avtDomainBoundaries
......@@ -80,6 +83,7 @@ class DATABASE_API avtDomainBoundaries
virtual bool RequiresCommunication(avtGhostDataType) = 0;
virtual bool ConfirmMesh(vector<int> domainNum,
vector<vtkDataSet*> meshes) =0;
virtual void ResetCachedMembers(void) {;};
};
#endif
......@@ -175,6 +175,9 @@ class BoundaryHelperFunctions
// Hank Childs, Sun Feb 27 12:14:32 PST 2005
// Added RequiresCommunication. Added new argument to CreateGhostNodes.
//
// Hank Childs, Wed Jun 29 15:24:35 PDT 2005
// Added ResetCachedMembers, as well as domain2proc member.
//
// ****************************************************************************
class DATABASE_API avtStructuredDomainBoundaries : public avtDomainBoundaries
......@@ -223,6 +226,7 @@ class DATABASE_API avtStructuredDomainBoundaries : public avtDomainBoundaries
virtual bool RequiresCommunication(avtGhostDataType);
virtual bool ConfirmMesh(vector<int> domainNum,
vector<vtkDataSet*> meshes);
virtual void ResetCachedMembers();
private:
virtual vector<vtkDataArray*> ExchangeFloatScalar(vector<int> domainNum,
......@@ -247,6 +251,7 @@ class DATABASE_API avtStructuredDomainBoundaries : public avtDomainBoundaries
bool shouldComputeNeighborsFromExtents;
vector<int> extents;
vector<int> levels;
vector<int> domain2proc;
friend class BoundaryHelperFunctions<int>;
friend class BoundaryHelperFunctions<float>;
......
......@@ -5,6 +5,7 @@
#include <avtUnstructuredDomainBoundaries.h>
#include <vtkCellData.h>
#include <vtkCellLinks.h>
#include <vtkFloatArray.h>
#include <vtkIdList.h>
#include <vtkIntArray.h>
......@@ -323,6 +324,9 @@ CopyPointer(T *src, T *dest, int components,
// Hank Childs, Fri Aug 27 16:34:46 PDT 2004
// Rename ghost data arrays. Also properly mark ghost data type.
//
// Hank Childs, Tue Jun 21 13:59:47 PDT 2005
// Fix UMR and memory leak.
//
// ****************************************************************************
vector<vtkDataSet*>
......@@ -460,6 +464,7 @@ avtUnstructuredDomainBoundaries::ExchangeMesh(vector<int> domainNum,
int nGhostCells = outm->GetNumberOfCells() - nOldCells;
for (i = 0; i < nGhostCells; ++i)
{
*ptr = 0;
avtGhostData::AddGhostZoneType(*ptr,
DUPLICATED_ZONE_INTERNAL_TO_PROBLEM);
ptr++;
......
......@@ -516,13 +516,183 @@ avtExpressionEvaluatorFilter::ReleaseData(void)
// using an 'Update' so that information that gets retrieved always
// reflect the current SILRestriction. (about March, 2004).
//
// Kathleen Bonnell, Thu Jun 30 10:59:50 PDT 2005
// Re-add the parsing code. In some way I don't understand, this code
// affects the avtDataAttributes that Pick uses to query from.
//
// ****************************************************************************
void
avtExpressionEvaluatorFilter::Query(PickAttributes *pa)
{
int i, j, k;
//
// Sanity check.
//
if (*(GetInput()) == NULL)
EXCEPTION0(NoInputException);
//
// We need to identify if there are expression variables that have been
// requested for the pick that are missing. If so, we will have to
// re-execute.
//
const stringVector &orig_vars = pa->GetVariables();
stringVector expr_vars;
std::vector<int> indices;
for (i = 0 ; i < orig_vars.size() ; i++)
{
Expression *exp = ParsingExprList::GetExpression(orig_vars[i]);
if (exp != NULL)
{
expr_vars.push_back(orig_vars[i]);
indices.push_back(i);
}
}
stringVector unmatched_vars;
if (expr_vars.size() > 0)
{
avtDataset_p output = GetTypedOutput();
VarList vl;
avtDatasetExaminer::GetVariableList(output, vl);
for (i = 0 ; i < expr_vars.size() ; i++)
{
bool foundMatch = false;
for (j = 0 ; j < vl.nvars ; j++)
{
if (expr_vars[i] == vl.varnames[j])
foundMatch = true;
}
if (!foundMatch)
{
unmatched_vars.push_back(expr_vars[i]);
}
}
modified = true;
}
if (unmatched_vars.size() > 0)
{
for (i = 0 ; i < unmatched_vars.size() ; i++)
lastUsedSpec->GetDataSpecification()->AddSecondaryVariable(
unmatched_vars[i].c_str());
//
// Force the update.
//
GetOutput()->Update(lastUsedSpec);
}
//
// Start by going to the new queryable source upstream (most likely the
// terminating source corresponding to the database) and ask it to pick
// with our new pick attributes.
//
avtQueryableSource *src = GetInput()->GetQueryableSource();
src->Query(pa);
//
// Now iterate over the expressions and add where possible.
//
if (expr_vars.size() > 0)
{
bool canUseNativeArray =
GetInput()->GetInfo().GetValidity().GetZonesPreserved();
const intVector &incidentElements = pa->GetIncidentElements();
int element = pa->GetElementNumber();
int domain = pa->GetDomain();
bool zonePick = pa->GetPickType() == PickAttributes::Zone ||
pa->GetPickType() == PickAttributes::DomainZone;
avtDataset_p output = GetTypedOutput();
for (i = 0 ; i < expr_vars.size() ; i++)
{
avtCentering cent = AVT_UNKNOWN_CENT;
vtkDataArray *arr = avtDatasetExaminer::GetArray(output,
expr_vars[i].c_str(), domain, cent);
if (arr == NULL)
{
continue;
}
PickVarInfo varInfo;
varInfo.SetVariableName(expr_vars[i]);
int ncomps = arr->GetNumberOfComponents();
if (ncomps == 1)
varInfo.SetVariableType("scalar");
else if (ncomps == 3)
varInfo.SetVariableType("vector");
else if (ncomps == 9)
varInfo.SetVariableType("tensor");
bool zoneCent = (cent == AVT_ZONECENT);
varInfo.SetCentering(zoneCent ? PickVarInfo::Zonal
: PickVarInfo::Nodal);
std::vector<double> vals;
std::vector<std::string> names;
char temp[1024];
if (canUseNativeArray)
{
if (zoneCent != zonePick)
{
for (j = 0 ; j < incidentElements.size() ; j++)
{
sprintf(temp, "(%d)", incidentElements[j]);
names.push_back(temp);
float mag = 0.;
for (k = 0 ; k < arr->GetNumberOfComponents() ; k++)
{
float val=arr->GetComponent(incidentElements[j],k);
mag += val*val;
vals.push_back(val);
}
mag = sqrt(mag);
vals.push_back(mag);
}
}
else
{
// the info we're after is associated with element
sprintf(temp, "(%d)", element);
names.push_back(temp);
float mag = 0.;
for (k = 0 ; k < arr->GetNumberOfComponents() ; k++)
{
float val = arr->GetComponent(element, k);
mag += val*val;
vals.push_back(val);
}
mag = sqrt(mag);
vals.push_back(mag);
}
}
if (!vals.empty())
{
varInfo.SetNames(names);
varInfo.SetValues(vals);
int index = -1;
for (int ii = 0 ; ii < pa->GetNumPickVarInfos() ; ii++)
{
PickVarInfo &vi = pa->GetPickVarInfo(ii);
if (vi.GetVariableName() == varInfo.GetVariableName())
{
index = ii;
break;
}
}