Ejemplo n.º 1
0
        private void UpdateStatistics(CompositionManager compositionManager)
        {
            statisticsUpdateTimeSeconds -= Time.deltaTime;
            if (statisticsUpdateTimeSeconds <= 0)
            {
                statisticsUpdateTimeSeconds = statisticsUpdateCooldownTimeSeconds;

                float average;
                framerateStatisticsMessage = GetFramerateStatistics(compositionManager, out average);
                framerateStatisticsColor   = (average > compositionManager.GetVideoFramerate()) ? Color.green : Color.red;
            }
        }
Ejemplo n.º 2
0
        public Robot(string name, ILogger logger)
        {
            Name = name;
            Version = "1.0"; //todo replace harcoding of the version number

            HelpList = new List<string>();

            Settings = new AppSettings();
            Logger = logger;

            _compositionManager = new CompositionManager(this);
        }
        private void PlaybackControllerGUI()
        {
            GUILayout.BeginVertical("Box");
            {
                RenderTitle("Playback Parameters", Color.green);

                GUILayout.Label("Recording index file location");
                IndexFilePath = EditorGUILayout.TextField(IndexFilePath);

                EditorGUILayout.Space();
                EditorGUILayout.Space();

                GUILayout.Label("Calibration file");
                CalibrationFilePath = EditorGUILayout.TextField(CalibrationFilePath);

                EditorGUILayout.Space();
                EditorGUILayout.Space();

                GUILayout.Label("Marker size (m)");
                var markerSizeString = EditorGUILayout.TextField(markerSizeForPlayback.ToString());
                float.TryParse(markerSizeString, out markerSizeForPlayback);
            }
            GUILayout.EndVertical();

            GUILayout.FlexibleSpace();

            GUILayout.BeginVertical("Box");
            {
                GUILayout.BeginHorizontal();
                {
                    CompositionManager compositionManager = GetCompositionManager();
                    GUI.enabled = CanPlay;
                    if (IsPlaying)
                    {
                        if (GUILayout.Button("Stop", GUILayout.Width(startStopRecordingButtonWidth), GUILayout.Height(startStopRecordingButtonHeight)))
                        {
                            IsPlaying = false;
                        }
                    }
                    else
                    {
                        if (GUILayout.Button("Play", GUILayout.Width(startStopRecordingButtonWidth), GUILayout.Height(startStopRecordingButtonHeight)))
                        {
                            IsPlaying = true;
                        }
                    }
                    GUI.enabled = true;
                }
                GUILayout.EndHorizontal();
            }
            GUILayout.EndVertical();
        }
Ejemplo n.º 4
0
        static public void SetDefaultCamera(CompositionManager compositor)
        {
            // Create a new camera for the compositor's output
            var newCameraGameObject = new GameObject(k_DefaultCameraName);
            var camera = newCameraGameObject.AddComponent <Camera>();

            {
                camera.tag         = "Untagged";
                camera.cullingMask = 0; // we don't want to render any 3D objects on the compositor camera
            }
            newCameraGameObject.AddComponent <HDAdditionalCameraData>();
            compositor.outputCamera = camera;
        }
Ejemplo n.º 5
0
        void MarkShaderAsDirty(Shader shader, object context)
        {
            CompositionManager compositor = CompositionManager.GetInstance();

            if (compositor)
            {
                compositor.shaderPropertiesAreDirty = true;
                m_RequiresRedraw = true;

                EditorUtility.SetDirty(compositor);
                EditorUtility.SetDirty(compositor.profile);
            }
        }
Ejemplo n.º 6
0
 static public void SetDefaultLayers(CompositionManager compositor)
 {
     for (int i = compositor.numLayers - 1; i >= 0; --i)
     {
         if (compositor.layers[i].outputTarget == CompositorLayer.OutputTarget.CompositorLayer)
         {
             if ((i + i < compositor.numLayers - 1) && (compositor.layers[i + 1].outputTarget == CompositorLayer.OutputTarget.CameraStack))
             {
                 continue;
             }
             compositor.AddNewLayer(i + 1);
         }
     }
 }
