private void GetTransformedCurveLoopsFromProfile(IFCProfileDef profile, Transform unscaledLcs, Transform scaledLcs, ISet <IList <CurveLoop> > loops) { if (profile is IFCSimpleProfile) { IFCSimpleProfile simpleSweptArea = profile as IFCSimpleProfile; IList <CurveLoop> currLoops = GetTransformedCurveLoopsFromSimpleProfile(simpleSweptArea, unscaledLcs, scaledLcs); if (currLoops != null && currLoops.Count > 0) { loops.Add(currLoops); } } else if (profile is IFCCompositeProfile) { IFCCompositeProfile compositeSweptArea = profile as IFCCompositeProfile; foreach (IFCProfileDef subProfile in compositeSweptArea.Profiles) { GetTransformedCurveLoopsFromProfile(subProfile, unscaledLcs, scaledLcs, loops); } } else if (profile is IFCDerivedProfileDef) { IFCDerivedProfileDef derivedProfileDef = profile as IFCDerivedProfileDef; Transform fullUnscaledLCS = unscaledLcs; Transform localLCS = derivedProfileDef.Operator.Transform; if (fullUnscaledLCS == null) { fullUnscaledLCS = localLCS; } else if (localLCS != null) { fullUnscaledLCS = fullUnscaledLCS.Multiply(localLCS); } Transform fullScaledLCS = scaledLcs; if (fullScaledLCS == null) { fullScaledLCS = localLCS; } else if (localLCS != null) { fullScaledLCS = fullScaledLCS.Multiply(localLCS); } GetTransformedCurveLoopsFromProfile(derivedProfileDef.ParentProfile, fullUnscaledLCS, fullScaledLCS, loops); } else { // TODO: Support. Importer.TheLog.LogError(Id, "SweptArea Profile #" + profile.Id + " not yet supported.", false); } }
/// <summary> /// Create an IFCDerivedProfileDef object from a handle of type IfcDerivedProfileDef. /// </summary> /// <param name="ifcDerivedProfileDef">The IFC handle.</param> /// <returns>The IFCDerivedProfileDef object.</returns> public static IFCDerivedProfileDef ProcessIFCDerivedProfileDef(IFCAnyHandle ifcDerivedProfileDef) { if (IFCAnyHandleUtil.IsNullOrHasNoValue(ifcDerivedProfileDef)) { Importer.TheLog.LogNullError(IFCEntityType.IfcDerivedProfileDef); return(null); } IFCEntity derivedProfileDef; if (!IFCImportFile.TheFile.EntityMap.TryGetValue(ifcDerivedProfileDef.StepId, out derivedProfileDef)) { derivedProfileDef = new IFCDerivedProfileDef(ifcDerivedProfileDef); } return(derivedProfileDef as IFCDerivedProfileDef); }