Пример #1
0
        /// <summary>
        /// Adds a new, colored vector to the display list.
        /// </summary>
        /// <param name="anchor">Anchor point of vector.</param>
        /// <param name="span">Direction and magnitude of vector.</param>
        /// <param name="color">Color of vector.</param>
        /// <param name="drawAnchor">Include a point at the vector anchor.</param>
        public void AddVector(Point3d anchor, Vector3d span, Color color, bool drawAnchor)
        {
            if (m_disposed)
            {
                throw new ObjectDisposedException("This CustomDisplay instance has been disposed and cannot be modified");
            }
            if (!anchor.IsValid)
            {
                return;
            }
            if (!span.IsValid)
            {
                return;
            }

            CDU_Vector cdu = new CDU_Vector();

            cdu.m_span   = new Line(anchor, span);
            cdu.m_color  = Color.FromArgb(255, color);
            cdu.m_anchor = drawAnchor;

            m_vectors.Add(cdu);
            m_clip.Union(cdu.m_span.BoundingBox);
        }
    /// <summary>
    /// Adds a new, colored vector to the display list.
    /// </summary>
    /// <param name="anchor">Anchor point of vector.</param>
    /// <param name="span">Direction and magnitude of vector.</param>
    /// <param name="color">Color of vector.</param>
    /// <param name="drawAnchor">Include a point at the vector anchor.</param>
    public void AddVector(Point3d anchor, Vector3d span, Color color, bool drawAnchor)
    {
      if (m_disposed) { throw new ObjectDisposedException("This CustomDisplay instance has been disposed and cannot be modified"); }
      if (!anchor.IsValid) { return; }
      if (!span.IsValid) { return; }

      CDU_Vector cdu = new CDU_Vector();
      cdu.m_span = new Line(anchor, span);
      cdu.m_color = Color.FromArgb(255, color);
      cdu.m_anchor = drawAnchor;

      m_vectors.Add(cdu);
      m_clip.Union(cdu.m_span.BoundingBox);
    }