コード例 #1
0
ファイル: Application.cs プロジェクト: leemcknight/VLoop.NET
 private void SafeViewRemove(ViewTypes type)
 {
     if (_views.Contains(type))
     {
         _views.Remove(type);
     }
 }
コード例 #2
0
ファイル: Application.cs プロジェクト: leemcknight/VLoop.NET
        public bool LoadView(ViewTypes Type)
        {
            Viewing.View view;

            view = (Viewing.View)_views[Type];
            return(LoadView(view));
        }
コード例 #3
0
 public void SetViewType(ViewTypes viewType)
 {
     RecentesModel.ViewType  = viewType;
     DestaquesModel.ViewType = viewType;
     MapasModel.ViewType     = viewType;
     FavoritosModel.ViewType = viewType;
 }
コード例 #4
0
 public void SetViewType(ViewTypes viewType)
 {
     FacebookModel.ViewType = viewType;
     TwitterModel.ViewType = viewType;
     InstagramModel.ViewType = viewType;
     SobreModel.ViewType = viewType;
 }
コード例 #5
0
ファイル: Camera.ViewType.cs プロジェクト: bobbyzhu/CSharpGL
        /// <summary>
        /// Apply specifed viewType to camera according to bounding box's size and position.
        /// <para>    +-------+    </para>
        /// <para>   /|      /|    </para>
        /// <para>  +-------+ |    </para>
        /// <para>  | |     | |    </para>
        /// <para>  | O-----|-+---X</para>
        /// <para>  |/      |/     </para>
        /// <para>  +-------+      </para>
        /// <para> /  |            </para>
        /// <para>Y   Z            </para>
        /// <para>其边长为(2 * Math.Sqrt(3)), 所在的坐标系如下</para>
        /// <para>   O---X</para>
        /// <para>  /|    </para>
        /// <para> Y |    </para>
        /// <para>   Z    </para>
        /// </summary>
        /// <param name="camera"></param>
        /// <param name="boundingBox"></param>
        /// <param name="viewType"></param>
        public static void ApplyViewType(this IPerspectiveViewCamera camera, IBoundingBox boundingBox,
                                         ViewTypes viewType)
        {
            vec3  length = boundingBox.MaxPosition - boundingBox.MinPosition;
            float size   = Math.Max(Math.Max(length.x, length.y), length.z);

            {
                vec3 target = boundingBox.MaxPosition / 2 + boundingBox.MinPosition / 2;

                vec3 target2Position;
                vec3 upVector;
                GetBackAndUp(out target2Position, out upVector, viewType);

                vec3 position = target + target2Position * (size * 2 + 1);

                camera.Position = position;
                camera.Target   = target;
                camera.UpVector = upVector;
            }

            {
                int[] viewport = new int[4];
                OpenGL.GetInteger(GetTarget.Viewport, viewport);
                int width = viewport[2]; int height = viewport[3];

                IPerspectiveCamera perspectiveCamera = camera;
                perspectiveCamera.FieldOfView = 60;
                perspectiveCamera.AspectRatio = (double)width / (double)height;
                perspectiveCamera.Near        = 0.01;
                perspectiveCamera.Far         = size * 3 + 1;// double.MaxValue;
            }
        }
コード例 #6
0
        public T GetView <T>(ViewTypes type) where T : Control
        {
            T result = default(T);

            switch (type)
            {
            case ViewTypes.Clone:
                result = new CloneView(_messenger, _shell, _storage, _web) as T;
                break;

            case ViewTypes.Create:
                result = new CreateView(_git, _messenger, _shell, _storage, _web) as T;
                break;

            case ViewTypes.Login:
                result = new LoginView(_messenger, _shell, _storage, _web) as T;
                break;

            case ViewTypes.CreateSnippet:
                result = new CreateSnippet(_messenger, _shell, _storage, _web) as T;
                break;

            default:
                break;
            }
            return(result);
        }
コード例 #7
0
ファイル: ViewFactory.cs プロジェクト: kicholen/SpaceShooter
    public virtual IView Create(ViewTypes type)
    {
        IView view = null;
        switch (type) {
            case ViewTypes.GAME:
                view = new GameView(services.Updateables, services.GameService);
            break;
            case ViewTypes.INIT:
                view = new InitView();
            break;
            case ViewTypes.LOAD:
                view = new LoadView();
            break;
            case ViewTypes.MAIN:
                view = new MainView(services);
                break;
            case ViewTypes.RESULTS:
                view = new ResultsView(services);
                break;
            case ViewTypes.LEVEL_UP:
                view = new LevelUpView(services);
                break;
        }
        initView(view);

        return view;
    }
コード例 #8
0
        private void AddSection(NotifyCollectionChangedEventArgs e)
        {
            // regard as coming only one item.
            if (e.NewItems[0] is not Section section)
            {
                return;
            }
            int startIndex = RowIndexFromParentCollection(e.NewStartingIndex);

            Insert(startIndex, new RowInfo(section, ViewType.CustomHeader));
            // Insert(startIndex, new RowInfo(section, section.HeaderView == null ? ViewType.TextHeader : ViewType.CustomHeader));

            for (var i = 0; i < section.Count; i++)
            {
                Cell cell = section[i];
                if (!ViewTypes.ContainsKey(cell.GetType()))
                {
                    ViewTypes.Add(cell.GetType(), GetNextTypeIndex());
                }

                var rowInfo = new RowInfo(section, cell, (ViewType)ViewTypes[cell.GetType()]);

                Insert(i + 1 + startIndex, rowInfo);
            }

            Insert(startIndex + section.Count() + 1, new RowInfo(section, ViewType.CustomFooter));
            // Insert(startIndex + section.Count() + 1, new RowInfo(section, section.FooterView == null ? ViewType.TextFooter : ViewType.CustomFooter));

            _Adapter.NotifyItemRangeInserted(startIndex, section.Count + 2);             // add a header and footer
        }
