private void RegisterCommands()
        {
            m_commandService.RegisterCommand(
                Command.Select,
                StandardMenu.Modify,
                CommandGroup.Manipulators,
                "Select".Localize(),
                "Activate Selection Manipulator".Localize(),
                Keys.Q,
                Sce.Atf.Resources.SelectionImage,
                CommandVisibility.All,
                this);

            m_commandService.RegisterCommand(
                Command.SnapToVertex,
                StandardMenu.Modify,
                CommandGroup.Manipulators,
                "SnapToVertex".Localize(),
                "Snap To Vertex".Localize(),
                Keys.None,
                Resources.VertexSnapImage,
                CommandVisibility.All,
                this);

            m_commandService.RegisterCommand(
                Command.RotateOnSnap,
                StandardMenu.Modify,
                CommandGroup.Manipulators,
                "RotateOnSnap".Localize(),
                "Rotate On Snap".Localize(),
                Keys.None,
                Resources.RotateOnSnapImage,
                CommandVisibility.All,
                this);


            // Register comboBoxes for snap-from-mode and reference-coordinate-system, in the edit
            //  menu's toolbar
            m_snapFromModeComboBox = new ToolStripComboBox();
            m_snapFromModeComboBox.DropDownStyle         = ComboBoxStyle.DropDownList;
            m_snapFromModeComboBox.Name                  = "Snap From Mode".Localize();
            m_snapFromModeComboBox.ComboBox.DataSource   = Enum.GetValues(typeof(SnapFromMode));
            m_snapFromModeComboBox.SelectedIndexChanged += new EventHandler(m_snapFromModeComboBox_SelectedIndexChanged);
            m_snapFromModeComboBox.ToolTipText           = "Snap mode".Localize();


            m_referenceCoordinateSystemComboBox = new ToolStripComboBox();
            m_referenceCoordinateSystemComboBox.DropDownStyle = ComboBoxStyle.DropDownList;
            m_referenceCoordinateSystemComboBox.Name          = "Reference Coordinate System";
            m_referenceCoordinateSystemComboBox.ToolTipText   = "Reference Coordinate System";
            m_referenceCoordinateSystemComboBox.Items.AddRange(
                new string[] { "World", "Local" });
            m_referenceCoordinateSystemComboBox.SelectedIndex         = 0;
            m_referenceCoordinateSystemComboBox.SelectedIndexChanged += referenceCoordinateSystemComboBox_SelectedIndexChanged;

            MenuInfo editMenuInfo = MenuInfo.Edit;

            editMenuInfo.GetToolStrip().Items.Add(m_referenceCoordinateSystemComboBox);
            editMenuInfo.GetToolStrip().Items.Add(m_snapFromModeComboBox);
        }
Exemple #2
0
        private void RegisterToolStripComboBox()
        {
            m_updateTypeComboBox = new ToolStripComboBox();
            m_updateTypeComboBox.DropDownStyle         = ComboBoxStyle.DropDownList;
            m_updateTypeComboBox.Name                  = "UpdateType".Localize();
            m_updateTypeComboBox.ComboBox.DataSource   = Enum.GetValues(typeof(UpdateType));
            m_updateTypeComboBox.SelectedItem          = this.UpdateType;
            m_updateTypeComboBox.SelectedIndexChanged += (sender, e) => this.UpdateType = (UpdateType)m_updateTypeComboBox.SelectedItem;
            m_updateTypeComboBox.ToolTipText           = "Update type".Localize();
            MenuInfo editMenuInfo = MenuInfo.Edit;

            editMenuInfo.GetToolStrip().Items.Add(m_updateTypeComboBox);
        }
