override protected void Process(IFCAnyHandle solid)
        {
            base.Process(solid);

            IFCAnyHandle directrix = IFCImportHandleUtil.GetRequiredInstanceAttribute(solid, "Directrix", true);

            Directrix = IFCCurve.ProcessIFCCurve(directrix);

            IFCAnyHandle referenceSurface = IFCImportHandleUtil.GetRequiredInstanceAttribute(solid, "ReferenceSurface", true);

            ReferenceSurface = IFCSurface.ProcessIFCSurface(referenceSurface);

            StartParameter = IFCImportHandleUtil.GetOptionalDoubleAttribute(solid, "StartParam", 0.0);
            if (StartParameter < MathUtil.Eps())
            {
                StartParameter = 0.0;
            }

            double endParameter = IFCImportHandleUtil.GetOptionalDoubleAttribute(solid, "EndParam", -1.0);

            if (!MathUtil.IsAlmostEqual(endParameter, -1.0))
            {
                if (endParameter < StartParameter + MathUtil.Eps())
                {
                    Importer.TheLog.LogError(solid.StepId, "IfcSurfaceCurveSweptAreaSolid swept curve end parameter less than or equal to start parameter, aborting.", true);
                }
                EndParameter = endParameter;
            }
        }
Beispiel #2
0
        protected override void Process(IFCAnyHandle ifcFaceSurface)
        {
            base.Process(ifcFaceSurface);

            // Only allow IfcFaceSurface for certain supported surfaces.
            IFCAnyHandle faceSurface = IFCImportHandleUtil.GetRequiredInstanceAttribute(ifcFaceSurface, "FaceSurface", false);

            if (!IFCAnyHandleUtil.IsNullOrHasNoValue(faceSurface))
            {
                FaceSurface = IFCSurface.ProcessIFCSurface(faceSurface);
                bool validSurface = (FaceSurface is IFCPlane) || (FaceSurface is IFCCylindricalSurface) || (FaceSurface is IFCBSplineSurface) ||
                                    (FaceSurface is IFCSurfaceOfLinearExtrusion) || (FaceSurface is IFCSurfaceOfRevolution);
                if (!validSurface)
                {
                    Importer.TheLog.LogError(ifcFaceSurface.StepId,
                                             "cannot handle IfcFaceSurface with FaceSurface of type " + IFCAnyHandleUtil.GetEntityType(faceSurface).ToString(), true);
                }
            }

            bool found     = false;
            bool sameSense = IFCImportHandleUtil.GetRequiredBooleanAttribute(ifcFaceSurface, "SameSense", out found);

            if (found)
            {
                SameSense = sameSense;
            }
            else
            {
                Importer.TheLog.LogWarning(ifcFaceSurface.StepId,
                                           "cannot find SameSense attribute, defaulting to true", false);
                SameSense = true;
            }
        }