コード例 #9
0
        private void cmbViewType_SelectedIndexChanged(object sender, EventArgs e)
        {
            string    selected = this.cmbViewType.SelectedItem.ToString();
            ViewTypes viewType = (ViewTypes)Enum.Parse(typeof(ViewTypes), selected);

            this.scientificVisual3DControl.ViewType = viewType;
        }
コード例 #10
0
 public void Dispose()
 {
     _Root.SectionCollectionChanged -= OnRootSectionCollectionChanged;
     _Root.CollectionChanged        -= OnRootCollectionChanged;
     Clear();
     ViewTypes?.Clear();
 }
コード例 #11
0
        public void Navigate(ViewTypes destination, object parameter = null, bool replace = false)
        {
            if (CurrentViewModel != null && replace == false)
            {
                History.Push(CurrentViewModel);
            }
            switch (destination)
            {
            case ViewTypes.Data:
                CurrentViewModel = _vmStore.Get <DataViewModel>(parameter);
                break;

            case ViewTypes.Search:
                CurrentViewModel = _vmStore.Get <SearchViewModel>(parameter);
                break;

            case ViewTypes.Match:
                CurrentViewModel = _vmStore.Get <MatchDetailsViewModel>(parameter);
                break;

            case ViewTypes.Lobby:
                CurrentViewModel = _vmStore.Get <LobbyViewModel>(parameter);
                break;

            case ViewTypes.TeamAnalyze:
                CurrentViewModel = _vmStore.Get <TeamAnalyzeViewModel>(parameter);
                break;
            }
        }
コード例 #12
0
        public void TurnViewOn(ViewTypes type, bool closeCurrentView = false, Action callback = null)
        {
            if (type == ViewTypes.None)
            {
                return;
            }

            if (ViewExists(type) == false)
            {
                return;
            }

            if (closeCurrentView)
            {
                TurnViewOff(CurrentViewType, type);
            }
            else
            {
                ViewBase page = GetView(type);
                page.gameObject.SetActive(true);
                page.SetState(true);
                CurrentViewType = type;
            }
            callback?.Invoke();
        }
コード例 #13
0
ファイル: CameraHelper.cs プロジェクト: JanneLee/CSharpGL
        /// <summary>
        /// Apply specifed viewType to camera according to bounding box's size and position.
        /// <para>    +-------+    </para>
        /// <para>   /|      /|    </para>
        /// <para>  +-------+ |    </para>
        /// <para>  | |     | |    </para>
        /// <para>  | O-----|-+---X</para>
        /// <para>  |/      |/     </para>
        /// <para>  +-------+      </para>
        /// <para> /  |            </para>
        /// <para>Y   Z            </para>
        /// <para>其边长为(2 * Math.Sqrt(3)), 所在的坐标系如下</para>
        /// <para>   O---X</para>
        /// <para>  /|    </para>
        /// <para> Y |    </para>
        /// <para>   Z    </para>
        /// </summary>
        /// <param name="camera"></param>
        /// <param name="boundingBox"></param>
        /// <param name="viewType"></param>
        public static void ApplyViewType(this IPerspectiveViewCamera camera, IBoundingBox boundingBox,
            ViewTypes viewType)
        {
            float sizeX, sizeY, sizeZ;
            boundingBox.GetBoundDimensions(out sizeX, out sizeY, out sizeZ);
            float size = Math.Max(Math.Max(sizeX, sizeY), sizeZ);

            {
                float centerX, centerY, centerZ;
                boundingBox.GetCenter(out centerX, out centerY, out centerZ);
                vec3 target = new vec3(centerX, centerY, centerZ);

                vec3 target2Position;
                vec3 upVector;
                GetBackAndUp(out target2Position, out upVector, viewType);

                vec3 position = target + target2Position * (size * 2 + 1);

                camera.Position = position;
                camera.Target = target;
                camera.UpVector = upVector;
            }

            {
                int[] viewport = new int[4];
                GL.GetInteger(GetTarget.Viewport, viewport);
                int width = viewport[2]; int height = viewport[3];

                IPerspectiveCamera perspectiveCamera = camera;
                perspectiveCamera.FieldOfView = 60;
                perspectiveCamera.AspectRatio = (double)width / (double)height;
                perspectiveCamera.Near = 0.01;
                perspectiveCamera.Far = size * 3 + 1;// double.MaxValue;
            }
        }
コード例 #14
0
        public void TurnViewOff(ViewTypes offType, ViewTypes onType = ViewTypes.None, bool waitForExit = false)
        {
            if (offType == ViewTypes.None)
            {
                return;
            }

            if (ViewExists(offType) == false)
            {
                return;
            }

            ViewBase offPage = GetView(offType);

            if (offPage.gameObject.activeSelf)
            {
                offPage.SetState(false);
            }

            if (waitForExit && offPage.UseAnimation)
            {
                ViewBase onPage = GetView(onType);
                StopCoroutine(nameof(WaitForViewExit));
                StartCoroutine(WaitForViewExit(onPage, offPage));
            }
            else
            {
                TurnViewOn(onType);
            }
        }
