예제 #1
0
        private void renderScene()
        {
            SetupScene3();

            RayTracer.RayTracer raytracer = new RayTracer.RayTracer(AntiAliasing.Medium, true, true, true, true, true);
            raytracer.RenderUpdate += new RenderUpdateDelegate(raytracer_RenderUpdate);

            rect_i rect = new rect_i(0, 0, 512, 512);

            bitmap = new ImageBuffer(rect.Width, rect.Height, 32, new BlenderBGRA());

            Graphics2D graphics2D = bitmap.NewGraphics2D();

            raytracer.RayTraceScene(graphics2D, rect, scene);

            graphics2D.Rect(new rect_d(bitmap.GetBoundingRect()), RGBA_Bytes.Black);
        }
예제 #2
0
        private static PopupMenu CreatePopupMenu()
        {
            var menuTheme = ApplicationController.Instance.MenuTheme;

            var popupMenu = new PopupMenu(menuTheme)
            {
                MinimumSize = new Vector2(300, 0)
            };

            var linkIcon = StaticData.Instance.LoadIcon("fa-link_16.png", 16, 16, menuTheme.InvertIcons);

            PopupMenu.MenuItem menuItem;

            menuItem        = popupMenu.CreateMenuItem("Help".Localize(), StaticData.Instance.LoadIcon("help_page.png", 16, 16, menuTheme.InvertIcons));
            menuItem.Click += (s, e) => ApplicationController.Instance.ShowApplicationHelp("Docs");

            menuItem        = popupMenu.CreateMenuItem("Interface Tour".Localize(), StaticData.Instance.LoadIcon("tour.png", 16, 16, menuTheme.InvertIcons));
            menuItem.Click += (s, e) =>
            {
                UiThread.RunOnIdle(() =>
                {
                    DialogWindow.Show <Tour.WelcomePage>();
                });
            };

            if (Application.EnableNetworkTraffic)
            {
                popupMenu.CreateSeparator();

                menuItem        = popupMenu.CreateMenuItem("Check For Update".Localize(), StaticData.Instance.LoadIcon("update.png", 16, 16, menuTheme.InvertIcons));
                menuItem.Click += (s, e) => UiThread.RunOnIdle(() =>
                {
                    UpdateControlData.Instance.CheckForUpdate();
                    DialogWindow.Show <CheckForUpdatesPage>();
                });
            }

            popupMenu.CreateSeparator();

            menuItem        = popupMenu.CreateMenuItem("Settings".Localize(), StaticData.Instance.LoadIcon("fa-cog_16.png", 16, 16, menuTheme.InvertIcons));
            menuItem.Click += (s, e) => DialogWindow.Show <ApplicationSettingsPage>();
            menuItem.Name   = "Settings MenuItem";

            popupMenu.CreateSeparator();

            ImageBuffer indicatorIcon = null;

            if (IntPtr.Size == 8)
            {
                indicatorIcon = StaticData.Instance.LoadIcon("x64.png", 16, 16, menuTheme.InvertIcons);
            }

            popupMenu.CreateSubMenu("Community".Localize(), menuTheme, (modifyMenu) =>
            {
                menuItem        = modifyMenu.CreateMenuItem("Forums".Localize(), linkIcon);
                menuItem.Click += (s, e) => ApplicationController.LaunchBrowser("https://forums.matterhackers.com/category/20/mattercontrol");

                menuItem        = modifyMenu.CreateMenuItem("Guides and Articles".Localize(), linkIcon);
                menuItem.Click += (s, e) => ApplicationController.LaunchBrowser("https://www.matterhackers.com/topic/mattercontrol");

                menuItem        = modifyMenu.CreateMenuItem("Support".Localize(), linkIcon);
                menuItem.Click += (s, e) => ApplicationController.LaunchBrowser("https://www.matterhackers.com/mattercontrol/support");

                menuItem        = modifyMenu.CreateMenuItem("Release Notes".Localize(), linkIcon);
                menuItem.Click += (s, e) => ApplicationController.LaunchBrowser("https://www.matterhackers.com/mattercontrol/support/release-notes");

                modifyMenu.CreateSeparator();

                menuItem        = modifyMenu.CreateMenuItem("Report a Bug".Localize(), StaticData.Instance.LoadIcon("feedback.png", 16, 16, menuTheme.InvertIcons));
                menuItem.Click += (s, e) => ApplicationController.LaunchBrowser("https://github.com/MatterHackers/MatterControl/issues");
            }, StaticData.Instance.LoadIcon("feedback.png", 16, 16, menuTheme.InvertIcons));

            popupMenu.CreateSeparator();

            var imageBuffer = new ImageBuffer(18, 18);

            // x64 indicator icon
            if (IntPtr.Size == 8)
            {
                var graphics = imageBuffer.NewGraphics2D();
                graphics.Clear(menuTheme.BackgroundColor);
                graphics.Rectangle(imageBuffer.GetBoundingRect(), menuTheme.PrimaryAccentColor);
                graphics.DrawString("64", imageBuffer.Width / 2, imageBuffer.Height / 2, 8, Agg.Font.Justification.Center, Agg.Font.Baseline.BoundsCenter, color: menuTheme.PrimaryAccentColor);
            }

            menuItem        = popupMenu.CreateMenuItem("About".Localize() + " MatterControl", imageBuffer);
            menuItem.Click += (s, e) => ApplicationController.Instance.ShowAboutPage();
            return(popupMenu);
        }