Пример #1
0
        /// <summary>
        /// Adds a new, colored 3D text object to the display list.
        /// </summary>
        /// <param name="text">Text to add.</param>
        /// <param name="plane">Plane for text orientation.</param>
        /// <param name="size">Height (in units) of font.</param>
        /// <param name="color">Color of text.</param>
        public void AddText(string text, Plane plane, double size, Color color)
        {
            if (m_disposed)
            {
                throw new ObjectDisposedException("This CustomDisplay instance has been disposed and cannot be modified");
            }
            if (text == null)
            {
                return;
            }
            if (text.Length == 0)
            {
                return;
            }
            if (!plane.IsValid)
            {
                return;
            }
            if (size <= 0.9)
            {
                return;
            }

            CDU_Text cdu = new CDU_Text();

            cdu.m_color       = Color.FromArgb(255, color);
            cdu.m_text        = new Text3d(text, plane, size);
            cdu.m_text.Bold   = false;
            cdu.m_text.Italic = false;

            m_text.Add(cdu);
            m_clip.Union(cdu.m_text.BoundingBox);
        }
Пример #2
0
        /// <summary>
        ///  Adds a new 3D text object to the display list.
        /// </summary>
        /// <param name="text">Text object to add.</param>
        /// <param name="color">Color of text object.</param>
        public void AddText(Text3d text, Color color)
        {
            if (m_disposed)
            {
                throw new ObjectDisposedException("This CustomDisplay instance has been disposed and cannot be modified");
            }
            if (text == null)
            {
                return;
            }

            CDU_Text cdu = new CDU_Text();

            cdu.m_color         = Color.FromArgb(255, color);
            cdu.m_text          = new Text3d(text.Text, text.TextPlane, text.Height);
            cdu.m_text.Bold     = text.Bold;
            cdu.m_text.Italic   = text.Italic;
            cdu.m_text.FontFace = text.FontFace;

            m_text.Add(cdu);
            m_clip.Union(text.BoundingBox);
        }
    /// <summary>
    ///  Adds a new 3D text object to the display list.
    /// </summary>
    /// <param name="text">Text object to add.</param>
    /// <param name="color">Color of text object.</param>
    public void AddText(Text3d text, Color color)
    {
      if (m_disposed) { throw new ObjectDisposedException("This CustomDisplay instance has been disposed and cannot be modified"); }
      if (text == null) { return; }

      CDU_Text cdu = new CDU_Text();
      cdu.m_color = Color.FromArgb(255, color);
      cdu.m_text = new Text3d(text.Text, text.TextPlane, text.Height);
      cdu.m_text.Bold = text.Bold;
      cdu.m_text.Italic = text.Italic;
      cdu.m_text.FontFace = text.FontFace;

      m_text.Add(cdu);
      m_clip.Union(text.BoundingBox);
    }
    /// <summary>
    /// Adds a new, colored 3D text object to the display list.
    /// </summary>
    /// <param name="text">Text to add.</param>
    /// <param name="plane">Plane for text orientation.</param>
    /// <param name="size">Height (in units) of font.</param>
    /// <param name="color">Color of text.</param>
    public void AddText(string text, Plane plane, double size, Color color)
    {
      if (m_disposed) { throw new ObjectDisposedException("This CustomDisplay instance has been disposed and cannot be modified"); }
      if (text == null) { return; }
      if (text.Length == 0) { return; }
      if (!plane.IsValid) { return; }
      if (size <= 0.9) { return; }

      CDU_Text cdu = new CDU_Text();
      cdu.m_color = Color.FromArgb(255, color);
      cdu.m_text = new Text3d(text, plane, size);
      cdu.m_text.Bold = false;
      cdu.m_text.Italic = false;

      m_text.Add(cdu);
      m_clip.Union(cdu.m_text.BoundingBox);
    }