コード例 #15
0
 public void SetViewType(ViewTypes viewType)
 {
     VideosModel.ViewType = viewType;
     VlogsModel.ViewType = viewType;
     FacebookModel.ViewType = viewType;
     AboutThiroshigaModel.ViewType = viewType;
 }
コード例 #16
0
 public void SetViewType(ViewTypes viewType)
 {
     QuestionablecontentModel.ViewType = viewType;
     PennyArcadeModel.ViewType         = viewType;
     PvponlineModel.ViewType           = viewType;
     CatandgirlModel.ViewType          = viewType;
 }
コード例 #17
0
        /// <summary>
        /// Sets the view type.
        /// </summary>
        /// <param name="viewType">The view type to be displayed</param>
        /// <history>
        /// [Curtis_Beard]	   11/11/2014	Initial
        /// [Curtis_Beard]	   08/16/2016	CHG: 107, allow time selection
        /// </history>
        public void SetViewType(ViewTypes viewType)
        {
            currentViewType = viewType;

            switch (currentViewType)
            {
            case ViewTypes.DateTime:
                pnlDateTime.Visible = true;
                txtValue.Visible    = false;
                numValue.Visible    = false;
                pnlSize.Visible     = false;
                break;

            case ViewTypes.String:
                pnlDateTime.Visible = false;
                txtValue.Visible    = true;
                numValue.Visible    = false;
                pnlSize.Visible     = false;
                break;

            case ViewTypes.Numeric:
                pnlDateTime.Visible = false;
                txtValue.Visible    = false;
                numValue.Visible    = true;
                pnlSize.Visible     = false;
                break;

            case ViewTypes.Size:
                pnlDateTime.Visible = false;
                txtValue.Visible    = false;
                numValue.Visible    = false;
                pnlSize.Visible     = true;
                break;
            }
        }
コード例 #18
0
ファイル: MainViewModel.cs プロジェクト: Pzink3/Disney-US
 public void SetViewType(ViewTypes viewType)
 {
     PhineasAndFerbModel.ViewType = viewType;
     KimPossibleModel.ViewType    = viewType;
     LizzieMcguireModel.ViewType  = viewType;
     HannahMontanaModel.ViewType  = viewType;
 }
コード例 #19
0
    public override IView Create(ViewTypes type)
    {
        IView view = null;
        switch (type) {
            case ViewTypes.EDITOR_LANDING:
                view = new EditorView(services.ViewService);
                break;
            case ViewTypes.EDITOR_PATH:
                view = new PathView((services as EditorServices).PathService, services.ViewService);
                break;
            case ViewTypes.EDITOR_EDIT_PATH:
                view = new EditPathView((services as EditorServices).PathService, services.ViewService);
                break;
            case ViewTypes.EDITOR_LEVELS:
                view = new LevelsView((services as EditorServices).LevelService, services.ViewService,
                    (services as EditorServices).PathService, (services as EditorServices).EnemyService,
                    (services as EditorServices).BonusService, (services as EditorServices).DifficultyService);
                break;
            case ViewTypes.EDITOR_EDIT_LEVEL:
                view = new EditLevelView(services.Pool,
                    (services as EditorServices).LevelService,
                    services.ViewService,
                    (services as EditorServices).PathService,
                    (services as EditorServices).EnemyService);
                break;
            case ViewTypes.EDITOR_EDIT_ENEMY:
                view = new EditEnemyView(services.Pool, services.ViewService, (services as EditorServices).EnemyService);
                break;
            case ViewTypes.EDITOR_ENEMIES:
                view = new EnemiesView(services.Pool, services.ViewService, (services as EditorServices).EnemyService);
                break;
            case ViewTypes.EDITOR_EDIT_DIFFICULTY:
                view = new EditDifficultyView(services.Pool, services.ViewService, (services as EditorServices).DifficultyService);
                break;
            case ViewTypes.EDITOR_DIFFICULTIES:
                view = new DifficultiesView(services.Pool, services.ViewService, (services as EditorServices).DifficultyService);
                break;
            case ViewTypes.EDITOR_EDIT_BONUS:
                view = new EditBonusView(services.Pool, services.ViewService, (services as EditorServices).BonusService);
                break;
            case ViewTypes.EDITOR_BONUSES:
                view = new BonusesView(services.Pool, services.ViewService, (services as EditorServices).BonusService);
                break;
            case ViewTypes.EDITOR_EDIT_LANGUAGE:
                view = new EditLanguageView(services.Pool, services.ViewService, (services as EditorServices).LanguageService);
                break;
            case ViewTypes.EDITOR_LANUGAGES:
                view = new LanguagesView(services.Pool, services.ViewService, (services as EditorServices).LanguageService);
                break;
        }
        if (view == null) {
            view = base.Create(type);
        }
        else {
            initView(view);
        }

        return view;
    }
コード例 #20
0
 public void SetViewType(ViewTypes viewType)
 {
     TopNewsModel.ViewType = viewType;
     NewsModel.ViewType = viewType;
     TechSolutionModel.ViewType = viewType;
     NumberGameModel.ViewType = viewType;
     FacebookModel.ViewType = viewType;
 }
