/// <summary> /// Do any command-specific drawing. /// </summary> /// <param name="point">The specific point (if any) that the parent window has drawn.</param> internal override void Paint(PointFeature point) { HighlightStyle style = new HighlightStyle(); if (m_Orient != null) { style.ShowLineEndPoints = false; m_Orient.Render(ActiveDisplay, style); } if (m_IsAutoPos && m_Polygon!=null) { if (m_AutoPosition==null) m_AutoPosition = m_Polygon.GetLabelPosition(Width, Height); DrawText(m_AutoPosition); } else base.Paint(point); if (IsValidPolygon()) { m_Polygon.Render(ActiveDisplay, style); // If the polygon actually contains a label that is drawn on the current editing // layer, take this opportunity to draw it in gray. TextFeature label = m_Polygon.Label; if (label!=null) label.Draw(ActiveDisplay, Color.Gray); } }
/// <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 }); } }
/// <summary> /// Draws the limit line (if it contains at least 2 positions) /// </summary> /// <param name="display">The display to draw to</param> internal void Render(ISpatialDisplay display) { if (m_Limit==null || m_Limit.Count==0 || m_Mouse==null) return; // Draw dotted line from the last point on the limit line to the last known mouse position int lastIndex = m_Limit.Count-1; IPosition last = m_Limit[lastIndex]; DottedStyle dottedLine = new DottedStyle(Color.Gray); dottedLine.Render(display, new IPosition[] { last, m_Mouse }); // If we have two or more positions, draw an additional dotted line to the start of // the limit line. if (m_Limit.Count>=2) dottedLine.Render(display, new IPosition[] { m_Mouse, m_Limit[0] }); // Draw the limit line if (m_Limit.Count>1) dottedLine.Render(display, m_Limit.ToArray()); // Draw any limit line selection if (m_LimSel.Count>0) { HighlightStyle style = new HighlightStyle(); style.ShowLineEndPoints = false; new SpatialSelection(m_LimSel).Render(display, style); } }
/// <summary> /// Highlights a line. /// </summary> /// <param name="line">The line to highlight</param> void Highlight(LineFeature line) { ISpatialDisplay display = ActiveDisplay; // Create thick pen (we want a line that is 1mm wide, corresponding // to the pick aperture). DrawStyle style = new HighlightStyle(); style.LineColor = m_LineColor; double scale = display.MapScale; float pxwid = display.LengthToDisplay(scale*0.001); style.Pen.Width = pxwid; // Do the draw line.Render(display, style); }