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;
            }
        }
      /// <summary>
      /// Processes an IfcWindowLiningProperties entity.
      /// </summary>
      /// <param name="ifcWindowLiningProperties">The IfcWindowLiningProperties handle.</param>
      protected override void Process(IFCAnyHandle ifcWindowLiningProperties)
      {
         base.Process(ifcWindowLiningProperties);

         if (m_WindowLiningPropertyDescs == null)
         {
            m_WindowLiningPropertyDescs = new List<Tuple<string, ForgeTypeId, AllowedValues>>();
            m_WindowLiningPropertyDescs.Add(Tuple.Create("LiningDepth", SpecTypeId.Length, AllowedValues.Positive));
            m_WindowLiningPropertyDescs.Add(Tuple.Create("LiningThickness", SpecTypeId.Length, AllowedValues.Positive));
            m_WindowLiningPropertyDescs.Add(Tuple.Create("TransomThickness", SpecTypeId.Length, AllowedValues.Positive));
            m_WindowLiningPropertyDescs.Add(Tuple.Create("MullionThickness", SpecTypeId.Length, AllowedValues.Positive));
            m_WindowLiningPropertyDescs.Add(Tuple.Create("FirstTransomOffset", SpecTypeId.Length, AllowedValues.NonNegative));
            m_WindowLiningPropertyDescs.Add(Tuple.Create("SecondTransomOffset", SpecTypeId.Length, AllowedValues.NonNegative));
            m_WindowLiningPropertyDescs.Add(Tuple.Create("FirstMullionOffset", SpecTypeId.Length, AllowedValues.NonNegative));
            m_WindowLiningPropertyDescs.Add(Tuple.Create("SecondMullionOffset", SpecTypeId.Length, AllowedValues.NonNegative));
         }

         for (int ii = 0; ii < 4; ii++)
         {
            Tuple<string, ForgeTypeId, AllowedValues> propertyDesc = m_WindowLiningPropertyDescs[ii];
            // Default is nonsense value.
            double currPropertyValue = IFCImportHandleUtil.GetOptionalScaledLengthAttribute(ifcWindowLiningProperties, propertyDesc.Item1, -1e+30);
            if (!MathUtil.IsAlmostEqual(currPropertyValue, -1e+30))
               DoubleProperties[propertyDesc] = currPropertyValue;
         }

         for (int ii = 4; ii < 8; ii++)
         {
            Tuple<string, ForgeTypeId, AllowedValues> propertyDesc = m_WindowLiningPropertyDescs[ii];
            // Default is nonsense value.
            double currPropertyValue = IFCImportHandleUtil.GetOptionalDoubleAttribute(ifcWindowLiningProperties, propertyDesc.Item1, -1e+30);
            if (!MathUtil.IsAlmostEqual(currPropertyValue, -1e+30))
               DoubleProperties[propertyDesc] = currPropertyValue;
         }
      }
Exemple #3
0
        override protected void Process(IFCAnyHandle solid)
        {
            base.Process(solid);

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

            Directrix = IFCCurve.ProcessIFCCurve(directrix);

            bool found = false;

            Radius = IFCImportHandleUtil.GetRequiredScaledLengthAttribute(solid, "Radius", out found);
            if (!found || !Application.IsValidThickness(Radius))
            {
                Importer.TheLog.LogError(solid.StepId, "IfcSweptDiskSolid radius is invalid, aborting.", true);
            }

            double innerRadius = IFCImportHandleUtil.GetOptionalScaledLengthAttribute(solid, "InnerRadius", 0.0);

            if (Application.IsValidThickness(innerRadius))
            {
                if (!Application.IsValidThickness(Radius - innerRadius))
                {
                    Importer.TheLog.LogError(solid.StepId, "IfcSweptDiskSolid inner radius is too large, aborting.", true);
                }
                InnerRadius = innerRadius;
            }

            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.LogWarning(solid.StepId, "IfcSweptDiskSolid swept curve end parameter less than or equal to start parameter, ignoring both.", true);
                    StartParameter = 0.0;
                }
                else
                {
                    EndParameter = endParameter;
                }
            }
        }
Exemple #4
0
        protected override void Process(IFCAnyHandle ifcMaterialProfileSetUsage)
        {
            base.Process(ifcMaterialProfileSetUsage);

            IFCAnyHandle ifcMaterialProfileSet = IFCImportHandleUtil.GetRequiredInstanceAttribute(ifcMaterialProfileSetUsage, "ForProfileSet", true);

            if (!IFCAnyHandleUtil.IsNullOrHasNoValue(ifcMaterialProfileSet))
            {
                ForProfileSet = IFCMaterialProfileSet.ProcessIFCMaterialProfileSet(ifcMaterialProfileSet);
            }

            bool found = false;

            CardinalPoint   = IFCImportHandleUtil.GetOptionalIntegerAttribute(ifcMaterialProfileSetUsage, "CardinalPoint", out found);
            ReferenceExtent = IFCImportHandleUtil.GetOptionalDoubleAttribute(ifcMaterialProfileSetUsage, "ReferenceExtent", 0);
        }