コード例 #21
0
 public void SetViewType(ViewTypes viewType)
 {
     AboutModel.ViewType         = viewType;
     PrabathsBlogModel.ViewType  = viewType;
     JaliyasBlogModel.ViewType   = viewType;
     ChamindasBlogModel.ViewType = viewType;
     MalinsBlogModel.ViewType    = viewType;
 }
コード例 #22
0
ファイル: MainViewModel.cs プロジェクト: KonradIT/waterluster
 public void SetViewType(ViewTypes viewType)
 {
     WaterlustModel.ViewType = viewType;
     VideosModel.ViewType = viewType;
     FacebookModel.ViewType = viewType;
     DonateModel.ViewType = viewType;
     ContactModel.ViewType = viewType;
 }
コード例 #23
0
 public void SetViewType(ViewTypes viewType)
 {
     NewYorkTimesModel.ViewType   = viewType;
     TheGuardianModel.ViewType    = viewType;
     NYRBModel.ViewType           = viewType;
     RTBookReviewsModel.ViewType  = viewType;
     TheIndependentModel.ViewType = viewType;
 }
コード例 #24
0
 void SetViewType(ViewTypes viewType)
 {
     if (_viewType != viewType)
     {
         _viewType = viewType;
         RaisePropertyChanged();
     }
 }
コード例 #25
0
 public void SetViewType(ViewTypes viewType)
 {
     TheOatmealModel.ViewType                = viewType;
     GarfieldGarfieldModel.ViewType          = viewType;
     XKCDModel.ViewType                      = viewType;
     SatMorningBreakfastCerealModel.ViewType = viewType;
     NuklearPowerModel.ViewType              = viewType;
 }
コード例 #26
0
 public void SetViewType(ViewTypes viewType)
 {
     ElheddafModel.ViewType    = viewType;
     EchoroukModel.ViewType    = viewType;
     ElwatanModel.ViewType     = viewType;
     LexpressionModel.ViewType = viewType;
     LiberteModel.ViewType     = viewType;
 }
コード例 #27
0
        void OnItemSelected(object sender, SelectedItemChangedEventArgs e)
        {
            MasterPageItem masterPageItem = e.SelectedItem as MasterPageItem;
            ModalPage      selected;

            if (masterPageItem != null)
            {
                ViewTypes viewSelected = masterPageItem.View;
                try
                {
                    if (String.IsNullOrEmpty(SessionSingleton.ContactlessDeviceId) && String.IsNullOrEmpty(SessionSingleton.ContactDeviceId)
                        &&
                        viewSelected != ViewTypes.Settings)
                    {
                        App.Current.MainPage.DisplayAlert("Validation", "No card reader selected in settings", "OK");
                        viewSelected = ViewTypes.Settings;
                    }

                    switch (viewSelected)
                    {
                    case ViewTypes.Transact:
                        selected = new EMVTx(contactCardInterfaceManger, contactlessCardInterfaceManger, configProvider, onlineApprover, tcpClientStream);
                        break;

                    case ViewTypes.QRCode:
                        selected = new EMVQRCodeView(contactCardInterfaceManger, contactlessCardInterfaceManger, configProvider, onlineApprover, tcpClientStream);
                        break;

                    case ViewTypes.Settings:
                        selected = new SettingsView(contactCardInterfaceManger, contactlessCardInterfaceManger);
                        break;

                    default:
                        throw new Exception("Unknown Form Type:" + viewSelected);
                    }
                    selected.PageClosing += (sender2, e2) =>
                    {
                        naviDetailPage.PopAsync();
                    };
                    masterPage.ClearSelectedItems();
                    IsPresented = false;

                    if (naviDetailPage.Navigation.NavigationStack.Count > 1)
                    {
                        naviDetailPage.Navigation.PopAsync();
                    }
                    naviDetailPage.PushAsync(selected);
                }
                catch (Exception ex)
                {
                    App.Current.MainPage.DisplayAlert("Error", ex.Message, "OK");
                    naviDetailPage.PushAsync(new IntroView());
                    masterPage.ClearSelectedItems();
                    IsPresented = false;
                    return;
                }
            }
        }
コード例 #28
0
 public void SetViewType(ViewTypes viewType)
 {
     AboutBandModel.ViewType = viewType;
     YouTubeChannelModel.ViewType = viewType;
     FacebookUpdatesModel.ViewType = viewType;
     InstaPhotosModel.ViewType = viewType;
     TwittItModel.ViewType = viewType;
     MenuModel.ViewType = viewType;
 }
コード例 #29
0
 public void SetViewType(ViewTypes viewType)
 {
     ScienceNewsModel.ViewType    = viewType;
     EScienceNewsModel.ViewType   = viewType;
     BbcScienceNewsModel.ViewType = viewType;
     SciencemagModel.ViewType     = viewType;
     ScienceDailyModel.ViewType   = viewType;
     TOIScienceModel.ViewType     = viewType;
 }
コード例 #30
0
 public void SetViewType(ViewTypes viewType)
 {
     ELECTRONICSModel.ViewType         = viewType;
     CircuitsAndNetworksModel.ViewType = viewType;
     CIRCUITSModel.ViewType            = viewType;
     NETWORKSModel.ViewType            = viewType;
     EXTRAINFOModel.ViewType           = viewType;
     AUDIOVISUALSModel.ViewType        = viewType;
 }
コード例 #31
0
        private ViewBase GetView(ViewTypes type)
        {
            if (ViewExists(type) == false)
            {
                return(null);
            }

            return((ViewBase)_views[type]);
        }