Ejemplo n.º 7
0
        private void HologramSettingsGUI()
        {
            hologramSettingsFoldout = EditorGUILayout.Foldout(hologramSettingsFoldout, "Hologram Settings");
            if (hologramSettingsFoldout)
            {
                EditorGUILayout.BeginVertical("Box");
                {
                    CompositionManager compositionManager = GetCompositionManager();

                    if (compositionManager != null)
                    {
                        EditorGUILayout.Space();

                        GUI.enabled = compositionManager == null || !compositionManager.IsVideoFrameProviderInitialized;
                        GUIContent label = new GUIContent("Video source", "The video capture card you want to use as input for compositing.");
                        compositionManager.CaptureDevice = (CompositionManager.FrameProviderDeviceType)EditorGUILayout.Popup(label, ((int)compositionManager.CaptureDevice), Enum.GetNames(typeof(CompositionManager.FrameProviderDeviceType)));
                        GUI.enabled = true;

                        EditorGUILayout.Space();
                    }

                    GUIContent alphaLabel = new GUIContent("Alpha", "The alpha value used to blend holographic content with video content. 0 will result in completely transparent holograms, 1 in completely opaque holograms.");
                    float      newAlpha   = EditorGUILayout.Slider(alphaLabel, this.hologramAlpha, 0, 1);
                    if (newAlpha != hologramAlpha)
                    {
                        hologramAlpha = newAlpha;
                        if (compositionManager != null && compositionManager.TextureManager != null)
                        {
                            compositionManager.TextureManager.SetHologramShaderAlpha(newAlpha);
                        }
                    }

                    EditorGUILayout.Space();

                    if (compositionManager != null)
                    {
                        EditorGUILayout.BeginHorizontal();
                        {
                            float      previousFrameOffset      = compositionManager.VideoTimestampToHolographicTimestampOffset;
                            GUIContent frameTimeAdjustmentLabel = new GUIContent("Frame time adjustment", "The time in seconds to offset video timestamps from holographic timestamps. Use this to manually adjust for network latency if holograms appear to lag behind or follow ahead of the video content as you move the camera.");
                            compositionManager.VideoTimestampToHolographicTimestampOffset = EditorGUILayout.Slider(frameTimeAdjustmentLabel, previousFrameOffset, -1 * maxFrameOffset, maxFrameOffset);
                        }
                        EditorGUILayout.EndHorizontal();
                    }

                    EditorGUILayout.Space();
                }
                EditorGUILayout.EndVertical();
            }
        }
Ejemplo n.º 8
0
        protected override void OnEnable()
        {
            base.OnEnable();

            CompositionManager compositionManager = GetCompositionManager();

            if (compositionManager != null)
            {
                hologramAlpha = compositionManager.DefaultAlpha;
            }

            holographicCameraIPAddress = PlayerPrefs.GetString(holographicCameraIPAddressKey, "localhost");
            appIPAddress = PlayerPrefs.GetString(appIPAddressKey, "localhost");
        }
Ejemplo n.º 9
0
        public Robot(string name, ILogger logger, IEventEmitter eventEmitter)
        {
            Name = name;
            Logger = logger;
            EventEmitter = eventEmitter;

            Version = "1.0"; //todo replace harcoding of the version number

            _listeners = new List<Listener>();

            Settings = new AppSettings();

            _compositionManager = new CompositionManager(this);
        }
Ejemplo n.º 10
0
        public Robot(string name, ILogger logger, IEventEmitter eventEmitter)
        {
            Name         = name;
            Logger       = logger;
            EventEmitter = eventEmitter;

            Version = "1.0"; //todo replace harcoding of the version number

            _listeners = new List <Listener>();

            Settings = new AppSettings();

            _compositionManager = new CompositionManager(this);
        }
