protected override void DrawSelfToShape(Shape target) { base.DrawSelfToShape(target); if (!Visible || !Active) return; var filled = GetFilledPolygonsGlobal(); foreach (var poly in filled) target.FilledPolygons.AddLast(poly); var outline = GetOutlinePolygonsGlobal(); foreach (var poly in outline) target.OutlinePolygons.AddLast(poly); }
private void MakeBackground() { background = new ColoredShape(); var brush = new ColoredRectangle(0, 0, SIZE, SIZE, 0.2F, 0.2F, 0.2F, 1); brush.AddOutline(0.7F, 0.7F, 0.7F, 1); background.BeginMassUpdate(); for (int i = 0; i < width; ++i) { for (int j = 0; j < height; j++) { brush.X = i * (SIZE + PADDING); brush.Y = j * (SIZE + PADDING); brush.DrawToShapeGlobal(background); } } background.EndMassUpdate(); }
/// <summary> /// Inserts the object into another one not including the transformations from this object's parent. /// </summary> /// <param name="target"></param> public void DrawToShapeLocal(Shape target) { var temp = parent; if (parent != null) { parent.RemoveChild(this); } //We need to draw this object as if it doesn't have a parent DrawToShapeGlobal(target); if (temp != null) { temp.AddChild(this); } //Finally we attach it to the parent again }
protected virtual void DrawSelfToShape(Shape target) { }
/// <summary> /// Inserts the object into another one including the transformations from this object's parent. /// </summary> /// <param name="target"></param> public void DrawToShapeGlobal(Shape target) { DrawSelfToShape(target); foreach (var child in children) DrawToShapeGlobal(target); target.SetPolygons(); }