/// <summary> /// 设计器支持所需的方法 - 不要 /// 使用代码编辑器修改此方法的内容。 /// </summary> private void InitializeComponent() { this.otree = new OTree(); this.otree.Dock = DockStyle.Fill; Controls.Add(this.otree); components = new System.ComponentModel.Container(); //this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; }
public CiRptObsTreeView() { InitializeComponent(); this.xapFormControl1 = new XapFormControl(); this.xapFormControl1.Dock = DockStyle.Fill; this.oTree1 = new xap.rui.control.tree.otree.OTree(); this.oTree1.Dock = DockStyle.Fill; menu = new NavBarControl(); menu.Size = new Size(30, 430); // this.xapFormControl1.Controls.Add(menu); this.Controls.Add(menu); }
/// <summary> /// Greedy algorithm. /// </summary> /// <param name="_modules">List of modules that represent the images that need to be inserted into the sprite.</param> /// <returns>Near optimal placement.</returns> public static Placement Greedy(List <Module> _modules) { //Empty O-Tree code. OTree oTree = new OTree(); OT finalOT = null; //Empty list of modules. List <Module> moduleList = new List <Module>(); //For each module which needs to be inserted. foreach (Module module in _modules) { OTree bestOTree = null; //Add module to the list of already packed modules. moduleList.Add(module); //Set the minimum perimeter of the placement to high. int minPerimeter = Int32.MaxValue; //Try all insertation point. foreach (int insertationPoint in oTree.InsertationPoints()) { OTree ot = oTree.Copy(); ot.Insert(module.Name, insertationPoint); OT oT = new OT(ot, moduleList); Placement pm = oT.Placement; //Choose the one with the minimum perimeter. if (pm.Perimeter < minPerimeter) { finalOT = oT; bestOTree = ot; minPerimeter = pm.Perimeter; } } oTree = bestOTree; } return(finalOT.Placement); }
/// <summary> /// Greedy algorithm. /// </summary> /// <param name="_modules">List of modules that represent the images that need to be inserted into the sprite.</param> /// <returns>Near optimal placement.</returns> public static Placement Greedy(List<Module> _modules) { //Empty O-Tree code. OTree oTree = new OTree(); OT finalOT = null; //Empty list of modules. List<Module> moduleList = new List<Module>(); //For each module which needs to be inserted. foreach (Module module in _modules) { OTree bestOTree = null; //Add module to the list of already packed modules. moduleList.Add(module); //Set the minimum perimeter of the placement to high. int minPerimeter = Int32.MaxValue; //Try all insertation point. foreach (int insertationPoint in oTree.InsertationPoints()) { OTree ot = oTree.Copy(); ot.Insert(module.Name, insertationPoint); OT oT = new OT(ot, moduleList); Placement pm = oT.Placement; //Choose the one with the minimum perimeter. if (pm.Perimeter < minPerimeter) { finalOT = oT; bestOTree = ot; minPerimeter = pm.Perimeter; } } oTree = bestOTree; } return finalOT.Placement; }
/// <summary> /// 设计器支持所需的方法 - 不要 /// 使用代码编辑器修改此方法的内容。 /// </summary> private void InitializeComponent() { xap.rui.control.tree.options.FocusOptions focusOptions1 = new xap.rui.control.tree.options.FocusOptions(); this.otree = new xap.rui.control.tree.otree.OTree(); this.treeView1 = new System.Windows.Forms.TreeView(); this.SuspendLayout(); // // otree // //this.otree.ActiveRender = null; //this.otree.AutoScaleDimensions = new System.Drawing.SizeF(0F, 0F); //this.otree.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; //this.otree.AutoValidate = System.Windows.Forms.AutoValidate.Disable; this.otree.BackColor = System.Drawing.Color.White; this.otree.Dock = System.Windows.Forms.DockStyle.Fill; focusOptions1.NodeFocusOnRefresh = xap.rui.control.tree.options.FocusOnRefreshMode.KeepFocus; this.otree.FocusOption = focusOptions1; this.otree.Location = new System.Drawing.Point(0, 0); this.otree.Name = "otree"; this.otree.ShowCheckBox = false; this.otree.Size = new System.Drawing.Size(290, 166); this.otree.TabIndex = 0; // // treeView1 // this.treeView1.LineColor = System.Drawing.Color.Empty; this.treeView1.Location = new System.Drawing.Point(0, 0); this.treeView1.Name = "treeView1"; this.treeView1.Size = new System.Drawing.Size(121, 97); this.treeView1.TabIndex = 0; // // LabDateTree // //this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.Controls.Add(this.otree); this.ResumeLayout(false); }
/// <summary> /// Algoritms class for O-Tree representation. /// </summary> /// <param name="ot">The O-tree code which describes the placement.</param> /// <param name="_modules">Modules to be packed.</param> public OT(OTree ot, List<Module> _modules) { oTree = ot; modules = _modules.ToDictionary(item => item.Name, item => item); placement = null; }
/// <summary> /// Algoritms class for O-Tree representation. /// </summary> /// <param name="ot">The O-tree code which describes the placement.</param> /// <param name="_modules">Modules to be packed.</param> public OT(OTree ot, List <Module> _modules) { oTree = ot; modules = _modules.ToDictionary(item => item.Name, item => item); placement = null; }