Ejemplo n.º 11
0
        private RoslynCommandTarget(ITextView textView, ITextBuffer languageBuffer)
        {
            ICommandHandlerServiceFactory commandHandlerServiceFactory = CompositionManager.GetExportedValue <ICommandHandlerServiceFactory>();

            if (commandHandlerServiceFactory != null)
            {
                commandHandlerServiceFactory.Initialize(languageBuffer.ContentType.TypeName);

                CurrentHandlers = commandHandlerServiceFactory.GetService(languageBuffer);
            }

            _languageBuffer = languageBuffer;
            _textView       = textView;
        }
Ejemplo n.º 12
0
        static public void SetDefaultCamera(CompositionManager compositor)
        {
            var camera = CompositionManager.GetSceceCamera();

            if (camera != null)
            {
                var outputCamera = Object.Instantiate(camera);
                RemoveAudioListeners(outputCamera);
                outputCamera.name        = k_DefaultCameraName;
                outputCamera.tag         = "Untagged";
                outputCamera.cullingMask = 0; // we don't want to render any 3D objects on the compositor camera
                compositor.outputCamera  = outputCamera;
            }
        }
        protected virtual void OnEnable()
        {
            renderFrameWidth  = CompositionManager.GetVideoFrameWidth();
            renderFrameHeight = CompositionManager.GetVideoFrameHeight();
            aspect            = ((float)renderFrameWidth) / renderFrameHeight;

            foreach (string appLabel in new[] { AppDeviceTypeLabel, HolographicCameraDeviceTypeLabel })
            {
                if (Guid.TryParse(PlayerPrefs.GetString($"{appLabel}_{nameof(selectedLocalizerIds)}"), out Guid localizerId))
                {
                    selectedLocalizerIds[appLabel] = localizerId;
                }
            }
        }
        private void SettingsPane_Loaded(object sender, RoutedEventArgs e)
        {
            CheckBack();

            if (DeviceManager.CurrentIs(Devices.Phone))
            {
            }
            else
            {
                if (IsDialog)
                {
                    CompositionManager.InitializeDropShadow(ShadowHost);
                }
            }
        }
Ejemplo n.º 15
0
        public Robot(string name, ILogger logger, IMessenger messenger, IBrain brain)
        {
            Name      = name;
            Logger    = logger;
            Messenger = messenger;
            Brain     = brain;

            Version = "1.0"; //todo replace harcoding of the version number

            _listeners = new List <Listener>();

            Settings = new AppSettings();

            _compositionManager = new CompositionManager(this);
        }
Ejemplo n.º 16
0
        void UndoCallback()
        {
            // Undo-redo might change the layer order, so we need to redraw the compositor UI and also refresh the layer setup
            m_Editor.CacheSerializedObjects();
            m_RequiresRedraw = true;
            s_SelectionIndex = m_Editor.selectionIndex;

            CompositionManager compositor = CompositionManager.GetInstance();
            {
                // Some properties were changed, mark the profile as dirty so it can be saved if the user saves the scene
                EditorUtility.SetDirty(compositor);
                EditorUtility.SetDirty(compositor.profile);
                compositor.UpdateLayerSetup();
            }
        }
Ejemplo n.º 17
0
        /// <summary>
        /// Populates this dialog with specified composition and proxy listener.
        /// </summary>
        /// <param name="composition">Composition which simulation is to be run.</param>
        /// <param name="listener">Listener which is used for monitoring simulation.</param>
        /// <remarks>
        /// Simulation is fired after this dialog is showed. That's because if
        /// simulation runs in same thread we won't be able to show it another way.
        /// We determine whether simulation runs in same thread using
        /// <see cref="CompositionManager.RunInSameThread">CompositionManager.RunInSameThread</see> property.
        /// </remarks>
        public void PopuplateDialog(CompositionManager composition)
        {
            _composition        = composition;
            _finished           = false;
            _started            = false;
            buttonClose.Enabled = !composition.RunInSameThread;
            buttonStop.Enabled  = !composition.RunInSameThread;

            progressBarRun.Value   = 0;
            progressBarRun.Enabled = true;

            labelInfo.Text = "Running...";

            listViewEvents.Items.Clear();
        }
