예제 #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
        private void AddPort(IRenderPackage package, Guid outputPortId)
        {
            if (portMap == null)
            {
                portMap = new Dictionary <Guid, RenderPackageCache>();
            }

            if (!portMap.ContainsKey(outputPortId))
            {
                portMap[outputPortId] = new RenderPackageCache();
            }

            portMap[outputPortId].Add(package);
        }
예제 #3
0
        /// <summary>
        /// Concatenates the other cache into this cache
        /// </summary>
        /// <param name="other">The cache to add to this cache.</param>
        public void Add(RenderPackageCache other)
        {
            packages.AddRange(other.packages);

            if (other.portMap == null)
            {
                return;
            }

            foreach (var port in other.portMap)
            {
                Guid portId = port.Key;
                if (portMap != null && portMap.ContainsKey(portId))
                {
                    throw new ArgumentException("The given port already exists in this render cache.");
                }

                foreach (var item in port.Value.packages)
                {
                    AddPort(item, portId);
                }
            }
        }