コード例 #32
0
 public void SetViewType(ViewTypes viewType)
 {
     AboutMeModel.ViewType         = viewType;
     TwitterModel.ViewType         = viewType;
     InstagramModel.ViewType       = viewType;
     MyBlogModel.ViewType          = viewType;
     MyVideosModel.ViewType        = viewType;
     MyFavoriteMusicModel.ViewType = viewType;
 }
コード例 #33
0
 public void SetViewType(ViewTypes viewType)
 {
     AboutModel.ViewType            = viewType;
     OnlineLecturesModel.ViewType   = viewType;
     FreeBooksModel.ViewType        = viewType;
     EngineeringToolsModel.ViewType = viewType;
     EngineeringMythsModel.ViewType = viewType;
     EngineersMemeModel.ViewType    = viewType;
 }
コード例 #34
0
 public void SetViewType(ViewTypes viewType)
 {
     AppModel.ViewType          = viewType;
     GoProVODModel.ViewType     = viewType;
     GPTipsTricksModel.ViewType = viewType;
     GoProPhotosModel.ViewType  = viewType;
     GoProMountsModel.ViewType  = viewType;
     AboutModel.ViewType        = viewType;
 }
コード例 #35
0
ファイル: MainViewModel.cs プロジェクト: KonradIT/BePro
 public void SetViewType(ViewTypes viewType)
 {
     VideosModel.ViewType = viewType;
     GoProPhotosModel.ViewType = viewType;
     GoProFlickrModel.ViewType = viewType;
     GoProNewsModel.ViewType = viewType;
     GoProFacebookModel.ViewType = viewType;
     AboutModel.ViewType = viewType;
 }
コード例 #36
0
 public void SetViewType(ViewTypes viewType)
 {
     NdtvModel.ViewType         = viewType;
     TimesOfIndiaModel.ViewType = viewType;
     IndiaTodayModel.ViewType   = viewType;
     SifySportsModel.ViewType   = viewType;
     TheHinduModel.ViewType     = viewType;
     IbnLiveModel.ViewType      = viewType;
 }
コード例 #37
0
        public bool IsViewOn(ViewTypes type)
        {
            if (ViewExists(type) == false)
            {
                return(false);
            }

            return(GetView(type).IsOn);
        }
コード例 #38
0
ファイル: MainViewModel.cs プロジェクト: jookie/Gaj2
 public void SetViewType(ViewTypes viewType)
 {
     AppModel.ViewType = viewType;
     GoProVODModel.ViewType = viewType;
     GPTipsTricksModel.ViewType = viewType;
     GoProPhotosModel.ViewType = viewType;
     GoProMountsModel.ViewType = viewType;
     AboutModel.ViewType = viewType;
 }
コード例 #39
0
 public void SetViewType(ViewTypes viewType)
 {
     EnvironemtalNewsModel.ViewType   = viewType;
     GoingGreenModel.ViewType         = viewType;
     LivingGreenModel.ViewType        = viewType;
     BackyardMattersModel.ViewType    = viewType;
     EnvironmentMattersModel.ViewType = viewType;
     VideoTipsModel.ViewType          = viewType;
 }
コード例 #40
0
ファイル: MainViewModel.cs プロジェクト: KonradIT/HeyIsItOn
 public void SetViewType(ViewTypes viewType)
 {
     HeyIsItOnVODModel.ViewType = viewType;
     HeyIsItOnBlogModel.ViewType = viewType;
     FBHeyIsItOnModel.ViewType = viewType;
     MountsAccesoriesModel.ViewType = viewType;
     BatteriesAndSDsModel.ViewType = viewType;
     DIYGoProModel.ViewType = viewType;
 }
コード例 #41
0
 public void SetViewType(ViewTypes viewType)
 {
     MuSiCModel.ViewType = viewType;
     MUSICALINSTRUMENTSModel.ViewType = viewType;
     TYPESOFINSTRUMENTSModel.ViewType = viewType;
     HOWTOPLAYModel.ViewType          = viewType;
     MUsIcNEWSModel.ViewType          = viewType;
     ViSuAlSModel.ViewType            = viewType;
 }
コード例 #42
0
ファイル: ViewService.cs プロジェクト: kicholen/SpaceShooter
 public IView SetView(ViewTypes type)
 {
     if (currentView != null) {
         touchBlocker.SetActive(true);
         nextView = factory.Create(type);
         currentView.Hide();
         return nextView;
     }
     else {
         currentView = factory.Create(type);
         showCurrentView();
         return currentView;
     }
 }
コード例 #43
0
 public void SetView(ViewTypes viewType)
 {
     switch (viewType)
     {
         case ViewTypes.Idopont:
             view = new Idopont_View(this);
             break;
         case ViewTypes.Adatok:
             view = new AdatMod_View(this);
             break;
         default:
             break;
     }
     OnPropertyChanged("view");
 }
