/// <summary> /// Renders the geometry for the spans along a leg. /// </summary> /// <param name="display">The display to draw to</param> /// <param name="spans">Information about each observed span</param> /// <param name="sections">The geometry that corresponds to each span</param> void DrawSpans(ISpatialDisplay display, SpanInfo[] spans, ILineGeometry[] sections) { Debug.Assert(spans.Length == sections.Length); IDrawStyle solidStyle = EditingController.Current.Style(Color.Magenta); IDrawStyle dottedStyle = new DottedStyle(Color.Magenta); for (int i = 0; i < spans.Length; i++) { ILineGeometry geom = sections[i]; IDrawStyle style = (spans[i].HasLine ? solidStyle : dottedStyle); if (geom is IClockwiseCircularArcGeometry) { style.Render(display, (IClockwiseCircularArcGeometry)geom); } else { style.Render(display, new IPosition[] { geom.Start, geom.End }); } if (spans[i].HasEndPoint) { solidStyle.Render(display, geom.End); } } }
internal void Draw() { // Highlight the line we are subdividing ISpatialDisplay draw = m_Cmd.ActiveDisplay; //IDrawStyle style = EditingController.Current.HighlightStyle; //m_Line.Render(draw, style); // Draw the points (except for the last one, which should // correspond with either the start or the end of the line // we are subdividing). List <IPosition> pts = Calculate(); if (pts != null) { IDrawStyle style = EditingController.Current.Style(Color.Magenta); for (int i = 0; i < pts.Count - 1; i++) { style.Render(draw, pts[i]); } } DistanceUnit entryUnit = EditingController.Current.EntryUnit; double tot = GetTotalDistance(); string s = (tot < Double.Epsilon ? String.Empty : entryUnit.Format(tot)); totalEnteredTextBox.Text = s; s = (tot < Double.Epsilon ? String.Empty : entryUnit.Format(m_GroundLength - tot)); lengthLeftTextBox.Text = s; }
/// <summary> /// Draws this control point on the specified display. /// </summary> /// <param name="display">The display to draw to</param> /// <param name="style">The style for the drawing</param> internal void Render(ISpatialDisplay display, IDrawStyle style) { if (IsDefined) { style.RenderTriangle(display, this); } }
/// <summary> /// Draws the new line based on currently entered data /// </summary> /// <param name="display">The display to draw to</param> /// <param name="style">The drawing style</param> internal virtual void RenderGeometry(ISpatialDisplay display, IDrawStyle style) { if (m_Start != null && m_End != null) { style.Render(display, new IPosition[] { m_Start, m_End }); } }
internal override void Paint(PointFeature point) { ISpatialDisplay display = ActiveDisplay; IDrawStyle style = Controller.DrawStyle; style.FillColor = style.LineColor = Color.Magenta; if (m_CurrentPoint != null) { style.Render(display, m_CurrentPoint); } if (m_Start != null && m_End != null) { RenderGeometry(display, style); EditingController ec = EditingController.Current; if (ec.Project.Settings.AreIntersectionsDrawn && ArePointsDrawn() && AddingTopology()) { // The intersect geometry could be null when starting to add a new // circular arc LineGeometry line = GetIntersectGeometry(); if (line != null) { IntersectionFinder xf = new IntersectionFinder(line, false); style.FillColor = Color.Transparent; xf.Render(display, style); } } } }
public override void Render(ISpatialDisplay display, IDrawStyle style) { if (!IsTrimPoint()) { m_Geom.Render(display, style); } }
/// <summary> /// Draws this object on the specified display /// </summary> /// <param name="display">The display to draw to</param> /// <param name="style">The drawing style</param> public virtual void Render(ISpatialDisplay display, IDrawStyle style) { if (m_Geometry is NTS.Polygon) { NTS.Polygon p = (NTS.Polygon)m_Geometry; NTS.LineString edge = p.ExteriorRing; NTS.LineString[] holes = p.InteriorRings; IPosition[][] outlines = new IPosition[1 + holes.Length][]; outlines[0] = GetPositionArray(edge.Coordinates); for (int i = 0; i < holes.Length; i++) { outlines[i + 1] = GetPositionArray(holes[i].Coordinates); } foreach (IPosition[] pa in outlines) { style.Render(display, pa); } if (style is HighlightStyle) { style.Render(display, outlines); } } else { style.Render(display, PositionArray); } }
/// <summary> /// Instantiates an instance of the SolidBlock class from a reference block. /// </summary> /// <param name="block">The block to use as a reference</param> public SolidBlock(Block block) { this.block = block; this.constructStyle = new SolidBlockImages(block); constructStyle.ConstructBlock(); this.drawStyle = new DrawFrom2ImageArray(((SolidBlockImages)constructStyle).Images, block); } // end constructor method SolidBlock
/// <summary> /// Draws the outline of all child nodes (if the child is also an /// instance of <see cref="IndexNode"/>, this will just cause further /// drilldown - something will only get drawn if the child is an /// instance of some other class). /// </summary> /// <param name="display">The display to draw to.</param> /// <param name="style">The style for the draw.</param> internal override void Render(ISpatialDisplay display, IDrawStyle style) { foreach (Node n in m_Children) { n.Render(display, style); } }
internal override void OnDraw(PointFeature point) { getDistance1.OnDrawAll(); getDistance2.OnDrawAll(); if (intersectInfo.Visible) { intersectInfo.OnDraw(); IPosition x = intersectInfo.Intersection; if (x != null) { ISpatialDisplay display = GetCommand().ActiveDisplay; IDrawStyle style = EditingController.Current.Style(Color.Magenta); if (getDistance1.LineType != null) { PointFeature p = getDistance1.From; style.Render(display, new IPosition[] { p, x }); } if (getDistance2.LineType != null) { PointFeature p = getDistance2.From; style.Render(display, new IPosition[] { p, x }); } } } }
void Initialize(IFont font, string text, IDrawStyle drawStyle = null, int? destX = null, int? destY = null) { if (drawStyle != null) ChangeDrawStyle(drawStyle, false); else if (this.drawStyle == null) ChangeDrawStyle(new DrawStyle(), false); if (destX != null) DrawX = destX.Value; if (destY != null) DrawY = destY.Value; if (font != null) { this.font = font; this.drawStyle.LineHeight = font.Info.LineHeight.Ceiling(); } originalGlyphs = new IGlyph[(text + "").Length]; for (int i = 0; i < originalGlyphs.Count; i++) originalGlyphs[i] = font.GetGlyph(text[i]); Changed = true; ID = Factory.NewID(Name); }
/// <summary> /// Draws this feature on a specific map display. Not intended for bulk draws, since /// it creates a drawing style object on each call. /// </summary> /// <param name="display">The display to draw to</param> /// <param name="col">The colour to use for the draw</param> public void Draw(ISpatialDisplay display, Color col) { IDrawStyle style = EditingController.Current.DrawStyle; style.LineColor = style.FillColor = col; Render(display, style); }
/// <summary> /// Draws this polygon with the supplied style (usually a hatched fill). /// </summary> /// <param name="display">The display to draw to</param> /// <param name="style">The drawing style</param> public override void Render(ISpatialDisplay display, IDrawStyle style) { // For any circular arcs, we will need to determine a suitable // arc tolerance, based on the current draw scale. Try 0.1mm at scale. ILength curvetol = new Length(0.0001 * display.MapScale); List <IPosition[]> outlines = new List <IPosition[]>(1 + IslandCount); // Grab the fill outline for this polygon. List <IDivider[]> edges = GetSimpleEdges(); foreach (IDivider[] da in edges) { outlines.Add(GetOutline(curvetol, this, da)); } // Now do any islands (but ignore any that don't overlap the display window) if (m_Islands != null) { IWindow drawExtent = display.Extent; foreach (Island i in m_Islands) { if (i.Extent.IsOverlap(drawExtent)) { outlines.Add(i.GetOutline(curvetol)); } } } style.Render(display, outlines.ToArray()); }
public void Draw(ISpatialDisplay display, HatchStyle hs, Color foreColor) { IDrawStyle style = EditingController.Current.DrawStyle; style.Fill = new Fill(hs, foreColor, display.MapPanel.BackColor); Render(display, style); }
/// <summary> /// Paints out those results that no longer apply. /// </summary> /// <param name="display">The display to draw to</param> /// <param name="style">The style for the drawing</param> /// <param name="newTypes">The new results</param> internal override void PaintOut(ISpatialDisplay display, IDrawStyle style, CheckType newTypes) { IPosition p = this.Place; double shift = IconSize(display); CheckType oldTypes = Types; if (IsPaintOut(CheckType.SmallPolygon, oldTypes, newTypes)) { p = new Position(p.X - shift, p.Y); AddPaintOut(p, Resources.CheckSmallPolygonIcon); // And shift a bit more in case we draw more. p = new Position(p.X - shift, p.Y); } if (IsPaintOut(CheckType.NotEnclosed, oldTypes, newTypes)) { AddPaintOut(p, Resources.CheckNotEnclosedIcon); } if (IsPaintOut(CheckType.NoLabel, oldTypes, newTypes)) { if ((oldTypes & CheckType.SmallPolygon) == 0) { p = new Position(p.X - shift / 2, p.Y + shift / 2); } AddPaintOut(p, Resources.CheckNoLabelIcon); } }
/// <summary> /// Redraws any control points. /// </summary> /// <param name="display">The display to draw to</param> /// <param name="style">The style for the drawing</param> internal void Render(ISpatialDisplay display, IDrawStyle style) { foreach (ControlRange r in m_Ranges) { r.Render(display, style); } }
internal IDrawStyle Style(Color c) { IDrawStyle result = InitializeDrawStyle(base.DrawStyle); result.LineColor = result.FillColor = c; return(result); }
/// <summary> /// Draws the content of this selection /// </summary> /// <param name="display">The display to draw to</param> /// <param name="style">The drawing style to use</param> public virtual void Render(ISpatialDisplay display, IDrawStyle style) { foreach (ISpatialObject item in m_Items) { item.Render(display, style); } }
/// <summary> /// Instantiates an instance of the FadedBlock class from a reference block. /// </summary> /// <param name="block">The block to use as a reference</param> public FadedBlock(Block block) { this.block = block; this.constructStyle = new FadedBlockImages(block); constructStyle.ConstructBlock(); this.drawStyle = new DrawFromMultiImageArray(((FadedBlockImages)constructStyle).Images, block); } // end constructor method FadedBlock
/// <summary> /// Draws intersections on the specified display /// </summary> /// <param name="display">The display to draw to</param> /// <param name="style">The drawing style</param> internal void Render(ISpatialDisplay display, IDrawStyle style) { foreach (IntersectionResult r in m_Intersects) { r.Render(display, style); } }
/// <summary> /// Paints out those results that no longer apply. /// </summary> /// <param name="display">The display to draw to</param> /// <param name="style">The style for the drawing</param> /// <param name="newTypes">The new results</param> internal override void PaintOut(ISpatialDisplay display, IDrawStyle style, CheckType newTypes) { // Get the reference position last used to paint stuff IPosition p = this.Place; double shift = GetIconSpacing(display); p = new Position(p.X - shift, p.Y); CheckType oldTypes = Types; if (IsPaintOut(CheckType.NoPolygonForLabel, oldTypes, newTypes)) { AddPaintOut(p, Resources.CheckNoPolygonForLabelIcon); p = new Position(p.X - shift, p.Y); } if (IsPaintOut(CheckType.NoAttributes, oldTypes, newTypes)) { AddPaintOut(p, Resources.CheckNoAttributesIcon); p = new Position(p.X - shift, p.Y); } if (IsPaintOut(CheckType.MultiLabel, oldTypes, newTypes)) { AddPaintOut(p, Resources.CheckMultiLabelIcon); p = new Position(p.X - shift, p.Y); } }
internal void Draw() { ISpatialDisplay display = m_Cmd.ActiveDisplay; // If we're doing an update, draw the original split point in grey. SimpleLineSubdivisionOperation pop = UpdateOp; if (pop != null) { PointFeature point = pop.NewPoint; if (point != null) { point.Draw(display, Color.Gray); } } // Ensure the line that's being subdivided is still highlighted IDrawStyle style = EditingController.Current.HighlightStyle; m_Line.Render(display, style); // Calculate the position of the split point. IPosition splitpos = SimpleLineSubdivisionOperation.Calculate(m_Line, m_Length, m_IsFromEnd); if (splitpos != null) { style = EditingController.Current.Style(Color.Magenta); style.Render(display, splitpos); } }
/// <summary> /// Draws intersection points /// </summary> /// <param name="display">The display to draw to</param> internal void DrawIntersections(ISpatialDisplay display) { IDrawStyle style = EditingController.Current.DrawStyle; style.FillColor = Color.Transparent; new DrawQuery(m_ExtraData, display, style, SpatialType.Point); }
/// <summary> /// Draws intersections on the specified display /// </summary> /// <param name="display">The display to draw to</param> /// <param name="style">The drawing style</param> internal void Render(ISpatialDisplay display, IDrawStyle style) { foreach (IntersectionData d in m_Data) { d.Render(display, style); } }
/// <summary> /// Do any drawing that is specific to the current update. /// </summary> void Draw() { // Get the operation associated with the update feature (or // the current problem op) Operation op = GetOp(); if (op == null) { return; } // Draw the features that were created by the operation that created the feature // selected for update. ISpatialDisplay display = ActiveDisplay; IDrawStyle style = Controller.Style(Color.Magenta); style.IsFixed = true; op.Render(display, style, true); // If the update feature is a line, ensure that it is highlighted the normal // way (so that the direction of the line is apparent). if (m_SelectedFeature is LineFeature) { m_SelectedFeature.Render(display, Controller.HighlightStyle); } }
/// <summary> /// Displays info about the edits that are dependent on the feature /// currently selected for update. /// </summary> internal void Dependencies() { // Get the operation that created the update feature. Operation pop = GetOp(); if (pop == null) { return; } // Get the edits that depend on features created by the update op Operation[] deps = pop.MapModel.Touch(pop); // Draw the features that were created by the dependent edits ISpatialDisplay display = ActiveDisplay; IDrawStyle style = Controller.Style(Color.Magenta); style.IsFixed = true; foreach (Operation d in deps) { d.Render(display, style, true); } // List the dependent operations. using (ListOperationsForm dial = new ListOperationsForm(deps)) { dial.ShowDialog(); } // Redraw the map the normal way (with the current update op in magenta) ErasePainting(); }
/// <summary> /// Draws the outline of this indexing node to a specific display (so /// long as the extent of the node isn't too big) /// </summary> /// <param name="display">The display to draw to.</param> /// <param name="style">The style for the draw.</param> internal virtual void Render(ISpatialDisplay display, IDrawStyle style) { if (m_Window.Width < 0x0000010000000000) { IPosition[] outline = m_Window.Outline; style.Render(display, outline); } }
/// <summary> /// Draws the edge of this ring. /// </summary> /// <param name="display">The display to draw to</param> /// <param name="style">The drawing style</param> internal void RenderOutline(ISpatialDisplay display, IDrawStyle style) { foreach (IDivider d in m_Edge) { LineGeometry g = d.LineGeometry; g.Render(display, style); } }
/// <summary> /// Does any command-specific drawing. /// </summary> /// <param name="point">The specific point (if any) that the parent window has drawn. Not used.</param> internal override void Paint(PointFeature point) { if (m_Dialog != null) { ISpatialDisplay display = ActiveDisplay; IDrawStyle style = Controller.Style(Color.Magenta); m_Dialog.Render(display, style); } }
/// <summary> /// Draws intersections on the specified display /// </summary> /// <param name="display">The display to draw to</param> /// <param name="style">The drawing style</param> internal void Render(ISpatialDisplay display, IDrawStyle style) { style.Render(display, m_X1); if (IsGraze) { style.Render(display, m_X2); } }
/// <summary> /// Creates a new <c>DrawQuery</c> that refers to the specified feature type(s), /// drawing the results of the spatial query to the specified display. /// </summary> /// <param name="index">The index to query</param> /// <param name="display">The display to draw to</param> /// <param name="style">The drawing style</param> /// <param name="types">The type(s) of spatial feature to draw</param> public DrawQuery(ISpatialIndex index, ISpatialDisplay display, IDrawStyle style, SpatialType types) { m_Display = display; m_Style = style; m_DoPaint = false; Timer t = new Timer(500); t.Elapsed += new ElapsedEventHandler(Timer_Elapsed); t.Start(); index.QueryWindow(m_Display.Extent, types, OnQueryHit); t.Close(); display.PaintNow(); }
internal override void Render(ISpatialDisplay display, IDrawStyle style) { LineSegmentGeometry.Render(this, display, style); }
void DrawIfDefined(IPosition point, ISpatialDisplay display, IDrawStyle style, Color col) { if (point!=null) { Color oldCol = style.FillColor; try { style.FillColor = col; style.Render(display, point); } finally { style.FillColor = oldCol; } } }
/// <summary> /// Draws the features that were created by this editing operation /// </summary> /// <param name="display">The display to draw to</param> /// <param name="style">The drawing style</param> /// <param name="drawInactive">Should features that are currently inactive be drawn too?</param> internal void Render(ISpatialDisplay display, IDrawStyle style, bool drawInactive) { foreach (Feature f in this.Features) { if (!drawInactive && f.IsInactive) continue; f.Render(display, style); } }
internal override void Render(ISpatialDisplay display, IDrawStyle style) { Make().Render(display, style); }
/// <summary> /// Draws this object on the specified display /// </summary> /// <param name="display">The display to draw to</param> /// <param name="style">The drawing style</param> public void Render(ISpatialDisplay display, IDrawStyle style) { m_Geom.Render(display, style); }
/// <summary> /// Draws this object on the specified display /// </summary> /// <param name="display">The display to draw to</param> /// <param name="style">The drawing style</param> public override void Render(ISpatialDisplay display, IDrawStyle style) { EditingController ec = EditingController.Current; if (style is HighlightStyle) { // If we're highlighting a non-topological line, always draw it in turquoise, // regardless of the supplied style. if (IsTopological) RenderLine(display, style); else { Color oldCol = style.LineColor; style.LineColor = Color.Turquoise; m_Geom.Render(display, style); style.LineColor = oldCol; } bool showPoints = (style as HighlightStyle).ShowLineEndPoints; // If we're highlighting, and points are displayed, render the end points too // (if the line is not a polygon boundary, draw hatched ends). if (showPoints && display.MapScale < ec.Project.Settings.ShowPointScale) { if (IsTopological) { StartPoint.Draw(display, Color.DarkBlue); EndPoint.Draw(display, Color.Cyan); } else { StartPoint.Draw(display, HatchStyle.DarkUpwardDiagonal, Color.DarkBlue); EndPoint.Draw(display, HatchStyle.DarkUpwardDiagonal, Color.Cyan); } } } else { //RenderLine(display, style); if (IsTopological) RenderLine(display, style); else { Color oldCol = style.LineColor; style.LineColor = Color.Turquoise; m_Geom.Render(display, style); style.LineColor = oldCol; } } // Return if we're not showing actual or observed lengths if (!ec.AreLineAnnotationsDrawn) return; // See if there is an observed distance. Distance dist = this.ObservedLength; LineAnnotationStyle annoStyle = ec.LineAnnotationStyle; if (annoStyle.ShowAdjustedLengths) { // Pass in any observed distance, to govern the number of // decimal places to show. m_Geom.RenderDistance(display, style, dist, false); } else if (annoStyle.ShowObservedLengths) { // Display observed distance only if the line has one. if (dist != null) m_Geom.RenderDistance(display, style, dist, true); } }
public void Render(ISpatialDisplay display, IDrawStyle style) { style.Render(display, this); //style.Render(display, this.Outline); // debug }
/// <summary> /// Draws a portion of this topological line on the specified display /// </summary> /// <param name="d">The divider that corresponds to a portion of this line (could /// be the entire line)</param> /// <param name="display">The display to draw to</param> /// <param name="style">The drawing style</param> internal void RenderDivider(IDivider d, ISpatialDisplay display, IDrawStyle style) { // If we're highlightling, don't attempt to pick up any other display color if (style is HighlightStyle || style.IsFixed) { d.LineGeometry.Render(display, style); return; } Style s = EntityUtil.GetStyle(d, EditingController.Current.ActiveLayer); Pen oldPen = style.Pen; try { ScaleSpecificPen ssPen = s.GetPen(display); style.Pen = ssPen.Pen; d.LineGeometry.Render(display, style); } finally { style.Pen = oldPen; } }
/// <summary> /// Draws intersections on the specified display /// </summary> /// <param name="display">The display to draw to</param> /// <param name="style">The drawing style</param> internal void Render(ISpatialDisplay display, IDrawStyle style) { foreach (IntersectionData d in m_Data) d.Render(display, style); }
/// <summary> /// Draws the content of the map on a display. /// </summary> /// <param name="display">The display on which to draw</param> /// <param name="style">The display style to use</param> public void Render(ISpatialDisplay display, IDrawStyle style) { new DrawQuery(m_Index, display, style); }
/// <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); } }
/// <summary> /// Draws a distance alongside this line. /// </summary> /// <param name="display">The display to draw to</param> /// <param name="style">The drawing style</param> /// <param name="dist">The observed distance (if any).</param> /// <param name="drawObserved">Draw observed distance? Specify <c>false</c> for /// actual distance.</param> internal override void RenderDistance(ISpatialDisplay display, IDrawStyle style, Distance dist, bool drawObserved) { Annotation a = GetAnnotation(dist, drawObserved); if (a != null) style.Render(display, a); }
/// <summary> /// Draws this object on the specified display /// </summary> /// <param name="display">The display to draw to</param> /// <param name="style">The drawing style</param> public override void Render(ISpatialDisplay display, IDrawStyle style) { style.PointHeight = HEIGHT; style.RenderPlus(display, Geometry); }
/// <summary> /// Draws intersections on the specified display /// </summary> /// <param name="display">The display to draw to</param> /// <param name="style">The drawing style</param> internal void Render(ISpatialDisplay display, IDrawStyle style) { foreach (IntersectionResult r in m_Intersects) r.Render(display, style); }
private IDrawStyle InitializeDrawStyle(IDrawStyle style) { style.PointHeight = new Length(m_Project.Settings.PointHeight); return style; }
/// <summary> /// Draws a topological line on the specified display /// </summary> /// <param name="display">The display to draw to</param> /// <param name="style">The drawing style</param> void RenderLine(ISpatialDisplay display, IDrawStyle style) { // If we're dealing with a line that's been divided into at least two sections, // and the line is marked as trimmed, ensure we only render the non-dangling // sections. /* if (IsTrimmed && (m_Topology is SectionTopologyList)) (m_Topology as SectionTopologyList).RenderTrimmed(display, style); else m_Geom.Render(display, style); */ if (m_Topology is SectionTopologyList) { if (IsTrimmed) (m_Topology as SectionTopologyList).RenderTrimmed(display, style); else { foreach (IDivider d in m_Topology) RenderDivider(d, display, style); } } else if (m_Topology is IDivider && !style.IsFixed) RenderDivider(m_Topology as IDivider, display, style); else m_Geom.Render(display, style); }
/// <summary> /// Draws the outline of all child nodes (if the child is also an /// instance of <see cref="IndexNode"/>, this will just cause further /// drilldown - something will only get drawn if the child is an /// instance of some other class). /// </summary> /// <param name="display">The display to draw to.</param> /// <param name="style">The style for the draw.</param> internal override void Render(ISpatialDisplay display, IDrawStyle style) { foreach (Node n in m_Children) n.Render(display, style); }
/// <summary> /// Draws the content of this selection /// </summary> /// <param name="display">The display to draw to</param> /// <param name="style">The drawing style to use</param> public virtual void Render(ISpatialDisplay display, IDrawStyle style) { foreach (ISpatialObject item in m_Items) item.Render(display, style); }
/// <summary> /// Draws a distance alongside this line. /// </summary> /// <param name="display">The display to draw to</param> /// <param name="style">The drawing style</param> /// <param name="dist">The observed distance (if any).</param> /// <param name="drawObserved">Draw observed distance? Specify <c>false</c> for /// actual distance.</param> internal override void RenderDistance(ISpatialDisplay display, IDrawStyle style, Distance dist, bool drawObserved) { Make().RenderDistance(display, style, dist, drawObserved); }
/// <summary> /// Draws this object on the specified display /// </summary> /// <param name="display">The display to draw to</param> /// <param name="style">The drawing style</param> public virtual void Render(ISpatialDisplay display, IDrawStyle style) { if (m_Geometry is NTS.Polygon) { NTS.Polygon p = (NTS.Polygon)m_Geometry; NTS.LineString edge = p.ExteriorRing; NTS.LineString[] holes = p.InteriorRings; IPosition[][] outlines = new IPosition[1+holes.Length][]; outlines[0] = GetPositionArray(edge.Coordinates); for (int i=0; i<holes.Length; i++) outlines[i+1] = GetPositionArray(holes[i].Coordinates); foreach (IPosition[] pa in outlines) style.Render(display, pa); if (style is HighlightStyle) style.Render(display, outlines); } else style.Render(display, PositionArray); }
/// <summary> /// Draws sections on the specified display, excluding dangling ends. /// </summary> /// <param name="display">The display to draw to</param> /// <param name="style">The drawing style</param> internal void RenderTrimmed(ISpatialDisplay display, IDrawStyle style) { // If we're highlighting, dangling portions should be drawn dotted IDrawStyle dangleStyle = (style is HighlightStyle ? new DottedStyle(Color.Red) : null); bool sDangle = Line.IsStartDangle(); bool eDangle = Line.IsEndDangle(); int last = m_Sections.Count-1; for (int i=0; i<=last; i++) { if ((i==0 && !sDangle) || (i>0 && i<last) || (i==last && !eDangle)) { IDivider d = m_Sections[i]; d.Line.RenderDivider(d, display, style); } else if (dangleStyle!=null && ((i==0 && sDangle) || (i==last && eDangle))) { IDivider d = m_Sections[i]; d.Line.RenderDivider(d, display, dangleStyle); } } }
/// <summary> /// Repaint icon(s) representing this check result. /// </summary> /// <param name="display">The display to draw to</param> /// <param name="style">The style for the drawing</param> internal override void Render(ISpatialDisplay display, IDrawStyle style) { // Return if the polygon doesn't overlap the draw. IWindow win = m_Ring.Extent; if (!win.IsOverlap(display.Extent)) return; // Draw stuff that's now irrelevant RenderPaintOuts(display, style); // Is the polygon real small? If so, we'll use a display // position that's just to the left of the polygon's window. IPosition gpos = null; Position p = null; CheckType types = Types; bool isSmall = ((types & CheckType.SmallPolygon)!=0); if (isSmall) { // Get the north-west corner of the window. gpos = new Position(win.Min.X, win.Max.Y); // NW corner // Draw the icon double shift = IconSize(display); p = new Position(gpos.X-shift, gpos.Y); style.Render(display, p, Resources.CheckSmallPolygonIcon); // And shift a bit more in case we draw more. p.X -= shift; } if (m_Ring is Island) { // If the polygon is a phantom that has no enclosing polygon, // display an icon at the east point (unless we previously // found that the polygon was real small). if (!isSmall && (types & CheckType.NotEnclosed)!=0) { if (gpos==null) { gpos = m_Ring.GetEastPoint(); p = new Position(gpos); } style.Render(display, p, Resources.CheckNotEnclosedIcon); } } else { // The other two possibilities relate to regular (non-phantom) polygons. // If the polygon has no label, get a suitable position (if the polygon is // real small, just use the position we already have). if ((types & CheckType.NoLabel)!=0) { // If the position hasn't been defined (because the polygon is NOT small), // figure out a good spot. If that fails, fall back on the east point. if (gpos==null) { Debug.Assert(!isSmall); double size = IconSize(display); gpos = (m_Ring as Polygon).GetLabelPosition(size, size); if (gpos==null) gpos = m_Ring.GetEastPoint(); // The shift here is not ideal if the east point got used, However, // it simplifies the logic in PaintOut to use the same offset. p = new Position(gpos.X-size/2, gpos.Y+size/2); } style.Render(display, p, Resources.CheckNoLabelIcon); } } // Remember the reference position we used. Place = gpos; }
public static void Render(ICircularArcGeometry g, ISpatialDisplay display, IDrawStyle style) { style.Render(display, (IClockwiseCircularArcGeometry)g); }
/// <summary> /// Paints out those results that no longer apply. /// </summary> /// <param name="display">The display to draw to</param> /// <param name="style">The style for the drawing</param> /// <param name="newTypes">The new results</param> internal override void PaintOut(ISpatialDisplay display, IDrawStyle style, CheckType newTypes) { IPosition p = this.Place; double shift = IconSize(display); CheckType oldTypes = Types; if (IsPaintOut(CheckType.SmallPolygon, oldTypes, newTypes)) { p = new Position(p.X-shift, p.Y); AddPaintOut(p, Resources.CheckSmallPolygonIcon); // And shift a bit more in case we draw more. p = new Position(p.X-shift, p.Y); } if (IsPaintOut(CheckType.NotEnclosed, oldTypes, newTypes)) AddPaintOut(p, Resources.CheckNotEnclosedIcon); if (IsPaintOut(CheckType.NoLabel, oldTypes, newTypes)) { if ((oldTypes & CheckType.SmallPolygon)==0) p = new Position(p.X-shift/2, p.Y+shift/2); AddPaintOut(p, Resources.CheckNoLabelIcon); } }
/// <summary> /// Redraws any check icons. /// </summary> /// <param name="display">The display to draw to</param> /// <param name="style">The style for the drawing</param> internal void Render(ISpatialDisplay display, IDrawStyle style) { if (m_Results==null) return; foreach (CheckItem check in m_Results) check.Render(display, style); // Tell the status window too. if (m_Status!=null) m_Status.Render(display, style); }
public void Render(ISpatialDisplay display, IDrawStyle style) { CircleGeometry.Render(this, display, style); }
public static void Render(ICircleGeometry g, ISpatialDisplay display, IDrawStyle style) { style.Render(display, g.Center, g.Radius); }
/// <summary> /// Draws the extent of the nodes in this index (excluding the higher level nodes). /// For experimentation. /// </summary> /// <param name="display">The display to draw to</param> /// <param name="style">The drawing tools to use</param> internal void Render(ISpatialDisplay display, IDrawStyle style) { m_Root.Render(display, style); }