Commit fa80246f authored by hrchilds's avatar hrchilds
Browse files

Update from April 22, 2004

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@228 18c085ea-50e0-402c-830e-de6fd14e8384
parent 0cb97237
......@@ -5324,12 +5324,18 @@ avtGenericDatabase::AssociateBounds(vtkDataSet *ds)
// Hank Childs, Sat Mar 27 11:51:10 PST 2004
// Do not let scaling go into an infinite loop.
//
// Hank Childs, Thu Apr 22 07:56:13 PDT 2004
// Make sure that all of the dimensions are too big or too small, not just
// one of them.
//
// ****************************************************************************
void
avtGenericDatabase::ScaleMesh(vtkDataSet *ds)
{
bool needScaling = false;
bool needXScaling = false;
bool needYScaling = false;
bool needZScaling = false;
double scaleFactor = 1.;
float bounds[6];
......@@ -5354,7 +5360,7 @@ avtGenericDatabase::ScaleMesh(vtkDataSet *ds)
temp /= 10.;
scaleFactor *= 10.;
}
needScaling = true;
needXScaling = true;
}
if ((bounds[1] > bounds[0]) && (bounds[1] - bounds[0] < 1e-6))
{
......@@ -5366,7 +5372,7 @@ avtGenericDatabase::ScaleMesh(vtkDataSet *ds)
temp *= 10.;
scaleFactor /= 10.;
}
needScaling = true;
needXScaling = true;
}
if (bounds[3] - bounds[2] > 1e8)
{
......@@ -5378,7 +5384,7 @@ avtGenericDatabase::ScaleMesh(vtkDataSet *ds)
temp /= 10.;
scaleFactor *= 10.;
}
needScaling = true;
needYScaling = true;
}
if ((bounds[3] > bounds[2]) && (bounds[3] - bounds[2] < 1e-6))
{
......@@ -5390,7 +5396,7 @@ avtGenericDatabase::ScaleMesh(vtkDataSet *ds)
temp *= 10.;
scaleFactor /= 10.;
}
needScaling = true;
needYScaling = true;
}
if (bounds[5] - bounds[4] > 1e8)
{
......@@ -5402,7 +5408,7 @@ avtGenericDatabase::ScaleMesh(vtkDataSet *ds)
temp /= 10.;
scaleFactor *= 10.;
}
needScaling = true;
needZScaling = true;
}
if ((bounds[5] > bounds[4]) && (bounds[5] - bounds[4] < 1e-6))
{
......@@ -5414,14 +5420,23 @@ avtGenericDatabase::ScaleMesh(vtkDataSet *ds)
temp *= 10.;
scaleFactor /= 10.;
}
needScaling = true;
needZScaling = true;
}
if (!needScaling)
//
// If any of the three dimensions don't need to be scaled, then don't
// scale. However, the Z-test is a little tricky, since we might only
// have a 2D dataset.
//
if (!needXScaling || !needYScaling)
{
return;
}
if (!needZScaling && (bounds[4] != bounds[5]))
{
return;
}
static bool haveIssuedWarning = false;
if (!haveIssuedWarning)
{
......
......@@ -85,6 +85,9 @@ avtBinaryMathFilter::~avtBinaryMathFilter()
// Hank Childs, Wed Dec 10 11:11:46 PST 2003
// Do a better job of handling variables with different centerings.
//
// Hank Childs, Thu Apr 22 11:11:33 PDT 2004
// When the centerings are different, always use zonal.
//
// ****************************************************************************
vtkDataArray *
......@@ -108,6 +111,7 @@ avtBinaryMathFilter::DeriveVariable(vtkDataSet *in_ds)
}
// Get the second variable.
bool ownData1 = false;
bool ownData2 = false;
if (centering == AVT_ZONECENT)
{
......@@ -134,8 +138,10 @@ avtBinaryMathFilter::DeriveVariable(vtkDataSet *in_ds)
data2 = in_ds->GetCellData()->GetArray(varnames[1]);
if (data2 != NULL)
{
data2 = Recenter(in_ds, data2, AVT_ZONECENT);
ownData2 = true;
// Recenter data1 so it will match data2. We want both zonal.
data1 = Recenter(in_ds, data1, AVT_NODECENT);
centering = AVT_ZONECENT;
ownData1 = true;
}
else
{
......@@ -164,6 +170,10 @@ avtBinaryMathFilter::DeriveVariable(vtkDataSet *in_ds)
GetOutput()->GetInfo().GetAttributes().SetVariableDimension(ncomps);
}
if (ownData1)
{
data1->Delete();
}
if (ownData2)
{
data2->Delete();
......
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