コード例 #44
0
ファイル: Camera.cs プロジェクト: BeRo1985/LevelEditor
 /// <summary>
 /// Gets all the data required to completely represent this camera's state, so that it can
 /// later be restored by calling SetState(). Note that the aspect ratio is not saved and
 /// restored, because it should be set depending on the aspect ratio of the viewport; it would
 /// be wrong to restore the camera's aspect ratio after the user has resized the window, for example.</summary>
 /// <param name="perspective">Camera view type</param>
 /// <param name="eye">Eye point in "world view" space</param>
 /// <param name="lookAtPoint">Camera look-at point in "world view" space</param>
 /// <param name="upVector">Camera up direction in "world view" space</param>
 /// <param name="yFov">Y-field-of-view in radians</param>
 /// <param name="nearZ">Current near plane distance value for the current projection type</param>
 /// <param name="farZ">Current far plane distance value for the current projection type</param>
 /// <param name="focusRadius">Focus radius around the "look at" point</param>
 public void GetState(
     out ViewTypes perspective,
     out Vec3F eye,
     out Vec3F lookAtPoint,
     out Vec3F upVector,
     out float yFov,
     out float nearZ,
     out float farZ,
     out float focusRadius)
 {
     perspective = m_viewType;
     eye = Eye;
     lookAtPoint = LookAtPoint;
     upVector = Up;
     yFov = YFov;
     nearZ = NearZ;
     farZ = FarZ;
     focusRadius = FocusRadius;
 }
コード例 #45
0
ファイル: CameraHelper.cs プロジェクト: Mofangbao/CSharpGL
        /// <summary>
        /// Apply specifed viewType to camera according to bounding box's size and position.
        /// <para>    +-------+    </para>
        /// <para>   /|      /|    </para>
        /// <para>  +-------+ |    </para>
        /// <para>  | |     | |    </para>
        /// <para>  | O-----|-+---X</para>
        /// <para>  |/      |/     </para>
        /// <para>  +-------+      </para>
        /// <para> /  |            </para>
        /// <para>Y   Z            </para>
        /// <para>其边长为(2 * Math.Sqrt(3)), 所在的坐标系如下</para>
        /// <para>   O---X</para>
        /// <para>  /|    </para>
        /// <para> Y |    </para>
        /// <para>   Z    </para>
        /// </summary>
        /// <param name="camera"></param>
        /// <param name="boundingBox"></param>
        /// <param name="viewType"></param>
        public static void ApplyViewType(this IOrthoViewCamera camera, IBoundingBox boundingBox,
             ViewTypes viewType)
        {
            float sizeX, sizeY, sizeZ;
            boundingBox.GetBoundDimensions(out sizeX, out sizeY, out sizeZ);
            float size = Math.Max(Math.Max(sizeX, sizeY), sizeZ);

            {
                float centerX, centerY, centerZ;
                boundingBox.GetCenter(out centerX, out centerY, out centerZ);
                vec3 target = new vec3(centerX, centerY, centerZ);

                vec3 target2Position;
                vec3 upVector;
                GetBackAndUp(out target2Position, out upVector, viewType);

                vec3 position = target + target2Position * (size * 2 + 1);

                camera.Position = position;
                camera.Target = target;
                camera.UpVector = upVector;
            }

            {
                int[] viewport = new int[4];
                GL.GetInteger(GetTarget.Viewport, viewport);
                int width = viewport[2]; int height = viewport[3];

                IOrthoCamera orthoCamera = camera;
                if (width > height)
                {
                    orthoCamera.Left = -size * width / height;
                    orthoCamera.Right = size * width / height;
                    orthoCamera.Bottom = -size;
                    orthoCamera.Top = size;
                }
                else
                {
                    orthoCamera.Left = -size;
                    orthoCamera.Right = size;
                    orthoCamera.Bottom = -size * height / width;
                    orthoCamera.Top = size * height / width;
                }
                orthoCamera.Near = 0.001;
                orthoCamera.Far = size * 3 + 1;// double.MaxValue;
            }
        }
コード例 #46
0
ファイル: CameraHelper.cs プロジェクト: Mofangbao/CSharpGL
 private static void GetBackAndUp(out vec3 target2Position, out vec3 upVector, ViewTypes viewType)
 {
     switch (viewType)
     {
         case ViewTypes.UserView:
             //UserView 定义为从顶视图开始,绕X 轴旋转30 度,在绕Z 轴45 度,并且能看到整个模型的虚拟模型空间。
             target2Position = new vec3((float)Math.Sqrt(3), (float)Math.Sqrt(3), -1);
             target2Position.Normalize();
             upVector = new vec3(0, 0, -1);
             break;
         case ViewTypes.Top:
             target2Position = new vec3(0, 0, -1);
             upVector = new vec3(0, -1, 0);
             break;
         case ViewTypes.Bottom:
             target2Position = new vec3(0, 0, 1);
             upVector = new vec3(0, -1, 0);
             break;
         case ViewTypes.Left:
             target2Position = new vec3(-1, 0, 0);
             upVector = new vec3(0, 0, -1);
             break;
         case ViewTypes.Right:
             target2Position = new vec3(1, 0, 0);
             upVector = new vec3(0, 0, -1);
             break;
         case ViewTypes.Front:
             target2Position = new vec3(0, 1, 0);
             upVector = new vec3(0, 0, -1);
             break;
         case ViewTypes.Back:
             target2Position = new vec3(0, -1, 0);
             upVector = new vec3(0, 0, -1);
             break;
         default:
             throw new NotImplementedException(string.Format("new value({0}) of EViewType is not implemented!", viewType));
         //break;
     }
 }
コード例 #47
0
ファイル: MainViewModel.cs プロジェクト: compkos/Menu
 public void SetViewType(ViewTypes viewType)
 {
     NavigateModel.ViewType = viewType;
     SpecialOffersModel.ViewType = viewType;
 }