Ejemplo n.º 18
0
        private void CompositeGUI()
        {
            EditorGUILayout.BeginVertical("Box");
            {
                //Title
                CompositionManager compositionManager = GetCompositionManager();
                {
                    string title;
                    if (compositionManager != null && compositionManager.IsVideoFrameProviderInitialized)
                    {
                        float framesPerSecond = compositionManager.GetVideoFramerate();
                        title = string.Format("Composite [{0} x {1} @ {2:F2} frames/sec]", renderFrameWidth, renderFrameHeight, framesPerSecond);
                    }
                    else
                    {
                        title = "Composite";
                    }

                    RenderTitle(title, Color.green);
                }

                EditorGUILayout.BeginHorizontal("Box");
                {
                    string[]   compositionOptions = new string[] { "Final composite", "Intermediate textures" };
                    GUIContent renderingModeLabel = new GUIContent("Preview display", "Choose between displaying the composited video texture or seeing intermediate textures displayed in 4 sections (bottom left: input video, top left: opaque hologram, top right: hologram alpha mask, bottom right: hologram alpha-blended onto video)");
                    textureRenderMode = EditorGUILayout.Popup(renderingModeLabel, textureRenderMode, compositionOptions);
                    if (compositionManager != null && compositionManager.TextureManager != null)
                    {
                        compositionManager.TextureManager.IsQuadrantVideoFrameNeededForPreviewing = textureRenderMode == (int)VideoRecordingFrameLayout.Quad;
                    }
                    FullScreenCompositorWindow fullscreenWindow = FullScreenCompositorWindow.TryGetWindow();
                    if (fullscreenWindow != null)
                    {
                        fullscreenWindow.TextureRenderMode = textureRenderMode;
                    }

                    if (GUILayout.Button("Fullscreen", GUILayout.Width(120)))
                    {
                        FullScreenCompositorWindow.ShowFullscreen();
                    }
                }
                EditorGUILayout.EndHorizontal();

                // Rendering
                CompositeTextureGUI(textureRenderMode);
            }
            EditorGUILayout.EndVertical();
        }
        protected override void Initialize()
        {
            base.Initialize();

            parseTree = VisualBasicSyntaxTree.ParseText(Editor.Text);
            var sourceText = SourceText.From(Editor.Text);

            var projectId = ProjectId.CreateNewId();

            documentId = DocumentId.CreateNewId(projectId);
            var projectInfo = ProjectInfo.Create(
                projectId,
                VersionStamp.Create(),
                "TestProject",
                "TestProject",
                LanguageNames.VisualBasic,
                null,
                null,
                new VisualBasicCompilationOptions(
                    OutputKind.DynamicallyLinkedLibrary
                    ),
                new VisualBasicParseOptions(),
                new [] {
                DocumentInfo.Create(
                    documentId,
                    Editor.FileName,
                    null,
                    SourceCodeKind.Regular,
                    TextLoader.From(TextAndVersion.Create(sourceText, VersionStamp.Create())),
                    filePath: Editor.FileName
                    )
            },
                null,
                DefaultMetadataReferences
                );
            var sInfo = SolutionInfo.Create(
                SolutionId.CreateNewId(),
                VersionStamp.Create(),
                null,
                new [] { projectInfo }
                );

            workspace.OpenSolutionInfo(sInfo);

            Editor.SyntaxHighlighting = CompositionManager.GetExportedValue <ITagBasedSyntaxHighlightingFactory> ().CreateSyntaxHighlighting(Editor.TextView, "source.vb");
            workspace.InformDocumentOpen(documentId, Editor, DocumentContext);
        }
