void AlignModelView()
        {
            m_Raycaster.Reset();
            m_Raycaster.ActiveScanning = false;
            m_Raycaster.DisableCursor();

            ToolState toolState = UIStateManager.current.stateData.toolState;

            toolState.activeTool = ToolType.OrbitTool;
            Dispatcher.Dispatch(Payload <ActionTypes> .From(ActionTypes.SetToolState, toolState));
            ARToolStateData arToolStateData = ARToolStateData.defaultData;

            arToolStateData.navigationEnabled = true;
            arToolStateData.okEnabled         = true;
            arToolStateData.okButtonValidator = this;
            arToolStateData.scaleEnabled      = false;
            arToolStateData.rotateEnabled     = false;
            Dispatcher.Dispatch(Payload <ActionTypes> .From(ActionTypes.SetARToolState, arToolStateData));
            Dispatcher.Dispatch(Payload <ActionTypes> .From(ActionTypes.SetStatusWithType,
                                                            new StatusMessageData()
            {
                text = m_InstructionAlignModelView, type = StatusMessageType.Instruction
            }));

            var navigationState = UIStateManager.current.stateData.navigationState;

            navigationState.EnableAllNavigation(true);
            navigationState.showScaleReference = false;
            Dispatcher.Dispatch(Payload <ActionTypes> .From(ActionTypes.SetNavigationState, navigationState));
        }
 void SetToolState(ToolState toolState)
 {
     if (m_CloseOnSelect)
     {
         Dispatcher.Dispatch(Payload <ActionTypes> .From(ActionTypes.OpenDialog, DialogType.None));
     }
     Dispatcher.Dispatch(Payload <ActionTypes> .From(ActionTypes.SetToolState, toolState));
 }
Exemplo n.º 3
0
        void OnStateDataChanged(UIStateData data)
        {
            if (m_ToolbarsEnabled != data.toolbarsEnabled)
            {
                m_OrbitButton.button.interactable      = data.toolbarsEnabled;
                m_LookAroundButton.button.interactable = data.toolbarsEnabled;
                m_SelectButton.button.interactable     = data.toolbarsEnabled;
                m_SunStudyButton.button.interactable   = data.toolbarsEnabled;
                m_ToolbarsEnabled = data.toolbarsEnabled;
            }

            if (m_CurrentToolState != data.toolState)
            {
                m_OrbitButton.selected = false;

                m_LookAroundButton.selected = false;
                m_SelectButton.selected     = false;

                if (data.toolState.activeTool == ToolType.SelectTool)
                {
                    m_SelectButton.selected = true;
                }
                else if (data.toolState.activeTool == ToolType.OrbitTool)
                {
                    if (data.toolState.orbitType == OrbitType.OrbitAtPoint)
                    {
                        m_CurrentOrbitButtonType = data.toolState.activeTool;
                        m_OrbitButton.selected   = true;
                        m_OrbitButton.SetIcon(m_OrbitImage);
                    }
                    else if (data.toolState.orbitType == OrbitType.WorldOrbit)
                    {
                        m_LookAroundButton.selected = true;
                    }
                }
                else if (data.toolState.activeTool == ToolType.ZoomTool)
                {
                    m_CurrentOrbitButtonType = data.toolState.activeTool;
                    m_OrbitButton.selected   = true;
                    m_OrbitButton.SetIcon(m_ZoomImage);
                }
                else if (data.toolState.activeTool == ToolType.PanTool)
                {
                    m_CurrentOrbitButtonType = data.toolState.activeTool;
                    m_OrbitButton.selected   = true;
                    m_OrbitButton.SetIcon(m_PanImage);
                }
                m_CurrentToolState = data.toolState;
            }
        }
Exemplo n.º 4
0
        void OnStateDataChanged(UIStateData data)
        {
            if (m_CachedActiveDialog != data.activeDialog)
            {
                m_StatsButton.selected = (data.activeDialog == DialogType.StatsInfo || data.activeDialog == DialogType.DebugOptions);
                m_CachedActiveDialog   = data.activeDialog;
            }

            if (m_CurrentToolState != data.toolState)
            {
                if (data.toolState.infoType == InfoType.Info)
                {
                    m_StatsButton.SetIcon(m_InfoImage);
                }
                else if (data.toolState.infoType == InfoType.Debug)
                {
                    m_StatsButton.SetIcon(m_DebugImage);
                }
                m_CurrentToolState = data.toolState;
            }
            m_StatsButton.button.interactable = data.toolbarsEnabled;
        }
        void ConfirmAnchorPointBack()
        {
            ARToolStateData arToolStateData = ARToolStateData.defaultData;

            arToolStateData.navigationEnabled     = true;
            arToolStateData.previousStepEnabled   = true;
            arToolStateData.okButtonValidator     = this;
            arToolStateData.wallIndicatorsEnabled = true;
            arToolStateData.anchorPointsEnabled   = true;
            Dispatcher.Dispatch(Payload <ActionTypes> .From(ActionTypes.SetARToolState, arToolStateData));
            ToolState toolState = UIStateManager.current.stateData.toolState;

            toolState.activeTool = ToolType.OrbitTool;
            Dispatcher.Dispatch(Payload <ActionTypes> .From(ActionTypes.SetToolState, toolState));

            m_Raycaster.Reset();
            m_Raycaster.ActiveScanning = false;

            Dispatcher.Dispatch(Payload <ActionTypes> .From(ActionTypes.EnableAR, false));
            Dispatcher.Dispatch(Payload <ActionTypes> .From(ActionTypes.SetPlacementRules, PlacementRule.None));
            var navigationState = UIStateManager.current.stateData.navigationState;

            navigationState.EnableAllNavigation(true);
            Dispatcher.Dispatch(Payload <ActionTypes> .From(ActionTypes.SetNavigationState, navigationState));
            Dispatcher.Dispatch(Payload <ActionTypes> .From(ActionTypes.SetActiveToolbar,
                                                            ToolbarType.ARModelAlignSidebar));

            ConfirmAnchorPoint();

            SettingsToolStateData settingsToolState = SettingsToolStateData.defaultData;

            settingsToolState.bimFilterEnabled   = true;
            settingsToolState.sceneOptionEnabled = true;
            settingsToolState.sunStudyEnabled    = false;
            Dispatcher.Dispatch(Payload <ActionTypes> .From(ActionTypes.SetSettingsToolState, settingsToolState));
        }