/// <summary>
        /// Draws the new line based on currently entered data. This is called by the
        /// <c>base.Paint</c> method.
        /// </summary>
        /// <param name="display">The display to draw to</param>
        /// <param name="style">The drawing style</param>
        internal override void RenderGeometry(ISpatialDisplay display, IDrawStyle style)
        {
            // The supplied style is a solid magenta line, which doesn't show up well
            // on top of a dotted magenta circle. So make it a bit thicker.

            if (m_Geom!=null)
            {
                DrawStyle thickStyle = new DrawStyle(style.LineColor);
                thickStyle.Pen.Width = 3.0f;
                m_Geom.Render(display, thickStyle);
            }
        }
示例#2
0
 /// <summary>
 /// Draws the checked item in a way that highlights it during a check review.
 /// For polygons that are small, this draws the perimeter in orange. This helps
 /// to identify polygons that are actually unclosed lines or networks.
 /// </summary>
 /// <param name="display">The display to draw to</param>
 internal override void HighlightCheckedItem(ISpatialDisplay display)
 {
     if ((Types & CheckType.SmallPolygon)!=0)
     {
         IDrawStyle style = new DrawStyle(Color.Orange);
         m_Ring.RenderOutline(display, style);
     }
 }
 internal IDrawStyle Style(HatchStyle hs, Color foreColor, Color backColor)
 {
     DrawStyle result = new DrawStyle();
     result.Fill = new Fill(hs, foreColor, backColor);
     InitializeDrawStyle(result);
     return result;
 }
        /// <summary>
        /// Draws the circular arcs that are suitable for the next pointing operation.
        /// As dotted lines. This is based on the list of circles that are associated
        /// with the last point that was specified.
        /// </summary>
        void DrawCurves()
        {
            // Use the circles associated with the last point entered (once the
            // 2nd point has been defined, that's the one we always use).

            Circle[] circles = (m_Point2!=null ? m_Cir2 : m_Cir1);
            if (circles==null)
                return;

            // Highlight the arcs associated with each circle

            ISpatialDisplay display = EditingController.Current.ActiveDisplay;
            IDrawStyle dottedBlack = new DottedStyle(Color.Black);
            IDrawStyle white = new DrawStyle(Color.White);

            foreach(Circle c in circles)
            {
                foreach(ArcFeature arc in c.Arcs)
                {
                    if (!arc.IsInactive)
                    {
                        arc.Render(display, white);
                        arc.Render(display, dottedBlack);
                    }
                }
            }
        }
        internal override void Draw()
        {
            ISpatialDisplay display = EditingController.Current.ActiveDisplay;

            // Redraw the arcs that are suitable for the next pointing operation.
            DrawCurves();

            // Draw a solid line to represent displayed distance (if any)
            if (m_CurrentDistanceArc!=null)
            {
                DrawStyle style = new DrawStyle(Color.Magenta);
                style.Pen.Width = 3.0F;
                style.Render(display, m_CurrentDistanceArc);
            }

            // Draw the points.
            if (m_Point1!=null)
                m_Point1.Draw(display, InverseColors[0]);

            if (m_Point2!=null)
                m_Point2.Draw(display, InverseColors[1]);
        }
示例#6
0
        /// <summary>
        /// Does any painting that this dialog does.
        /// </summary>
        /// <param name="display">The display to draw to</param>
        internal void Render(ISpatialDisplay display)
        {
            // Draw the original path (in pale gray)
            IDrawStyle gray = new DrawStyle(Color.LightGray);
            m_pop.Render(display, gray, true);

            // Draw the current path (in magenta).
            PathInfo p = new PathInfo(m_pop.StartPoint, m_pop.EndPoint, GetLegs());
            p.Render(display);

            // Highlight the currently selected line.
            int index = distancesListBox.SelectedIndex;
            if (index >= 0 && index < m_FaceSections.Length)
            {
                IDrawStyle style = new HighlightStyle();
                ILineGeometry geom = m_FaceSections[index];
                if (geom is IClockwiseCircularArcGeometry)
                    style.Render(display, (IClockwiseCircularArcGeometry)geom);
                else
                    style.Render(display, new IPosition[] { geom.Start, geom.End });
            }
        }
示例#7
0
        /// <summary>
        /// Draws the text that is currently being added, together with a rectangle representing
        /// the outline of the label.
        /// </summary>
        /// <param name="refpos">Reference position for the label</param>
        protected void DrawText(IPosition refpos)
        {
            if (refpos==null)
                return;

            // Draw the outline of the label.
            IPosition[] outline = GetOutline(refpos);
            IDrawStyle style = new DrawStyle(); // black
            style.Render(ActiveDisplay, outline);

            // Draw the text
            PointGeometry p = PointGeometry.Create(refpos);
            IFont font = (m_Entity==null ? null : m_Entity.Font);
            MiscTextGeometry text = new MiscTextGeometry(m_Text, p, font, m_Height, m_Width, (float)m_Rotation);
            style.Render(ActiveDisplay, text);

            // If doing auto-angle stuff, draw an additional line
            // at the position used to search for candidate lines
            // ... perhaps (the auto-angle stuff needs to move to
            // this class from CuiNewLabel)

            // Remember the specified position as the "last" position.
            m_LastPos = refpos;
        }
示例#8
0
 /// <summary>
 /// Draws a representation of the internal structure of this index, for
 /// use in experimentation.
 /// </summary>
 /// <param name="display">The display to draw to</param>
 public void Draw(ISpatialDisplay display)
 {
     DrawStyle style = new DrawStyle();
     style.Pen.Color = System.Drawing.Color.Crimson;
     //m_Points.Render(display, style);
     //m_Lines.Render(display, style, 0);
     m_Polygons.Render(display, style);
 }