Exemplo n.º 1
0
void
avtTraceHistoryFilter::Execute(void)
{
    //
    // Write out the connectivity.  "-1" is the hint to do that.
    //
    OutputTime(GetTypedInput(), -1);

    //
    // Pull out just the points.
    //
    avtDataset_p ds = InitializeDataset();

    //
    // Put the fields from the current time step on the points and then
    // output those fields.
    //
    PerformIteration(0, ds, false);
    OutputTime(ds, 0);

    //
    // Now iterate through the time slices, displacing and evaluating.
    //
    for (int i = 0 ; i < atts.GetNumiter() ; i++)
    {
        ds->SetSource(GetInput()->GetSource());
        PerformIteration(i, ds, true);
        OutputTime(ds, i+1);
    }

    // The operator just passes the data through.
    GetDataTree() = GetInputDataTree();
}
Exemplo n.º 2
0
void 
avtLCSFilter::CreateNativeMeshIterativeCalcOutput(std::vector<avtIntegralCurve*> &ics)
{
    //accumulate all of the points then do jacobian?
    //or do jacobian then accumulate?
    //picking the first.

    int    offset = 0;
    double minv   =  std::numeric_limits<double>::max();
    double maxv   = -std::numeric_limits<double>::max();
    int    count  = 0;

    CreateMultiBlockIterativeCalcOutput(GetInputDataTree(), GetDataTree(),
                                        ics, offset, minv, maxv, count);

    int nTuples = (int) ics.size();

    if( 1 || count <= nTuples/10 )
    {
      if( minSizeValue == std::numeric_limits<double>::max() )
        minSizeValue = 0.0;
      
      if( maxSizeValue == -std::numeric_limits<double>::max() )
        maxSizeValue = 0.0;
      
      char str[1028];
      
      SNPRINTF(str, 1028, "\n%d%% of the nodes (%d of %d nodes) "
               "exaimed produced a valid exponent (%f to %f). "
               "This may be due to too large of a size limit (%f), "
               "too small of an integration step (%f), or "
               "too few integration steps (%d out of %d where taken), or "
               "simply due to the nature of the data. "
               "The size range was from %f to %f. ",
               (int) (100.0 * (double) count / (double) nTuples),
               count, nTuples,
               minv, maxv,
               maxSize, maxStepLength, numSteps, maxSteps,
               minSizeValue, maxSizeValue );
      
      avtCallback::IssueWarning(str);
    }

    avtDataAttributes &dataatts = GetOutput()->GetInfo().GetAttributes();
    avtExtents* e = dataatts.GetThisProcsActualDataExtents();

    double range[2];
    range[0] = minv;
    range[1] = maxv;
    e->Set(range);

    e = dataatts.GetThisProcsOriginalDataExtents();
    e->Set(range);

    e = dataatts.GetThisProcsActualSpatialExtents();
    e->Set(global_bounds);
    e = dataatts.GetThisProcsOriginalSpatialExtents();
    e->Set(global_bounds);
}
wxString uwTreeList::OnGetItemText( wxTreeItemData* item, long column ) const
{
    return GetDataTree(item).GetText(column);
    //dword index = tree.GetSerialID();
    //if		( index != ID_IGNORE )			return Table->GetText( index, column );	
    //else if	( column == GetMainColumn() )	return GetDataTree(item)->GetCaption();		
    //else									    return wxEmptyString;	
}
void
avtDatasetToDatasetFilter::PostExecute(void)
{
    if (switchVariables)
    {
        debug5 << GetType() << ": Setting output variable to be " 
               << pipelineVariable << " after execution." << endl;
        OutputSetActiveVariable(pipelineVariable);
        if (removeActiveVariableWhenDone)
        {
            debug5 << GetType() << ": Removing variable " << activeVariable
                   << " after execution." << endl;
            avtDataTree_p tree = GetDataTree();
            bool    success;
            tree->Traverse(CRemoveVariable, (void *)activeVariable, success);
            GetOutput()->GetInfo().GetAttributes(). 
                                                RemoveVariable(activeVariable);
        }
    }

    // Iterate through the secondary variables, removing them when needed.
    for (int i = 0; i < removeSecondaryVariable.size(); i++)
    {
        if (removeSecondaryVariable[i] == true)
        {
            debug5 << GetType() << ": Removing secondary variable "
                   << secondaryVarList[i] << " after execution." << endl;
            avtDataTree_p tree = GetDataTree();
            bool    success;
            tree->Traverse(CRemoveVariable, (void *)secondaryVarList[i],
                           success);
            GetOutput()->GetInfo().GetAttributes(). 
                                           RemoveVariable(secondaryVarList[i]);
        } else
        {
            debug5 << GetType() << ": Leaving secondary variable "
                   << secondaryVarList[i] << " after execution." << endl;
        }
    }

    avtDatasetToDataObjectFilter::PostExecute();
    avtDataObjectToDatasetFilter::PostExecute();
}
bool
avtOriginatingDatasetSource::FetchData(avtDataRequest_p spec)
{
    bool rv = false;
    rv = FetchDataset(spec, GetDataTree());
    avtDataTree_p tree = GetDataTree();

    if (!ArtificialPipeline())
    {
        int nleaves = 0;
        vtkDataSet **ds = tree->GetAllLeaves(nleaves);
        vector<int> domains;
        tree->GetAllDomainIds(domains);
        verifier.VerifyDatasets(nleaves, ds, domains);
        delete [] ds;
    }

    return rv;
}
void
avtDataObjectToDatasetFilter::OutputSetActiveVariable(const char *varname)
{
    SetActiveVariableArgs args;
    args.varname = varname;
    args.activeVarDim = -1;
    avtDataTree_p tree = GetDataTree();
    bool success = false;
    tree->Traverse(CSetActiveVariable, (void *) &args, success);

    GetOutput()->GetInfo().GetAttributes().SetActiveVariable(varname);
}
void uwTreeList::ExpandPlaceholder( const wxTreeItemId& parent )
{
	unDataTree& tree = GetDataTree( parent );

	if( tree.Expand() )
	{
		AddChildren( tree );	
		if( tree.ShouldSort() )				
			SortChildren( tree.GetTreeID() );	

        wxTreeItemIdValue cookie = 0;
        wxTreeItemId child = GetFirstChild(parent, cookie);
        while( child.IsOk() ) 
        {
            unDataTree& tree_child = GetDataTree( child );
            if( tree_child.GetAutoExpand() )
            {
                Expand(child);
            }
            child = GetNextChild(parent, cookie);
        }
	}
}
void
avtDataObjectToDatasetFilter::PostExecute(void)
{
    avtDataTree_p tree = GetDataTree();
    bool dummy;

    avtDataAttributes &atts = GetOutput()->GetInfo().GetAttributes();
    if ((atts.GetSpatialDimension()==3 && atts.GetTopologicalDimension()<3) ||
        (atts.GetSpatialDimension()==2 && atts.GetTopologicalDimension()<2))
    {
        int t0 = visitTimer->StartTimer();
        tree->Traverse(CConvertUnstructuredGridToPolyData, NULL, dummy);
        visitTimer->StopTimer(t0, "converting ugrids to polydata in postex");
    }

    int t0 = visitTimer->StartTimer();
    tree->Traverse(CBreakVTKPipelineConnections, (void*)&vtkDebugMode, dummy);
    visitTimer->StopTimer(t0, "Breaking pipeline connections in postex");
}
unDataTree& uwTreeList::GetDataTree( const wxTreeItemId& item ) const
{
	return GetDataTree(GetItemData(SafeTreeID(item)));
}