protected override IEnumerator AsyncRun(SIGGraphProcessor processor, TContext context) { dataset.Clear(); yield return(base.AsyncRun(processor, context)); dataset.SaveDatasetAnnotations(); }
protected virtual IEnumerator AsyncRun(SIGGraphProcessor processor, TContext context) { progressId = Progress.Start(this.name, null); Progress.SetPriority(progressId, Progress.Priority.High); Progress.Report(progressId, 1, context.Count); Progress.RegisterCancelCallback(progressId, OnCancel); shouldCancel = false; yield return(null); for (int i = 0; i < context.Count; i += context.BatchSize) { if (shouldCancel) { break; } RunBatch(processor, context); yield return(null); } Progress.Finish(progressId, shouldCancel ? Progress.Status.Canceled : Progress.Status.Succeeded); Progress.UnregisterCancelCallback(progressId); Complete(!shouldCancel); bool OnCancel() { shouldCancel = true; return(true); } }
public virtual void Run(SIGGraphProcessor processor, SIGProcessingContext context) { OnPreProcess(context); processor.Run(context); OnPostProcess(context); Complete(); }
protected virtual void RunOnce(SIGGraphProcessor processor, TContext context) { OnPreProcess(context); processor.Run(context); OnPostProcess(context); context.MoveNext(); }
protected virtual void RunBatch(SIGGraphProcessor processor, TContext context) { for (int i = 0; i < context.BatchSize && context.Index < context.Count; i++) { RunOnce(processor, context); } }
protected override void Run(SIGGraphProcessor processor, TContext context) { for (int i = 0; i < context.Count; i += context.BatchSize) { RunBatch(processor, context); } Complete(); }
protected override void RunOnce(SIGGraphProcessor processor, CocoProcessingContext context) { context.Profiler.Reset(); base.RunOnce(processor, context); if (context.Profiler is StopWatchProfiler profiler) { profilerResults.Add(profiler.FlatResults); } }
protected void InitializeGraphProcessor() { if (task != null) { graph = task.Graph; } Debug.Assert(graph != null, "Unable to initialize processor without graph."); graph.UpdateComputeOrder(); graphProcessor = new SIGGraphProcessor(graph); graphProcessor.UpdateComputeOrder(); }
protected override void Run(SIGGraphProcessor processor, CocoProcessingContext context) { totalStopwatch = Stopwatch.StartNew(); base.Run(processor, context); }
protected override void RunOnce(SIGGraphProcessor processor, TContext context) { base.RunOnce(processor, context); Progress.Report(progressId, context.Index + 2, context.Count); }
protected override void Run(SIGGraphProcessor processor, TContext context) { #if UNITY_EDITOR EditorCoroutineUtility.StartCoroutine(AsyncRun(processor, context), this); #endif }