예제 #1
0
        /// <summary>
        /// render scene in every view port.
        /// </summary>
        /// <param name="viewPort"></param>
        /// <param name="clientRectangle"></param>
        /// <param name="pickingGeometryType"></param>
        private void RenderViewPort(ViewPort viewPort, Rectangle clientRectangle, PickingGeometryType pickingGeometryType)
        {
            if (viewPort.Enabled)
            {
                // render in this view port.
                if (viewPort.Visiable)
                {
                    // render scene in this view port.
                    viewPort.Render(this, clientRectangle, pickingGeometryType);
                }

                // render children viewport.
                foreach (ViewPort item in viewPort.Children)
                {
                    this.RenderViewPort(item, clientRectangle, pickingGeometryType);
                }
            }
        }
예제 #2
0
 // TODO: big bug: when mouse is picking something and move outside of viewport to anothher one, camera will go wrong.
 /// <summary>
 /// Initializes a new instance of the <see cref="RenderEventArgs"/> class.
 /// </summary>
 /// <param name="canvasRect"></param>
 /// <param name="viewPort">camera used during rendering.</param>
 /// <param name="pickingGeometryType">Target geometry type(point, line, triangle, quad or polygon) for color-coded-picking; otherwise useless.</param>
 public RenderEventArgs(Rectangle canvasRect, ViewPort viewPort, PickingGeometryType pickingGeometryType)
 {
     this.CanvasRect          = canvasRect;
     this.UsingViewPort       = viewPort;
     this.PickingGeometryType = pickingGeometryType;
 }