Beispiel #1
0
        /// <summary>
        /// グラフの深さ優先走査のためのクラスを生成する
        /// </summary>
        /// <param name="graph">グラフ</param>
        /// <param name="vtx">走査開始頂点.nullの場合,走査は先頭の頂点(頂点シーケンスのうち最小のインデックスを持つ頂点)から始まる.</param>
        /// <param name="mask">イベントマスク.どのイベントにユーザが着目したいのかを指定する.</param>
#else
        /// <summary>
        /// Creates structure for depth-first graph traversal
        /// </summary>
        /// <param name="graph">Graph. </param>
        /// <param name="vtx">Initial vertex to start from. If NULL, the traversal starts from the first vertex (a vertex with the minimal index in the sequence of vertices). </param>
        /// <param name="mask">Event mask indicating which events are interesting to the user (where cvNextGraphItem  function returns control to the user) It can be CV_GRAPH_ALL_ITEMS (all events are interesting) or combination of the following flags:
        /// <br/> * CV_GRAPH_VERTEX - stop at the graph vertices visited for the first time
        ///   <br/>* CV_GRAPH_TREE_EDGE - stop at tree edges (tree edge is the edge connecting the last visited vertex and the vertex to be visited next)
        /// <br/>* CV_GRAPH_BACK_EDGE - stop at back edges (back edge is an edge connecting the last visited vertex with some of its ancestors in the search tree)
        /// <br/>* CV_GRAPH_FORWARD_EDGE - stop at forward edges (forward edge is an edge conecting the last visited vertex with some of its descendants in the search tree). The forward edges are only possible during oriented graph traversal)
        ///   <br/>* CV_GRAPH_CROSS_EDGE - stop at cross edges (cross edge is an edge connecting different search trees or branches of the same tree. The cross edges are only possible during oriented graphs traversal)
        ///   <br/> * CV_GRAPH_ANY_EDGE - stop and any edge (tree, back, forward and cross edges)
        ///   <br/>* CV_GRAPH_NEW_TREE - stop in the beginning of every new search tree. When the traversal procedure visits all vertices and edges reachible from the initial vertex (the visited vertices together with tree edges make up a tree), it searches for some unvisited vertex in the graph and resumes the traversal process from that vertex. Before starting a new tree (including the very first tree when cvNextGraphItem is called for the first time) it generates CV_GRAPH_NEW_TREE event.
        ///    <br/> For unoriented graphs each search tree corresponds to a connected component of the graph.
        ///  <br/> * CV_GRAPH_BACKTRACKING - stop at every already visited vertex during backtracking - returning to already visited vertexes of the traversal tree.</param>
#endif
        public CvGraphScanner(CvGraph graph, CvGraphVtx vtx, GraphScannerMask mask)
            : this(CvInvoke.cvCreateGraphScanner(graph.CvPtr, (vtx == null) ? IntPtr.Zero : vtx.CvPtr, mask))
        {
        }
Beispiel #2
0
        /// <summary>
        /// グラフの深さ優先走査のためのクラスを生成する
        /// </summary>
        /// <param name="graph">グラフ</param>
        /// <param name="vtx">走査開始頂点.nullの場合,走査は先頭の頂点(頂点シーケンスのうち最小のインデックスを持つ頂点)から始まる.</param>
        /// <param name="mask">イベントマスク.どのイベントにユーザが着目したいのかを指定する.</param>
#else
        /// <summary>
        /// Creates structure for depth-first graph traversal
        /// </summary>
        /// <param name="graph">Graph. </param>
        /// <param name="vtx">Initial vertex to start from. If NULL, the traversal starts from the first vertex (a vertex with the minimal index in the sequence of vertices). </param>
        /// <param name="mask">Event mask indicating which events are interesting to the user (where cvNextGraphItem  function returns control to the user) It can be CV_GRAPH_ALL_ITEMS (all events are interesting) or combination of the following flags:
        /// <br/> * CV_GRAPH_VERTEX - stop at the graph vertices visited for the first time
        ///   <br/>* CV_GRAPH_TREE_EDGE - stop at tree edges (tree edge is the edge connecting the last visited vertex and the vertex to be visited next)
        /// <br/>* CV_GRAPH_BACK_EDGE - stop at back edges (back edge is an edge connecting the last visited vertex with some of its ancestors in the search tree)
        /// <br/>* CV_GRAPH_FORWARD_EDGE - stop at forward edges (forward edge is an edge conecting the last visited vertex with some of its descendants in the search tree). The forward edges are only possible during oriented graph traversal)
        ///   <br/>* CV_GRAPH_CROSS_EDGE - stop at cross edges (cross edge is an edge connecting different search trees or branches of the same tree. The cross edges are only possible during oriented graphs traversal)
        ///   <br/> * CV_GRAPH_ANY_EDGE - stop and any edge (tree, back, forward and cross edges)
        ///   <br/>* CV_GRAPH_NEW_TREE - stop in the beginning of every new search tree. When the traversal procedure visits all vertices and edges reachible from the initial vertex (the visited vertices together with tree edges make up a tree), it searches for some unvisited vertex in the graph and resumes the traversal process from that vertex. Before starting a new tree (including the very first tree when cvNextGraphItem is called for the first time) it generates CV_GRAPH_NEW_TREE event.
        ///    <br/> For unoriented graphs each search tree corresponds to a connected component of the graph.
        ///  <br/> * CV_GRAPH_BACKTRACKING - stop at every already visited vertex during backtracking - returning to already visited vertexes of the traversal tree.</param>
#endif
        public CvGraphScanner(CvGraph graph, CvGraphVtx vtx, GraphScannerMask mask)
            : this(NativeMethods.cvCreateGraphScanner(graph.CvPtr, (vtx == null) ? IntPtr.Zero : vtx.CvPtr, mask))
        {
        }