///////////////////////////////////////////////////////////////////////////////// /// /// Function Name: IVA_GetPoint /// /// Description : Retrieves a point from the PointsResults array /// /// Parameters : ivaData - Internal data structure /// stepIndex - Index of the step that produced the point /// pointIndex - Index of the x value. /// /// Return Value : point /// ///////////////////////////////////////////////////////////////////////////////// public static PointContour IVA_GetPoint(IVA_Data ivaData, int stepIndex, int pointIndex) { PointContour point = new PointContour(); if ((pointIndex + 1) < ivaData.stepResults[stepIndex].results.Count) { point.X = ivaData.stepResults[stepIndex].results[pointIndex].resultVal.numVal; point.Y = ivaData.stepResults[stepIndex].results[pointIndex + 1].resultVal.numVal; } return(point); }
///////////////////////////////////////////////////////////////////////////////// /// /// Function Name: IVA_GetNumericResult /// /// Description : Retrieves a numeric result value from the data manager. /// /// Parameters : ivaData - Internal data structure /// stepIndex - Index of the step that produced the result /// resultIndex - result index. /// /// Return Value : numeric result value /// ///////////////////////////////////////////////////////////////////////////////// public static double IVA_GetNumericResult(IVA_Data ivaData, int stepIndex, int resultIndex) { double value = 0; if (resultIndex < ivaData.stepResults[stepIndex].results.Count) { value = ivaData.stepResults[stepIndex].results[resultIndex].resultVal.numVal; } return(value); }
///////////////////////////////////////////////////////////////////////////////// /// /// Function Name: IVA_PushBuffer /// /// Description : Stores an image in a buffer /// /// Parameters : ivaData - Internal data structure /// image - image /// bufferNumber - Buffer index /// /// Return Value : success /// ///////////////////////////////////////////////////////////////////////////////// public static void IVA_PushBuffer(IVA_Data ivaData, VisionImage image, int bufferNumber) { /// Release the previous image that was contained in the buffer ivaData.buffers[bufferNumber].Dispose(); /// Creates an image buffer of the same type of the source image. ivaData.buffers[bufferNumber] = new VisionImage(image.Type, 7); /// Copies the image in the buffer. Algorithms.Copy(image, ivaData.buffers[bufferNumber]); }
///////////////////////////////////////////////////////////////////////////////// /// /// Function Name: IVA_PopBuffer /// /// Description : Retrieves an image from a buffer /// /// Parameters : ivaData - Internal data structure /// bufferNumber - Buffer index /// /// Return Value : success /// ///////////////////////////////////////////////////////////////////////////////// public static VisionImage IVA_GetBuffer(IVA_Data ivaData, int bufferNumber) { return(ivaData.buffers[bufferNumber]); }
///////////////////////////////////////////////////////////////////////////////// /// /// Function Name: IVA_DisposeStepResults /// /// Description : Dispose of the results of a specific step. /// /// Parameters : ivaData - Internal data structure /// stepIndex - step index /// /// Return Value : success /// ///////////////////////////////////////////////////////////////////////////////// public static void IVA_DisposeStepResults(IVA_Data ivaData, int stepIndex) { ivaData.stepResults[stepIndex].results.Clear(); }