Esempio n. 1
0
        public MainViewer3DControl()
        {
            // create delegate used for asynchronous calls
            _delegateSelectTab         = SelectTab;
            _delegatePopulateInspector = PopulateInspector;

            InitializeComponent();
            _captionStub = Text;

            AddEmptyTab();

            // initialize UI state shelf with a default tab
            _ui  = new UiState(new Tab(_emptyTab, null));
            _fps = new FpsTracker();

            // sync global UI with UIState
            framerateToolStripMenuItem.Checked             = toolStripButtonShowFPS.Checked = _ui.ShowFps;
            lightingToolStripMenuItem.Checked              = toolStripButtonShowShaded.Checked = _ui.RenderLit;
            cullingToolStripMenuItem.Checked               = toolStripButtonCulling.Checked = GraphicsSettings.Default.BackFaceCulling;
            texturedToolStripMenuItem.Checked              = toolStripButtonShowTextures.Checked = _ui.RenderTextured;
            wireframeToolStripMenuItem.Checked             = toolStripButtonWireframe.Checked = _ui.RenderWireframe;
            showNormalVectorsToolStripMenuItem.Checked     = toolStripButtonShowNormals.Checked = _ui.ShowNormals;
            showBoundingBoxesToolStripMenuItem.Checked     = toolStripButtonShowBB.Checked = _ui.ShowBBs;
            showAnimationSkeletonToolStripMenuItem.Checked = toolStripButtonShowSkeleton.Checked = _ui.ShowSkeleton;

            // manually register the MouseWheel handler
            glControl1.MouseWheel += OnMouseMove;

            InitRecentList();

#if LEAP
            //LeapMotion Support
            _leapListener   = new LeapListener(this as MainWindow);
            _leapController = new Controller(_leapListener);
#endif

            // register listener for tab changs
            tabControl1.SelectedIndexChanged += (object o, EventArgs e) =>
            {
                if (SelectedTabChanged != null)
                {
                    SelectedTabChanged(UiState.TabForId(tabControl1.SelectedTab));
                }
            };

            _initialized = true;

            this.toolStripButton_OpenInteraction.Checked = true;
            this.bOpenInteraction = true;

            StartUndoRedoUiStatePollLoop();
        }
Esempio n. 2
0
        public MainWindow()
        {        
            // create delegate used for asynchronous calls 
            _delegateSelectTab = SelectTab;
            _delegatePopulateInspector = PopulateInspector;
         
            InitializeComponent();
            _captionStub = Text;

            AddEmptyTab();           
   
            // initialize UI state shelf with a default tab
            _ui = new UiState(new Tab(_emptyTab, null));
            _fps = new FpsTracker();

            // sync global UI with UIState
            framerateToolStripMenuItem.Checked = toolStripButtonShowFPS.Checked = _ui.ShowFps;
            lightingToolStripMenuItem.Checked = toolStripButtonShowShaded.Checked = _ui.RenderLit;
            texturedToolStripMenuItem.Checked = toolStripButtonShowTextures.Checked = _ui.RenderTextured;
            wireframeToolStripMenuItem.Checked = toolStripButtonWireframe.Checked = _ui.RenderWireframe;
            showNormalVectorsToolStripMenuItem.Checked = toolStripButtonShowNormals.Checked = _ui.ShowNormals;
            showBoundingBoxesToolStripMenuItem.Checked = toolStripButtonShowBB.Checked = _ui.ShowBBs;
            showAnimationSkeletonToolStripMenuItem.Checked = toolStripButtonShowSkeleton.Checked = _ui.ShowSkeleton;

            // manually register the MouseWheel handler
            glControl1.MouseWheel += OnMouseMove;

            // intercept all key events sent to children
            KeyPreview = true;

            InitRecentList();

#if LEAP
            //LeapMotion Support
            _leapListener = new LeapListener(this as MainWindow);
            _leapController = new Controller(_leapListener);
#endif

            // register listener for tab changs
           tabControl1.SelectedIndexChanged += (object o, EventArgs e) => {
               if (SelectedTabChanged != null)
               {
                   SelectedTabChanged(UiState.TabForId(tabControl1.SelectedTab));
               }
           };

            _initialized = true;
            StartUndoRedoUiStatePollLoop();
        }