Beispiel #1
0
        /// <summary>
        /// Render the specified target, projection, layers, zoomFactor and coordinate.
        /// </summary>
        /// <param name="target">The target to render on.</param>
        /// <param name="projection">The projection being used to render.</param>
        /// <param name="layers">The layers to rendering in the given order.</param>
        /// <param name="view">The view to show.</param>
        /// <param name="viewRender">The view to determine what to render. It may be needed to render a bit more along the edges.</param>
        /// <param name="zoomFactor">The zoom factor relative to the projection.</param>
        public bool Render(TTarget target, IProjection projection, List <Layer> layers, View2D view, View2D viewRender, float zoomFactor)
        {
            // create and concatenate primitives from all layers.
            IEnumerable <Primitive2D> primitives = new List <Primitive2D>();

            // calculate zoom level.
            var zoomLevel = (float)projection.ToZoomLevel(zoomFactor);

            // draw all layers seperatly but in the correct order.
            var scenes = new List <Scene2D>();

            for (int layerIdx = 0; layerIdx < layers.Count; layerIdx++)
            {
                if (layers[layerIdx].IsLayerVisibleFor(zoomLevel))
                {
                    primitives = primitives.Concat(
                        layers[layerIdx].Get(zoomFactor, viewRender));
                }
            }

            // get the backcolor.
            int?backcolor = null;

            if (layers.Count > 0)
            { // use the backcolor of the first layer.
                backcolor = layers[0].BackColor;
            }

            // render the scenes.
            return(_renderer.Render(target, view, zoomFactor, primitives, backcolor));
        }
Beispiel #2
0
        /// <summary>
        /// Render the specified target, projection, layers, zoomFactor and coordinate.
        /// </summary>
        /// <param name="target">Target.</param>
        /// <param name="projection">Projection.</param>
        /// <param name="layers">Layers.</param>
        /// <param name="view">View</param>
        public bool Render(TTarget target, List <ILayer> layers, View2D view)
        {
            // create the view for this control.
//			Target2DWrapper<TTarget> target2DWrapper = _renderer.CreateTarget2DWrapper(target);

            // draw all layers seperatly but in the correct order.
            var scenes = new List <Scene2D>();

            for (int layerIdx = 0; layerIdx < layers.Count; layerIdx++)
            {
                // get the layer.
                scenes.Add(layers[layerIdx].Scene);
            }

            // render the scenes.
            return(_renderer.Render(target, scenes, view));
        }
Beispiel #3
0
        /// <summary>
        /// Render the specified target, projection, layers, zoomFactor and coordinate.
        /// </summary>
        /// <param name="target">Target.</param>
        /// <param name="projection">Projection.</param>
        /// <param name="layers">Layers.</param>
        /// <param name="view">View</param>
        /// <param name="zoomFactor">View</param>
        public bool Render(TTarget target, List <Layer> layers, View2D view, float zoomFactor)
        {
            // create and concatenate primitives from all layers.
            IEnumerable <Primitive2D> primitives = new List <Primitive2D>();

            // draw all layers seperatly but in the correct order.
            var scenes = new List <Scene2D>();

            for (int layerIdx = 0; layerIdx < layers.Count; layerIdx++)
            {
                primitives = primitives.Concat(
                    layers[layerIdx].Get(zoomFactor, view));
            }

            // render the scenes.
            return(_renderer.Render(target, view, zoomFactor, primitives));
        }
Beispiel #4
0
        public void Draw()
        {
            CanvasRenderer.Render();

            if (RectTool != null)
            {
                RectTool.DrawShape(MousePos);
            }
        }
Beispiel #5
0
 public void Draw()
 {
     Renderer2D.Render();
 }
Beispiel #6
0
 protected void Render()
 {
     GeneralRenderer.Render();
     UiRenderer.Render();
 }