コード例 #1
0
ファイル: EngineAPI.cs プロジェクト: zshankang/OpenHalcon
        internal static int LoadTupleVector(HTupleVector outVector, IntPtr vectorHandle)
        {
            int dimension;

            EngineAPI.HCkE(EngineAPI.GetTupleVectorDimension(vectorHandle, out dimension));
            int length;

            EngineAPI.HCkE(EngineAPI.GetTupleVectorLength(vectorHandle, out length));
            if (dimension == 1)
            {
                for (int index = length - 1; index >= 0; --index)
                {
                    IntPtr element_handle;
                    EngineAPI.HCkE(EngineAPI.GetTupleVectorTuple(vectorHandle, index, out element_handle));
                    outVector[index].T = HalconAPI.LoadTuple(element_handle);
                }
            }
            else
            {
                for (int index = length - 1; index >= 0; --index)
                {
                    IntPtr element_handle;
                    EngineAPI.HCkE(EngineAPI.GetTupleVectorVector(vectorHandle, index, out element_handle));
                    EngineAPI.HCkE(EngineAPI.LoadTupleVector(outVector[index], element_handle));
                    EngineAPI.HCkE(EngineAPI.DestroyTupleVector(element_handle));
                }
            }
            return(2);
        }