예제 #1
0
        public Viewport(bool LoadDrawables = true)
        {
            this.DoubleBuffered = true;

            InitializeComponent();
            LoadViewport();
            LoadViewportRuntimeValues();
            LoadShadingModes();
            editor = new Runtime.ViewportEditor();
            Runtime.viewportEditors.Add(editor);

            foreach (var type in Enum.GetValues(typeof(Runtime.ViewportShading)).Cast <Runtime.ViewportShading>())
            {
                if (type == Runtime.viewportShading)
                {
                    shadingToolStripMenuItem.DropDownItems.Add(new ToolStripMenuItem(type.ToString())
                    {
                        Checked = true
                    });
                }
                else
                {
                    shadingToolStripMenuItem.DropDownItems.Add(new ToolStripMenuItem(type.ToString()));
                }
            }

            shadingToolStripMenuItem.Text = $"Shading: [{Runtime.viewportShading.ToString()}]";

            if (LoadDrawables)
            {
                LoadBaseDrawables();
            }
        }
예제 #2
0
        public Viewport(List <DrawableContainer> container, bool LoadDrawables = true)
        {
            DrawableContainers = container;
            if (DrawableContainers == null)
            {
                DrawableContainers = new List <DrawableContainer>();
            }

            this.DoubleBuffered = true;

            InitializeComponent();
            LoadViewport();
            LoadViewportRuntimeValues();
            LoadShadingModes();
            editor = new Runtime.ViewportEditor();
            Runtime.viewportEditors.Add(editor);

            perspectiveToolStripMenuItem.Checked = Runtime.ViewportCameraMode == Runtime.CameraMode.Perspective;

            foreach (var type in Enum.GetValues(typeof(Runtime.ViewportShading)).Cast <Runtime.ViewportShading>())
            {
                if (type == Runtime.viewportShading)
                {
                    shadingToolStripMenuItem.DropDownItems.Add(new ToolStripMenuItem(type.ToString())
                    {
                        Checked = true
                    });
                }
                else
                {
                    shadingToolStripMenuItem.DropDownItems.Add(new ToolStripMenuItem(type.ToString()));
                }
            }

            shadingToolStripMenuItem.Text = $"Shading: [{Runtime.viewportShading.ToString()}]";


            if (LoadDrawables)
            {
                LoadBaseDrawables();
            }
        }