Пример #1
0
        private void GetTransformedCurveLoopsFromProfile(IFCProfile profile, Transform lcs, ISet <IList <CurveLoop> > loops)
        {
            if (profile is IFCSimpleProfile)
            {
                IFCSimpleProfile simpleSweptArea = profile as IFCSimpleProfile;

                IList <CurveLoop> currLoops = GetTransformedCurveLoopsFromSimpleProfile(simpleSweptArea, lcs);
                if (currLoops != null && currLoops.Count > 0)
                {
                    loops.Add(currLoops);
                }
            }
            else if (profile is IFCCompositeProfile)
            {
                IFCCompositeProfile compositeSweptArea = profile as IFCCompositeProfile;

                foreach (IFCProfile subProfile in compositeSweptArea.Profiles)
                {
                    GetTransformedCurveLoopsFromProfile(subProfile, lcs, loops);
                }
            }
            else
            {
                // TODO: Support.
                Importer.TheLog.LogError(Id, "SweptArea Profile #" + profile.Id + " not yet supported.", false);
            }
        }
        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);
            }
        }
Пример #3
0
        protected override void Process(IFCAnyHandle ifcMaterialProfileSet)
        {
            base.Process(ifcMaterialProfileSet);

            IList <IFCAnyHandle> ifcMaterialProfiles =
                IFCAnyHandleUtil.GetAggregateInstanceAttribute <List <IFCAnyHandle> >(ifcMaterialProfileSet, "MaterialProfiles");

            if (ifcMaterialProfiles == null)
            {
                Importer.TheLog.LogError(ifcMaterialProfileSet.Id, "Expected at least 1 MaterialProfile, found none.", false);
                return;
            }

            foreach (IFCAnyHandle ifcMaterialProfile in ifcMaterialProfiles)
            {
                IFCMaterialProfile materialProfile = null;
                if (IFCAnyHandleUtil.IsTypeOf(ifcMaterialProfile, IFCEntityType.IfcMaterialProfileWithOffsets))
                {
                    materialProfile = IFCMaterialProfileWithOffsets.ProcessIFCMaterialProfileWithOffsets(ifcMaterialProfile);
                }
                else
                {
                    materialProfile = IFCMaterialProfile.ProcessIFCMaterialProfile(ifcMaterialProfile);
                }

                if (materialProfile != null)
                {
                    MaterialProfileSet.Add(materialProfile);
                }
            }

            Name        = IFCImportHandleUtil.GetOptionalStringAttribute(ifcMaterialProfileSet, "Name", null);
            Description = IFCImportHandleUtil.GetOptionalStringAttribute(ifcMaterialProfileSet, "Description", null);
            IFCAnyHandle compositeProfileHnd = IFCImportHandleUtil.GetOptionalInstanceAttribute(ifcMaterialProfileSet, "CompositeProfile");

            if (!IFCAnyHandleUtil.IsNullOrHasNoValue(compositeProfileHnd))
            {
                CompositeProfile = IFCCompositeProfile.ProcessIFCCompositeProfile(compositeProfileHnd);
            }
        }