コード例 #1
0
        void drawRandomTree()
        {
            t=Tree.Generate(gen_type,
                            depth: tree_depth,
                            max_breadth: tree_breadth, // 40,100
                            num_first_children : -1,
                            max_nodes : -1);

            //t.root.Visible=false;

            depthMap=DepthMap.Generate(t.MaxDepth, rand);

            t.Root.Point.X = this.splitContainer1.Panel2.Width / 2;
            t.Root.Point.Y = this.splitContainer1.Panel2.Height / 2;

            radius = new PointF();
            radius.Y = (float)branch_radius;
            radius.X=radius.Y;

#if RADIAL
            t.LayoutRadial2D(radius, edge_length, layout_type, chkGrow.Checked);
#else
            t.LayoutTopDown2D(radius, edge_length, layout_type, chkGrow.Checked);
#endif

            Render();
        }
コード例 #2
0
        void fsTreeRenderNode(Tree owner, TNode c)
        {
            if (owner.MaxDepth == 0) return;

            t = owner;
            t.Root.Point.X = this.splitContainer1.Panel2.Width / 2;
            t.Root.Point.Y = this.splitContainer1.Panel2.Height / 2;
            t.UpdateAttributes();
            depthMap = DepthMap.Generate(t.MaxDepth, rand);
#if RADIAL
            t.LayoutRadial2D(radius, edge_length, layout_type, chkGrow.Checked);
#else
            t.LayoutTopDown2D(radius, edge_length, layout_type, chkGrow.Checked);
#endif

            Redraw(false);
        }