示例#1
0
        public float[,] GenerateCutPattern()
        {
            var cutPattern = WhiteCanvas();

            RemoveEdges();
            foreach (var voronoiEdge in _graph.GetEdges())
            {
                DrawEdge(cutPattern, voronoiEdge as VoronoiEdge);
            }
            FillAllBlack(cutPattern);
            foreach (var vector in _peaks)
            {
                cutPattern[(int)vector[0], (int)vector[1]] = 0.7f;
            }
            foreach (var vector in _graph.GetVertices())
            {
                if ((int)vector[0] < 0 || (int)vector[1] < 0 || (int)vector[0] >= cutPattern.GetLength(0) || (int)vector[1] >= cutPattern.GetLength(1))
                {
                    continue;
                }
                cutPattern[(int)vector[0], (int)vector[1]] = 0.3f;
            }
            return(cutPattern);
        }