コード例 #48
0
ファイル: MainViewModel.cs プロジェクト: compkos/Menu
 public void SetViewType(ViewTypes viewType)
 {
     DashboardModel.ViewType = viewType;
 }
コード例 #49
0
ファイル: Camera.cs プロジェクト: BeRo1985/LevelEditor
 /// <summary>
 /// Sets this cammera's state completely. Complements GetState().</summary>
 /// <param name="viewType">Camera view type</param>
 /// <param name="eye">Eye point in "world view" space</param>
 /// <param name="lookAtPoint">Camera look-at point in "world view" space</param>
 /// <param name="upVector">Camera up direction in "world view" space</param>
 /// <param name="yFov">Y-field-of-view in radians</param>
 /// <param name="nearZ">Current near plane distance value for the current projection type</param>
 /// <param name="farZ">Current far plane distance value for the current projection type</param>
 /// <param name="focusRadius">Focus radius around the "look at" point</param>
 public void SetState(
     ViewTypes viewType,
     Vec3F eye,
     Vec3F lookAtPoint,
     Vec3F upVector,
     float yFov,
     float nearZ,
     float farZ,
     float focusRadius)
 {
     // to avoid duplicate camera events, let's batch up all the changes.
     m_changingCamera = true;
     try
     {
         m_viewType = viewType;
         Set(eye, lookAtPoint, upVector);
         if (viewType == ViewTypes.Perspective)
         {
             SetPerspective(yFov, m_aspectRatio, nearZ, farZ);
         }
         else
         {
             float d = DistanceFromLookAt;
             SetOrthographic(d * m_aspectRatio / 2,
                 -d * m_aspectRatio / 2,
                 d / 2,
                 -d / 2,
                 nearZ,
                 farZ);
         }
     }
     finally
     {
         m_changingCamera = false;
     }
     OnCameraChanged(EventArgs.Empty);
 }
コード例 #50
0
        private void Earth3d_Load(object sender, System.EventArgs e)
        {
            CheckOSVersion();
            string path = Properties.Settings.Default.ImageSetUrl;

            if (Properties.Settings.Default.ImageSetUrl.ToLower().Contains("imagesetsnew"))
            {
                Properties.Settings.Default.ImageSetUrl = "http://www.worldwidetelescope.org/wwtweb/catalog.aspx?X=ImageSets5";
            }
             
            Earth3d.MainWindow = this;
            this.dsm = new DataSetManager();
            Constellations.Containment = this.constellationCheck;

            ContextSearch.InitializeDatabase(true);

            LoadExploreRoot();
            if (explorerRoot != null)
            {
                ContextSearch.AddFolderToSearch(explorerRoot, true);
            }
            ContextSearch.AddCatalogs(true);

            BackInitDelegate initBackground = SearchInit;

            initBackground.BeginInvoke(null, null);

            this.WindowState = FormWindowState.Maximized;



            this.FormBorderStyle = TouchKiosk ? FormBorderStyle.None : FormBorderStyle.Sizable;
            TileCache.StartQueue();
            this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            this.SetStyle(ControlStyles.UserPaint, true);
            Earth3d.MainWindow.Config.DomeTilt = (float)Properties.Settings.Default.DomeTilt;
            if (ProjectorServer)
            {
                ShowFullScreen(true);
                this.timer.Interval = 1000;
                this.InputTimer.Enabled = false;
                Cursor.Hide();
                Properties.Settings.Default.ShowCrosshairs = false;
                Properties.Settings.Default.SolarSystemMultiRes = true;
                NetControl.Start();

            }
            else
            {
                if (Properties.Settings.Default.ListenMode || Settings.DomeView)
                {
                    NetControl.Start();
                }
            }
            if (Settings.MasterController)
            {
                NetControl.StartStatusListner();
            }

            if (Settings.MasterController)
            {
                NetControl.LoadNodeList();
            }

            if (Earth3d.TouchKiosk)
            {
                this.menuTabs.IsVisible = false;
                this.kioskTitleBar.Visible = true;
                Properties.Settings.Default.ShowTouchControls = true;
                ShowFullScreen(true);
            }

            if (NoUi)
            {
                this.menuTabs.IsVisible = false;
                Properties.Settings.Default.ShowTouchControls = true;
                ShowFullScreen(true);
            }

            Tile.GrayscaleStyle = Properties.Settings.Default.MonochromeImageStyle;



            // This forces a init at startup does not do anything but force the static contstuctor to fire now
            LayerManager.LoadTree();

            listenUpBoysToolStripMenuItem.Checked = Properties.Settings.Default.ListenMode;
            int id = Properties.Settings.Default.StartUpLookAt;
            if (Properties.Settings.Default.StartUpLookAt == 5)
            {
                id = Properties.Settings.Default.LastLookAtMode;
            }

            if (Properties.Settings.Default.StartUpLookAt == 6)
            {
                Random rnd = new Random();
                id = rnd.Next(-1, 5);
                Properties.Settings.Default.LastLookAtMode = id;
            }

            CurrentImageSet = GetDefaultImageset((ImageSetType)id, BandPass.Visible);

            Properties.Settings.Default.SettingChanging += new System.Configuration.SettingChangingEventHandler(Default_SettingChanging);
            Properties.Settings.Default.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(Default_PropertyChanged);

            if (Properties.Settings.Default.LocalHorizonMode)
            {
                viewType = ViewTypes.AltAz;
            }
            else
            {
                viewType = ViewTypes.Equatorial;
            }
            InitSpaceNavigator();
            ReadyToRender = true;
            Refresh();

            try
            {
                fov = new FieldOfView(Properties.Settings.Default.FovTelescope, Properties.Settings.Default.FovCamera, Properties.Settings.Default.FovEyepiece);
            }
            catch
            {
            }

            SpaceTimeController.Altitude = Properties.Settings.Default.LocationAltitude;
            SpaceTimeController.Location = Coordinates.FromLatLng(Properties.Settings.Default.LocationLat, Properties.Settings.Default.LocationLng);

            TourPlayer.TourEnded += new EventHandler(TourPlayer_TourEnded);
            if (KmlMarkers == null)
            {
                KmlMarkers = new KmlLabels();
            }
            ReadyToRender = true;
            Initialized = true;
            this.Activate();
            fadeImageSet.State = false;
            fadeImageSet.State = true;
            fadeImageSet.TargetState = false;

            // Force settings 
            Properties.Settings.Default.ActualPlanetScale = true;
            Properties.Settings.Default.HighPercitionPlanets = true;
            Properties.Settings.Default.ShowMoonsAsPointSource = false;
            Properties.Settings.Default.ShowSolarSystem.TargetState = true;

            toolStripMenuItem2.Checked = Settings.MasterController;

            viewCamera.Target = SolarSystemObjects.Sun;

            if (!ProjectorServer)
            {
                webServer.Startup();

                sampConnection = new Samp();

                // Register goto
                SampMessageHandler.RegiseterMessage(new SampCoordPointAtSky(new CoordPointAtSkyDelegate(SampGoto)));
                SampMessageHandler.RegiseterMessage(new SampTableLoadVoTable(new TableLoadVoTableDelegate(SampLoadTable)));
                SampMessageHandler.RegiseterMessage(new SampImageLoadFits(new ImageLoadFitsDelegate(SampLoadFitsImage)));
                SampMessageHandler.RegiseterMessage(new SampTableHighlightRow(new TableHighlightRowDelegate(SampHighlightRow)));

                NetworkChange.NetworkAddressChanged += new NetworkAddressChangedEventHandler(NetworkChange_NetworkAddressChanged);

                MidiMapManager.Startup();

            }

            Fader.TargetState = false;

            hold = new Text3dBatch(80);
            hold.Add(new Text3d(new Vector3d(0, 0, 1), new Vector3d(0, 1, 0), " 0hr123456789-+", 80, .0001f));
            hold.Add(new Text3d(new Vector3d(0, 0, 1), new Vector3d(0, 1, 0), "JanuyFebMcApilg", 80, .0001f));
            hold.Add(new Text3d(new Vector3d(0, 0, 1), new Vector3d(0, 1, 0), "stSmOoNvDBCEdqV", 80, .0001f));
            hold.Add(new Text3d(new Vector3d(0, 0, 1), new Vector3d(0, 1, 0), "jxGHILPRTU", 80, .0001f));
            hold.PrepareBatch();

            Constellations.InitializeConstellationNames();

            if (Properties.Settings.Default.ShowClientNodeList && !ProjectorServer)
            {

                ClientNodeList.ShowNodeList();
            }

            if (DetachScreenId > -1)
            {
                FreeFloatRenderWindow(DetachScreenId);
            }

            if (!string.IsNullOrWhiteSpace(Properties.Settings.Default.RefreshToken))
            {
                WindowsLiveSignIn();
            }
        }
