2.2.4.32.18 OriginObject::GetIncomingOperation

Description

Get the operation that is using this object as its output

Syntax

OperationBase & GetIncomingOperation( BOOL bDirect, int & nOuputIndex )

Parameters

bDirect
[input] TRUE if this object is one of the direct output from the operation that we are trying to get,
and FALSE if this object may or may not be the direct output, it could be one of the children of the direct output object
nOuputIndex
[input] optional index for bDirect = FALSE case where multiple output objects are linked to the incoming operation, This index
can be used in other commands in OperationBase to identify the particular output.

Return

a valid operation wrapper that represent the internal operation object

Examples

EX1

// Example requires a graph on which some operation object analyses have been preformed.
// The code lists all the analyses
#include <Operation.h>        
void    OriginObject_GetIncomingOperation_Ex1()
{
    GraphLayer gl = Project.ActiveLayer();
    if(gl)
    {
        printf("Operation\tIndex\tDescription\tFit Y[0]\n");
        foreach(DataPlot dp in gl.DataPlots)
        {
            int nIndex = false;
            double y1 = -500;// just some value to show not found, could have used NANUM
            OperationBase& op = dp.GetIncomingOperation(false, nIndex);
            if(op)
            {
                string strClassName = op.GetClassName();
                Tree trOp;
                op.GetTree(trOp);
                
                vector vx, vy;
                if(op.GetFitCurve(trOp, vx, vy, nIndex))
                {
                    for(int ii = 0 ; ii < vy.GetSize() ; ii++ )
                    {
                        y1 = vy[ii];
                        printf("%s\t%d\t%s\t%f\n", strClassName, nIndex, op.GetDescription(ii), y1);
                    }
                }
                
            }
        }
    }
}

Remark

See Also

OriginObject::FindIncomingOperations OriginObject::FindOutgoingOperations

Header to Include

origin.h