internal bool Initialize(UpdateRenderPackageParams initParams) { if (initParams == null) { throw new ArgumentNullException("initParams"); } if (initParams.Node == null) { throw new ArgumentNullException("initParams.Node"); } if (initParams.EngineController == null) { throw new ArgumentNullException("initParams.EngineController"); } if (initParams.DrawableIds == null) { throw new ArgumentNullException("initParams.DrawableIds"); } var nodeModel = initParams.Node; if (nodeModel.WasRenderPackageUpdatedAfterExecution && !initParams.ForceUpdate) { return(false); // Not has not been updated at all. } // If a node is in either of the following states, then it will not // produce any geometric output. Bail after clearing the render packages. if (nodeModel.IsInErrorState || !nodeModel.IsVisible) { return(false); } // Without AstIdentifierForPreview, a node cannot have MirrorData. if (string.IsNullOrEmpty(nodeModel.AstIdentifierForPreview.Value)) { return(false); } drawableIds = initParams.DrawableIds; if (!drawableIds.Any()) { return(false); // Nothing to be drawn. } displayLabels = nodeModel.DisplayLabels; isNodeSelected = nodeModel.IsSelected; factory = initParams.RenderPackageFactory; engineController = initParams.EngineController; previewIdentifierName = initParams.PreviewIdentifierName; nodeGuid = nodeModel.GUID; nodeModel.WasRenderPackageUpdatedAfterExecution = true; return(true); }
internal bool Initialize(UpdateRenderPackageParams initParams) { if (initParams == null) throw new ArgumentNullException("initParams"); if (initParams.Node == null) throw new ArgumentNullException("initParams.Node"); if (initParams.EngineController == null) throw new ArgumentNullException("initParams.EngineController"); if (initParams.DrawableIds == null) throw new ArgumentNullException("initParams.DrawableIds"); var nodeModel = initParams.Node; if (nodeModel.WasRenderPackageUpdatedAfterExecution && !initParams.ForceUpdate) return false; // Not has not been updated at all. // If a node is in either of the following states, then it will not // produce any geometric output. Bail after clearing the render packages. if (nodeModel.IsInErrorState || !nodeModel.IsVisible) return false; // Without AstIdentifierForPreview, a node cannot have MirrorData. if (string.IsNullOrEmpty(nodeModel.AstIdentifierForPreview.Value)) return false; drawableIds = initParams.DrawableIds; if (!drawableIds.Any()) return false; // Nothing to be drawn. displayLabels = nodeModel.DisplayLabels; isNodeSelected = nodeModel.IsSelected; factory = initParams.RenderPackageFactory; engineController = initParams.EngineController; previewIdentifierName = initParams.PreviewIdentifierName; nodeGuid = nodeModel.GUID; nodeModel.WasRenderPackageUpdatedAfterExecution = true; return true; }