示例#1
0
        /// <summary>
        /// Adds a polygon to the drawing list. Polygons are not like Hatches, when you supply a concave
        /// polygon, the shading probably won't work.
        /// </summary>
        /// <param name="polygon">Points that define the corners of the polygon.</param>
        /// <param name="fillColor">Fill color of polygon.</param>
        /// <param name="edgeColor">Edge color of polygon.</param>
        /// <param name="drawFill">If true, the polygon contents will be drawn.</param>
        /// <param name="drawEdge">If true, the polygon edge will be drawn.</param>
        public void AddPolygon(IEnumerable <Point3d> polygon, Color fillColor, Color edgeColor, bool drawFill, bool drawEdge)
        {
            if (m_disposed)
            {
                throw new ObjectDisposedException("This CustomDisplay instance has been disposed and cannot be modified");
            }
            if (polygon == null)
            {
                return;
            }
            Polyline pgon = new Polyline(polygon);

            CDU_Polygon cdu = new CDU_Polygon();

            cdu.m_polygon    = pgon;
            cdu.m_color_fill = fillColor;
            cdu.m_color_edge = edgeColor;
            cdu.m_draw_fill  = drawFill;
            cdu.m_draw_edge  = drawEdge;

            m_polygons.Add(cdu);
            m_clip.Union(pgon.BoundingBox);
        }
    /// <summary>
    /// Adds a polygon to the drawing list. Polygons are not like Hatches, when you supply a concave 
    /// polygon, the shading probably won't work.
    /// </summary>
    /// <param name="polygon">Points that define the corners of the polygon.</param>
    /// <param name="fillColor">Fill color of polygon.</param>
    /// <param name="edgeColor">Edge color of polygon.</param>
    /// <param name="drawFill">If true, the polygon contents will be drawn.</param>
    /// <param name="drawEdge">If true, the polygon edge will be drawn.</param>
    public void AddPolygon(IEnumerable<Point3d> polygon, Color fillColor, Color edgeColor, bool drawFill, bool drawEdge)
    {
      if (m_disposed) { throw new ObjectDisposedException("This CustomDisplay instance has been disposed and cannot be modified"); }
      if (polygon == null) { return; }
      Polyline pgon = new Polyline(polygon);

      CDU_Polygon cdu = new CDU_Polygon();
      cdu.m_polygon = pgon;
      cdu.m_color_fill = fillColor;
      cdu.m_color_edge = edgeColor;
      cdu.m_draw_fill = drawFill;
      cdu.m_draw_edge = drawEdge;

      m_polygons.Add(cdu);
      m_clip.Union(pgon.BoundingBox);
    }