Ejemplo n.º 1
0
        /// <summary>
        /// Get an enumerator of the QuadEdges in this plannar subdivision
        /// </summary>
        /// <returns>An enumerator of all MCvQuadEdge2D</returns>
        public IEnumerator <MCvQuadEdge2D> GetEnumerator()
        {
            IntPtr       subdivEdges = MCvSubdiv2D.edges;
            int          elemSize    = ((MCvSet)Marshal.PtrToStructure(subdivEdges, typeof(MCvSet))).elem_size;
            MCvSeqReader reader      = new MCvSeqReader();

            CvInvoke.cvStartReadSeq(subdivEdges, ref reader, false);

            for (; CvInvoke.CV_IS_SET_ELEM(reader.ptr); CvInvoke.CV_NEXT_SEQ_ELEM(elemSize, ref reader))
            {
                yield return((MCvQuadEdge2D)Marshal.PtrToStructure(reader.ptr, typeof(MCvQuadEdge2D)));
            }
        }