GetGraphPoints::IsFollowData

Description

Returns whether a DataPlot object represents the same plot as the plot whose index was specified in GetGraphPoints::SetFollowData(). It is only useful when called from within an event method of a derived class.

Syntax

BOOL IsFollowData(DataPlot& dp);

Parameters

dp
[input] The DataPlot object to be tested.

Return

Returns true if the picking is being performed on the specified DataPlot object. Otherwise it returns false.

Examples

#include <Origin.h>

class TestGetGraphPoints : public GetGraphPoints
{
public:
        // Constructor to set GraphLayer property.
        TestGetGraphPoints(GraphLayer& gl)
        {
                m_gl = gl;
        }

        void OnNewPoint(int nPoint)
        {
                // Is the instance set to follow the 1st data plot?
                bool bb = IsFollowData(m_gl.DataPlots(0));
                printf("Following first data plot? %s\n", bb ? "Yes!" : "No!");
        }

private:
        GraphLayer m_gl;
};

// It is assumed that a graph is active with at least 2 XY data plots.
void test_IsFollowData()
{
        // Get the active GraphLayer.
        GraphLayer gl = Project.GraphPages(-1).Layers(-1);
        if( !gl.IsValid() )
                return;

        // Create an instance of class.
        TestGetGraphPoints ggp(gl);

        // Follow the 2nd data plot in the layer.
        ggp.SetFollowData(true, 1);

        // Pick 5 points.
        ggp.GetPoints(5, gl);
}

Remark

See Also

SetFollowData

header to Include

origin.h