Beispiel #1
0
        /// <summary>
        /// Adds a new, colored curve to the display list.
        /// The curve will be duplicated so changes to the
        /// original will not affect the display.
        /// </summary>
        /// <param name="curve">Curve to add.</param>
        /// <param name="color">Color of curve.</param>
        /// <param name="thickness">Thickness of curve.</param>
        public void AddCurve(Curve curve, Color color, int thickness)
        {
            if (m_disposed)
            {
                throw new ObjectDisposedException("This CustomDisplay instance has been disposed and cannot be modified");
            }
            if (curve == null)
            {
                return;
            }
            if (!curve.IsValid)
            {
                return;
            }

            CDU_Curve cdu = new CDU_Curve();

            cdu.m_curve     = curve.DuplicateCurve();
            cdu.m_color     = Color.FromArgb(255, color);
            cdu.m_thickness = thickness;

            m_curves.Add(cdu);
            m_clip.Union(cdu.m_curve.GetBoundingBox(false));
        }
    /// <summary>
    /// Adds a new, colored curve to the display list.
    /// The curve will be duplicated so changes to the 
    /// original will not affect the display.
    /// </summary>
    /// <param name="curve">Curve to add.</param>
    /// <param name="color">Color of curve.</param>
    /// <param name="thickness">Thickness of curve.</param>
    public void AddCurve(Curve curve, Color color, int thickness)
    {
      if (m_disposed) { throw new ObjectDisposedException("This CustomDisplay instance has been disposed and cannot be modified"); }
      if (curve == null) { return; }
      if (!curve.IsValid) { return; }

      CDU_Curve cdu = new CDU_Curve();
      cdu.m_curve = curve.DuplicateCurve();
      cdu.m_color = Color.FromArgb(255, color);
      cdu.m_thickness = thickness;

      m_curves.Add(cdu);
      m_clip.Union(cdu.m_curve.GetBoundingBox(false));
    }