public override void Render(Graphics2D graphics2D, GCodeRenderInfo renderInfo) { if ((renderInfo.CurrentRenderType & RenderType.Retractions) == RenderType.Retractions) { double radius = Radius(renderInfo.LayerScale); Vector2 position = new Vector2(this.position.x, this.position.y); renderInfo.Transform.transform(ref position); RGBA_Bytes retractionColor = new RGBA_Bytes(RGBA_Bytes.Red, 200); if (extrusionAmount > 0) { // unretraction retractionColor = new RGBA_Bytes(RGBA_Bytes.Blue, 200); } // render the part using opengl Graphics2DOpenGL graphics2DGl = graphics2D as Graphics2DOpenGL; if (graphics2DGl != null) { graphics2DGl.DrawAACircle(position, radius, retractionColor); } else { Ellipse extrusion = new Ellipse(position, radius); graphics2D.Render(extrusion, retractionColor); } } }
public override void Render(Graphics2D graphics2D, GCodeRenderInfo renderInfo) { if ((renderInfo.CurrentRenderType & RenderType.Retractions) == RenderType.Retractions) { double radius = Radius(renderInfo.LayerScale); Vector2 position = new Vector2(this.position.x, this.position.y); if (renderInfo.CurrentRenderType.HasFlag(RenderType.HideExtruderOffsets)) { Vector2 offset = renderInfo.GetExtruderOffset(extruderIndex); position = position + offset; } renderInfo.Transform.transform(ref position); Color retractionColor = new Color(Color.Red, 200); if (extrusionAmount > 0) { // unretraction retractionColor = new Color(Color.Blue, 200); } // render the part using opengl Graphics2DOpenGL graphics2DGl = graphics2D as Graphics2DOpenGL; if (graphics2DGl != null) { graphics2DGl.DrawAACircle(position, radius, retractionColor); } else { Ellipse extrusion = new Ellipse(position, radius); graphics2D.Render(extrusion, retractionColor); } } }
protected void Render3DStartEndMarkers(Graphics2DOpenGL graphics2DGl, double radius, Vector2 startPoint, Vector2 endPoint) { graphics2DGl.DrawAACircle(startPoint, radius, RenderFeatureBase.StartColor); graphics2DGl.DrawAACircle(endPoint, radius, RenderFeatureBase.EndColor); }