Ejemplo n.º 1
0
bool
avtDatasetExaminer::GetDataExtents(avtDataset_p &ds, double *de,
                                   const char *varname)
{
    if (varname == NULL)
    {
        varname = ds->GetInfo().GetAttributes().GetVariableName().c_str();
    }

    avtDataTree_p dataTree = ds->dataTree;

    bool foundExtents = false;
    de[0] = +DBL_MAX;
    de[1] = -DBL_MAX;
 
    GetVariableRangeArgs gvra;
    gvra.varname = varname;
    gvra.extents = de;
    if (*dataTree != NULL)
    {
        dataTree->Traverse(CGetDataExtents, (void *) &gvra, foundExtents);
    }
 
    if (!foundExtents)
    {
        debug1 << "Unable to determine data extents -- dataset needs an "
               << "update" << endl;
    }
    return foundExtents;
}
Ejemplo n.º 2
0
bool
avtDatasetExaminer::GetSpatialExtents(avtDataset_p &ds, double *se)
{
    avtDataTree_p dataTree = ds->dataTree;

    int   i;
 
    bool foundExtents = false;
    for (i = 0 ; i < 3 ; i++)
    {
        se[2*i + 0] = +DBL_MAX;
        se[2*i + 1] = -DBL_MAX;
    }
 
    if ( *dataTree != NULL )
    {
        // See if we're supposed to apply a transform to any rectilinear grids.
        const double *rectXform = NULL;
        avtDataAttributes &atts = ds->GetInfo().GetAttributes();
        if (atts.GetRectilinearGridHasTransform())
            rectXform = atts.GetRectilinearGridTransform();

        // Create an info structure with the needed variables.
        struct {double *se; const double *xform;} info = { se, rectXform };
        dataTree->Traverse(CGetSpatialExtents, &info, foundExtents);
    }
 
    if (!foundExtents)
    {
        debug1 << "Unable to determine spatial extents -- dataset needs an "
               << "update" << endl;
    }
 
    return foundExtents;
}
Ejemplo n.º 3
0
void
avtDatasetExaminer::GetVariableList(avtDataset_p &ds, VarList &vl)
{
    avtDataAttributes &atts = ds->GetInfo().GetAttributes();
    vl.nvars = atts.GetNumberOfVariables();
    vl.varnames.clear();
    vl.varsizes.clear();
    for (int i = 0 ; i < vl.nvars ; i++)
    {
        vl.varnames.push_back(atts.GetVariableName(i));
        vl.varsizes.push_back(atts.GetVariableDimension(vl.varnames[i].c_str()));
    }
}
avtSourceFromAVTDataset::avtSourceFromAVTDataset(avtDataset_p d)
    : avtInlinePipelineSource(DataObjectFromDataset(d))
{
    tree = d->GetDataTree();
    GetTypedOutput()->GetInfo().Copy(d->GetInfo());
}
Ejemplo n.º 5
0
avtDataset::avtDataset(avtDataset_p in, avtDataTree_p newTree)
   : avtDataObject(in->source)
{
   info.Copy(in->GetInfo());
   dataTree = newTree;
}
Ejemplo n.º 6
0
avtDataset::avtDataset(avtDataset_p in, bool dontCopyData)
   : avtDataObject(in->source)
{
   info.Copy(in->GetInfo());
   dataTree = new avtDataTree(in->dataTree, dontCopyData);
}