public override void BuildMesh(DirectX.DirectXCanvas canvas, ThreadScroll scroll) { DirectX.DynamicMesh builder = canvas.CreateMesh(); builder.Geometry = DirectX.Mesh.GeometryType.Lines; double headerHeight = 1.0; //(Height - RenderParams.BaseMargin) / scroll.Height; // Adding Tickers if (EnableTickers) { for (double tick = Math.Ceiling(scroll.TimeSlice.StartMS); tick < Math.Ceiling(scroll.TimeSlice.FinishMS); tick += 1.0) { double longX = scroll.TimeToUnit(new Tick { Start = Durable.MsToTick(tick) }); builder.AddLine(new Point(longX, headerHeight * 3.0 / 6.0), new Point(longX, headerHeight), TickColor); double medX = scroll.TimeToUnit(new Tick { Start = Durable.MsToTick(tick + 0.5) }); builder.AddLine(new Point(medX, headerHeight * 4.0 / 6.0), new Point(medX, headerHeight), TickColor); for (double miniTick = 0.1; miniTick < 1.0; miniTick += 0.1) { double miniX = scroll.TimeToUnit(new Tick { Start = Durable.MsToTick(tick + miniTick) }); builder.AddLine(new Point(miniX, headerHeight * 5.0 / 6.0), new Point(miniX, headerHeight), TickColor); } } } BackgroundMeshLines = builder.Freeze(canvas.RenderDevice); DirectX.DynamicMesh builderHeader = canvas.CreateMesh(); builderHeader.AddRect(new Rect(0.0, 0.0, 1.0, headerHeight), new Color[] { GradientTop, GradientTop, GradientBottom, GradientBottom }); BackgroundMeshTris = builderHeader.Freeze(canvas.RenderDevice); }
public override void BuildMesh(DirectX.DirectXCanvas canvas, ThreadScroll scroll) { DirectX.DynamicMesh builder = canvas.CreateMesh(); builder.Geometry = DirectX.Mesh.GeometryType.Lines; foreach (EventFrame frame in Group.MainThread.Events) { double x = scroll.TimeToUnit(frame.Header).Left; builder.AddLine(new Point(x, 0.0), new Point(x, 1.0), SplitLines); } BackgroundMeshLines = builder.Freeze(canvas.RenderDevice); DirectX.DynamicMesh builderHeader = canvas.CreateMesh(); builderHeader.AddRect(new Rect(0.0, 0.0, 1.0, (Height - RenderParams.BaseMargin) / scroll.Height), new Color[] { GradientTop, GradientTop, GradientBottom, GradientBottom }); BackgroundMeshTris = builderHeader.Freeze(canvas.RenderDevice); }