Ejemplo n.º 20
0
        protected override async Task OnInitialize(ServiceProvider serviceProvider)
        {
            IntitializeTrackedProjectHandling();

            serviceProvider.WhenServiceInitialized <CompositionManager> (s => {
                miscellaneousFilesWorkspace = CompositionManager.Instance.GetExportedValue <MiscellaneousFilesWorkspace> ();
                serviceProvider.WhenServiceInitialized <DocumentManager> (dm => {
                    documentManager = dm;
                });
            });
            serviceProvider.WhenServiceInitialized <RootWorkspace> (s => {
                rootWorkspace = s;
                rootWorkspace.ActiveConfigurationChanged += HandleActiveConfigurationChanged;
            });

            RoslynServices.RoslynService.Initialize();
            CleanupCache();

                        #pragma warning disable CS0618, 612 // Type or member is obsolete
            parsers = AddinManager.GetExtensionNodes <TypeSystemParserNode> ("/MonoDevelop/TypeSystem/Parser");
            bool initialLoad = true;
            AddinManager.AddExtensionNodeHandler("/MonoDevelop/TypeSystem/Parser", delegate(object sender, ExtensionNodeEventArgs args) {
                //refresh entire list to respect insertbefore/insertafter ordering
                if (!initialLoad)
                {
                    parsers = AddinManager.GetExtensionNodes <TypeSystemParserNode> ("/MonoDevelop/TypeSystem/Parser");
                }
            });
                        #pragma warning restore CS0618, 612 // Type or member is obsolete
            initialLoad = false;

            try {
                compositionManager = await serviceProvider.GetService <CompositionManager> ().ConfigureAwait(false);

                emptyWorkspace = new MonoDevelopWorkspace(compositionManager.HostServices, null, this);
                await emptyWorkspace.Initialize().ConfigureAwait(false);
            } catch (Exception e) {
                LoggingService.LogFatalError("Can't create roslyn workspace", e);
            }

            FileService.FileChanged += FileService_FileChanged;
            FileService.FileRemoved += FileService_FileRemoved;

            desktopService = await serviceProvider.GetService <DesktopService> ();

            await serviceProvider.GetService <HelpService> ();
        }
Ejemplo n.º 21
0
        void UpdateHighlighting()
        {
            if (DocumentContext?.AnalysisDocument == null)
            {
                if (Editor.SyntaxHighlighting != fallbackHighlighting)
                {
                    Editor.SyntaxHighlighting = fallbackHighlighting;
                }
                return;
            }
            var old = Editor.SyntaxHighlighting as TagBasedSyntaxHighlighting;

            if (old == null)
            {
                Editor.SyntaxHighlighting = CompositionManager.GetExportedValue <ITagBasedSyntaxHighlightingFactory> ().CreateSyntaxHighlighting(Editor.TextView, "source.cs");
            }
        }
        private void AdjustIndentation(IProjectionBuffer subjectBuffer, IEnumerable <int> visibleSpanIndex)
        {
            if (!visibleSpanIndex.Any())
            {
                return;
            }

            var snapshot = subjectBuffer.CurrentSnapshot;
            var document = _workspace.CurrentSolution.GetDocument(this.Id);

            if (!document.SupportsSyntaxTree)
            {
                return;
            }

            var originalText = document.GetTextAsync(CancellationToken.None).WaitAndGetResult(CancellationToken.None);

            Contract.Requires(object.ReferenceEquals(originalText, snapshot.AsText()));

            var root = document.GetSyntaxRootSynchronously(CancellationToken.None);

            var editorOptionsFactory = CompositionManager.GetExportedValue <IEditorOptionsFactoryService> ();
            var editorOptions        = editorOptionsFactory.GetOptions(DataBuffer);
            var options = _workspace.Options
                          .WithChangedOption(FormattingOptions.NewLine, root.Language, editorOptions.GetNewLineCharacter())
                          .WithChangedOption(FormattingOptions.UseTabs, root.Language, !editorOptions.IsConvertTabsToSpacesEnabled())
                          .WithChangedOption(FormattingOptions.TabSize, root.Language, editorOptions.GetTabSize())
                          .WithChangedOption(FormattingOptions.IndentationSize, root.Language, editorOptions.GetIndentSize());

            using (var pooledObject = SharedPools.Default <List <TextSpan> > ().GetPooledObject()) {
                var spans = pooledObject.Object;

                spans.AddRange(this.GetEditorVisibleSpans());
                using (var edit = subjectBuffer.CreateEdit(s_venusEditOptions, reiteratedVersionNumber: null, editTag: null)) {
                    foreach (var spanIndex in visibleSpanIndex)
                    {
                        var rule = GetBaseIndentationRule(root, originalText, spans, spanIndex);

                        var visibleSpan = spans[spanIndex];
                        AdjustIndentationForSpan(document, edit, visibleSpan, rule, options);
                    }

                    edit.Apply();
                }
            }
        }
