Exemple #1
0
        protected override void Process(IFCAnyHandle ifcMaterialLayer)
        {
            base.Process(ifcMaterialLayer);

            IFCAnyHandle ifcMaterial = IFCImportHandleUtil.GetOptionalInstanceAttribute(ifcMaterialLayer, "Material");

            if (!IFCAnyHandleUtil.IsNullOrHasNoValue(ifcMaterial))
            {
                Material = IFCMaterial.ProcessIFCMaterial(ifcMaterial);
            }

            bool found = false;

            LayerThickness = IFCImportHandleUtil.GetRequiredScaledLengthAttribute(ifcMaterialLayer, "LayerThickness", out found);
            if (!found)
            {
                return;
            }

            // GetOptionalLogicalAttribute defaults to Unknown.  We want to default to false here.
            IsVentilated = IFCImportHandleUtil.GetOptionalLogicalAttribute(ifcMaterialLayer, "IsVentilated", out found);
            if (!found)
            {
                IsVentilated = IFCLogical.False;
            }
        }
 /// <summary>
 /// Creates an IFCData object as IfcLogical.
 /// </summary>
 /// <param name="value">The logical value.</param>
 /// <returns>The IFCData object.</returns>
 public static IFCData CreateAsLogical(IFCLogical value)
 {
     IFCData ifcData = IFCData.CreateLogical(value);
     IList<string> types = new List<string>();
     types.Add("IfcLogical");
     ifcData.SetTypeList(types);
     return ifcData;
 }
Exemple #3
0
        /// <summary>
        /// Sets logical attribute for the handle.
        /// </summary>
        /// <remarks>
        /// If value is null or empty, the attribute will be unset.
        /// </remarks>
        /// <param name="handle">The handle.</param>
        /// <param name="name">The attribute name.</param>
        /// <param name="value">The logical value.</param>
        /// <exception cref="ArgumentException">If the name is null or empty.</exception>
        public static void SetAttribute(IFCAnyHandle handle, string name, IFCLogical value)
        {
            if (String.IsNullOrEmpty(name))
            {
                throw new ArgumentException("The name is empty.", "name");
            }

            handle.SetAttribute(name, IFCData.CreateLogical(value));
        }
