Commit e0a9a56d authored by hrchilds's avatar hrchilds
Browse files

Update from July 29, 2004

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@290 18c085ea-50e0-402c-830e-de6fd14e8384
parent 938f46e6
......@@ -10,13 +10,13 @@
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Dec 18 11:24:14 PDT 2003
// Creation: Tue Jul 27 09:34:37 PDT 2004
//
// Modifications:
//
// ****************************************************************************
Line::Line() : AttributeSubject("DDsaiibbsi"),
Line::Line() : AttributeSubject("DDsaiibbsbi"),
color(0, 0, 0)
{
point1[0] = 0;
......@@ -30,6 +30,7 @@ Line::Line() : AttributeSubject("DDsaiibbsi"),
interactive = false;
reflineLabels = false;
varName = "default";
samplingOn = false;
numSamples = 50;
}
......@@ -42,13 +43,13 @@ Line::Line() : AttributeSubject("DDsaiibbsi"),
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Dec 18 11:24:14 PDT 2003
// Creation: Tue Jul 27 09:34:37 PDT 2004
//
// Modifications:
//
// ****************************************************************************
Line::Line(const Line &obj) : AttributeSubject("DDsaiibbsi")
Line::Line(const Line &obj) : AttributeSubject("DDsaiibbsbi")
{
point1[0] = obj.point1[0];
point1[1] = obj.point1[1];
......@@ -65,6 +66,7 @@ Line::Line(const Line &obj) : AttributeSubject("DDsaiibbsi")
interactive = obj.interactive;
reflineLabels = obj.reflineLabels;
varName = obj.varName;
samplingOn = obj.samplingOn;
numSamples = obj.numSamples;
SelectAll();
......@@ -79,7 +81,7 @@ Line::Line(const Line &obj) : AttributeSubject("DDsaiibbsi")
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Dec 18 11:24:14 PDT 2003
// Creation: Tue Jul 27 09:34:37 PDT 2004
//
// Modifications:
//
......@@ -99,7 +101,7 @@ Line::~Line()
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Dec 18 11:24:14 PDT 2003
// Creation: Tue Jul 27 09:34:37 PDT 2004
//
// Modifications:
//
......@@ -123,6 +125,7 @@ Line::operator = (const Line &obj)
interactive = obj.interactive;
reflineLabels = obj.reflineLabels;
varName = obj.varName;
samplingOn = obj.samplingOn;
numSamples = obj.numSamples;
SelectAll();
......@@ -137,7 +140,7 @@ Line::operator = (const Line &obj)
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Dec 18 11:24:14 PDT 2003
// Creation: Tue Jul 27 09:34:37 PDT 2004
//
// Modifications:
//
......@@ -168,6 +171,7 @@ Line::operator == (const Line &obj) const
(interactive == obj.interactive) &&
(reflineLabels == obj.reflineLabels) &&
(varName == obj.varName) &&
(samplingOn == obj.samplingOn) &&
(numSamples == obj.numSamples));
}
......@@ -180,7 +184,7 @@ Line::operator == (const Line &obj) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Dec 18 11:24:14 PDT 2003
// Creation: Tue Jul 27 09:34:37 PDT 2004
//
// Modifications:
//
......@@ -201,7 +205,7 @@ Line::operator != (const Line &obj) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Dec 18 11:24:14 PDT 2003
// Creation: Tue Jul 27 09:34:37 PDT 2004
//
// Modifications:
//
......@@ -222,7 +226,7 @@ Line::TypeName() const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Dec 18 11:24:14 PDT 2003
// Creation: Tue Jul 27 09:34:37 PDT 2004
//
// Modifications:
//
......@@ -250,7 +254,7 @@ Line::CopyAttributes(const AttributeGroup *atts)
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Dec 18 11:24:14 PDT 2003
// Creation: Tue Jul 27 09:34:37 PDT 2004
//
// Modifications:
//
......@@ -276,7 +280,7 @@ Line::CreateCompatible(const std::string &tname) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Dec 18 11:24:14 PDT 2003
// Creation: Tue Jul 27 09:34:37 PDT 2004
//
// Modifications:
//
......@@ -303,7 +307,7 @@ Line::NewInstance(bool copy) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Dec 18 11:24:14 PDT 2003
// Creation: Tue Jul 27 09:34:37 PDT 2004
//
// Modifications:
//
......@@ -321,7 +325,8 @@ Line::SelectAll()
Select(6, (void *)&interactive);
Select(7, (void *)&reflineLabels);
Select(8, (void *)&varName);
Select(9, (void *)&numSamples);
Select(9, (void *)&samplingOn);
Select(10, (void *)&numSamples);
}
///////////////////////////////////////////////////////////////////////////////
......@@ -337,7 +342,7 @@ Line::SelectAll()
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Dec 18 11:24:14 PDT 2003
// Creation: Tue Jul 27 09:34:37 PDT 2004
//
// Modifications:
//
......@@ -411,6 +416,12 @@ Line::CreateNode(DataNode *parentNode, bool completeSave, bool forceAdd)
}
if(completeSave || !FieldsEqual(9, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("samplingOn", samplingOn));
}
if(completeSave || !FieldsEqual(10, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("numSamples", numSamples));
......@@ -435,7 +446,7 @@ Line::CreateNode(DataNode *parentNode, bool completeSave, bool forceAdd)
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Dec 18 11:24:14 PDT 2003
// Creation: Tue Jul 27 09:34:37 PDT 2004
//
// Modifications:
//
......@@ -471,6 +482,8 @@ Line::SetFromNode(DataNode *parentNode)
SetReflineLabels(node->AsBool());
if((node = searchNode->GetNode("varName")) != 0)
SetVarName(node->AsString());
if((node = searchNode->GetNode("samplingOn")) != 0)
SetSamplingOn(node->AsBool());
if((node = searchNode->GetNode("numSamples")) != 0)
SetNumSamples(node->AsInt());
}
......@@ -546,11 +559,18 @@ Line::SetVarName(const std::string &varName_)
Select(8, (void *)&varName);
}
void
Line::SetSamplingOn(bool samplingOn_)
{
samplingOn = samplingOn_;
Select(9, (void *)&samplingOn);
}
void
Line::SetNumSamples(int numSamples_)
{
numSamples = numSamples_;
Select(9, (void *)&numSamples);
Select(10, (void *)&numSamples);
}
///////////////////////////////////////////////////////////////////////////////
......@@ -641,6 +661,12 @@ Line::GetVarName()
return varName;
}
bool
Line::GetSamplingOn() const
{
return samplingOn;
}
int
Line::GetNumSamples() const
{
......@@ -694,7 +720,7 @@ Line::SelectVarName()
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Dec 18 11:24:14 PDT 2003
// Creation: Tue Jul 27 09:34:37 PDT 2004
//
// Modifications:
//
......@@ -714,7 +740,8 @@ Line::GetFieldName(int index) const
case 6: return "interactive";
case 7: return "reflineLabels";
case 8: return "varName";
case 9: return "numSamples";
case 9: return "samplingOn";
case 10: return "numSamples";
default: return "invalid index";
}
}
......@@ -728,7 +755,7 @@ Line::GetFieldName(int index) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Dec 18 11:24:14 PDT 2003
// Creation: Tue Jul 27 09:34:37 PDT 2004
//
// Modifications:
//
......@@ -748,7 +775,8 @@ Line::GetFieldType(int index) const
case 6: return FieldType_bool;
case 7: return FieldType_bool;
case 8: return FieldType_string;
case 9: return FieldType_int;
case 9: return FieldType_bool;
case 10: return FieldType_int;
default: return FieldType_unknown;
}
}
......@@ -762,7 +790,7 @@ Line::GetFieldType(int index) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Dec 18 11:24:14 PDT 2003
// Creation: Tue Jul 27 09:34:37 PDT 2004
//
// Modifications:
//
......@@ -782,7 +810,8 @@ Line::GetFieldTypeName(int index) const
case 6: return "bool";
case 7: return "bool";
case 8: return "string";
case 9: return "int";
case 9: return "bool";
case 10: return "int";
default: return "invalid index";
}
}
......@@ -796,7 +825,7 @@ Line::GetFieldTypeName(int index) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Dec 18 11:24:14 PDT 2003
// Creation: Tue Jul 27 09:34:37 PDT 2004
//
// Modifications:
//
......@@ -867,6 +896,11 @@ Line::FieldsEqual(int index_, const AttributeGroup *rhs) const
}
break;
case 9:
{ // new scope
retval = (samplingOn == obj.samplingOn);
}
break;
case 10:
{ // new scope
retval = (numSamples == obj.numSamples);
}
......
......@@ -14,7 +14,7 @@
// Notes: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Dec 18 11:24:14 PDT 2003
// Creation: Tue Jul 27 09:34:37 PDT 2004
//
// Modifications:
//
......@@ -54,6 +54,7 @@ public:
void SetInteractive(bool interactive_);
void SetReflineLabels(bool reflineLabels_);
void SetVarName(const std::string &varName_);
void SetSamplingOn(bool samplingOn_);
void SetNumSamples(int numSamples_);
// Property getting methods
......@@ -71,6 +72,7 @@ public:
bool GetReflineLabels() const;
const std::string &GetVarName() const;
std::string &GetVarName();
bool GetSamplingOn() const;
int GetNumSamples() const;
// Persistence methods
......@@ -97,6 +99,7 @@ private:
bool interactive;
bool reflineLabels;
std::string varName;
bool samplingOn;
int numSamples;
};
......
......@@ -13,10 +13,10 @@
<Field name="designator" label="designator" type="string">
</Field>
<Field name="color" label="color" type="color">
0
0
0
255
0
0
0
255
</Field>
<Field name="lineStyle" label="lineStyle" type="linestyle">
0
......@@ -33,7 +33,10 @@
<Field name="varName" label="varName" type="string">
default
</Field>
<Field name="numSamples" label="numSamples" type="int">
<Field name="samplingOn" label="samplingOn" type="bool">
false
</Field>
<Field name="numSamples" label="numSamples" type="int" enabler="samplingOn:true">
50
</Field>
<Function name="SetPoint1" user="true" member="true">
......
......@@ -9,6 +9,7 @@
#include <vector>
#include <Expression.h>
#include <ParsingExprList.h>
#include <PickAttributes.h>
#include <PickVarInfo.h>
#include <Utility.h>
......@@ -623,6 +624,9 @@ avtDatabase::GetNewMetaData(int timeState)
// ('4214). Also, if the meshes are in subdirectories, set them up so that
// the expressions code will recognize them ('4195).
//
// Hank Childs, Thu Jul 29 09:30:43 PDT 2004
// Do not add MQE for nodes or edges.
//
// ****************************************************************************
void
......@@ -647,6 +651,10 @@ avtDatabase::AddMeshQualityExpressions(avtDatabaseMetaData *md)
continue;
}
int topoDim = mmd->topologicalDimension;
if (topoDim == 0 || topoDim == 1)
continue;
const int nPairs = 20;
MQExprTopoPair exprs[nPairs];
exprs[0] = MQExprTopoPair("area", 2);
......@@ -670,7 +678,6 @@ avtDatabase::AddMeshQualityExpressions(avtDatabaseMetaData *md)
exprs[18] = MQExprTopoPair("volume", 3);
exprs[19] = MQExprTopoPair("warpage", 2);
int topoDim = mmd->topologicalDimension;
string name = mmd->name;
for (int i = 0 ; i < nPairs ; i++)
{
......@@ -1099,9 +1106,13 @@ avtDatabase::GetFileListFromTextFile(const char *textfile,
// Kathleen Bonnell, Fri May 28 18:26:09 PDT 2004
// Account for pick type of DomainZone.
//
// Kathleen Bonnell,Wed Jun 9 12:44:48 PDT 2004
// Kathleen Bonnell, Wed Jun 9 12:44:48 PDT 2004
// Added bool arg to QueryMesh.
//
// Kathleen Bonnell, Thu Jul 29 08:34:18 PDT 2004
// If a scalar var derived from an expression already has info, it
// probably isn't a mixed var, so go ahead and skip it.
//
// ****************************************************************************
void
......@@ -1208,11 +1219,23 @@ avtDatabase::Query(PickAttributes *pa)
// Skip any variables that already have info, unless they are scalar,
// because then MatFracs might be necessary.
//
if (pa->GetPickVarInfo(varNum).HasInfo() &&
strcmp(pa->GetPickVarInfo(varNum).GetVariableType().c_str(), "scalar") != 0)
if (pa->GetPickVarInfo(varNum).HasInfo() )
{
continue;
if (pa->GetPickVarInfo(varNum).GetVariableType() == "scalar")
{
//
// If an expression, skip it, otherwise it might be a
// mixed-var, so let the db add more info if available.
//
if (ParsingExprList::GetExpressionTree(vName) != NULL)
continue;
}
else
{
continue;
}
}
bool success = false;
TRY
{
......
......@@ -50,6 +50,7 @@
#include <DebugStream.h>
#include <ImproperUseException.h>
#include <InvalidDBTypeException.h>
#include <InvalidVariableException.h>
#include <NoInputException.h>
#include <TimingsManager.h>
......@@ -2171,6 +2172,10 @@ avtGenericDatabase::AddOriginalNodesArray(vtkDataSet *ds, const int domain)
// Use the material object to determine the material indices, not meta-data
// from timestep 0.
//
// Hank Childs, Wed Jul 28 15:28:23 PDT 2004
// Make sure that the material object and the dataset are sized
// appropriately before starting to execute.
//
// ****************************************************************************
avtDataTree_p
......@@ -2195,6 +2200,12 @@ avtGenericDatabase::MaterialSelect(vtkDataSet *ds, avtMaterial *mat,
vector<int> mindex;
GetMaterialIndices(mat, mnames, mindex);
if (mat == NULL || ds == NULL || mat->GetNZones() !=ds->GetNumberOfCells())
{
EXCEPTION1(InvalidDBTypeException, "The material object and dataset "
"object are different sizes.");
}
//
// Make room for the "mixed" material (i.e. for clean-zones-only)
//
......@@ -2424,12 +2435,23 @@ avtGenericDatabase::MaterialSelect(vtkDataSet *ds, avtMaterial *mat,
// Brad Whitlock, Wed Apr 14 12:14:42 PDT 2004
// I fixed it for Windows.
//
// Hank Childs, Wed Jul 28 15:27:45 PDT 2004
// Make sure material is valid before moving on.
//
// ****************************************************************************
void
avtGenericDatabase::GetMaterialIndices(avtMaterial *mat, vector<string> &mn,
vector<int> &ml)
{
if (mat == NULL)
{
debug1 << "ERROR: The file format returned a NULL material object."
<< endl;
EXCEPTION1(InvalidDBTypeException, "\"Unable to sucessfully read "
"the material information.\"");
}
const vector<string> &matlist = mat->GetCompleteMaterialList();
int nstr = mn.size();
......
......@@ -16,8 +16,10 @@
#include <vtkIntArray.h>
#include <vtkMath.h>
#include <vtkPointData.h>
#include <vtkPolyData.h>
#include <vtkUnsignedIntArray.h>
#include <vtkUnsignedCharArray.h>
#include <vtkUnstructuredGrid.h>
#include <avtCallback.h>
#include <avtDataTree.h>
......@@ -287,6 +289,60 @@ CGetNumberOfZones(avtDataRepresentation &data, void *sum, bool &)
}
// ****************************************************************************
// Method: CConvertUnstructuredGridToPolyData
//
// Purpose:
// Converts unstructured grids to poly data.
//
// Arguments:
// data The data from which to calculate number of cells.
// <unused>
// <unused>
//
// Notes:
// This method is designed to be used as the function parameter of
// avtDataTree::Iterate.
//
// Programmer: Hank Childs
// Creation: July 27, 2004
//
// ****************************************************************************
void
CConvertUnstructuredGridToPolyData(avtDataRepresentation &data, void *, bool &)
{
if (!data.Valid())
{
return; // This is a problem, but no need to flag it for this...
}
vtkDataSet *ds = data.GetDataVTK();
if (ds->GetDataObjectType() == VTK_UNSTRUCTURED_GRID)
{
vtkUnstructuredGrid *ugrid = (vtkUnstructuredGrid *) ds;
vtkPolyData *out_pd = vtkPolyData::New();
out_pd->SetPoints(ugrid->GetPoints());
out_pd->GetPointData()->ShallowCopy(ugrid->GetPointData());
out_pd->GetCellData()->ShallowCopy(ugrid->GetCellData());
int ncells = ugrid->GetNumberOfCells();
out_pd->Allocate(ncells);
for (int i = 0 ; i < ncells ; i++)
{
int celltype = ugrid->GetCellType(i);
vtkIdType *pts;
int npts;
ugrid->GetCellPoints(i, npts, pts);
out_pd->InsertNextCell(celltype, npts, pts);
}
avtDataRepresentation new_data(out_pd, data.GetDomain(),
data.GetLabel());
data = new_data;
out_pd->Delete();
}
}
// ****************************************************************************
// Method: CGetVariableList
//
......
......@@ -53,6 +53,9 @@ class vtkDataArray;
// Removed CGetDataMagnitudeExtents (handled by CGetDataExtents).
// Added MajorEigenvalue.
//
// Hank Childs, Tue Jul 27 08:49:51 PDT 2004
// Add CConvertUnstructuredGridToPolyData.
//
// ****************************************************************************
//
......@@ -77,6 +80,8 @@ 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 CConvertUnstructuredGridToPolyData(avtDataRepresentation &,
void *, bool &);
PIPELINE_API void GetDataRange(vtkDataSet *, double *, const char *);
PIPELINE_API double MajorEigenvalue(float *);
......
......@@ -95,3 +95,29 @@ avtDataObjectToDatasetFilter::OutputSetActiveVariable(const char *varname)
}
// ****************************************************************************
// Method: avtDataObjectToDatasetFilter::PostExecute
//
// Purpose:
// Walks through the data and determines if we have polygonal data stored
// as an unstructured grid.
//
// Programmer: Hank Childs
// Creation: July 27, 2004
//
// ****************************************************************************
void
avtDataObjectToDatasetFilter::PostExecute(void)
{
avtDataAttributes &atts = GetOutput()->GetInfo().GetAttributes();
if ((atts.GetSpatialDimension()==3 && atts.GetTopologicalDimension()<3) ||
(atts.GetSpatialDimension()==2 && atts.GetTopologicalDimension()<2))
{
avtDataTree_p tree = GetDataTree();
bool dummy;
tree->Traverse(CConvertUnstructuredGridToPolyData, NULL, dummy);
}
}
......@@ -27,6 +27,10 @@
// Moved inlined constructor and destructor definitions to .C files
// because certain compilers have problems with them.
//
// Hank Childs, Tue Jul 27 08:41:21 PDT 2004
// Convert unstructured data that could be stored as poly data to poly
// data.
//
// ****************************************************************************
class PIPELINE_API avtDataObjectToDatasetFilter
......@@ -37,6 +41,8 @@ class PIPELINE_API avtDataObjectToDatasetFilter
virtual ~avtDataObjectToDatasetFilter();
void OutputSetActiveVariable(const char *);
virtual void PostExecute(void);
};
......
......@@ -106,6 +106,9 @@ avtDatasetToDatasetFilter::PreExecute(void)
// Hank Childs, Wed Feb 25 14:51:00 PST 2004
// Remove the variables from the data attributes when done.
//
// Hank Childs, Tue Jul 27 08:56:44 PDT 2004