Ejemplo n.º 23
0
        private void ApplyFrame(int frameIndex)
        {
            CompositionManager compositionManager = GetCompositionManager();

            string directory = Path.GetDirectoryName(indexFilePath);
            string frameFile = Path.Combine(directory, $"{recordingForPlayback.Poses[frameIndex].FrameFileNumber}.raw");

            if (imageTexture == null)
            {
                imageTexture = new Texture2D(recordingForPlayback.FrameWidth, recordingForPlayback.FrameHeight, TextureFormat.BGRA32, false);
            }
            imageTexture.LoadRawTextureData(File.ReadAllBytes(frameFile));
            imageTexture.Apply();
            aspect = ((float)imageTexture.width) / imageTexture.height;
            compositionManager.TextureManager.SetOverrideColorTexture(imageTexture);
            compositionManager.SetOverridePose(recordingForPlayback.Poses[frameIndex].CameraPosition, Quaternion.Euler(recordingForPlayback.Poses[frameIndex].CameraRotationEuler));
        }
Ejemplo n.º 24
0
        private void StartPlayback()
        {
            currentTime          = 0;
            currentFrameIndex    = 0;
            recordingForPlayback = JsonUtility.FromJson <CalibrationRecording>(File.ReadAllText(indexFilePath));
            ApplyFrame(currentFrameIndex);

            CompositionManager        compositionManager = GetCompositionManager();
            HolographicCameraObserver networkManager     = GetHolographicCameraObserver();

            previousCalibrationData = compositionManager.CalibrationData;
            compositionManager.EnableHolographicCamera(networkManager.transform, calibrationDataForPlayback);

            testCube = GameObject.CreatePrimitive(PrimitiveType.Cube);
            testCube.transform.localScale    = Vector3.one * DeviceInfoObserver.arUcoMarkerSizeInMeters;
            testCube.transform.localPosition = new Vector3(0.0f, 0.0f, 0.05f);
        }
Ejemplo n.º 25
0
        protected override void Run()
        {
            try {
                var exportedValues = CompositionManager.Instance.ExportProvider.GetExportedValues <IFoo> ().ToList();
                foreach (var item in exportedValues)
                {
                    Console.WriteLine(item.GetType().FullName);
                }

                var foo = CompositionManager.GetExportedValue <FooContainer> ();
                foreach (var item in foo.items)
                {
                    Console.WriteLine(item.GetType().FullName);
                }
            } catch (Exception ex) {
                LoggingService.LogError("error", ex);
            }
        }
Ejemplo n.º 26
0
        private void RecordingGUI()
        {
            recordingFoldout = EditorGUILayout.Foldout(recordingFoldout, "Recording");
            if (recordingFoldout)
            {
                CompositionManager compositionManager = GetCompositionManager();

                EditorGUILayout.BeginVertical("Box");
                {
                    RenderTitle("Recording", Color.green);

                    GUI.enabled = compositionManager != null && compositionManager.TextureManager != null;
                    if (compositionManager == null || !compositionManager.IsRecording())
                    {
                        if (GUILayout.Button("Start Recording"))
                        {
                            compositionManager.StartRecording();
                        }
                    }
                    else
                    {
                        if (GUILayout.Button("Stop Recording"))
                        {
                            compositionManager.StopRecording();
                        }
                    }

                    if (GUILayout.Button("Take Picture"))
                    {
                        compositionManager.TakePicture();
                    }

                    EditorGUILayout.Space();
                    GUI.enabled = true;

                    // Open Folder
                    if (GUILayout.Button("Open Folder"))
                    {
                        Process.Start(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "HologramCapture"));
                    }
                }
                EditorGUILayout.EndVertical();
            }
        }
