Esempio n. 1
0
 private void UpdateUI(IndexBufferPtrController indexBufferPtrController)
 {
     if (indexBufferPtrController is ZeroIndexBufferPtrController)
     {
         this.lblFirst.Text      = "First Vertex:";
         this.lblCount.Text      = "Vertex Count:";
         this.trackFirst.Minimum = 0;
         this.trackFirst.Maximum = indexBufferPtrController.Count();
         this.trackFirst.Value   = indexBufferPtrController.First();
         this.trackCount.Minimum = 0;
         this.trackCount.Maximum = indexBufferPtrController.Count();
         this.trackCount.Value   = indexBufferPtrController.Count();
         this.lblFirstValue.Text = this.trackFirst.Value.ToString();
         this.lblCountValue.Text = this.trackCount.Value.ToString();
         this.Text = string.Format("{0}", this.controller);
     }
     else if (indexBufferPtrController is OneIndexBufferPtrController)
     {
         this.lblFirst.Text      = "First Index:";
         this.lblCount.Text      = "Element Count:";
         this.trackFirst.Minimum = 0;
         this.trackFirst.Maximum = indexBufferPtrController.Count();
         this.trackFirst.Value   = indexBufferPtrController.First();
         this.trackCount.Minimum = 0;
         this.trackCount.Maximum = indexBufferPtrController.Count();
         this.trackCount.Value   = indexBufferPtrController.Count();
         this.lblFirstValue.Text = this.trackFirst.Value.ToString();
         this.lblCountValue.Text = this.trackCount.Value.ToString();
     }
     else
     {
         throw new NotImplementedException();
     }
 }
Esempio n. 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="indexBufferPtr"></param>
        public void SetTarget(IndexBufferPtr indexBufferPtr)
        {
            if (indexBufferPtr == null)
            {
                throw new ArgumentNullException();
            }

            this.controller = indexBufferPtr.CreateController();

            UpdateUI(this.controller);

            this.Text = string.Format("{0}", this.controller);
        }
Esempio n. 3
0
        private void UpdateUI(IndexBufferPtrController indexBufferPtrController)
        {
            int index = -1;

            foreach (var item in this.cmbDrawMode.Items)
            {
                index++;
                if ((DrawMode)item == indexBufferPtrController.IndexBufferPtr.Mode)
                {
                    this.cmbDrawMode.SelectedIndex = index;
                    break;
                }
            }

            if (indexBufferPtrController is ZeroIndexBufferPtrController)
            {
                this.lblFirst.Text      = "First Vertex:";
                this.lblCount.Text      = "Vertex Count:";
                this.trackFirst.Minimum = 0;
                this.trackFirst.Maximum = indexBufferPtrController.OriginalCount();
                this.trackFirst.Value   = indexBufferPtrController.First();
                this.trackCount.Minimum = 0;
                this.trackCount.Maximum = indexBufferPtrController.OriginalCount();
                this.trackCount.Value   = indexBufferPtrController.Count();
                this.lblFirstValue.Text = this.trackFirst.Value.ToString();
                this.lblCountValue.Text = this.trackCount.Value.ToString();
                this.Text = string.Format("{0}", this.controller);
            }
            else if (indexBufferPtrController is OneIndexBufferPtrController)
            {
                this.lblFirst.Text      = "First Index:";
                this.lblCount.Text      = "Element Count:";
                this.trackFirst.Minimum = 0;
                this.trackFirst.Maximum = indexBufferPtrController.OriginalCount();
                this.trackFirst.Value   = indexBufferPtrController.First();
                this.trackCount.Minimum = 0;
                this.trackCount.Maximum = indexBufferPtrController.OriginalCount();
                this.trackCount.Value   = indexBufferPtrController.Count();
                this.lblFirstValue.Text = this.trackFirst.Value.ToString();
                this.lblCountValue.Text = this.trackCount.Value.ToString();
            }
            else
            {
                throw new NotImplementedException();
            }
        }