public Dictionary<string, XbimGeometryHandleCollection> GroupLayers(XbimGeometryHandleCollection inputHandles) { // creates a new dictionary and then fills it by type enumerating the known non-abstract subtypes of Product Dictionary<string, XbimGeometryHandleCollection> result = new Dictionary<string, XbimGeometryHandleCollection>(); // prepares transparents first HashSet<short> traspTypes = new HashSet<short>(); foreach (var ttp in _lightTransparentTypes) { traspTypes.Add(IfcMetaData.IfcTypeId(ttp)); } XbimGeometryHandleCollection transp = new XbimGeometryHandleCollection( inputHandles.Where(g => traspTypes.Contains(g.IfcTypeId) || _lightTransparentEntities.Contains(g.ProductLabel) ) ); result.Add("_LightBlueTransparent", transp); // deal with ignore elements HashSet<short> hiddTypes = new HashSet<short>(); foreach (var htp in _hiddenTypes) { hiddTypes.Add(IfcMetaData.IfcTypeId(htp)); } XbimGeometryHandleCollection hidd = new XbimGeometryHandleCollection( inputHandles.Where(g => hiddTypes.Contains(g.IfcTypeId) || _hiddenEntities.Contains(g.ProductLabel) ) ); // now execute normal type loop, but with the exclusion of hidden and transparent // IfcType baseType = IfcMetaData.IfcType(typeof(IfcProduct)); foreach (var subType in baseType.NonAbstractSubTypes) { short ifcTypeId = IfcMetaData.IfcTypeId(subType); XbimGeometryHandleCollection handles = new XbimGeometryHandleCollection( inputHandles.Where(g => g.IfcTypeId == ifcTypeId && !(transp.Contains(g)) && !(hidd.Contains(g)) ) ); // only add the item if there are handles in it if (handles.Count > 0) result.Add(subType.Name, handles); } return result; }
public Dictionary<string, XbimGeometryHandleCollection> GroupLayers(XbimGeometryHandleCollection inputHandles) { var retvalues = new Dictionary<string, XbimGeometryHandleCollection>(); XbimGeometryHandleCollection odd = new XbimGeometryHandleCollection(inputHandles.Where(g => g.ProductLabel % 2 == 0)); XbimGeometryHandleCollection even = new XbimGeometryHandleCollection(inputHandles.Where(g => g.ProductLabel % 2 == 1)); if (even.Count > 0) retvalues.Add("Even", even); if (odd.Count > 0) retvalues.Add("Odd", odd); return retvalues; }
public Dictionary <string, XbimGeometryHandleCollection> GroupLayers(XbimGeometryHandleCollection inputHandles) { var retvalues = new Dictionary <string, XbimGeometryHandleCollection>(); XbimGeometryHandleCollection odd = new XbimGeometryHandleCollection(inputHandles.Where(g => g.ProductLabel % 2 == 0)); XbimGeometryHandleCollection even = new XbimGeometryHandleCollection(inputHandles.Where(g => g.ProductLabel % 2 == 1)); if (even.Count > 0) { retvalues.Add("Even", even); } if (odd.Count > 0) { retvalues.Add("Odd", odd); } return(retvalues); }
public Dictionary<string, XbimGeometryHandleCollection> GroupLayers(XbimGeometryHandleCollection InputHandles) { Dictionary<string, XbimGeometryHandleCollection> result = new Dictionary<string, XbimGeometryHandleCollection>(); var f = InputHandles.GroupBy(p => p.ProductLabel).Select(g => g.First().ProductLabel).ToList(); foreach (var label in f) { XbimGeometryHandleCollection handles = new XbimGeometryHandleCollection(InputHandles.Where(g => g.ProductLabel == label)); if (handles.Count > 0) result.Add(label.ToString(), handles); } return result; }
public Dictionary<string, XbimGeometryHandleCollection> GroupLayers(XbimGeometryHandleCollection InputHandles) { // creates a new dictionary and then fills it by type enumerating the known non-abstract subtypes of Product Dictionary<string, XbimGeometryHandleCollection> result = new Dictionary<string, XbimGeometryHandleCollection>(); IfcType baseType = IfcMetaData.IfcType(typeof(IfcProduct)); foreach (var subType in baseType.NonAbstractSubTypes) { short ifcTypeId = IfcMetaData.IfcTypeId(subType); XbimGeometryHandleCollection handles = new XbimGeometryHandleCollection(InputHandles.Where(g => g.IfcTypeId == ifcTypeId)); // only add the item if there are handles in it if (handles.Count > 0) result.Add(subType.Name, handles); } return result; }
public Dictionary <string, XbimGeometryHandleCollection> GroupLayers(XbimGeometryHandleCollection inputHandles) { // creates a new dictionary and then fills it by type enumerating the known non-abstract subtypes of Product Dictionary <string, XbimGeometryHandleCollection> result = new Dictionary <string, XbimGeometryHandleCollection>(); // prepares transparents first HashSet <short> traspTypes = new HashSet <short>(); foreach (var ttp in _lightTransparentTypes) { traspTypes.Add(IfcMetaData.IfcTypeId(ttp)); } XbimGeometryHandleCollection transp = new XbimGeometryHandleCollection( inputHandles.Where(g => traspTypes.Contains(g.IfcTypeId) || _lightTransparentEntities.Contains(g.ProductLabel) ) ); result.Add("_LightBlueTransparent", transp); // deal with ignore elements HashSet <short> hiddTypes = new HashSet <short>(); foreach (var htp in _hiddenTypes) { hiddTypes.Add(IfcMetaData.IfcTypeId(htp)); } XbimGeometryHandleCollection hidd = new XbimGeometryHandleCollection( inputHandles.Where(g => hiddTypes.Contains(g.IfcTypeId) || _hiddenEntities.Contains(g.ProductLabel) ) ); // now execute normal type loop, but with the exclusion of hidden and transparent // IfcType baseType = IfcMetaData.IfcType(typeof(IfcProduct)); foreach (var subType in baseType.NonAbstractSubTypes) { short ifcTypeId = IfcMetaData.IfcTypeId(subType); XbimGeometryHandleCollection handles = new XbimGeometryHandleCollection( inputHandles.Where(g => g.IfcTypeId == ifcTypeId && !(transp.Contains(g)) && !(hidd.Contains(g)) ) ); // only add the item if there are handles in it if (handles.Count > 0) { result.Add(subType.Name, handles); } } return(result); }
public Dictionary <string, XbimGeometryHandleCollection> GroupLayers(XbimGeometryHandleCollection InputHandles) { // creates a new dictionary and then fills it by type enumerating the known non-abstract subtypes of Product Dictionary <string, XbimGeometryHandleCollection> result = new Dictionary <string, XbimGeometryHandleCollection>(); IfcType baseType = IfcMetaData.IfcType(typeof(IfcProduct)); foreach (var subType in baseType.NonAbstractSubTypes) { short ifcTypeId = IfcMetaData.IfcTypeId(subType); XbimGeometryHandleCollection handles = new XbimGeometryHandleCollection(InputHandles.Where(g => g.IfcTypeId == ifcTypeId)); // only add the item if there are handles in it if (handles.Count > 0) { result.Add(subType.Name, handles); } } return(result); }
public Dictionary <string, XbimGeometryHandleCollection> GroupLayers(XbimGeometryHandleCollection InputHandles) { Dictionary <string, XbimGeometryHandleCollection> result = new Dictionary <string, XbimGeometryHandleCollection>(); var f = InputHandles.GroupBy(p => p.ProductLabel).Select(g => g.First().ProductLabel).ToList(); foreach (var label in f) { XbimGeometryHandleCollection handles = new XbimGeometryHandleCollection(InputHandles.Where(g => g.ProductLabel == label)); if (handles.Count > 0) { result.Add(label.ToString(), handles); } } return(result); }