Exemplo n.º 1
0
        override protected void Process(IFCAnyHandle ifcConnectedFaceSet)
        {
            base.Process(ifcConnectedFaceSet);

            HashSet <IFCAnyHandle> ifcCfsFaces =
                IFCAnyHandleUtil.GetValidAggregateInstanceAttribute <HashSet <IFCAnyHandle> >(ifcConnectedFaceSet, "CfsFaces");

            if (ifcCfsFaces == null || ifcCfsFaces.Count == 0)
            {
                throw new InvalidOperationException("#" + ifcConnectedFaceSet.StepId + ": no faces in connected face set, aborting.");
            }

            foreach (IFCAnyHandle ifcCfsFace in ifcCfsFaces)
            {
                try
                {
                    Faces.Add(IFCFace.ProcessIFCFace(ifcCfsFace));
                }
                catch
                {
                    Importer.TheLog.LogWarning(ifcCfsFace.StepId, "Invalid face, ignoring.", false);
                }
            }

            if (Faces.Count == 0)
            {
                throw new InvalidOperationException("#" + ifcConnectedFaceSet.StepId + ": no faces, aborting.");
            }
        }
Exemplo n.º 2
0
        public static IFCTopologicalRepresentationItem ProcessIFCTopologicalRepresentationItem(IFCAnyHandle ifcTopologicalRepresentationItem)
        {
            if (IFCAnyHandleUtil.IsSubTypeOf(ifcTopologicalRepresentationItem, IFCEntityType.IfcConnectedFaceSet))
            {
                return(IFCConnectedFaceSet.ProcessIFCConnectedFaceSet(ifcTopologicalRepresentationItem));
            }
            if (IFCAnyHandleUtil.IsSubTypeOf(ifcTopologicalRepresentationItem, IFCEntityType.IfcEdge))
            {
                return(IFCEdge.ProcessIFCEdge(ifcTopologicalRepresentationItem));
            }
            if (IFCAnyHandleUtil.IsSubTypeOf(ifcTopologicalRepresentationItem, IFCEntityType.IfcFace))
            {
                return(IFCFace.ProcessIFCFace(ifcTopologicalRepresentationItem));
            }
            if (IFCAnyHandleUtil.IsSubTypeOf(ifcTopologicalRepresentationItem, IFCEntityType.IfcLoop))
            {
                return(IFCLoop.ProcessIFCLoop(ifcTopologicalRepresentationItem));
            }
            if (IFCAnyHandleUtil.IsSubTypeOf(ifcTopologicalRepresentationItem, IFCEntityType.IfcVertex))
            {
                return(IFCVertex.ProcessIFCVertex(ifcTopologicalRepresentationItem));
            }

            Importer.TheLog.LogUnhandledSubTypeError(ifcTopologicalRepresentationItem, IFCEntityType.IfcTopologicalRepresentationItem, true);
            return(null);
        }