override protected void Process(IFCAnyHandle item) { base.Process(item); IList <IFCAnyHandle> layerStyles = IFCAnyHandleUtil.GetAggregateInstanceAttribute <List <IFCAnyHandle> >(item, "LayerStyles"); foreach (IFCAnyHandle layerStyle in layerStyles) { if (layerStyle == null) { Importer.TheLog.LogNullError(IFCEntityType.IfcPresentationStyle); continue; } IFCPresentationStyle presentationStyle = IFCPresentationStyle.ProcessIFCPresentationStyle(layerStyle); if (presentationStyle != null) { LayerStyles.Add(presentationStyle); } else { Importer.TheLog.LogUnhandledSubTypeError(layerStyle, "IfcPresentationStyle", false); } } }
protected override void setJSON(JObject obj, BaseClassIfc host, SetJsonOptions options) { base.setJSON(obj, host, options); obj["LayerOn"] = mLayerOn.ToString(); obj["LayeyFrozen"] = mLayerFrozen.ToString(); obj["LayerBlocked"] = mLayerBlocked.ToString(); if (mLayerStyles.Count > 0) { obj["LayerStyles"] = new JArray(LayerStyles.ToList().ConvertAll(x => x.getJson(this, options))); } }
protected override void setJSON(JObject obj, BaseClassIfc host, HashSet <int> processed) { base.setJSON(obj, host, processed); obj["LayerOn"] = mLayerOn.ToString(); obj["LayeyFrozen"] = mLayerFrozen.ToString(); obj["LayerBlocked"] = mLayerBlocked.ToString(); if (mLayerStyles.Count > 0) { obj["LayerStyles"] = new JArray(LayerStyles.ConvertAll(x => x.getJson(this, processed))); } }
internal override void parseJObject(JObject obj) { base.parseJObject(obj); JToken token = obj.GetValue("LayerOn", StringComparison.InvariantCultureIgnoreCase); if (token != null) { Enum.TryParse <IfcLogicalEnum>(token.Value <string>(), true, out mLayerOn); } token = obj.GetValue("LayerFrozen", StringComparison.InvariantCultureIgnoreCase); if (token != null) { Enum.TryParse <IfcLogicalEnum>(token.Value <string>(), true, out mLayerFrozen); } token = obj.GetValue("LayerBlocked", StringComparison.InvariantCultureIgnoreCase); if (token != null) { Enum.TryParse <IfcLogicalEnum>(token.Value <string>(), true, out mLayerBlocked); } LayerStyles.AddRange(mDatabase.extractJArray <IfcPresentationStyle>(obj.GetValue("LayerStyles", StringComparison.InvariantCultureIgnoreCase) as JArray)); }