public void Render(IRenderTargetProvider provider) { renderedPathInfosCore = new List <RenderedPathInfo>(); foreach (var path in provider.Paths) { RenderedPathInfo renderedPathInfo = RenderPath(path); renderedPathInfosCore.Add(renderedPathInfo); } }
protected virtual RenderedPathInfo RenderPath(Path path) { RenderedPathInfo renderedPathInfo = new RenderedPathInfo(path.PathAppearance, path.LocationInfo); foreach (var command in path.PathCommands) { RenderPathCommand(renderedPathInfo, command); } return(renderedPathInfo); }
protected virtual void RenderPathCommand(RenderedPathInfo renderedPathInfo, PathCommand command) { switch (command.Type) { case PathCommandType.MoveTo: renderedPathInfo.MoveTo(command.Args as MoveToCommandArgs); break; case PathCommandType.LineTo: renderedPathInfo.LineTo(command.Args as MoveToCommandArgs); break; case PathCommandType.CurveTo: case PathCommandType.QuadraticCurveTo: case PathCommandType.SmoothCurveTo: case PathCommandType.SmoothQuadraticCurveTo: renderedPathInfo.CurveTo(command.Args as MoveToCommandArgs); break; } }
protected virtual void RenderPathCommand(RenderedPathInfo renderedPathInfo, PathCommand command) { switch(command.Type) { case PathCommandType.MoveTo: renderedPathInfo.MoveTo(command.Args as MoveToCommandArgs); break; case PathCommandType.LineTo: renderedPathInfo.LineTo(command.Args as MoveToCommandArgs); break; case PathCommandType.CurveTo: case PathCommandType.QuadraticCurveTo: case PathCommandType.SmoothCurveTo: case PathCommandType.SmoothQuadraticCurveTo: renderedPathInfo.CurveTo(command.Args as MoveToCommandArgs); break; } }
protected virtual RenderedPathInfo RenderPath(Path path) { RenderedPathInfo renderedPathInfo = new RenderedPathInfo(path.PathAppearance, path.LocationInfo); foreach(var command in path.PathCommands) { RenderPathCommand(renderedPathInfo, command); } return renderedPathInfo; }