public void AddVisualizer(Type visType) { IVisualizer visualizer = (IVisualizer)Activator.CreateInstance(visType); Visualizers.Add(visualizer); TabPage page = new TabPage(visualizer.DisplayName); page.Tag = visualizer; var toolbar = new VisualizerToolbar(ActiveSnapshot, visualizer); toolbar.Dock = DockStyle.Top; page.Controls.Add(toolbar); visualizer.Control.Top = toolbar.Height; visualizer.Control.Left = 0; visualizer.Control.Size = new System.Drawing.Size(page.Width, page.Height - toolbar.Height); visualizer.Control.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; page.Controls.Add(visualizer.Control); VisualizerHost.TabPages.Add(page); //We have to initialize here to make sure everything is wired if the visualizer calls back in if (!visualizer.Initialize(this, Connection, ActiveSnapshot)) { VisualizerHost.TabPages.Remove(page); Visualizers.Remove(visualizer); return; } VisualizerHost.SelectedTab = page; m_closeVisualizerButton.Enabled = true; }
/// <summary> /// Starts the application. /// </summary> public void Run() { RegisterUnhandledExceptionHandler(); Builder builder = CreateBuilder(); AddBuilderStrategies(builder); CreateRootWorkItem(builder); IVisualizer visualizer = CreateVisualizer(); if (visualizer != null) { visualizer.Initialize(rootWorkItem, builder); } AddRequiredServices(); AddConfiguredServices(); AddServices(); AuthenticateUser(); ProcessShellAssembly(); rootWorkItem.BuildUp(); LoadModules(); rootWorkItem.FinishInitialization(); rootWorkItem.Run(); Start(); rootWorkItem.Dispose(); if (visualizer != null) { visualizer.Dispose(); } }
/// <summary> /// Calculate and upload the final projection /// </summary> void ExecuteTransform() { if (_visualizer == null) { return; } if (viewer4.projector.IsCullable(_bounds)) { _visualizer.Clear(_mesh); return; } if (viewer4.background) { if (_hyperState == 3) { ExecuteVisualizer(); } if (_hyperState == 0) { _visualizer.Initialize(_helper); _hyperState = 1; viewer4.projectorJob.AddJob(new ProjectUnit(_buffer, transform4.localToWorldMatrix.ToTRS(transform4.localScale), _visualizer, this)); } else { _hyperState = 2; } } else { _visualizer.Initialize(_helper); viewer4.projector.Project(_buffer, transform4.localToWorldMatrix.ToTRS(transform4.localScale), _visualizer); } }