internal override void parseJObject(JObject obj)
{
base.parseJObject(obj);
JObject jobj = obj.GetValue("ContextOfItems", StringComparison.InvariantCultureIgnoreCase) as JObject;
if (jobj != null)
{
JToken tok = jobj["href"];
if (tok != null)
mContextOfItems = tok.Value<int>();
else
{
IfcRepresentationContext rc = extractObject<IfcRepresentationContext>(jobj);
IfcContext context = mDatabase.Context;
if (context != null)
{
foreach(IfcRepresentationContext repContext in context.RepresentationContexts)
{
IfcGeometricRepresentationSubContext gsc = rc as IfcGeometricRepresentationSubContext;
if (gsc != null)
{
IfcGeometricRepresentationContext grc = repContext as IfcGeometricRepresentationContext;
if(grc != null)
{
foreach(IfcGeometricRepresentationSubContext sub in grc.HasSubContexts)
{
if(string.Compare(sub.mContextIdentifier,gsc.mContextIdentifier, true) == 0)
{
ContextOfItems = sub;
mDatabase[rc.mIndex] = null;
}
}
}
}
}
}
if (mContextOfItems == 0)
ContextOfItems = rc;
}
}
JToken token = obj.GetValue("RepresentationIdentifier", StringComparison.InvariantCultureIgnoreCase);
if (token != null)
RepresentationIdentifier = token.Value<string>();
token = obj.GetValue("RepresentationType", StringComparison.InvariantCultureIgnoreCase);
if (token != null)
RepresentationType = token.Value<string>();
Items = mDatabase.extractJArray<IfcRepresentationItem>(obj.GetValue("Items", StringComparison.InvariantCultureIgnoreCase) as JArray);
List<IfcPresentationLayerAssignment> assignments = mDatabase.extractJArray<IfcPresentationLayerAssignment>(obj.GetValue("LayerAssignments", StringComparison.InvariantCultureIgnoreCase) as JArray);
foreach (IfcPresentationLayerAssignment a in assignments)
a.addItem(this);
}
protected override void setJSON(JObject obj, BaseClassIfc host, HashSet<int> processed)