Esempio n. 1
0
            RequestVisualUpdateAsyncCore(IScheduler scheduler, EngineController engine, IRenderPackageFactory factory)
        {
            var initParams = new UpdateRenderPackageParams()
            {
                Node = this,
                RenderPackageFactory = factory,
                EngineController = engine,
                DrawableIds = GetDrawableIds(),
                PreviewIdentifierName = AstIdentifierForPreview.Name
            };

            var task = new UpdateRenderPackageAsyncTask(scheduler);
            if (task.Initialize(initParams))
            {
                task.Completed += OnRenderPackageUpdateCompleted;
                scheduler.ScheduleForExecution(task);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// When called, the base implementation of this method schedules an 
        /// UpdateRenderPackageAsyncTask to regenerate its render packages 
        /// asynchronously. Derived classes can optionally override this method 
        /// to prevent render packages to be generated if they do not require 
        /// geometric preview.
        /// </summary>
        /// <param name="maxTesselationDivisions">The maximum number of 
        /// tessellation divisions to use for regenerating render packages.</param>
        /// 
        protected virtual void RequestVisualUpdateCore(int maxTesselationDivisions)
        {
            var initParams = new UpdateRenderPackageParams()
            {
                Node = this,
                MaxTesselationDivisions = maxTesselationDivisions,
                EngineController = Workspace.DynamoModel.EngineController,
                DrawableIds = GetDrawableIds(),
                PreviewIdentifierName = AstIdentifierForPreview.Name
            };

            var scheduler = Workspace.DynamoModel.Scheduler;
            var task = new UpdateRenderPackageAsyncTask(scheduler);
            if (task.Initialize(initParams))
            {
                task.Completed += OnRenderPackageUpdateCompleted;
                scheduler.ScheduleForExecution(task);
            }
        }