Exemple #3
0
        public virtual void Initialize()
        {
            // register a custom menu without any commands, so it won't appear in the main menu bar
            MenuInfo  menuInfo = m_commandService.RegisterMenu(this, "RenderModes", "Rendering modes");
            ToolStrip strip    = menuInfo.GetToolStrip();

            CommandInfo cmdInfo = m_commandService.RegisterCommand(
                Command.RenderSmooth,
                StandardMenu.View,
                m_commandGroup,
                "Solid".Localize(),
                "Solid rendering".Localize(),
                Keys.None,
                Resources.SmoothImage,
                CommandVisibility.Menu,
                this);

            strip.Items.Add(cmdInfo.GetButton());

            cmdInfo = m_commandService.RegisterCommand(
                Command.RenderWireFrame,
                StandardMenu.View,
                m_commandGroup,
                "Wireframe".Localize(),
                "Wireframe rendering".Localize(),
                Keys.None,
                Resources.WireframeImage,
                CommandVisibility.Menu,
                this);
            strip.Items.Add(cmdInfo.GetButton());

            cmdInfo = m_commandService.RegisterCommand(
                Command.RenderOutlined,
                StandardMenu.View,
                m_commandGroup,
                "SolidOverWire",
                "Solid over wireframe rendering".Localize(),
                Keys.None,
                Resources.OutlinedImage,
                CommandVisibility.Menu,
                this);
            strip.Items.Add(cmdInfo.GetButton());

            cmdInfo = m_commandService.RegisterCommand(
                Command.RenderTextured,
                StandardMenu.View,
                m_commandGroup,
                "Textured".Localize(),
                "Textured rendering".Localize(),
                Keys.T,
                Resources.TexturedImage,
                CommandVisibility.Menu,
                this);
            strip.Items.Add(cmdInfo.GetButton());


            cmdInfo = m_commandService.RegisterCommand(
                Command.RenderLight,
                StandardMenu.View,
                m_commandGroup,
                "Lighting".Localize(),
                "Lighting".Localize(),
                Keys.L,
                Resources.LightImage,
                CommandVisibility.Menu,
                this);
            strip.Items.Add(cmdInfo.GetButton());

            cmdInfo = m_commandService.RegisterCommand(
                Command.RenderBackFace,
                StandardMenu.View,
                m_commandGroup,
                "BackFace".Localize(),
                "Render back faces".Localize(),
                Keys.B,
                Resources.BackfaceImage,
                CommandVisibility.Menu,
                this);
            strip.Items.Add(cmdInfo.GetButton());

            cmdInfo = m_commandService.RegisterCommand(
                Command.RenderShadow,
                StandardMenu.View,
                m_commandGroup,
                "Shadow".Localize(),
                "Render shadow".Localize(),
                Keys.None,
                Resources.ShadowImage,
                CommandVisibility.Menu,
                this);
            strip.Items.Add(cmdInfo.GetButton());


            cmdInfo = m_commandService.RegisterCommand(
                Command.RenderNormals,
                StandardMenu.View,
                m_commandGroup,
                "Normals".Localize(),
                "Render Normals".Localize(),
                Keys.None,
                Resources.NormalImage,
                CommandVisibility.Menu,
                this);
            strip.Items.Add(cmdInfo.GetButton());

            m_commandService.RegisterCommand(
                Command.RenderCycle,
                StandardMenu.View,
                m_commandGroup,
                "CycleRenderModes".Localize(),
                "Cycle render modes".Localize(),
                Keys.Space,
                null,
                CommandVisibility.Menu,
                this);

            //cmdInfo = m_commandService.RegisterCommand(
            //  Command.RealTime,
            //  StandardMenu.View,
            //  m_commandGroup,
            //  "RealTime".Localize(),
            //  "Toggle real time rendering".Localize(),
            //  Keys.None,
            //  Resources.RealTimeImage,
            //  CommandVisibility.Menu,
            //  this);
            //strip.Items.Add(cmdInfo.GetButton());

            ControlInfo controlInfo = new ControlInfo("Render settings", "per view port render settings", StandardControlGroup.Hidden);

            m_propertyGrid = new Sce.Atf.Controls.PropertyEditing.PropertyGrid();
            m_controlHostService.RegisterControl(m_propertyGrid, controlInfo, null);

            if (m_scriptingService != null)
            {
                m_scriptingService.SetVariable("renderCommands", this);
            }
        }