override protected void Process(IFCAnyHandle item) { base.Process(item); // We will not fail if the transform is not given, but instead assume it to be the identity. IFCAnyHandle mappingTarget = IFCImportHandleUtil.GetRequiredInstanceAttribute(item, "MappingTarget", false); if (mappingTarget != null) { MappingTarget = IFCCartesianTransformOperator.ProcessIFCCartesianTransformOperator(mappingTarget); } else { MappingTarget = IFCCartesianTransformOperator.ProcessIFCCartesianTransformOperator(); } IFCAnyHandle mappingSource = IFCImportHandleUtil.GetRequiredInstanceAttribute(item, "MappingSource", false); if (mappingSource == null) { return; } MappingSource = IFCRepresentationMap.ProcessIFCRepresentationMap(mappingSource); }
/// <summary> /// Processes IfcTypeObject attributes. /// </summary> /// <param name="ifcTypeProduct">The IfcTypeProduct handle.</param> protected override void Process(IFCAnyHandle ifcTypeProduct) { base.Process(ifcTypeProduct); Tag = IFCAnyHandleUtil.GetStringAttribute(ifcTypeProduct, "Tag"); IList <IFCAnyHandle> representationMapsHandle = IFCAnyHandleUtil.GetAggregateInstanceAttribute <List <IFCAnyHandle> >(ifcTypeProduct, "RepresentationMaps"); if (representationMapsHandle != null && representationMapsHandle.Count > 0) { foreach (IFCAnyHandle representationMapHandle in representationMapsHandle) { IFCRepresentationMap representationMap = IFCRepresentationMap.ProcessIFCRepresentationMap(representationMapHandle); if (representationMap != null) { RepresentationMaps.Add(representationMap); // Traditionally we would create a "dummy" DirectShapeType for each IfcRepresentationMap. In the case where the IfcRepresentationMap is not used by another other IfcTypeProduct, // we would like to stop creating the "dummy" DirectShapeType and store the geometry in the DirectShapeType associated with the IfcTypeProduct. However, IfcRepresentationMap // does not have an INVERSE relationship to its IfcTypeProduct(s), at least in IFC2x3. // As such, we keep track of the IfcRepresentationMaps that have the relationship described above for future correspondence. RegisterRepresentationMapWithTypeProject(representationMap, this); } } } }