Beispiel #1
0
        public void Render(BaseRenderer renderer)
        {
            renderer.SelectedColor = Colors.White;
            foreach (var model in models)
            {
                model.Render(renderer);
            }
            renderer.UseIndices  = false;
            renderer.ModelMatrix = Matrix4.CreateIdentity();
            var renderingPoints = new List <Vector3>(1);

            renderingPoints.Insert(0, new Vector3());
            renderer.Points = renderingPoints;
            foreach (var point in Points)
            {
                if (!point.Visible)
                {
                    continue;
                }
                renderingPoints[0]     = point.Position;
                renderer.SelectedColor = point.IsSelected ? Colors.LimeGreen : Colors.White;
                renderer.Transform();
                renderer.DrawPoints();
            }

            if (hiddenPoints != null)
            {
                foreach (var point in hiddenPoints)
                {
                    if (!point.Visible)
                    {
                        continue;
                    }
                    renderingPoints[0]     = point.Position;
                    renderer.SelectedColor = Colors.BlueViolet;// point.IsSelected ? Colors.LimeGreen : Colors.White;
                    renderer.Transform();
                    renderer.DrawPoints();
                }
            }

            if (dragMode == MouseDragMode.SelectPoints)
            {
                var minX = System.Math.Min(dragActualPosition.X, dragStartPosition.X) / ScreenSize.X;
                var maxX = System.Math.Max(dragActualPosition.X, dragStartPosition.X) / ScreenSize.X;
                var minY = System.Math.Min(dragActualPosition.Y, dragStartPosition.Y) / ScreenSize.Y;
                var maxY = System.Math.Max(dragActualPosition.Y, dragStartPosition.Y) / ScreenSize.Y;
                renderer.DrawRectangle(minX, maxX, 1.0 - minY, 1.0 - maxY, Colors.DarkOrchid);
            }
            Cursor.Render(renderer);
        }