Beispiel #3
0
        override protected void Process(IFCAnyHandle ifcFace)
        {
            if (IFCAnyHandleUtil.IsSubTypeOf(ifcFace, IFCEntityType.IfcFaceSurface))
            {
                // Only allow IfcFaceSurface is the surface is a plane.
                IFCAnyHandle faceSurface = IFCImportHandleUtil.GetRequiredInstanceAttribute(ifcFace, "FaceSurface", false);
                if (!IFCAnyHandleUtil.IsNullOrHasNoValue(faceSurface))
                {
                    IFCSurface surface = IFCSurface.ProcessIFCSurface(faceSurface);
                    if (!(surface is IFCPlane))
                    {
                        IFCImportFile.TheLog.LogError(ifcFace.StepId,
                                                      "cannot handle IfcFaceSurface with FaceSurface of type " + IFCAnyHandleUtil.GetEntityType(faceSurface).ToString(), true);
                    }
                }
            }

            base.Process(ifcFace);

            HashSet <IFCAnyHandle> ifcBounds =
                IFCAnyHandleUtil.GetAggregateInstanceAttribute <HashSet <IFCAnyHandle> >(ifcFace, "Bounds");

            if (ifcBounds == null || ifcBounds.Count == 0)
            {
                throw new InvalidOperationException("#" + ifcFace.StepId + ": no face boundaries, aborting.");
            }

            foreach (IFCAnyHandle ifcBound in ifcBounds)
            {
                try
                {
                    Bounds.Add(IFCFaceBound.ProcessIFCFaceBound(ifcBound));
                }
                catch
                {
                    // LOG: WARNING: #: Invalid face boundary ifcBound.StepId, ignoring.
                }
            }

            if (Bounds.Count == 0)
            {
                throw new InvalidOperationException("#" + ifcFace.StepId + ": no face boundaries, aborting.");
            }

            // Give warning if too many outer bounds.  We won't care how they are designated, regardless.
            bool hasOuter = false;

            foreach (IFCFaceBound faceBound in Bounds)
            {
                if (faceBound.IsOuter)
                {
                    if (hasOuter)
                    {
                        // LOG: WARNING: #: Too many outer boundary loops for IfcFace.
                        break;
                    }
                    hasOuter = true;
                }
            }
        }
        protected override void Process(IFCAnyHandle ifcFaceSurface)
        {
            base.Process(ifcFaceSurface);

            // Only allow IfcFaceSurface for certain supported surfaces.
            IFCAnyHandle faceSurface = IFCImportHandleUtil.GetRequiredInstanceAttribute(ifcFaceSurface, "FaceSurface", false);
            if (!IFCAnyHandleUtil.IsNullOrHasNoValue(faceSurface))
            {
                FaceSurface = IFCSurface.ProcessIFCSurface(faceSurface);
                bool validSurface = (FaceSurface is IFCPlane);
                if (!validSurface)
                    Importer.TheLog.LogError(ifcFaceSurface.StepId,
                        "cannot handle IfcFaceSurface with FaceSurface of type " + IFCAnyHandleUtil.GetEntityType(faceSurface).ToString(), true);
            }

            bool found = false;
            bool sameSense = IFCImportHandleUtil.GetRequiredBooleanAttribute(ifcFaceSurface, "SameSense", out found);
            if (found)
            {
                SameSense = sameSense;
            }
            else
            {
                Importer.TheLog.LogWarning(ifcFaceSurface.StepId,
                    "cannot find SameSense attribute, defaulting to true", false);
                SameSense = true;
            }
        }
Beispiel #5
0
        override protected void Process(IFCAnyHandle solid)
        {
            base.Process(solid);

            bool found         = false;
            bool agreementFlag = IFCImportHandleUtil.GetRequiredBooleanAttribute(solid, "AgreementFlag", out found);

            if (found)
            {
                AgreementFlag = agreementFlag;
            }

            IFCAnyHandle baseSurface = IFCImportHandleUtil.GetRequiredInstanceAttribute(solid, "BaseSurface", true);

            BaseSurface = IFCSurface.ProcessIFCSurface(baseSurface);
            if (!(BaseSurface is IFCPlane))
            {
                Importer.TheLog.LogUnhandledSubTypeError(baseSurface, IFCEntityType.IfcSurface, true);
            }

            if (IFCAnyHandleUtil.IsValidSubTypeOf(solid, IFCEntityType.IfcPolygonalBoundedHalfSpace))
            {
                IFCAnyHandle position = IFCImportHandleUtil.GetRequiredInstanceAttribute(solid, "Position", false);
                if (!IFCAnyHandleUtil.IsNullOrHasNoValue(position))
                {
                    BaseBoundingCurveTransform = IFCLocation.ProcessIFCAxis2Placement(position);
                }
                else
                {
                    BaseBoundingCurveTransform = Transform.Identity;
                }

                IFCAnyHandle boundaryCurveHandle = IFCImportHandleUtil.GetRequiredInstanceAttribute(solid, "PolygonalBoundary", true);
                BaseBoundingCurve = IFCCurve.ProcessIFCCurve(boundaryCurveHandle);
                if (BaseBoundingCurve == null || BaseBoundingCurve.GetTheCurveLoop() == null)
                {
                    Importer.TheLog.LogError(Id, "IfcPolygonalBoundedHalfSpace has an invalid boundary, ignoring.", true);
                }
            }
        }