/// <summary> /// Return geometry for a particular representation item. /// </summary> /// <param name="shapeEditScope">The shape edit scope.</param> /// <param name="lcs">Local coordinate system for the geometry, without scale.</param> /// <param name="scaledLcs">Local coordinate system for the geometry, including scale, potentially non-uniform.</param> /// <param name="guid">The guid of an element for which represntation is being created.</param> /// <returns>Zero or more created geometries.</returns> public IList <GeometryObject> CreateGeometry(IFCImportShapeEditScope shapeEditScope, Transform lcs, Transform scaledLcs, string guid) { if (StyledByItem != null) { StyledByItem.Create(shapeEditScope); } return(CreateGeometryInternal(shapeEditScope, lcs, scaledLcs, guid)); }
/// <summary> /// Return geometry for a particular representation item. /// </summary> /// <param name="shapeEditScope">The shape edit scope.</param> /// <param name="lcs">Local coordinate system for the geometry, without scale.</param> /// <param name="scaledLcs">Local coordinate system for the geometry, including scale, potentially non-uniform.</param> /// <param name="guid">The guid of an element for which represntation is being created.</param> /// <returns>Zero or more created geometries.</returns> public IList <GeometryObject> CreateGeometry(IFCImportShapeEditScope shapeEditScope, Transform lcs, Transform scaledLcs, string guid) { if (StyledByItem != null) { StyledByItem.Create(shapeEditScope); } using (IFCImportShapeEditScope.IFCMaterialStack stack = new IFCImportShapeEditScope.IFCMaterialStack(shapeEditScope, StyledByItem, null)) { return(CreateGeometryInternal(shapeEditScope, lcs, scaledLcs, guid)); } }
/// <summary> /// Create geometry for a particular representation item. /// </summary> /// <param name="shapeEditScope">The geometry creation scope.</param> /// <param name="lcs">Local coordinate system for the geometry, without scale.</param> /// <param name="scaledLcs">Local coordinate system for the geometry, including scale, potentially non-uniform.</param> /// <param name="guid">The guid of an element for which represntation is being created.</param> public void CreateShape(IFCImportShapeEditScope shapeEditScope, Transform lcs, Transform scaledLcs, string guid) { if (StyledByItem != null) { StyledByItem.Create(shapeEditScope); } if (LayerAssignment != null) { LayerAssignment.Create(shapeEditScope); } using (IFCImportShapeEditScope.IFCMaterialStack stack = new IFCImportShapeEditScope.IFCMaterialStack(shapeEditScope, StyledByItem, LayerAssignment)) { CreateShapeInternal(shapeEditScope, lcs, scaledLcs, guid); } }
override protected void Process(IFCAnyHandle item) { base.Process(item); LayerAssignment = IFCPresentationLayerAssignment.GetTheLayerAssignment(item); // IFC2x has a different representation for styled items which we don't support. ICollection <IFCAnyHandle> styledByItems = null; if (Importer.TheCache.StyledByItems.TryGetValue(item, out styledByItems)) { if (styledByItems != null && styledByItems.Count > 0) { // We can only handle one styled item, but we allow the possiblity that there are duplicates. Do a top-level check. foreach (IFCAnyHandle styledByItem in styledByItems) { if (!IFCAnyHandleUtil.IsSubTypeOf(styledByItem, IFCEntityType.IfcStyledItem)) { Importer.TheLog.LogUnexpectedTypeError(styledByItem, IFCEntityType.IfcStyledItem, false); StyledByItem = null; break; } else { if (StyledByItem == null) { StyledByItem = IFCStyledItem.ProcessIFCStyledItem(styledByItem); } else { IFCStyledItem compStyledByItem = IFCStyledItem.ProcessIFCStyledItem(styledByItem); if (!StyledByItem.IsEquivalentTo(compStyledByItem)) { Importer.TheLog.LogWarning(Id, "Multiple inconsistent styled items found for this item; using first one.", false); break; } } } } } } }
override protected void Process(IFCAnyHandle item) { base.Process(item); LayerAssignment = IFCPresentationLayerAssignment.GetTheLayerAssignment(item, false); List <IFCAnyHandle> styledByItems = IFCAnyHandleUtil.GetAggregateInstanceAttribute <List <IFCAnyHandle> >(item, "StyledByItem"); if (styledByItems != null && styledByItems.Count > 0) { // We can only handle one styled item, but we allow the possiblity that there are duplicates. Do a top-level check. foreach (IFCAnyHandle styledByItem in styledByItems) { if (!IFCAnyHandleUtil.IsSubTypeOf(styledByItem, IFCEntityType.IfcStyledItem)) { Importer.TheLog.LogUnexpectedTypeError(styledByItem, IFCEntityType.IfcStyledItem, false); StyledByItem = null; break; } else { if (StyledByItem == null) { StyledByItem = IFCStyledItem.ProcessIFCStyledItem(styledByItem); } else { IFCStyledItem compStyledByItem = IFCStyledItem.ProcessIFCStyledItem(styledByItem); if (!StyledByItem.IsEquivalentTo(compStyledByItem)) { Importer.TheLog.LogWarning(Id, "Multiple inconsistent styled items found for this item; using first one.", false); break; } } } } } }