Ejemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <typeparam name="UV"></typeparam>
        /// <typeparam name="UE"></typeparam>
        /// <param name="graph"></param>
        /// <param name="componentIndices"></param>
        /// <param name="edgeIndices"></param>
        /// <param name="setVertex"></param>
        /// <param name="setHedge"></param>
        /// <returns></returns>
        public TG[] CreateConnectedComponents <UV, UE>(HeGraph <UV, UE> graph, out int[] componentIndices, out int[] edgeIndices, Action <TV, UV> setVertex = null, Action <TE, UE> setHedge = null)
            where UV : HeGraph <UV, UE> .Vertex
            where UE : HeGraph <UV, UE> .Halfedge
        {
            int ne = graph.Edges.Count;

            componentIndices = new int[ne];
            edgeIndices      = new int[ne];

            return(CreateConnectedComponents(
                       graph,
                       Halfedge <UE> .CreateEdgeProperty(componentIndices),
                       Halfedge <UE> .CreateEdgeProperty(edgeIndices),
                       setVertex,
                       setHedge
                       ));
        }
Ejemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <typeparam name="UV"></typeparam>
        /// <typeparam name="UE"></typeparam>
        /// <typeparam name="UF"></typeparam>
        /// <param name="mesh"></param>
        /// <param name="componentIndices"></param>
        /// <param name="edgeIndices"></param>
        /// <param name="setVertex"></param>
        /// <param name="setHedge"></param>
        /// <param name="setFace"></param>
        /// <returns></returns>
        public TM[] CreateConnectedComponents <UV, UE, UF>(HeMesh <UV, UE, UF> mesh, out int[] componentIndices, out int[] edgeIndices, Action <TV, UV> setVertex = null, Action <TE, UE> setHedge = null, Action <TF, UF> setFace = null)
            where UV : HeMesh <UV, UE, UF> .Vertex
            where UE : HeMesh <UV, UE, UF> .Halfedge
            where UF : HeMesh <UV, UE, UF> .Face
        {
            int ne = mesh.Edges.Count;

            componentIndices = new int[ne];
            edgeIndices      = new int[ne];

            return(CreateConnectedComponents(
                       mesh,
                       Halfedge <UE> .CreateEdgeProperty(componentIndices),
                       Halfedge <UE> .CreateEdgeProperty(edgeIndices),
                       setVertex,
                       setHedge,
                       setFace
                       ));
        }