示例#1
0
        public override void DrawRailItem(DrawingContext drawingContext, RailViewMode viewMode, RailLayer layer)
        {
            this.DockPoints.ForEach(d => d.DrawOpen(drawingContext));

            this.Rails.ForEach(r => r.DrawRailItem(drawingContext, viewMode, layer));

            if (this.IsSelected && viewMode < RailViewMode.Terrain)
            {
                var geometrie = GetGeometry(viewMode /*, null*/);
                drawingContext.DrawDrawing(new GeometryDrawing(null, this.linePen, geometrie));
                drawingContext.DrawDrawing(new GeometryDrawing(null, this.dotPen, geometrie));
            }
        }
示例#2
0
 public abstract void DrawRailItem(DrawingContext drawingContext, RailViewMode viewMode, RailLayer layer);
示例#3
0
        public override void DrawRailItem(DrawingContext drawingContext, RailViewMode viewMode, RailLayer layer)
        {
            this.DockPoints.ForEach(d => d.DrawOpen(drawingContext));

            drawingContext.PushTransform(this.RailTransform);

            //Debug.WriteLine($"DrawRailItem {this.IsSelected}");
            switch (viewMode)
            {
            case RailViewMode.Tracks:
                this.Track.RenderTrack(drawingContext, layer.TrackBrush);
                break;

            case RailViewMode.Rail:
            case RailViewMode.Terrain:
                this.Track.RenderRail(drawingContext);
                break;
            }

            if (this.IsSelected)
            {
                this.Track.RenderSelection(drawingContext);
            }
            if (this.IsAnchored)
            {
                Geometry geometry = anchorGeometry.Clone();
                geometry.Transform = new ScaleTransform(0.15, 0.15, 20, -20);
                drawingContext.DrawGeometry(Brushes.Red, anchorPen, geometry);
            }

            drawingContext.Pop();

            DrawDebug(drawingContext);
            DrawDebugDogpoints(drawingContext);
        }