コード例 #51
0
        public void ProcessChanged()
        {
            ignoreChanges = false;


            Planets.ShowActualSize = Settings.Active.ActualPlanetScale;

            if (Properties.Settings.Default.LocalHorizonMode)
            {
                viewType = ViewTypes.AltAz;
            }
            else
            {
                viewType = ViewTypes.Equatorial;
            }

        }
コード例 #52
0
ファイル: FilterValueType.cs プロジェクト: joshball/astrogrep
        /// <summary>
        /// Sets the view type.
        /// </summary>
        /// <param name="viewType">The view type to be displayed</param>
        /// <history>
        /// [Curtis_Beard]	   11/11/2014	Initial
        /// </history>
        public void SetViewType(ViewTypes viewType)
        {
            currentViewType = viewType;

             switch (currentViewType)
             {
            case ViewTypes.DateTime:
               dtpValue.Visible = true;
               txtValue.Visible = false;
               numValue.Visible = false;
               pnlSize.Visible = false;
               break;

            case ViewTypes.String:
               dtpValue.Visible = false;
               txtValue.Visible = true;
               numValue.Visible = false;
               pnlSize.Visible = false;
               break;

            case ViewTypes.Numeric:
               dtpValue.Visible = false;
               txtValue.Visible = false;
               numValue.Visible = true;
               pnlSize.Visible = false;
               break;

            case ViewTypes.Size:
               dtpValue.Visible = false;
               txtValue.Visible = false;
               numValue.Visible = false;
               pnlSize.Visible = true;
               break;
             }
        }
コード例 #53
0
 public void SetViewType(ViewTypes viewType)
 {
     VideosViewModel.ViewType = viewType;
     AboutIndiasGotTalentViewModel.ViewType = viewType;
 }
コード例 #54
0
 public void SetViewType(ViewTypes viewType)
 {
     WhatsNewModel.ViewType = viewType;
     TechUpdatesModel.ViewType = viewType;
     SelectSourceModel.ViewType = viewType;
 }