Ejemplo n.º 27
0
        private void StopPlayback()
        {
            CompositionManager        compositionManager = GetCompositionManager();
            HolographicCameraObserver networkManager     = GetHolographicCameraObserver();

            if (compositionManager != null && compositionManager.TextureManager != null)
            {
                compositionManager.TextureManager.SetOverrideColorTexture(null);
                compositionManager.ClearOverridePose();

                if (previousCalibrationData != null)
                {
                    compositionManager.EnableHolographicCamera(networkManager.transform, previousCalibrationData);
                }
                Destroy(testCube);
            }

            testCube = null;
        }
Ejemplo n.º 28
0
        /// <summary>
        /// Populates this dialog with specific composition.
        /// </summary>
        /// <param name="composition">Composition to be used for dialog.</param>
        /// <param name="initialTriggerInvokeTime">
        /// If <c>true</c>, the <see cref="CompositionManager.TriggerInvokeTime">CompositionManager.TriggerInvokeTime</see>
        /// is set to latest overlapping time of time horizons of all models. Typically this is used
        /// when this dialog is showed for the first time.</param>
        public void PopulateDialog(CompositionManager composition, bool initialTriggerInvokeTime)
        {
            _composition = composition;

            if (initialTriggerInvokeTime)
            {
                buttonTimeLatestOverlapping_Click(null, null);
            }
            else
            {
                textTriggerInvokeTime.Text = _composition.TriggerInvokeTime.ToString( );
            }

            checkBoxEventsToListbox.Checked = _composition.ShowEventsInListbox;

            checkBoxNoMultithreading.Checked = _composition.RunInSameThread;

            runIt = false;
        }
Ejemplo n.º 29
0
        private MonoDevelopContainedDocument(ITextBuffer languageBuffer, IProjectionBuffer dataBuffer, IMonoDevelopContainedLanguageHost containedLanguageHost)
        {
            LanguageBuffer        = languageBuffer;
            DataBuffer            = dataBuffer;
            ContainedLanguageHost = containedLanguageHost;

            _differenceSelectorService = CompositionManager.GetExportedValue <ITextDifferencingSelectorService> ();

            var container    = languageBuffer.CurrentSnapshot.AsText().Container;
            var registration = Workspace.GetWorkspaceRegistration(container);

            if (registration.Workspace == null)
            {
                registration.WorkspaceChanged += Registration_WorkspaceChanged;
            }
            else
            {
                FinishInitialization();
            }
        }
