Esempio n. 1
0
avtDataObject_p
avtContourPlot::ApplyOperators(avtDataObject_p input)
{
    //
    // Very clumsy.  I should really go back and make this be a formal part of
    // the ContourAttributes and just get this sub-part.
    //
    ContourOpAttributes catts;
    catts.SetContourNLevels(atts.GetContourNLevels());
    catts.SetContourValue(atts.GetContourValue());
    catts.SetContourPercent(atts.GetContourPercent());
    catts.SetContourMethod(ContourOpAttributes::ContourMethod(
        atts.GetContourMethod()));
    if (dataExtents.size() == 2)
    {
        catts.SetMinFlag(true);
        catts.SetMaxFlag(true);
        catts.SetMin(dataExtents[0]);
        catts.SetMax(dataExtents[1]);
    }
    else
    {
        catts.SetMinFlag(atts.GetMinFlag());
        catts.SetMaxFlag(atts.GetMaxFlag());
        catts.SetMin(atts.GetMin());
        catts.SetMax(atts.GetMax());
    }
    catts.SetScaling(ContourOpAttributes::ContourScaling(atts.GetScaling()));

    if (contourFilter != NULL)
    {
        delete contourFilter;
    }
    contourFilter = new avtContourFilter(catts);
    contourFilter->SetInput(input);

    return contourFilter->GetOutput();
}
Esempio n. 2
0
void
avtIsosurfaceFilter::SetAtts(const AttributeGroup *a)
{
    atts = *(const IsosurfaceAttributes*)a;

    //
    // Construct a new contour filter based on these attributes.
    //
    if (cf != NULL)
    {
        delete cf;
    }
    ContourOpAttributes coa;
    coa.SetContourNLevels(atts.GetContourNLevels());
    coa.SetContourValue(atts.GetContourValue());
    coa.SetContourPercent(atts.GetContourPercent());
    coa.SetContourMethod(ContourOpAttributes::ContourMethod(
        atts.GetContourMethod()));
    coa.SetMinFlag(atts.GetMinFlag());
    coa.SetMaxFlag(atts.GetMaxFlag());
    coa.SetMin(atts.GetMin());
    coa.SetMax(atts.GetMax());
    coa.SetScaling(ContourOpAttributes::ContourScaling(atts.GetScaling()));
    coa.SetVariable(atts.GetVariable());
    cf = new avtContourFilter(coa);
    cf->ShouldCreateLabels(false);
}