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(); }
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); }
/// <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); } } }