예제 #1
0
        protected override void setJSON(JObject obj, BaseClassIfc host, SetJsonOptions options)
        {
            IfcObjectPlacement placement    = ObjectPlacement;
            JObject            placementObj = null;

            if (placement != null)
            {
                if (string.IsNullOrEmpty(placement.mGlobalId))
                {
                    placement.setGlobalId(ParserIfc.EncodeGuid(Guid.NewGuid()));
                }
                placementObj = placement.getJson(this, options);
            }
            base.setJSON(obj, host, options);

            if (placementObj != null)
            {
                obj["ObjectPlacement"] = placementObj;
            }
            if (options.Style != SetJsonOptions.JsonStyle.Repository)
            {
                IfcProductDefinitionShape representation = Representation;
                if (representation != null)
                {
                    obj["Representation"] = representation.getJson(this, options);
                }
            }
            //internal List<IfcRelAssignsToProduct> mReferencedBy = new List<IfcRelAssignsToProduct>();//	 :	SET OF IfcRelAssignsToProduct FOR RelatingProduct;
        }
예제 #2
0
        protected override void setJSON(JObject obj, BaseClassIfc host, HashSet <int> processed)
        {
            base.setJSON(obj, host, processed);
            IfcObjectPlacement placement = Placement;

            if (placement != null)
            {
                obj["Placement"] = placement.getJson(this, processed);
            }
            IfcProductRepresentation representation = Representation;

            if (representation != null)
            {
                //IfcProductDefinitionShape shape = representation as IfcProductDefinitionShape;
                //if(shape != null)
                //{
                //	if(shape.mHasShapeAspects.Count == 1)
                //	{
                obj["Representation"] = representation.getJson(this, processed);
                //	}
                //	else
                //}
                //else
                //{
                //}
            }
            //internal List<IfcRelAssignsToProduct> mReferencedBy = new List<IfcRelAssignsToProduct>();//	 :	SET OF IfcRelAssignsToProduct FOR RelatingProduct;
        }