Commit 56a911d2 authored by fogal1's avatar fogal1

Add 'GetBounds' method.

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@8009 18c085ea-50e0-402c-830e-de6fd14e8384
parent ce2221a1
......@@ -366,6 +366,9 @@ avtResampleFilter::BypassResample(void)
// Allow for data set with no variables to get pushed through, for the case
// where a mesh plot is resampled.
//
// Tom Fogal, Wed Jun 24 20:28:04 MDT 2009
// Use new GetBounds method.
//
// ****************************************************************************
void
......@@ -373,37 +376,9 @@ avtResampleFilter::ResampleInput(void)
{
int i, j, k;
bool is3D = true;
avtDataset_p output = GetTypedOutput();
double bounds[6] = { 0, 0, 0, 0, 0, 0 };
if (atts.GetUseBounds())
{
bounds[0] = atts.GetMinX();
bounds[1] = atts.GetMaxX();
bounds[2] = atts.GetMinY();
bounds[3] = atts.GetMaxY();
bounds[4] = atts.GetMinZ();
bounds[5] = atts.GetMaxZ();
}
else
{
avtDataAttributes &datts = GetInput()->GetInfo().GetAttributes();
avtExtents *exts = datts.GetEffectiveSpatialExtents();
if (exts->HasExtents())
{
exts->CopyTo(bounds);
}
else
{
GetSpatialExtents(bounds);
}
}
if (fabs(bounds[4]) < 1e-100 && fabs(bounds[5]) < 1e-100)
{
is3D = false;
bounds[5] += 0.1;
}
bool is3D = GetBounds(bounds);
debug4 << "Resampling over space: " << bounds[0] << ", " << bounds[1]
<< ": " << bounds[2] << ", " << bounds[3] << ": " << bounds[4]
......@@ -880,6 +855,57 @@ avtResampleFilter::GetDimensions(int &width, int &height, int &depth,
<< height << ", " << depth << endl;
}
// ****************************************************************************
// Method: avtResampleFilter::GetBounds
//
// Purpose:
// Obtains the bounds of the resampled volume. This could come from
// attributes, or the existing spatial extents of the input.
//
// Arguments:
// bounds Output array. Format is min/max X, then m/m Y, m/m Z.
//
// Returns: whether or not these specify 3-dimensional bounds.
//
// Programmer: Tom Fogal
// Creation: June 23, 2009
//
// Modifications:
//
// ****************************************************************************
bool avtResampleFilter::GetBounds(double bounds[6]) const
{
bool is3D = true;
if (atts.GetUseBounds())
{
bounds[0] = atts.GetMinX();
bounds[1] = atts.GetMaxX();
bounds[2] = atts.GetMinY();
bounds[3] = atts.GetMaxY();
bounds[4] = atts.GetMinZ();
bounds[5] = atts.GetMaxZ();
}
else
{
const avtDataAttributes &datts = GetInput()->GetInfo().GetAttributes();
avtExtents *exts = datts.GetEffectiveSpatialExtents();
if (exts->HasExtents())
{
exts->CopyTo(bounds);
}
else
{
GetSpatialExtents(bounds);
}
}
if (fabs(bounds[4]) < 1e-100 && fabs(bounds[5]) < 1e-100)
{
is3D = false;
bounds[5] += 0.1;
}
return is3D;
}
// ****************************************************************************
// Function: CreateViewFromBounds
......
......@@ -79,6 +79,9 @@
// Hank Childs, Wed Dec 31 13:45:03 PST 2008
// Change name of attributes from ResampleAtts to InternalResampleAtts.
//
// Tom Fogal, Tue Jun 23 20:28:01 MDT 2009
// Added GetBounds method.
//
// ****************************************************************************
class AVTFILTERS_API avtResampleFilter : public avtDatasetToDatasetFilter
......@@ -106,6 +109,7 @@ class AVTFILTERS_API avtResampleFilter : public avtDatasetToDatasetFilter
void GetDimensions(int &, int &, int &, const double *,
bool);
bool GetBounds(double[6]) const;
bool InputNeedsNoResampling(void);
void ResampleInput(void);
void BypassResample(void);
......
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