Exemple #4
0
        /// <summary>
        /// Creates an IFCData object as IfcLogical.
        /// </summary>
        /// <param name="value">The logical value.</param>
        /// <returns>The IFCData object.</returns>
        public static IFCData CreateAsLogical(IFCLogical value)
        {
            IFCData        ifcData = IFCData.CreateLogical(value);
            IList <string> types   = new List <string>();

            types.Add("IfcLogical");
            ifcData.SetTypeList(types);
            return(ifcData);
        }
        protected override void Process(IFCAnyHandle ifcCurve)
        {
            base.Process(ifcCurve);

            bool foundDegree = false;

            Degree = IFCImportHandleUtil.GetRequiredIntegerAttribute(ifcCurve, "Degree", out foundDegree);
            if (!foundDegree)
            {
                Importer.TheLog.LogError(ifcCurve.StepId, "Cannot find the degree of this curve", true);
            }

            IList <IFCAnyHandle> controlPoints = IFCAnyHandleUtil.GetAggregateInstanceAttribute <List <IFCAnyHandle> >(ifcCurve, "ControlPointsList");

            if (controlPoints == null || controlPoints.Count == 0)
            {
                Importer.TheLog.LogError(ifcCurve.StepId, "This curve has invalid number of control points", true);
            }

            IList <XYZ> controlPointLists = new List <XYZ>();

            foreach (IFCAnyHandle point in controlPoints)
            {
                XYZ pointXYZ = IFCPoint.ProcessScaledLengthIFCCartesianPoint(point);
                controlPointLists.Add(pointXYZ);
            }
            ControlPointsList = controlPointLists;

            bool       foundClosedCurve = false;
            IFCLogical closedCurve      = IFCImportHandleUtil.GetOptionalLogicalAttribute(ifcCurve, "ClosedCurve", out foundClosedCurve);

            if (!foundClosedCurve)
            {
                Importer.TheLog.LogWarning(ifcCurve.StepId, "Cannot find the ClosedCurve property of this curve, ignoring", false);
                ClosedCurve = null;
            }
            else
            {
                ClosedCurve = (closedCurve == IFCLogical.True);
            }
        }
      /// <summary>
      /// Creates an IfcBSplineSurface and assigns it to the handle
      /// </summary>
      /// <param name="file">the file</param>
      /// <param name="uDegree">algebraic degree of basis functions in u</param>
      /// <param name="vDegree">algebraic degree of basis functions in v</param>
      /// <param name="controlPointsList">the list of control points</param>
      /// <param name="surfaceForm">enum of the surface type</param>
      /// <param name="uClosed">whether the surface is closed in the u direction</param>
      /// <param name="vClosed">whether the surface is closed in the v direction</param>
      /// <param name="selfIntersect">whether the surface is self-intersecting</param>
      /// <returns>the handle</returns>
      public static IFCAnyHandle CreateBSplineSurface(IFCFile file, int uDegree, int vDegree, IList<IList<IFCAnyHandle>> controlPointsList,
                      IFC4.IFCBSplineSurfaceForm surfaceForm, IFCLogical uClosed, IFCLogical vClosed, IFCLogical selfIntersect)
      {
         ValidateControlPointsList(controlPointsList);

         IFCAnyHandle bSplineSurface = CreateInstance(file, IFCEntityType.IfcBSplineSurface);
         SetBSplineSurface(bSplineSurface, uDegree, vDegree, controlPointsList, surfaceForm, uClosed, vClosed, selfIntersect);

         return bSplineSurface;
      }
 /// <summary>
 /// Sets the values of an IfcBSplineSurfaceWithKnots.
 /// </summary>
 /// <param name="bSplineSurfaceWithKnots">The IfcBSplineSurfaceWithKnots handle.</param>
 /// <param name="uDegree">algebraic degree of basis functions in u</param>
 /// <param name="vDegree">algebraic degree of basis functions in v</param>
 /// <param name="controlPointsList">the list of control points</param>
 /// <param name="surfaceForm">enum of the surface type</param>
 /// <param name="uClosed">whether the surface is closed in the u direction</param>
 /// <param name="vClosed">whether the surface is closed in the v direction</param>
 /// <param name="selfIntersect">whether the surface is self-intersecting</param>
 /// <param name="uMultiplicities">The multiplicities of the knots in the u parameter direction</param>
 /// <param name="vMultiplicities">The multiplicities of the knots in the v parameter direction</param>
 /// <param name="uKnots">The list of the distinct knots in the u parameter direction</param>
 /// <param name="vKnots">The list of the distinct knots in the v parameter direction</param>
 /// <param name="knotSpec">The description of the knot type.</param>
 public static void SetBSplineSurfaceWithKnots(IFCAnyHandle bSplineSurfaceWithKnots, int uDegree, int vDegree, IList<IList<IFCAnyHandle>> controlPointsList,
                 IFC4.IFCBSplineSurfaceForm surfaceForm, IFCLogical uClosed, IFCLogical vClosed, IFCLogical selfIntersect, IList<int> uMultiplicities, IList<int> vMultiplicities,
                 IList<double> uKnots, IList<double> vKnots, IFC4.IFCKnotType knotSpec)
 {
    SetBSplineSurface(bSplineSurfaceWithKnots, uDegree, vDegree, controlPointsList, surfaceForm, uClosed, vClosed, selfIntersect);
    IFCAnyHandleUtil.SetAttribute(bSplineSurfaceWithKnots, "UMultiplicities", uMultiplicities);
    IFCAnyHandleUtil.SetAttribute(bSplineSurfaceWithKnots, "VMultiplicities", vMultiplicities);
    IFCAnyHandleUtil.SetAttribute(bSplineSurfaceWithKnots, "UKnots", uKnots);
    IFCAnyHandleUtil.SetAttribute(bSplineSurfaceWithKnots, "VKnots", vKnots);
    IFCAnyHandleUtil.SetAttribute(bSplineSurfaceWithKnots, "KnotSpec", knotSpec);
 }
 /// <summary>
 /// Creates an IfcRationalBSplineCurveWithKnots, and assigns it to the handle
 /// </summary>
 /// <param name="file">The file</param>
 /// <param name="degree">The degree of the b-spline curve</param>
 /// <param name="controlPointLists">The list of control points</param>
 /// <param name="curveForm">The form of the b-spline curve</param>
 /// <param name="closedCurve">The flag that indicates whether the curve is closed or not</param>
 /// <param name="selfIntersect">The flag that indicates whether the curve is self-intersect or not</param>
 /// <param name="knotMultiplicities">The knot multiplicities</param>
 /// <param name="knots">The knots</param>
 /// <param name="knotSpec">The type of the knots</param>
 /// <param name="weightsData">The weights</param>
 /// <returns>The handle</returns>
 public static IFCAnyHandle CreateRationalBSplineCurveWithKnots(IFCFile file, int degree, IList<IFCAnyHandle> controlPointLists, IFC4.IFCBSplineCurveForm curveForm,
     IFCLogical closedCurve, IFCLogical selfIntersect, IList<int> knotMultiplicities, IList<double> knots, IFC4.IFCKnotType knotSpec, IList<double> weightsData)
 {
    //TODO: validate parameters
    IFCAnyHandle rationBSplineCurveWithKnots = CreateInstance(file, IFCEntityType.IfcRationalBSplineCurveWithKnots);
    IFCAnyHandleUtil.SetAttribute(rationBSplineCurveWithKnots, "WeightsData", weightsData);
    SetBSplineCurveWithKnots(rationBSplineCurveWithKnots, degree, controlPointLists, curveForm, closedCurve, selfIntersect, knotMultiplicities, knots, knotSpec);
    return rationBSplineCurveWithKnots;
 }
 /// <summary>
 /// Sets the values of an IfcBSplineSurface.
 /// </summary>
 /// <param name="bsplineSurface">The IfcBSplineSurface entity.</param>
 /// <param name="uDegree">algebraic degree of basis functions in u</param>
 /// <param name="vDegree">algebraic degree of basis functions in v</param>
 /// <param name="controlPointsList">the list of control points</param>
 /// <param name="surfaceForm">enum of the surface type</param>
 /// <param name="uClosed">whether the surface is closed in the u direction</param>
 /// <param name="vClosed">whether the surface is closed in the v direction</param>
 /// <param name="selfIntersect">whether the surface is self-intersecting</param>
 private static void SetBSplineSurface(IFCAnyHandle bsplineSurface, int uDegree, int vDegree, IList<IList<IFCAnyHandle>> controlPointsList,
                 IFC4.IFCBSplineSurfaceForm surfaceForm, IFCLogical uClosed, IFCLogical vClosed, IFCLogical selfIntersect)
 {
    IFCAnyHandleUtil.SetAttribute(bsplineSurface, "UDegree", uDegree);
    IFCAnyHandleUtil.SetAttribute(bsplineSurface, "VDegree", vDegree);
    IFCAnyHandleUtil.SetAttribute(bsplineSurface, "ControlPointsList", controlPointsList, 2, null, 2, null);
    IFCAnyHandleUtil.SetAttribute(bsplineSurface, "SurfaceForm", surfaceForm);
    IFCAnyHandleUtil.SetAttribute(bsplineSurface, "UClosed", uClosed);
    IFCAnyHandleUtil.SetAttribute(bsplineSurface, "VClosed", vClosed);
    IFCAnyHandleUtil.SetAttribute(bsplineSurface, "SelfIntersect", selfIntersect);
 }
      /// <summary>
      /// Creates a handle representing an IfcCompositeCurve and assigns it to the file.
      /// </summary>
      /// <param name="file">The file.</param>
      /// <param name="segments">The list of IfcCompositeCurveSegments.</param>
      /// <param name="selfIntersect">True if curve self-intersects, false if not, or unknown.</param>
      /// <returns>The handle.</returns>
      public static IFCAnyHandle CreateCompositeCurve(IFCFile file, IList<IFCAnyHandle> segments, IFCLogical selfIntersect)
      {
         IFCAnyHandleUtil.ValidateSubTypeOf(segments, true, IFCEntityType.IfcCompositeCurveSegment);

         IFCAnyHandle compositeCurve = CreateInstance(file, IFCEntityType.IfcCompositeCurve);
         IFCAnyHandleUtil.SetAttribute(compositeCurve, "Segments", segments);
         IFCAnyHandleUtil.SetAttribute(compositeCurve, "SelfIntersect", selfIntersect);
         return compositeCurve;
      }
 /// <summary>
 /// Creates an IfcBSplineCurveWithKnots, and assigns it to the handle
 /// </summary>
 /// <param name="file">The file</param>
 /// <param name="degree">The degree of the b-spline curve</param>
 /// <param name="controlPointLists">The list of control points</param>
 /// <param name="curveForm">The form of the b-spline curve</param>
 /// <param name="closedCurve">The flag that indicates whether the curve is closed or not</param>
 /// <param name="selfIntersect">The flag that indicates whether the curve is self-intersect or not</param>
 /// <param name="knotMultiplicities">The knot multiplicities</param>
 /// <param name="knots">The knots</param>
 /// <param name="knotSpec">The type of the knots</param>
 /// <returns>The handle</returns>
 public static IFCAnyHandle CreateBSplineCurveWithKnots(IFCFile file, int degree, IList<IFCAnyHandle> controlPointLists, IFC4.IFCBSplineCurveForm curveForm,
     IFCLogical closedCurve, IFCLogical selfIntersect, IList<int> knotMultiplicities, IList<double> knots, IFC4.IFCKnotType knotSpec)
 {
    //TODO: validate parameters
    IFCAnyHandle bSplineCurveWithKnots = CreateInstance(file, IFCEntityType.IfcBSplineCurveWithKnots);
    SetBSplineCurveWithKnots(bSplineCurveWithKnots, degree, controlPointLists, curveForm, closedCurve, selfIntersect, knotMultiplicities, knots, knotSpec);
    return bSplineCurveWithKnots;
 }
        /// <summary>
        /// Creates an IfcBSplineSurfaceWithKnots and assigns it to the handle
        /// </summary>
        /// <param name="file">the file</param>
        /// <param name="uDegree">algebraic degree of basis functions in u</param>
        /// <param name="vDegree">algebraic degree of basis functions in v</param>
        /// <param name="controlPointsList">the list of control points</param>
        /// <param name="surfaceForm">enum of the surface type</param>
        /// <param name="uClosed">whether the surface is closed in the u direction</param>
        /// <param name="vClosed">whether the surface is closed in the v direction</param>
        /// <param name="selfIntersect">whether the surface is self-intersecting</param>
        /// <param name="uMultiplicities">The multiplicities of the knots in the u parameter direction</param>
        /// <param name="vMultiplicities">The multiplicities of the knots in the v parameter direction</param>
        /// <param name="uKnots">The list of the distinct knots in the u parameter direction</param>
        /// <param name="vKnots">The list of the distinct knots in the v parameter direction</param>
        /// <param name="knotSpec">The description of the knot type.</param>
        /// <returns>the handle</returns>
        public static IFCAnyHandle CreateBSplineSurfaceWithKnots(IFCFile file, int uDegree, int vDegree, List<List<IFCAnyHandle>> controlPointsList,
                        IFCAnyHandle surfaceForm, IFCLogical uClosed, IFCLogical vClosed, IFCLogical selfIntersect, List<int> uMultiplicities, List<int> vMultiplicities,
                        List<double> uKnots, List<double> vKnots, IFC4.IFCKnotType knotSpec)
        {
            ValidateControlPointsList(controlPointsList);

            IFCAnyHandle BSplineSurface = CreateInstance(file, IFCEntityType.IfcBSplineSurface);
            IFCAnyHandleUtil.SetAttribute(BSplineSurface, "UDegree", uDegree);
            IFCAnyHandleUtil.SetAttribute(BSplineSurface, "VDegree", vDegree);
            IFCAnyHandleUtil.SetAttribute(BSplineSurface, "ControlPointsList", controlPointsList, 2, null, 2, null);
            IFCAnyHandleUtil.SetAttribute(BSplineSurface, "SurfaceForm", surfaceForm);
            IFCAnyHandleUtil.SetAttribute(BSplineSurface, "UClosed", uClosed);
            IFCAnyHandleUtil.SetAttribute(BSplineSurface, "VClosed", vClosed);
            IFCAnyHandleUtil.SetAttribute(BSplineSurface, "SelfIntersect", selfIntersect);
            IFCAnyHandleUtil.SetAttribute(BSplineSurface, "UMultiplicities", uMultiplicities);
            IFCAnyHandleUtil.SetAttribute(BSplineSurface, "VMultiplicities", vMultiplicities);
            IFCAnyHandleUtil.SetAttribute(BSplineSurface, "UKnots", uKnots);
            IFCAnyHandleUtil.SetAttribute(BSplineSurface, "VKnots", vKnots);
            IFCAnyHandleUtil.SetAttribute(BSplineSurface, "KnotSpec", knotSpec);
            return BSplineSurface;
        }
 /// <summary>
 /// Create a logical property.
 /// </summary>
 /// <param name="file">
 /// The IFC file.
 /// </param>
 /// <param name="propertyName">
 /// The name of the property.
 /// </param>
 /// <param name="value">
 /// The value of the property.
 /// </param>
 /// <param name="valueType">
 /// The value type of the property.
 /// </param>
 /// <returns>
 /// The created property handle.
 /// </returns>
 public static IFCAnyHandle CreateLogicalProperty(IFCFile file, string propertyName, IFCLogical value, PropertyValueType valueType)
 {
     switch (valueType)
     {
         case PropertyValueType.EnumeratedValue:
             {
                 IList<IFCData> valueList = new List<IFCData>();
                 valueList.Add(IFCDataUtil.CreateAsLogical(value));
                 return IFCInstanceExporter.CreatePropertyEnumeratedValue(file, propertyName, null, valueList, null);
             }
         case PropertyValueType.SingleValue:
             return IFCInstanceExporter.CreatePropertySingleValue(file, propertyName, null, IFCDataUtil.CreateAsLogical(value), null);
         default:
             throw new InvalidOperationException("Missing case!");
     }
 }
        /// <summary>
        /// Create a logical property or gets one from cache.
        /// </summary>
        /// <param name="file">The file.</param>
        /// <param name="propertyName">The property name.</param>
        /// <param name="value">The value.</param>
        /// <param name="valueType">The value type.</param>
        /// <returns>The created property handle.</returns>
        public static IFCAnyHandle CreateLogicalPropertyFromCache(IFCFile file, string propertyName, IFCLogical value, PropertyValueType valueType)
        {
            LogicalPropertyInfoCache logicalInfoCache = ExporterCacheManager.PropertyInfoCache.LogicalCache;
            IFCAnyHandle logicalHandle = logicalInfoCache.Find(propertyName, value);
            if (!IFCAnyHandleUtil.IsNullOrHasNoValue(logicalHandle))
                return logicalHandle;

            logicalHandle = CreateLogicalProperty(file, propertyName, value, valueType);
            logicalInfoCache.Add(propertyName, value, logicalHandle);
            return logicalHandle;
        }
      /// <summary>
      /// Creates an IfcMaterialLayer and assigns it to the file.
      /// </summary>
      /// <param name="file">The file.</param>
      /// <param name="material">The material.</param>
      /// <param name="layerThickness">The thickness of the layer.</param>
      /// <param name="isVentilated">  Indication of whether the material layer represents an air layer (or cavity).</param>
      /// <returns>The handle.</returns>
      public static IFCAnyHandle CreateMaterialLayer(IFCFile file, IFCAnyHandle material, double layerThickness, IFCLogical? isVentilated)
      {
         IFCAnyHandleUtil.ValidateSubTypeOf(material, true, IFCEntityType.IfcMaterial);

         IFCAnyHandle materialLayer = CreateInstance(file, IFCEntityType.IfcMaterialLayer);
         IFCAnyHandleUtil.SetAttribute(materialLayer, "Material", material);
         IFCAnyHandleUtil.SetAttribute(materialLayer, "LayerThickness", layerThickness);
         IFCAnyHandleUtil.SetAttribute(materialLayer, "IsVentilated", isVentilated);
         return materialLayer;
      }
 /// <summary>
 /// Create a logical property.
 /// </summary>
 /// <param name="file">The IFC file.</param>
 /// <param name="propertyName">The name of the property.</param>
 /// <param name="value">The value of the property.</param>
 /// <param name="valueType">The value type of the property.</param>
 /// <returns>The created property handle.</returns>
 public static IFCAnyHandle CreateLogicalProperty(IFCFile file, string propertyName, IFCLogical value, PropertyValueType valueType)
 {
     IFCData logicalData = IFCDataUtil.CreateAsLogical(value);
     return CreateCommonProperty(file, propertyName, logicalData, valueType, null);
     }
 /// <summary>
 /// Creates an IFCData object as IfcLogical.
 /// </summary>
 /// <param name="value">The logical value.</param>
 /// <returns>The IFCData object.</returns>
 public static IFCData CreateAsLogical(IFCLogical value)
 {
     return(IFCData.CreateLogicalOfType(value, "IfcLogical"));
 }
 /// <summary>
 /// Creates an IFCData object as IfcLogical.
 /// </summary>
 /// <param name="value">The logical value.</param>
 /// <returns>The IFCData object.</returns>
 public static IFCData CreateAsLogical(IFCLogical value)
 {
     return IFCData.CreateLogicalOfType(value, "IfcLogical");
 }
      /// <summary>
      /// Creates an IfcBSplineSurfaceWithKnots and assigns it to the handle
      /// </summary>
      /// <param name="file">the file</param>
      /// <param name="uDegree">algebraic degree of basis functions in u</param>
      /// <param name="vDegree">algebraic degree of basis functions in v</param>
      /// <param name="controlPointsList">the list of control points</param>
      /// <param name="surfaceForm">enum of the surface type</param>
      /// <param name="uClosed">whether the surface is closed in the u direction</param>
      /// <param name="vClosed">whether the surface is closed in the v direction</param>
      /// <param name="selfIntersect">whether the surface is self-intersecting</param>
      /// <param name="uMultiplicities">The multiplicities of the knots in the u parameter direction</param>
      /// <param name="vMultiplicities">The multiplicities of the knots in the v parameter direction</param>
      /// <param name="uKnots">The list of the distinct knots in the u parameter direction</param>
      /// <param name="vKnots">The list of the distinct knots in the v parameter direction</param>
      /// <param name="knotSpec">The description of the knot type.</param>
      /// <returns>the handle</returns>
      public static IFCAnyHandle CreateBSplineSurfaceWithKnots(IFCFile file, int uDegree, int vDegree, IList<IList<IFCAnyHandle>> controlPointsList,
                      IFC4.IFCBSplineSurfaceForm surfaceForm, IFCLogical uClosed, IFCLogical vClosed, IFCLogical selfIntersect, List<int> uMultiplicities, List<int> vMultiplicities,
                      List<double> uKnots, List<double> vKnots, IFC4.IFCKnotType knotSpec)
      {
         ValidateControlPointsList(controlPointsList);

         IFCAnyHandle bSplineSurfaceWithKnots = CreateInstance(file, IFCEntityType.IfcBSplineSurfaceWithKnots);
         SetBSplineSurfaceWithKnots(bSplineSurfaceWithKnots, uDegree, vDegree, controlPointsList, surfaceForm, uClosed, vClosed, selfIntersect,
            uMultiplicities, vMultiplicities, uKnots, vKnots, knotSpec);
         return bSplineSurfaceWithKnots;
      }
 /// <summary>
 /// Set attributes for IfcBSplineCurve
 /// </summary>
 /// <param name="bSplineCurve">The IfcBSplineCurve</param>
 /// <param name="degree">The degree</param>
 /// <param name="controlPointsList">The list of control points</param>
 /// <param name="curveForm">The curve form</param>
 /// <param name="closedCurve">Indicates whether this curve is closed or not, (or unknown)</param>
 /// <param name="selfIntersect">Indicates whether this curve is self-intersect or not, (or unknown)</param>
 private static void SetBSplineCurve(IFCAnyHandle bSplineCurve, int degree, IList<IFCAnyHandle> controlPointsList, IFC4.IFCBSplineCurveForm curveForm,
     IFCLogical closedCurve, IFCLogical selfIntersect)
 {
    ValidateBSplineCurve(controlPointsList);
    IFCAnyHandleUtil.SetAttribute(bSplineCurve, "Degree", degree);
    IFCAnyHandleUtil.SetAttribute(bSplineCurve, "ControlPointsList", controlPointsList);
    IFCAnyHandleUtil.SetAttribute(bSplineCurve, "CurveForm", curveForm);
    IFCAnyHandleUtil.SetAttribute(bSplineCurve, "ClosedCurve", closedCurve);
    IFCAnyHandleUtil.SetAttribute(bSplineCurve, "SelfIntersect", selfIntersect);
 }
      /// <summary>
      /// Creates an IfcRationalBSplineSurfaceWithKnots and assigns it to the handle
      /// </summary>
      /// <param name="file">the file</param>
      /// <param name="uDegree">algebraic degree of basis functions in u</param>
      /// <param name="vDegree">algebraic degree of basis functions in v</param>
      /// <param name="controlPointsList">the list of control points</param>
      /// <param name="surfaceForm">enum of the surface type</param>
      /// <param name="uClosed">whether the surface is closed in the u direction</param>
      /// <param name="vClosed">whether the surface is closed in the v direction</param>
      /// <param name="selfIntersect">whether the surface is self-intersecting</param>
      /// <param name="uMultiplicities">The multiplicities of the knots in the u parameter direction</param>
      /// <param name="vMultiplicities">The multiplicities of the knots in the v parameter direction</param>
      /// <param name="uKnots">The list of the distinct knots in the u parameter direction</param>
      /// <param name="vKnots">The list of the distinct knots in the v parameter direction</param>
      /// <param name="knotSpec">The description of the knot type.</param>
      /// <param name="weightsData">The double array of weights for the control points.</param>
      /// <returns>the handle</returns>
      public static IFCAnyHandle CreateRationalBSplineSurfaceWithKnots(IFCFile file, int uDegree, int vDegree, IList<IList<IFCAnyHandle>> controlPointsList,
                      IFC4.IFCBSplineSurfaceForm surfaceForm, IFCLogical uClosed, IFCLogical vClosed, IFCLogical selfIntersect, IList<int> uMultiplicities, IList<int> vMultiplicities,
                      IList<double> uKnots, IList<double> vKnots, IFC4.IFCKnotType knotSpec, IList<IList<double>> weightsData)
      {
         ValidateControlPointsList(controlPointsList);
         ValidateWeightsDataList(weightsData);

         IFCAnyHandle rationalBSplineSurfaceWithKnots = CreateInstance(file, IFCEntityType.IfcRationalBSplineSurfaceWithKnots);
         SetBSplineSurfaceWithKnots(rationalBSplineSurfaceWithKnots, uDegree, vDegree, controlPointsList, surfaceForm, uClosed, vClosed, selfIntersect,
             uMultiplicities, vMultiplicities, uKnots, vKnots, knotSpec);
         IFCAnyHandleUtil.SetAttribute(rationalBSplineSurfaceWithKnots, "WeightsData", weightsData, 2, null, 2, null);
         return rationalBSplineSurfaceWithKnots;
      }
