コード例 #1
0
void
DeletePlotDatabaseKeyframeAction::Execute()
{
    //
    // Delete the database keyframe
    //
    int plotId = args.GetIntArg1();
    int index = args.GetIntArg2();
    ViewerPlotList *plotList = window->GetPlotList();
    plotList->DeletePlotDatabaseKeyframe(plotId, index);
}
コード例 #2
0
void
SetPlotDatabaseStateAction::Execute()
{
    //
    // Perform the rpc.
    //
    int plotId = args.GetIntArg1();
    int index = args.GetIntArg2();
    int state = args.GetIntArg3();
    ViewerPlotList *plotList = window->GetPlotList();
    plotList->SetPlotDatabaseState(plotId, index, state);
}
コード例 #3
0
void
MovePlotKeyframeAction::Execute()
{
    //
    // Move the plot keyframe.
    //
    int plotId = args.GetIntArg1();
    int oldIndex = args.GetIntArg2();
    int newIndex = args.GetIntArg3();
    ViewerPlotList *plotList = window->GetPlotList();
    plotList->MovePlotKeyframe(plotId, oldIndex, newIndex);
}
コード例 #4
0
void
SetPlotFrameRangeAction::Execute()
{
    //
    // Set the plot frame range.
    //
    int plotId = args.GetIntArg1();
    int index0 = args.GetIntArg2();
    int index1 = args.GetIntArg3();
    ViewerPlotList *plotList = window->GetPlotList();
    plotList->SetPlotRange(plotId, index0, index1);
}
コード例 #5
0
ファイル: QueryActions.C プロジェクト: burlen/visit_vtk_7_src
void
ConstructDataBinningAction::Execute()
{
    //
    // Perform the RPC.
    //
    ViewerPlotList *plist = GetWindow()->GetPlotList();
    intVector plotIDs;
    plist->GetActivePlotIDs(plotIDs);
    if (plotIDs.size() <= 0)
    {
        GetViewerMessaging()->Error(
            TR("To construct a data binning, you must have an active "
               "plot.  No data binning was created."));
        return;
    }
    if (plotIDs.size() > 1)
    {
        GetViewerMessaging()->Message(
           TR("Only one data binning can be created at a time.  VisIt is using "
              "the first active plot."));
    }

    ViewerPlot *plot = plist->GetPlot(plotIDs[0]);
    const EngineKey   &engineKey = plot->GetEngineKey();
    int networkId = plot->GetNetworkID();
    TRY
    {
        if (GetViewerEngineManager()->ConstructDataBinning(engineKey, networkId))
        {
            GetViewerMessaging()->Message(TR("Created data binning"));
        }
        else
        {
            GetViewerMessaging()->Error(TR("Unable to create data binning"));
        }
    }
    CATCH2(VisItException, e)
    {
        GetViewerMessaging()->Error(
            ViewerText("(%1): %2\n").
            arg(e.GetExceptionType()).
            arg(e.Message()));
    }
コード例 #6
0
void
LineoutListItem::HandleTool(const avtToolInterface &ti)
{
    int i;
    bool success = false;
    if (ti.GetAttributes()->TypeName() == "Line")
    {
        for (i = 0; i < nQueries; i++)
        {
            success |= queries[i]->HandleTool(ti); 
        }
    }
    else if (origPlotQueryInfo)  // in Dynamic mode, other tools can be handled
    {
        if (ti.GetAttributes()->TypeName() == "PlaneAttributes")
        {
           PlaneAttributes *planeAtts = (PlaneAttributes*)ti.GetAttributes()->
                                        CreateCompatible("PlaneAttributes"); 
           if (planeAtts)
           {
               for (i =0; i < nQueries; i++)
               {
                   success |= queries[i]->UpdateLineFromSlice(planeAtts);
               }
               delete planeAtts;
           }
        } 
        else // some other tool, have the plot list handle it in the usual way.
        {
            ViewerPlotList *resPL = resWin->GetPlotList();
            resPL->HandleTool(ti);
        }
    }
    if (success)
    {
        //
        //  We want to update the window where lineouts are drawn,
        //
        ViewerPlotList *resPL = resWin->GetPlotList();
        resPL->UpdatePlotAtts(false);
        resPL->UpdateFrame();
    }
}
コード例 #7
0
void
ViewerQuery::CreateLineout(const bool fromDefault, const bool forceSampling)
{
    //
    //  Grab information from the originating window.
    //
    ViewerPlotList *origList = originatingWindow->GetPlotList();
    intVector plotIDs;
    origList->GetActivePlotIDs(plotIDs);
    int origPlotID = (plotIDs.size() > 0 ? plotIDs[0] : -1);
    originatingPlot = origList->GetPlot(origPlotID);

    std::string vName;
    if (lineAtts->GetVarName() == "default")
        vName = originatingPlot->GetVariableName();
    else 
        vName = lineAtts->GetVarName();
    std::string hdbName(originatingPlot->GetSource());
    bool replacePlots = ViewerWindowManager::Instance()->
                        GetClientAtts()->GetReplacePlots();
 
    int plotType = GetPlotPluginManager()->GetEnabledIndex("Curve_1.0");
    ViewerPlotList *plotList = resultsWindow->GetPlotList();

    // If the original plot list has a time slider corresponding to the
    // the originating plot's hostdabase name, make sure that
    // the the new plot list uses the same time slider.
    if (origList->TimeSliderExists(hdbName))
    {
        int state, nStates;
        origList->GetTimeSliderStates(hdbName, state, nStates);
        plotList->CreateTimeSlider(hdbName, state);
        plotList->SetActiveTimeSlider(hdbName);
    }

    plotList->SetHostDatabaseName(hdbName);
    plotList->SetEngineKey(originatingPlot->GetEngineKey());
 
    int pid = plotList->AddPlot(plotType, vName, replacePlots, false, false);
    resultsPlot = plotList->GetPlot(pid);

    resultsPlot->SetSILRestriction(originatingPlot->GetSILRestriction()); 
    //
    // Copy operators from the originating plot to the results (curve) plot.
    //
    for (int j = 0; j < originatingPlot->GetNOperators(); ++j)
    {
        ViewerOperator *op = originatingPlot->GetOperator(j);
        //
        // Keep a copy of the slice-plane atts, so that the line endpoints
        // may be updated accordingly whent the slice-plane changes.
        //
        if (strcmp(op->GetName(), "Slice") == 0)
        {
            planeAtts = (PlaneAttributes *)op->GetOperatorAtts()->
                        CreateCompatible("PlaneAttributes");
        }
        resultsPlot->AddOperator(op->GetType());
        ViewerOperator *newOp = resultsPlot->GetOperator(j);
        newOp->SetOperatorAtts(op->GetOperatorAtts());
    }
 
    //
    // Add the lineout operator.
    //
    int operatorType = GetOperatorPluginManager()->GetEnabledIndex("Lineout_1.0");
    resultsPlot->AddOperator(operatorType, fromDefault);

    //
    //  The client atts were already copied created,
    //  so now update them with the lineAtts.
    //
    resultsPlot->SetPlotAtts(lineAtts);

    int id = resultsPlot->GetNOperators() -1;
    resultsPlot->GetOperator(id)->SetOperatorAtts(lineAtts);
    resultsPlot->GetOperator(id)->SetOperatorAtts(
        ViewerQueryManager::Instance()->GetGlobalLineoutAtts());
    if (forceSampling)
    {
        lineAtts->SetSamplingOn(true);
        resultsPlot->GetOperator(id)->SetOperatorAtts(lineAtts);
    }

    plotList->RealizePlots();
}
コード例 #8
0
ViewerQuery::ViewerQuery(const ViewerQuery *obj, int ts) : SimpleObserver(), 
    ViewerBase()
{
    resPlotQueryInfo = 0;
    planeAtts = 0;

    lineAtts = new Line();
    originatingWindow = obj->originatingWindow;
    resultsWindow = obj->resultsWindow;
    lineAtts->CopyAttributes(obj->lineAtts);

    ViewerQueryManager *vqm = ViewerQueryManager::Instance();
    if (vqm->GetGlobalLineoutAtts()->GetColorOption() ==
        GlobalLineoutAttributes::CreateColor)
    {
        lineAtts->SetColor(vqm->GetColor());
    }

    originatingPlot = obj->originatingPlot;
    std::string vName;
    if (lineAtts->GetVarName() == "default")
        vName = originatingPlot->GetVariableName();
    else 
        vName = lineAtts->GetVarName();

    bool replacePlots = ViewerWindowManager::Instance()->
                        GetClientAtts()->GetReplacePlots();

    ViewerPlotList *plotList = resultsWindow->GetPlotList();

    int plotType = GetPlotPluginManager()->GetEnabledIndex("Curve_1.0");

    int pid = plotList->AddPlot(plotType, vName, replacePlots, false, false);
    resultsPlot = plotList->GetPlot(pid);
    resultsPlot->SetSILRestriction(originatingPlot->GetSILRestriction());

    //
    // Copy operators from the originating plot to the results (curve) plot.
    //
    for (int j = 0; j < originatingPlot->GetNOperators(); ++j)
    {
        ViewerOperator *op = originatingPlot->GetOperator(j);
        //
        // Keep a copy of the slice-plane atts, so that the line endpoints
        // may be updated accordingly whent the slice-plane changes.
        //
        if (strcmp(op->GetName(), "Slice") == 0)
        {
            planeAtts = (PlaneAttributes *)op->GetOperatorAtts()->
                        CreateCompatible("PlaneAttributes");
        }
        resultsPlot->AddOperator(op->GetType());
        ViewerOperator *newOp = resultsPlot->GetOperator(j);
        newOp->SetOperatorAtts(op->GetOperatorAtts());
    }
 
    //
    // Add the lineout operator.
    //
    int operatorType = GetOperatorPluginManager()->GetEnabledIndex("Lineout_1.0");
    resultsPlot->AddOperator(operatorType, false);

    //
    //  The client atts were already copied created,
    //  so now update them with the lineAtts.
    //
    resultsPlot->SetPlotAtts(lineAtts);

    int id = resultsPlot->GetNOperators() -1;
    resultsPlot->GetOperator(id)->SetOperatorAtts(lineAtts);
    resultsPlot->GetOperator(id)->SetOperatorAtts(
        ViewerQueryManager::Instance()->GetGlobalLineoutAtts());

    resultsPlot->SetFollowsTime(true);
    resultsPlot->SetCacheIndex(ts);
    resultsPlot->SetFollowsTime(false);
    plotList->RealizePlots();

    //
    // Connect to the resultsPlot
    //
    StartObservingPlot();
    
    handlingTool = false;
}
コード例 #9
0
void
LineoutListItem::Update(Subject *TheChangedSubject)
{
     if (origPlotQueryInfo == TheChangedSubject)
     {
         ViewerPlotList *vpl = resWin->GetPlotList();
         int i, nOps;
         switch(origPlotQueryInfo->GetChangeType())
         {
             case PlotQueryInfo::Database:
                 vpl->ReplaceDatabase(origPlot->GetEngineKey(),
                     origPlot->GetDatabaseName(), 0, false, false,false);
                 break;
             case PlotQueryInfo::VarName:
                 vpl->SetPlotVar(origPlot->GetVariableName());
                 break;
             case PlotQueryInfo::OpAtts:
                 nOps = origPlot->GetNOperators();
                 for (i = 0; i < nOps; i++)
                 {
                     vpl->SetPlotOperatorAtts(origPlot->GetOperator(i)->GetType());
                 }
                 break;
             case PlotQueryInfo::CacheIndex:
                 if (ViewerQueryManager::Instance()->GetGlobalLineoutAtts()->
                     GetCurveOption() == GlobalLineoutAttributes::CreateCurve)
                 {
                     int newf = origPlotQueryInfo->GetNewFrameIndex();
                     int oldf = origPlotQueryInfo->GetOldFrameIndex();
                     std::vector<ViewerQuery_p> addme;
                     for (i = 0; i < nQueries; i++)
                     {
                         if (queries[i]->MatchTimeState(oldf))
                         {
                             ViewerQuery_p nq = new ViewerQuery(*queries[i], newf);
                             addme.push_back(nq);
                         }
                     }
                     for (i = 0; i < (int)addme.size(); i++)
                     {
                         AddQuery(addme[i]);
                     }
                 }
                 else
                 {
                     int newf = origPlotQueryInfo->GetNewFrameIndex();
                     vpl->SetActiveTimeSlider(origWin->GetPlotList()->
                                              GetActiveTimeSlider());
                     vpl->SetTimeSliderState(newf);
                 }
                 break;
             case PlotQueryInfo::AddOp:          // fall through
             case PlotQueryInfo::MoveOperator:   // fall through
             case PlotQueryInfo::RemoveOperator: // fall through
             case PlotQueryInfo::RemoveAll:      // fall through
             case PlotQueryInfo::RemoveLast:
                 for (i = 0; i < nQueries; i++)
                 {
                     queries[i]->ReCreateLineout(); 
                 }
                 break;
             default:
                 // do nothing
                 break;

        }  // switch
    } // if
}