/// <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>
      /// 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;
      }
      /// <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 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>
 /// 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>
 /// 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 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>
        /// 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;
        }