Ejemplo n.º 30
0
        static async Task FixAll(TextEditor editor, ValidCodeDiagnosticAction fix, FixAllProvider provider, DiagnosticAnalyzer diagnosticAnalyzer)
        {
            var diagnosticIds = diagnosticAnalyzer.SupportedDiagnostics.Select(d => d.Id).ToImmutableHashSet();

            var analyzers = new [] { diagnosticAnalyzer }.ToImmutableArray();

            var codeFixService           = CompositionManager.GetExportedValue <ICodeFixService> () as CodeFixService;
            var fixAllDiagnosticProvider = codeFixService.CreateFixAllState(
                provider,
                editor.DocumentContext.AnalysisDocument,
                FixAllProviderInfo.Create(null),
                null,
                null,
                async(doc, diagnostics, token) => await GetDiagnosticsForDocument(analyzers, doc, diagnostics, token).ConfigureAwait(false),
                (Project arg1, bool arg2, ImmutableHashSet <string> arg3, CancellationToken arg4) => {
                return(Task.FromResult((IEnumerable <Diagnostic>) new Diagnostic[] { }));
            }).DiagnosticProvider;

            //var fixAllDiagnosticProvider = new FixAllState.FixAllDiagnosticProvider (
            //	diagnosticIds,
            //	async (doc, diagnostics, token) => await GetDiagnosticsForDocument (analyzers, doc, diagnostics, token).ConfigureAwait (false),
            //	(Project arg1, bool arg2, ImmutableHashSet<string> arg3, CancellationToken arg4) => {
            //		return Task.FromResult ((IEnumerable<Diagnostic>)new Diagnostic [] { });
            //	});

            var ctx = new FixAllContext(
                editor.DocumentContext.AnalysisDocument,
                fix.Diagnostic.GetCodeFixProvider(),
                FixAllScope.Document,
                fix.CodeAction.EquivalenceKey,
                diagnosticIds,
                fixAllDiagnosticProvider,
                default(CancellationToken)
                );

            var fixAll = await provider.GetFixAsync(ctx);

            using (var undo = editor.OpenUndoGroup()) {
                await CodeDiagnosticDescriptor.RunAction(editor.DocumentContext, fixAll, default(CancellationToken));
            }
        }
        protected void CompositeTextureGUI(int textureRenderMode)
        {
            UpdateFrameDimensions();

            Rect framesRect = ComputeCompositeGUIRect(uiFrameWidth, uiFrameHeight);

            if (Event.current != null && Event.current.type == EventType.Repaint)
            {
                CompositionManager compositionManager = GetCompositionManager();
                if (compositionManager != null && compositionManager.TextureManager != null)
                {
                    if (textureRenderMode == textureRenderModeSplit)
                    {
                        Rect[] quadrantRects = CalculateVideoQuadrants(framesRect);
                        if (compositionManager.TextureManager.compositeTexture != null)
                        {
                            Graphics.DrawTexture(quadrantRects[0], compositionManager.TextureManager.compositeTexture);
                        }

                        if (compositionManager.TextureManager.colorRGBTexture != null)
                        {
                            Graphics.DrawTexture(quadrantRects[1], compositionManager.TextureManager.colorRGBTexture, compositionManager.TextureManager.IgnoreAlphaMaterial);
                        }

                        if (compositionManager.TextureManager.renderTexture != null)
                        {
                            Graphics.DrawTexture(quadrantRects[2], compositionManager.TextureManager.renderTexture, compositionManager.TextureManager.IgnoreAlphaMaterial);
                        }

                        if (compositionManager.TextureManager.alphaTexture != null)
                        {
                            Graphics.DrawTexture(quadrantRects[3], compositionManager.TextureManager.alphaTexture, compositionManager.TextureManager.IgnoreAlphaMaterial);
                        }
                    }
                    else
                    {
                        Graphics.DrawTexture(framesRect, compositionManager.TextureManager.compositeTexture);
                    }
                }
            }
        }
Ejemplo n.º 32
0
        static public void LoadDefaultCompositionGraph(CompositionManager compositor)
        {
            if (!AssetDatabase.IsValidFolder("Assets/Compositor"))
            {
                AssetDatabase.CreateFolder("Assets", "Compositor");
                AssetDatabase.SaveAssets();
                AssetDatabase.Refresh();
            }

            string path = "Assets/Compositor/DefaultCompositionGraph.shadergraph";

            path = AssetDatabase.GenerateUniqueAssetPath(path);
            bool ret1 = AssetDatabase.CopyAsset(HDUtils.GetHDRenderPipelinePath() + "Runtime/Compositor/ShaderGraphs/DefaultCompositionGraph.shadergraph", path);

            if (ret1 == false)
            {
                Debug.LogError("Error creating default shader graph");
                return;
            }
            AssetDatabase.SaveAssets();
            AssetDatabase.Refresh();

            compositor.shader = AssetDatabase.LoadAssetAtPath <Shader>(path);

            string profilePath;
            {
                var fullpath = AssetDatabase.GetAssetPath(compositor.shader);
                profilePath = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(fullpath), System.IO.Path.GetFileNameWithoutExtension(compositor.shader.name)) + ".asset";
                profilePath = AssetDatabase.GenerateUniqueAssetPath(profilePath);
            }

            bool ret2 = AssetDatabase.CopyAsset(HDUtils.GetHDRenderPipelinePath() + "Runtime/Compositor/ShaderGraphs/DefaultCompositionGraph.asset", profilePath);

            if (ret2 == false)
            {
                Debug.LogError("Error creating default profile");
                return;
            }
            AssetDatabase.SaveAssets();
            AssetDatabase.Refresh();
        }