Esempio n. 1
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);
        }
        /// <summary>
        /// Create an IFCVertex object from a handle of type IfcVertex.
        /// </summary>
        /// <param name="ifcFace">The IFC handle.</param>
        /// <returns>The IFCVertex object.</returns>
        public static IFCVertex ProcessIFCVertex(IFCAnyHandle ifcVertex)
        {
            if (IFCAnyHandleUtil.IsSubTypeOf(ifcVertex, IFCEntityType.IfcVertexPoint))
                return IFCVertexPoint.ProcessIFCVertexPoint(ifcVertex);

            if (IFCAnyHandleUtil.IsNullOrHasNoValue(ifcVertex))
            {
                Importer.TheLog.LogNullError(IFCEntityType.IfcVertex);
                return null;
            }

            IFCEntity vertex;
            if (!IFCImportFile.TheFile.EntityMap.TryGetValue(ifcVertex.StepId, out vertex))
                vertex = new IFCVertex(ifcVertex);
            return (vertex as IFCVertex);
        }
Esempio n. 3
0
        /// <summary>
        /// Create an IFCVertex object from a handle of type IfcVertex.
        /// </summary>
        /// <param name="ifcFace">The IFC handle.</param>
        /// <returns>The IFCVertex object.</returns>
        public static IFCVertex ProcessIFCVertex(IFCAnyHandle ifcVertex)
        {
            if (IFCAnyHandleUtil.IsSubTypeOf(ifcVertex, IFCEntityType.IfcVertexPoint))
            {
                return(IFCVertexPoint.ProcessIFCVertexPoint(ifcVertex));
            }

            if (IFCAnyHandleUtil.IsNullOrHasNoValue(ifcVertex))
            {
                Importer.TheLog.LogNullError(IFCEntityType.IfcVertex);
                return(null);
            }

            IFCEntity vertex;

            if (!IFCImportFile.TheFile.EntityMap.TryGetValue(ifcVertex.StepId, out vertex))
            {
                vertex = new IFCVertex(ifcVertex);
            }
            return(vertex as IFCVertex);
        }
Esempio n. 4
0
        protected override void Process(IFCAnyHandle ifcEdge)
        {
            base.Process(ifcEdge);
 
            IFCAnyHandle edgeStart = IFCImportHandleUtil.GetRequiredInstanceAttribute(ifcEdge, "EdgeStart", false);
            if (IFCAnyHandleUtil.IsNullOrHasNoValue(edgeStart))
            {
                Importer.TheLog.LogError(ifcEdge.StepId, "Cannot find the starting vertex", true);
                return;
            }

            IFCAnyHandle edgeEnd = IFCImportHandleUtil.GetRequiredInstanceAttribute(ifcEdge, "EdgeEnd", false);
            if (IFCAnyHandleUtil.IsNullOrHasNoValue(edgeEnd))
            {
                Importer.TheLog.LogError(ifcEdge.StepId, "Cannot find the ending vertex", true);
                return;
            }

            EdgeStart = IFCVertex.ProcessIFCVertex(edgeStart);
            EdgeEnd = IFCVertex.ProcessIFCVertex(edgeEnd);
        }
Esempio n. 5
0
        protected override void Process(IFCAnyHandle ifcEdge)
        {
            base.Process(ifcEdge);

            IFCAnyHandle edgeStart = IFCImportHandleUtil.GetRequiredInstanceAttribute(ifcEdge, "EdgeStart", false);

            if (IFCAnyHandleUtil.IsNullOrHasNoValue(edgeStart))
            {
                Importer.TheLog.LogError(ifcEdge.StepId, "Cannot find the starting vertex", true);
                return;
            }

            IFCAnyHandle edgeEnd = IFCImportHandleUtil.GetRequiredInstanceAttribute(ifcEdge, "EdgeEnd", false);

            if (IFCAnyHandleUtil.IsNullOrHasNoValue(edgeEnd))
            {
                Importer.TheLog.LogError(ifcEdge.StepId, "Cannot find the ending vertex", true);
                return;
            }

            EdgeStart = IFCVertex.ProcessIFCVertex(edgeStart);
            EdgeEnd   = IFCVertex.ProcessIFCVertex(edgeEnd);
        }
Esempio n. 6
0
        protected override void Process(IFCAnyHandle ifcEdge)
        {
            base.Process(ifcEdge);

            // The ODA toolkit doesn't support derived attributes.  As such, we will
            // let IfcOrientedEdge compute them.
            IFCAnyHandle edgeStart = IFCImportHandleUtil.GetOptionalInstanceAttribute(ifcEdge, "EdgeStart");

            if (IFCAnyHandleUtil.IsNullOrHasNoValue(edgeStart))
            {
                if (!(this is IFCOrientedEdge))
                {
                    Importer.TheLog.LogError(ifcEdge.StepId, "Cannot find the starting vertex", true);
                    return;
                }
            }
            else
            {
                EdgeStart = IFCVertex.ProcessIFCVertex(edgeStart);
            }

            IFCAnyHandle edgeEnd = IFCImportHandleUtil.GetOptionalInstanceAttribute(ifcEdge, "EdgeEnd");

            if (IFCAnyHandleUtil.IsNullOrHasNoValue(edgeEnd))
            {
                if (!(this is IFCOrientedEdge))
                {
                    Importer.TheLog.LogError(ifcEdge.StepId, "Cannot find the ending vertex", true);
                    return;
                }
            }
            else
            {
                EdgeEnd = IFCVertex.ProcessIFCVertex(edgeEnd);
            }
        }