Exemple #22
0
        protected override void Process(IFCAnyHandle ifcMaterialLayer)
        {
            base.Process(ifcMaterialLayer);

            IFCAnyHandle ifcMaterial = IFCImportHandleUtil.GetOptionalInstanceAttribute(ifcMaterialLayer, "Material");
            if (!IFCAnyHandleUtil.IsNullOrHasNoValue(ifcMaterial))
                Material = IFCMaterial.ProcessIFCMaterial(ifcMaterial);

            bool found = false;
            LayerThickness = IFCImportHandleUtil.GetRequiredScaledLengthAttribute(ifcMaterialLayer, "LayerThickness", out found);
            if (!found)
                return;

            // GetOptionalLogicalAttribute defaults to Unknown.  We want to default to false here.
            IsVentilated = IFCImportHandleUtil.GetOptionalLogicalAttribute(ifcMaterialLayer, "IsVentilated", out found);
            if (!found)
                IsVentilated = IFCLogical.False;
        }
 /// <summary>
 /// Set attributes for IfcBSplineCurveWithKnots
 /// </summary>
 /// <param name="bSplineCurveWithKnots">The IfcBSplineCurveWithKnots</param>
 /// <param name="degree">The degree</param>
 /// <param name="controlPointsList">The list of control points</param>
 /// <param name="curveForm">The curve form</param>
 /// <param name="closedCurve">Indicates whether this curve is closed or not (or unknown)</param>
 /// <param name="selfIntersect">Indicates whether this curve is self-intersect (or unknown)</param>
 /// <param name="knotMultiplicities">The knot multiplicites</param>
 /// <param name="knots">The list of disctinct knots, the multiplicity of each knot is stored in knotMultiplicities</param>
 /// <param name="knotSpec">The description of knot type</param>
 private static void SetBSplineCurveWithKnots(IFCAnyHandle bSplineCurveWithKnots, int degree, IList<IFCAnyHandle> controlPointsList, IFC4.IFCBSplineCurveForm curveForm,
     IFCLogical closedCurve, IFCLogical selfIntersect, IList<int> knotMultiplicities, IList<double> knots, IFC4.IFCKnotType knotSpec)
 {
    IFCAnyHandleUtil.SetAttribute(bSplineCurveWithKnots, "KnotMultiplicities", knotMultiplicities);
    IFCAnyHandleUtil.SetAttribute(bSplineCurveWithKnots, "Knots", knots);
    IFCAnyHandleUtil.SetAttribute(bSplineCurveWithKnots, "KnotSpec", knotSpec);
    SetBSplineCurve(bSplineCurveWithKnots, degree, controlPointsList, curveForm, closedCurve, selfIntersect);
 }
        /// <summary>
        /// Creates an IfcBSplineSurface and assigns it to the handle
        /// </summary>
        /// <param name="file">the file</param>
        /// <param name="uDegree">algebraic degree of basis functions in u</param>
        /// <param name="vDegree">algebraic degree of basis functions in v</param>
        /// <param name="controlPointsList">the list of control points</param>
        /// <param name="surfaceForm">enum of the surface type</param>
        /// <param name="uClosed">whether the surface is closed in the u direction</param>
        /// <param name="vClosed">whether the surface is closed in the v direction</param>
        /// <param name="selfIntersect">whether the surface is self-intersecting</param>
        /// <returns>the handle</returns>
        public static IFCAnyHandle CreateBSplineSurface(IFCFile file, int uDegree, int vDegree, List<List<IFCAnyHandle>> controlPointsList, 
                        IFC4.IFCBSplineSurfaceForm surfaceForm, IFCLogical uClosed, IFCLogical vClosed, IFCLogical selfIntersect)
        {
            ValidateControlPointsList(controlPointsList);
            
            IFCAnyHandle BSplineSurface = CreateInstance(file, IFCEntityType.IfcBSplineSurface);
            IFCAnyHandleUtil.SetAttribute(BSplineSurface, "UDegree", uDegree);
            IFCAnyHandleUtil.SetAttribute(BSplineSurface, "VDegree", vDegree);
            IFCAnyHandleUtil.SetAttribute(BSplineSurface, "ControlPointsList", controlPointsList, 2, null, 2, null);
            IFCAnyHandleUtil.SetAttribute(BSplineSurface, "SurfaceForm", surfaceForm);
            IFCAnyHandleUtil.SetAttribute(BSplineSurface, "UClosed", uClosed);
            IFCAnyHandleUtil.SetAttribute(BSplineSurface, "VClosed", vClosed);
            IFCAnyHandleUtil.SetAttribute(BSplineSurface, "SelfIntersect", selfIntersect);

            return BSplineSurface;
        }