示例#1
0
        private void Step_Click(object sender, EventArgs e)
        {
            if (((Button)sender).Tag is GenerationStep)
            {
                var step = (GenerationStep)((Button)sender).Tag;
                gen.Generate(step + 1);
            }
            else
            {
                gen.Generate();
                if (ras == null)
                {
                    ras = new Rasterizer(seed, gen.ExportGraph());
                }

                var step = (RasterizationStep)((Button)sender).Tag;
                ras.Rasterize(step + 1);
            }

            Render();
            foreach (var btn in btns)
            {
                if (btn.Tag is GenerationStep)
                {
                    btn.Enabled = (GenerationStep)btn.Tag >= gen.Step;
                }
                else
                {
                    btn.Enabled = ras == null || (RasterizationStep)btn.Tag >= ras.Step;
                }
            }
        }
示例#2
0
 public void GenerateAsync()
 {
     gen.Generate();
     if (ras == null)
     {
         ras = new Rasterizer(seed, gen.ExportGraph());
     }
     ras.Rasterize();
 }
示例#3
0
 public void GenerateAsync()
 {
     _gen.Generate();
     if (_ras == null)
     {
         _ras = new Rasterizer(_seed, _gen.ExportGraph());
     }
     _ras.Rasterize();
 }