Пример #1
0
        private void NodeRenderPackagesUpdated(NodeModel nodeModel, RenderPackageCache renderPackages)
        {
            if (renderPackages.Packages.Any())
            {
                data = new GeometryData(nodeModel.GUID.ToString(), renderPackages.Packages);

                // We have geometry
                HasGeometry = true;
            }

            // We are 'Done'
            Done.Set();
        }
Пример #2
0
        public GeometryHolder(DynamoModel model, IRenderPackageFactory factory, NodeModel nodeModel)
        {
            data = new GeometryData(nodeModel.GUID.ToString());

            // Schedule the generation of render packages for this node. NodeRenderPackagesUpdated will be
            // called with the render packages when they are ready. The node will be set do 'Done' if the
            // scheduling for some reason is not successful (usually because the node have no geometry or is invisible)
            nodeModel.RenderPackagesUpdated += NodeRenderPackagesUpdated;
            if (!nodeModel.RequestVisualUpdateAsync(model.Scheduler, model.EngineController, factory, true))
            {
                // The node has no geometry so we are 'Done'
                Done.Set();
            }
        }