/// <summary> /// /// </summary> /// <param name="drawCmd"></param> public void SetTarget(IDrawCommand drawCmd) { if (drawCmd == null) { throw new ArgumentNullException(); } this.controller = drawCmd.CreateController(); UpdateUI(this.controller); this.Text = string.Format("{0}", this.controller); }
/// <summary> /// /// </summary> /// <param name="indexBuffer"></param> public void SetTarget(IndexBuffer indexBuffer) { if (indexBuffer == null) { throw new ArgumentNullException(); } this.controller = indexBuffer.CreateController(); UpdateUI(this.controller); this.Text = string.Format("{0}", this.controller); }
private void UpdateUI(IndexBufferController drawCmdController) { int index = -1; foreach (object item in this.cmbDrawMode.Items) { index++; if ((DrawMode)item == drawCmdController.DrawCmd.Mode) { this.cmbDrawMode.SelectedIndex = index; break; } } if (drawCmdController is ZeroIndexBufferController) { this.lblFirst.Text = "First Vertex:"; this.lblCount.Text = "Vertex Count:"; this.trackFirst.Minimum = 0; this.trackFirst.Maximum = drawCmdController.OriginalCount(); this.trackFirst.Value = drawCmdController.First(); this.trackCount.Minimum = 0; this.trackCount.Maximum = drawCmdController.OriginalCount(); this.trackCount.Value = drawCmdController.Count(); this.lblFirstValue.Text = this.trackFirst.Value.ToString(); this.lblCountValue.Text = this.trackCount.Value.ToString(); this.Text = string.Format("{0}", this.controller); } else if (drawCmdController is OneIndexBufferController) { this.lblFirst.Text = "First Index:"; this.lblCount.Text = "Element Count:"; this.trackFirst.Minimum = 0; this.trackFirst.Maximum = drawCmdController.OriginalCount(); this.trackFirst.Value = drawCmdController.First(); this.trackCount.Minimum = 0; this.trackCount.Maximum = drawCmdController.OriginalCount(); this.trackCount.Value = drawCmdController.Count(); this.lblFirstValue.Text = this.trackFirst.Value.ToString(); this.lblCountValue.Text = this.trackCount.Value.ToString(); } else { throw new Exception("Unexpected IndexBuffer type!"); } }