public void initialize(StandaloneController standaloneController) { GUIManager guiManager = standaloneController.GUIManager; editorTimelineController = new TimelineController(standaloneController); standaloneController.giveGUIsToTimelineController(editorTimelineController); editorController = new EditorController(standaloneController, editorTimelineController); editorController.ProjectTypes.addInfo(new ZipProjectType(".sl")); standaloneController.DocumentController.addDocumentHandler(new SlideshowDocumentHandler(editorController)); //Prop Mover MedicalController medicalController = standaloneController.MedicalController; propMover = new SimObjectMover("LectureProps", medicalController.PluginManager.RendererPlugin, medicalController.EventManager, standaloneController.SceneViewController); propEditController = new PropEditController(propMover); editorUICallback = new LectureUICallback(standaloneController, editorController, propEditController); slideshowEditController = new SlideshowEditController(standaloneController, editorUICallback, this.propEditController, editorController, editorTimelineController); slideshowExplorer = new SlideshowExplorer(slideshowEditController); guiManager.addManagedDialog(slideshowExplorer); TaskController taskController = standaloneController.TaskController; taskController.addTask(new MDIDialogOpenTask(slideshowExplorer, "Medical.SlideshowExplorer", "Authoring Tools", "Lecture.Icon.SmartLectureIcon", TaskMenuCategories.Create)); CommonEditorResources.initialize(standaloneController); standaloneController.ViewHostFactory.addFactory(new SlideTaskbarFactory()); standaloneController.MedicalStateController.StateAdded += MedicalStateController_StateAdded; standaloneController.MedicalStateController.BlendingStopped += MedicalStateController_BlendingStopped; }
public void initialize(StandaloneController standaloneController) { GUIManager guiManager = standaloneController.GUIManager; guiManager.MainGUIShown += new Action(guiManager_MainGUIShown); guiManager.MainGUIHidden += new Action(guiManager_MainGUIHidden); //Prop Mover MedicalController medicalController = standaloneController.MedicalController; propMover = new SimObjectMover("Props", medicalController.PluginManager.RendererPlugin, medicalController.EventManager, standaloneController.SceneViewController); this.standaloneController = standaloneController; editorTimelineController = new TimelineController(standaloneController); standaloneController.giveGUIsToTimelineController(editorTimelineController); scratchAreaController = new ScratchAreaController(standaloneController.Clipboard); //Controller editorController = new EditorController(standaloneController, editorTimelineController); standaloneController.DocumentController.addDocumentHandler(new ProjectDocumentHandler(editorController)); standaloneController.DocumentController.UnknownDocumentHander = new UnknownDocumentHandler(editorController); propEditController = new PropEditController(propMover); //UI Helpers editorUICallback = new EditorUICallback(standaloneController, editorController, propEditController); typeControllerManager = new TypeControllerManager(standaloneController, this); typeControllerManager.FilesystemWatcherCreated += typeControllerManager_FilesystemWatcherCreated; //Dialogs scratchArea = new ScratchArea(scratchAreaController, editorUICallback); guiManager.addManagedDialog(scratchArea); projectExplorer = new ProjectExplorer(editorController, typeControllerManager); guiManager.addManagedDialog(projectExplorer); //Tasks Menu TaskController taskController = standaloneController.TaskController; aspectRatioTask = new AspectRatioTask(standaloneController.SceneViewController); if (MedicalConfig.ShowDeveloperTools) { taskController.addTask(new MDIDialogOpenTask(scratchArea, "Medical.ScratchArea", "Scratch Area", "EditorIcons.ScratchAreaIcon", TaskMenuCategories.Create)); taskController.addTask(new MDIDialogOpenTask(projectExplorer, "Medical.EditorTools", "Editor Tools", "EditorIcons.EditorTools", TaskMenuCategories.Create)); taskController.addTask(aspectRatioTask); } editorTaskbarFactory = new EditorTaskbarFactory(editorController); standaloneController.ViewHostFactory.addFactory(new EditorInfoBarFactory()); standaloneController.ViewHostFactory.addFactory(new TextEditorComponentFactory()); standaloneController.ViewHostFactory.addFactory(editorTaskbarFactory); CommonEditorResources.initialize(standaloneController); editorController.ProjectChanged += editorController_ProjectChanged; //Editor Views standaloneController.ViewHostFactory.addFactory(new OffsetSequenceEditorFactory(standaloneController.MedicalController, standaloneController.Clipboard)); }
public TeethToolController(SimObjectMover teethMover) { TeethMover = teethMover; TeethController.ToothAdded += TeethController_ToothAdded; TeethController.ToothRemoved += TeethController_ToothRemoved; foreach (var tooth in TeethController.Teeth) { TeethController_ToothAdded(tooth); } }
public OffsetSequenceEditorView(String name, GuiFrameworkUICallback uiCallback, SimObjectMover simObjectMover, OffsetModifierSequence sequence = null) : base(name) { ElementName = new MDILayoutElementName(GUILocationNames.MDI, DockLocation.Bottom) { AllowedDockLocations = DockLocation.Top | DockLocation.Bottom | DockLocation.Floating }; Sequence = sequence; UICallback = uiCallback; SimObjectMover = simObjectMover; }
public SkeletonWindow(SimObjectMover objectMover) : base("OgreModelEditor.GUI.SkeletonWindow.SkeletonWindow.layout") { this.objectMover = objectMover;; scrollView = window.findWidget("Scroller") as ScrollView; skeletonTree = new Tree(scrollView); skeletonTree.NodeMouseDoubleClick += SkeletonTree_NodeMouseDoubleClick; this.Resized += SkeletonWindow_Resized; }
public OffsetSequenceEditor(SaveableClipboard clipboard, MyGUIViewHost viewHost, OffsetSequenceEditorView view, MedicalController medicalController) : base("Medical.GUI.OffsetSequence.OffsetSequenceEditor.layout", viewHost) { this.clipboard = clipboard; this.medicalController = medicalController; this.simObjectMover = view.SimObjectMover; widget.KeyButtonReleased += new MyGUIEvent(window_KeyButtonReleased); widget.RootKeyChangeFocus += new MyGUIEvent(widget_RootKeyChangeFocus); //Remove button Button removeButton = widget.findWidget("RemoveAction") as Button; removeButton.MouseButtonClick += new MyGUIEvent(removeButton_MouseButtonClick); //Timeline view ScrollView timelineViewScrollView = widget.findWidget("ActionView") as ScrollView; timelineView = new TimelineView(timelineViewScrollView); timelineView.Duration = Duration; timelineView.KeyReleased += new EventHandler <KeyEventArgs>(timelineView_KeyReleased); timelineView.ActiveDataChanged += timelineView_ActiveDataChanged; //Properties ScrollView timelinePropertiesScrollView = widget.findWidget("ActionPropertiesScrollView") as ScrollView; actionProperties = new TimelineDataProperties(timelinePropertiesScrollView, timelineView); actionProperties.Visible = false; actionProperties.addPanel("Offset Position", new OffsetKeyframeProperties(timelinePropertiesScrollView, this, view.UICallback)); //Timeline filter ScrollView timelineFilterScrollView = widget.findWidget("ActionFilter") as ScrollView; trackFilter = new TrackFilter(timelineFilterScrollView, timelineView); trackFilter.AddTrackItem += new AddTrackItemCallback(trackFilter_AddTrackItem); numberLine = new NumberLine(widget.findWidget("NumberLine") as ScrollView, timelineView); //Add tracks to timeline. timelineView.addTrack("Offset Position"); ViewHost.Context.getModel <EditMenuManager>(EditMenuManager.DefaultName).setMenuProvider(this); Button chooseTargetButton = (Button)widget.findWidget("ChooseTargetButton"); chooseTargetButton.MouseButtonClick += chooseTargetButton_MouseButtonClick; targetLabel = (TextBox)widget.findWidget("TargetLabel"); targetLabel.Caption = DefaultTargetLabelText; CurrentSequence = view.Sequence; }
public void initialize(StandaloneController standaloneController) { RocketInterface.Instance.FileInterface.addExtension(new RocketAssemblyResourceLoader(this.GetType().Assembly)); if (VirtualFileSystem.Instance.exists("Watermark/AnomalousMedical.png")) { standaloneController.ImageRenderer.LoadLogo = () => { using (Stream stream = VirtualFileSystem.Instance.openStream("Watermark/AnomalousMedical.png", Engine.Resources.FileMode.Open)) { return(new FreeImageBitmap(stream)); } }; } this.guiManager = standaloneController.GUIManager; this.standaloneController = standaloneController; standaloneController.MovementSequenceController.GroupAdded += MovementSequenceController_GroupAdded; bool hasPremium = licenseManager.allowFeature(1); standaloneController.AnatomyController.ShowPremiumAnatomy = hasPremium; guiManager.SaveUIConfiguration += guiManager_SaveUIConfiguration; guiManager.LoadUIConfiguration += guiManager_LoadUIConfiguration; guiManager.MainGUIShown += guiManager_MainGUIShown; guiManager.MainGUIHidden += guiManager_MainGUIHidden; //Controllers imageLicenseServer = new ImageLicenseServer(licenseManager); bookmarksController = new BookmarksController(standaloneController, ScaleHelper.Scaled(100), ScaleHelper.Scaled(100), hasPremium); //Create Dialogs aboutDialog = new AboutDialog(licenseManager); chooseSceneDialog = new ChooseSceneDialog(guiManager); chooseSceneDialog.ChooseScene += new EventHandler(chooseSceneDialog_ChooseScene); standaloneController.AnatomyController.ShowPremiumAnatomyChanged += AnatomyController_ShowPremiumAnatomyChanged; anatomyFinder = new AnatomyFinder(standaloneController.AnatomyController, standaloneController.SceneViewController, standaloneController.LayerController, standaloneController.AnatomyTaskManager); guiManager.addManagedDialog(anatomyFinder); options = new OptionsDialog(guiManager); options.VideoOptionsChanged += new EventHandler(options_VideoOptionsChanged); options.RequestRestart += new EventHandler(options_RequestRestart); bookmarks = new BookmarksGUI(bookmarksController, standaloneController.GUIManager, standaloneController.SceneViewController); viewsGui = new ViewsGui(standaloneController.SceneViewController, standaloneController.AnatomyController); guiManager.addManagedDialog(viewsGui); //Taskbar taskbar = new AppButtonTaskbar(); taskbar.OpenTaskMenu += taskbar_OpenTaskMenu; taskbar.setAppIcon("AppButton/Hamburger", "AppButton/Hamburger"); taskbarLink = new SingleChildChainLink(GUILocationNames.Taskbar, taskbar); guiManager.addLinkToChain(taskbarLink); guiManager.pushRootContainer(GUILocationNames.Taskbar); //Task Menu taskMenu = new TaskMenu(standaloneController.DocumentController, standaloneController.TaskController, standaloneController.GUIManager, new LayoutElementName(GUILocationNames.FullscreenPopup)); taskMenu.GroupComparison = TaskMenuCategories.Sorter; guiTaskManager = new GUITaskManager(taskbar, taskMenu, standaloneController.TaskController); //Tasks Menu TaskController taskController = standaloneController.TaskController; standaloneController.AnatomyTaskManager.HighlightTasks += AnatomyTaskManager_HighlightTasks; //Tasks cameraMovementModeTask = new CameraMovementModeTask(standaloneController.SceneViewController); taskController.addTask(cameraMovementModeTask); Slideshow.AdditionalTasks.addTask(cameraMovementModeTask); selectionOperatorTask = new SelectionOperatorTask(standaloneController.AnatomyController); taskController.addTask(selectionOperatorTask); Slideshow.AdditionalTasks.addTask(selectionOperatorTask); var viewsTask = new PinableMDIDialogOpenTask(viewsGui, "Medical.Views", "Views", "AnomalousMedical/ViewIcon", TaskMenuCategories.Explore); taskController.addTask(viewsTask); //Patient Section taskController.addTask(new ShowPopupTask(chooseSceneDialog, "Medical.NewPatient", "New", "AnomalousMedical/ChangeScene", TaskMenuCategories.Explore, 0)); taskController.addTask(new DialogOpenTask(aboutDialog, "Medical.About", "About", "AnomalousMedical/About", TaskMenuCategories.System, int.MaxValue - 2)); taskController.addTask(new VolumeControlTask()); CallbackTask unhideAllAnatomy = new CallbackTask("Medical.UnhideAllAnatomy", "Unhide All", "AnatomyFinder.ShowAll", TaskMenuCategories.Explore, int.MaxValue - 2, false, (item) => { LayerState undo = LayerState.CreateAndCapture(); standaloneController.LayerController.unhideAll(); standaloneController.LayerController.pushUndoState(undo); }); taskController.addTask(unhideAllAnatomy); //Navigation Section PinableMDIDialogOpenTask anatomyFinderTask = new PinableMDIDialogOpenTask(anatomyFinder, "Medical.AnatomyFinder", "Anatomy Finder", "AnomalousMedical/SearchIcon", TaskMenuCategories.Explore); taskController.addTask(anatomyFinderTask); Slideshow.AdditionalTasks.addTask(anatomyFinderTask); ShowPopupTask bookmarkTask = null; standaloneController.AnatomyController.setCommandPermission(AnatomyCommandPermissions.Unrestricted, PlatformConfig.UnrestrictedEnvironment); standaloneController.AnatomyController.setCommandPermission(AnatomyCommandPermissions.PremiumActive, hasPremium); if (PlatformConfig.UnrestrictedEnvironment || hasPremium) { //Explore selectionModeTask = new SelectionModeTask(standaloneController.AnatomyController); taskController.addTask(selectionModeTask); Slideshow.AdditionalTasks.addTask(selectionModeTask); bookmarkTask = new ShowPopupTask(bookmarks, "Medical.Bookmarks", "Bookmarks", "AnomalousMedical/FavoritesIcon", TaskMenuCategories.Explore); taskController.addTask(bookmarkTask); Slideshow.AdditionalTasks.addTask(bookmarkTask); } if (PlatformConfig.UnrestrictedEnvironment) { //System CallbackTask helpTaskItem = new CallbackTask("Medical.Help", "Help", "AnomalousMedical/Help", TaskMenuCategories.System, int.MaxValue - 4, false); helpTaskItem.OnClicked += new CallbackTask.ClickedCallback(helpTaskItem_OnClicked); taskController.addTask(helpTaskItem); taskController.addTask(new ShowPopupTask(options, "Medical.Options", "Options", "AnomalousMedical/Options", TaskMenuCategories.System, int.MaxValue - 3)); CallbackTask exitTaskItem = new CallbackTask("Medical.Exit", "Exit", "AnomalousMedical/Exit", TaskMenuCategories.System, int.MaxValue, false); exitTaskItem.OnClicked += new CallbackTask.ClickedCallback(exitTaskItem_OnClicked); taskController.addTask(exitTaskItem); if (MedicalConfig.ShowDeveloperTools) { CallbackTask createOverrideTaskItem = new CallbackTask("Medical.CreateOverride", "CreateOverride", CommonResources.NoIcon, TaskMenuCategories.Developer, int.MaxValue, false); createOverrideTaskItem.OnClicked += CreateOverrideTaskItem_OnClicked; taskController.addTask(createOverrideTaskItem); } } if (PlatformConfig.AllowFullscreenToggle) { CallbackTask toggleFullscreen = new CallbackTask("Medical.ToggleFullscreen", "Toggle Fullscreen", "AnomalousMedical/ToggleFullscreen", TaskMenuCategories.System, int.MaxValue - 2, false, (item) => { MainWindow.Instance.toggleFullscreen(); }); taskController.addTask(toggleFullscreen); //Fullscreen Toggle Shortcut var toggleFullscreenMessageEvent = new ButtonEvent(EventLayers.Gui, frameUp: (evtMgr) => { MainWindow.Instance.toggleFullscreen(); }); toggleFullscreenMessageEvent.addButton(KeyboardButtonCode.KC_RETURN); toggleFullscreenMessageEvent.addButton(KeyboardButtonCode.KC_LMENU); standaloneController.MedicalController.EventManager.addEvent(toggleFullscreenMessageEvent); } //Premium / Non Premium if (!hasPremium) { if (PlatformConfig.UnrestrictedEnvironment) { buyScreens = new BuyScreenController(standaloneController); taskMenuAd = new PremiumFeaturesTaskMenuAd(taskMenu); selectionModeTask.SelectionModeChooser.ShowBuyMessage += SelectionModeChooser_ShowBuyMessage; anatomyFinder.ShowBuyMessage += anatomyFinder_ShowBuyMessage; bookmarks.ShowBuyMessage += bookmarks_ShowBuyMessage; } if (MedicalConfig.FirstRun) { guiTaskManager.addPinnedTask(anatomyFinderTask); guiTaskManager.addPinnedTask(viewsTask); guiTaskManager.addPinnedTask(cameraMovementModeTask); if (bookmarkTask != null) { guiTaskManager.addPinnedTask(bookmarkTask); } guiTaskManager.addPinnedTask(unhideAllAnatomy); } } standaloneController.AtlasPluginManager.RequestDependencyDownload += AtlasPluginManager_RequestDependencyDownload; //Teeth mover teethMover = new SimObjectMover("Teeth", standaloneController.MedicalController.PluginManager.RendererPlugin, standaloneController.MedicalController.EventManager, standaloneController.SceneViewController); TeethToolController teethToolController = new TeethToolController(teethMover); standaloneController.ImageRenderer.ImageRenderStarted += teethToolController.ScreenshotRenderStarted; standaloneController.ImageRenderer.ImageRenderCompleted += teethToolController.ScreenshotRenderCompleted; standaloneController.ViewHostFactory.addFactory(new WizardComponentFactory(teethToolController)); }
/// <summary> /// Constructor. /// </summary> public AnomalyController(App app, Solution solution, IAnomalyImplementation implementation) { this.app = app; this.solution = solution; this.implementation = implementation; //Create the log. logListener = new LogFileListener(); logListener.openLogFile(AnomalyConfig.DocRoot + "/log.log"); Log.Default.addLogListener(logListener); mainWindow = new NativeOSWindow(String.Format("{0} - Anomaly", solution.Name), new IntVector2(-1, -1), new IntSize2(AnomalyConfig.EngineConfig.HorizontalRes, AnomalyConfig.EngineConfig.VerticalRes)); mainWindow.Closed += mainWindow_Closed; //Setup DPI float pixelScale = mainWindow.WindowScaling; ScaleHelper._setScaleFactor(pixelScale); var builder = new ServiceCollection(); //Initialize the plugins pluginManager = new PluginManager(AnomalyConfig.ConfigFile, builder); sceneController = new SceneController(pluginManager); //Hardcoded assemblies MyGUIInterface.EventLayerKey = EventLayers.Main; GuiFrameworkCamerasInterface.MoveCameraEventLayer = EventLayers.Cameras; GuiFrameworkCamerasInterface.SelectWindowEventLayer = EventLayers.AfterMain; GuiFrameworkCamerasInterface.ShortcutEventLayer = EventLayers.Main; GuiFrameworkEditorInterface.ToolsEventLayers = EventLayers.Tools; //Setup microcode cache load OgreInterface.MicrocodeCachePath = Path.Combine(AnomalyConfig.DocRoot, "ShaderCache.mcc"); OgreInterface.AllowMicrocodeCacheLoad = AnomalyConfig.LastShaderVersion == UnifiedMaterialBuilder.Version; AnomalyConfig.LastShaderVersion = UnifiedMaterialBuilder.Version; implementation.AddPlugins(pluginManager); pluginManager.OnConfigureDefaultWindow = createWindow; //Create core classes systemTimer = new NativeSystemTimer(); mainTimer = new NativeUpdateTimer(systemTimer); mainTimer.FramerateCap = AnomalyConfig.EngineConfig.MaxFPS; idleHandler = new IdleHandler(mainTimer.OnIdle); inputHandler = new NativeInputHandler(mainWindow, false); eventManager = new EventManager(inputHandler, Enum.GetValues(typeof(EventLayers))); eventUpdate = new EventUpdateListener(eventManager); builder.TryAddSingleton <EventManager>(eventManager); //This is externally owned pluginManager.initializePlugins(); frameClearManager = new FrameClearManager(OgreInterface.Instance.OgrePrimaryWindow.OgreRenderTarget, new Color(0.2f, 0.2f, 0.2f)); lightManager = pluginManager.RendererPlugin.createSceneViewLightManager(); //Core resources MyGUIInterface.Instance.CommonResourceGroup.addResource(this.GetType().AssemblyQualifiedName, "EmbeddedResource", true); OgreResourceGroupManager.getInstance().initializeAllResourceGroups(); //Intialize the platform mainTimer.addUpdateListener(eventUpdate); mainTimer.addUpdateListener(updateEventListener); pluginManager.setPlatformInfo(mainTimer, eventManager); GuiFrameworkInterface.Instance.handleCursors(mainWindow); //Layout Chain mdiLayout = new MDILayoutManager(); //Scene views sceneViewController = new SceneViewController(mdiLayout, eventManager, mainTimer, pluginManager.RendererPlugin.PrimaryWindow, MyGUIInterface.Instance.OgrePlatform.RenderManager, null); sceneStatsDisplayManager = new SceneStatsDisplayManager(sceneViewController, OgreInterface.Instance.OgrePrimaryWindow.OgreRenderTarget); sceneStatsDisplayManager.StatsVisible = true; sceneViewController.createWindow("Camera 1", AnomalyConfig.CameraConfig.MainCameraPosition, AnomalyConfig.CameraConfig.MainCameraLookAt, Vector3.Min, Vector3.Max, 0.0f, float.MaxValue, 100); virtualTextureLink = new VirtualTextureSceneViewLink(this); //Tools selectionMovementTools = new SimObjectMover("SelectionMover", PluginManager.Instance.RendererPlugin, eventManager, sceneViewController); selectionMovementTools.Visible = true; selectionMovementTools.addMovableObject("Selection", new SelectionMovableObject(selectionController)); mainForm = new AnomalyMain(this); LayoutChain layoutChain = new LayoutChain(); layoutChain.addLink(new SingleChildChainLink(GUILocationNames.Taskbar, mainForm.LayoutContainer), true); layoutChain.addLink(new PopupAreaChainLink(GUILocationNames.FullscreenPopup), true); layoutChain.SuppressLayout = true; layoutChain.addLink(new MDIChainLink(GUILocationNames.MDI, mdiLayout), true); layoutChain.addLink(new PopupAreaChainLink(GUILocationNames.ContentAreaPopup), true); layoutChain.addLink(new FinalChainLink("SceneViews", mdiLayout.DocumentArea), true); layoutChain.SuppressLayout = false; guiManager = new GUIManager(); guiManager.createGUI(mdiLayout, layoutChain, mainWindow); layoutChain.layout(); splashScreen = new SplashScreen(mainWindow, 100, "Anomaly.GUI.SplashScreen.SplashScreen.layout", "Anomaly.GUI.SplashScreen.SplashScreen.xml"); splashScreen.Hidden += splashScreen_Hidden; splashScreen.StatusUpdated += splashScreen_StatusUpdated; splashScreen.updateStatus(0, "Loading..."); idleHandler.runTemporaryIdle(finishInitialization()); }
public OgreModelEditorController(App app, String defaultModel) { this.app = app; //Create the log. logListener = new LogFileListener(); logListener.openLogFile(OgreModelEditorConfig.DocRoot + "/log.log"); Log.Default.addLogListener(logListener); //Main window mainWindow = new NativeOSWindow("Ogre Model Editor", new IntVector2(-1, -1), new IntSize2(OgreModelEditorConfig.EngineConfig.HorizontalRes, OgreModelEditorConfig.EngineConfig.VerticalRes)); mainWindow.Closed += mainWindow_Closed; //Setup DPI ScaleHelper._setScaleFactor(mainWindow.WindowScaling); //Initailize plugins MyGUIInterface.EventLayerKey = EventLayers.Main; GuiFrameworkCamerasInterface.MoveCameraEventLayer = EventLayers.Cameras; GuiFrameworkCamerasInterface.SelectWindowEventLayer = EventLayers.AfterMain; GuiFrameworkCamerasInterface.ShortcutEventLayer = EventLayers.Main; GuiFrameworkEditorInterface.ToolsEventLayers = EventLayers.Tools; //Setup microcode cache load OgreInterface.MicrocodeCachePath = Path.Combine(OgreModelEditorConfig.DocRoot, "ShaderCache.mcc"); OgreInterface.AllowMicrocodeCacheLoad = OgreModelEditorConfig.LastShaderVersion == UnifiedMaterialBuilder.Version; OgreModelEditorConfig.LastShaderVersion = UnifiedMaterialBuilder.Version; OgreInterface.TrackMemoryLeaks = true; OgreInterface.CompressedTextureSupport = OgreModelEditorConfig.CompressedTextureSupport; RuntimePlatformInfo.addPath(OgreModelEditorConfig.OpenGLESEmulatorPath); pluginManager = new PluginManager(OgreModelEditorConfig.ConfigFile, new ServiceCollection()); pluginManager.OnConfigureDefaultWindow = createWindow; pluginManager.addPluginAssembly(typeof(OgreInterface).Assembly); pluginManager.addPluginAssembly(typeof(NativePlatformPlugin).Assembly); pluginManager.addPluginAssembly(typeof(MyGUIInterface).Assembly); pluginManager.addPluginAssembly(typeof(GuiFrameworkInterface).Assembly); pluginManager.addPluginAssembly(typeof(GuiFrameworkCamerasInterface).Assembly); pluginManager.addPluginAssembly(typeof(GuiFrameworkEditorInterface).Assembly); pluginManager.addPluginAssembly(typeof(GuiFrameworkDebuggingInterface).Assembly); pluginManager.initializePlugins(); frameClearManager = new FrameClearManager(OgreInterface.Instance.OgrePrimaryWindow.OgreRenderTarget, new Color(0.2f, 0.2f, 0.2f)); lightManager = pluginManager.RendererPlugin.createSceneViewLightManager(); //Core resources MyGUIInterface.Instance.CommonResourceGroup.addResource(this.GetType().AssemblyQualifiedName, "EmbeddedResource", true); OgreResourceGroupManager.getInstance().addResourceLocation(GetType().AssemblyQualifiedName, "EmbeddedResource", "DebugShaders", true); OgreResourceGroupManager.getInstance().initializeAllResourceGroups(); //Intialize the platform systemTimer = new NativeSystemTimer(); mainTimer = new NativeUpdateTimer(systemTimer); mainTimer.FramerateCap = OgreModelEditorConfig.EngineConfig.MaxFPS; idleHandler = new IdleHandler(mainTimer.OnIdle); inputHandler = new NativeInputHandler(mainWindow, false); eventManager = new EventManager(inputHandler, Enum.GetValues(typeof(EventLayers))); eventUpdate = new EventUpdateListener(eventManager); mainTimer.addUpdateListener(eventUpdate); mainTimer.addUpdateListener(updateEventListener); pluginManager.setPlatformInfo(mainTimer, eventManager); GuiFrameworkInterface.Instance.handleCursors(mainWindow); //Layout Chain mdiLayout = new MDILayoutManager(); //Scene views sceneViewController = new SceneViewController(mdiLayout, eventManager, mainTimer, pluginManager.RendererPlugin.PrimaryWindow, MyGUIInterface.Instance.OgrePlatform.RenderManager, null); sceneStatsDisplayManager = new SceneStatsDisplayManager(sceneViewController, OgreInterface.Instance.OgrePrimaryWindow.OgreRenderTarget); sceneStatsDisplayManager.StatsVisible = true; sceneViewController.createWindow("Camera 1", OgreModelEditorConfig.CameraConfig.MainCameraPosition, OgreModelEditorConfig.CameraConfig.MainCameraLookAt, Vector3.Min, Vector3.Max, 0.0f, float.MaxValue, 100); virtualTextureLink = new VirtualTextureSceneViewLink(this); materialController = new MaterialController(this); //Tools objectMover = new SimObjectMover("ModelMover", PluginManager.Instance.RendererPlugin, eventManager, sceneViewController); mainForm = new OgreModelEditorMain(this); LayoutChain layoutChain = new LayoutChain(); layoutChain.addLink(new SingleChildChainLink(GUILocationNames.Taskbar, mainForm.LayoutContainer), true); layoutChain.addLink(new PopupAreaChainLink(GUILocationNames.FullscreenPopup), true); layoutChain.SuppressLayout = true; layoutChain.addLink(new MDIChainLink(GUILocationNames.MDI, mdiLayout), true); layoutChain.addLink(new PopupAreaChainLink(GUILocationNames.ContentAreaPopup), true); layoutChain.addLink(new FinalChainLink("SceneViews", mdiLayout.DocumentArea), true); layoutChain.SuppressLayout = false; guiManager = new GUIManager(mdiLayout, mainWindow); guiManager.createGUILayout(layoutChain); layoutChain.layout(); splashScreen = new SplashScreen(mainWindow, 100, "OgreModelEditor.GUI.SplashScreen.SplashScreen.layout", "OgreModelEditor.GUI.SplashScreen.SplashScreen.xml"); splashScreen.Hidden += splashScreen_Hidden; splashScreen.StatusUpdated += splashScreen_StatusUpdated; splashScreen.updateStatus(0, "Loading..."); idleHandler.runTemporaryIdle(finishInitialization(defaultModel)); }
public PropEditController(SimObjectMover simObjectMover) { this.simObjectMover = simObjectMover; simObjectMover.ShowMoveTools = true; simObjectMover.ToolSize = 3.0f; }
public OffsetSequenceEditorContext(OffsetModifierSequence movementSequence, String file, OffsetSequenceTypeController typeController, GuiFrameworkUICallback uiCallback, SimObjectMover simObjectMover) { this.typeController = typeController; this.currentFile = file; this.movementSequence = movementSequence; this.simObjectMover = simObjectMover; simObjectMover.ShowMoveTools = true; simObjectMover.ShowRotateTools = false; mvcContext = new AnomalousMvcContext(); mvcContext.StartupAction = "Common/Start"; mvcContext.FocusAction = "Common/Focus"; mvcContext.BlurAction = "Common/Blur"; mvcContext.SuspendAction = "Common/Suspended"; mvcContext.ResumeAction = "Common/Resumed"; mvcContext.Models.add(new EditMenuManager()); OffsetSequenceEditorView offsetSequenceView = new OffsetSequenceEditorView("SequenceEditor", uiCallback, simObjectMover, movementSequence); offsetSequenceView.ElementName = new MDILayoutElementName(GUILocationNames.MDI, DockLocation.Bottom); mvcContext.Views.add(offsetSequenceView); EditorTaskbarView taskbar = new EditorTaskbarView("InfoBar", currentFile, "Editor/Close"); taskbar.addTask(new CallbackTask("SaveAll", "Save All", "Editor/SaveAllIcon", "", 0, true, item => { saveAll(); })); taskbar.addTask(new RunMvcContextActionTask("Save", "Save Movement Sequence File", "CommonToolstrip/Save", "File", "Editor/Save", mvcContext)); taskbar.addTask(new RunMvcContextActionTask("Cut", "Cut", "Editor/CutIcon", "", "Editor/Cut", mvcContext)); taskbar.addTask(new RunMvcContextActionTask("Copy", "Copy", "Editor/CopyIcon", "", "Editor/Copy", mvcContext)); taskbar.addTask(new RunMvcContextActionTask("Paste", "Paste", "Editor/PasteIcon", "", "Editor/Paste", mvcContext)); taskbar.addTask(new RunMvcContextActionTask("SelectAll", "Select All", "Editor/SelectAllIcon", "", "Editor/SelectAll", mvcContext)); taskbar.addTask(new RunMvcContextActionTask("Translation", "Translation", "Editor/TranslateIcon", "", "Editor/Translation", mvcContext)); taskbar.addTask(new RunMvcContextActionTask("Rotation", "Rotation", "Editor/RotateIcon", "", "Editor/Rotation", mvcContext)); mvcContext.Views.add(taskbar); mvcContext.Controllers.add(new MvcController("Editor", new RunCommandsAction("Show", new ShowViewCommand("SequenceEditor"), new ShowViewCommand("InfoBar")), new RunCommandsAction("Close", new CloseAllViewsCommand()), new CallbackAction("Save", context => { save(); }), new CutAction(), new CopyAction(), new PasteAction(), new SelectAllAction(), new CallbackAction("Translation", context => { this.simObjectMover.ShowMoveTools = true; this.simObjectMover.ShowRotateTools = false; }), new CallbackAction("Rotation", context => { this.simObjectMover.ShowMoveTools = false; this.simObjectMover.ShowRotateTools = true; }))); mvcContext.Controllers.add(new MvcController("Common", new RunCommandsAction("Start", new RunActionCommand("Editor/Show")), new CallbackAction("Focus", context => { GlobalContextEventHandler.setEventContext(eventContext); if (Focus != null) { Focus.Invoke(this); } }), new CallbackAction("Blur", context => { GlobalContextEventHandler.disableEventContext(eventContext); if (Blur != null) { Blur.Invoke(this); } }), new RunCommandsAction("Suspended", new SaveViewLayoutCommand()), new RunCommandsAction("Resumed", new RestoreViewLayoutCommand()))); eventContext = new EventContext(); ButtonEvent saveEvent = new ButtonEvent(EventLayers.Gui); saveEvent.addButton(KeyboardButtonCode.KC_LCONTROL); saveEvent.addButton(KeyboardButtonCode.KC_S); saveEvent.FirstFrameUpEvent += eventManager => { saveAll(); }; eventContext.addEvent(saveEvent); eventContext.addEvent(new ButtonEvent(EventLayers.Gui, frameUp: eventManager => { mvcContext.runAction("Editor/Cut"); }, keys: new KeyboardButtonCode[] { KeyboardButtonCode.KC_LCONTROL, KeyboardButtonCode.KC_X })); eventContext.addEvent(new ButtonEvent(EventLayers.Gui, frameUp: eventManager => { mvcContext.runAction("Editor/Copy"); }, keys: new KeyboardButtonCode[] { KeyboardButtonCode.KC_LCONTROL, KeyboardButtonCode.KC_C })); eventContext.addEvent(new ButtonEvent(EventLayers.Gui, frameUp: eventManager => { mvcContext.runAction("Editor/Paste"); }, keys: new KeyboardButtonCode[] { KeyboardButtonCode.KC_LCONTROL, KeyboardButtonCode.KC_V })); eventContext.addEvent(new ButtonEvent(EventLayers.Gui, frameUp: eventManager => { mvcContext.runAction("Editor/SelectAll"); }, keys: new KeyboardButtonCode[] { KeyboardButtonCode.KC_LCONTROL, KeyboardButtonCode.KC_A })); eventContext.addEvent(new ButtonEvent(EventLayers.Gui, frameUp: eventManager => { mvcContext.runAction("Editor/Translation"); }, keys: new KeyboardButtonCode[] { KeyboardButtonCode.KC_LCONTROL, KeyboardButtonCode.KC_T })); eventContext.addEvent(new ButtonEvent(EventLayers.Gui, frameUp: eventManager => { mvcContext.runAction("Editor/Rotation"); }, keys: new KeyboardButtonCode[] { KeyboardButtonCode.KC_LCONTROL, KeyboardButtonCode.KC_R })); }