Ejemplo n.º 1
0
        /// <summary>
        /// Todo: add summary
        /// </summary>
        /// <param name="Degree">degree</param>
        /// <param name="UpKnots">upperIndexOnKnots</param>
        /// <param name="UpCp">upperIndexOnControlPoints</param>
        /// <param name="KnotMult">knotMultiplicities</param>
        /// <param name="Knots">knots</param>
        /// <returns></returns>
        internal static bool IfcConstraintsParamBSpline(IfcInteger Degree, IfcInteger UpKnots, IfcInteger UpCp, IItemSet <IfcInteger> KnotMult, IItemSet <IfcParameterValue> Knots)
        {
            // local variables
            bool Result = true;
            int  K;
            int  Sum;

            Sum = (int)KnotMult[0];
            for (var i = 2; i <= UpKnots; i++)
            {
                Sum = (int)(Sum + KnotMult[i - 1]);
            }


            if ((Degree < 1) || (UpKnots < 2) || (UpCp < Degree) ||
                (Sum != (Degree + UpCp + 2)))
            {
                Result = false;
                return(Result);
            }

            K = (int)KnotMult[1];
            if ((K < 1) || (K > Degree + 1))
            {
                Result = false;
                return(Result);
            }

            for (var i = 2; i <= UpKnots; i++)
            {
                if ((KnotMult[i - 1] < 1) || (Knots[i - 1] <= Knots[i - 2]))
                {
                    Result = false;
                    return(Result);
                }
                K = (int)KnotMult[i - 1];
                if ((i < UpKnots) && (K > Degree))
                {
                    Result = false;
                    return(Result);
                }
                if ((i == UpKnots) && (K > Degree + 1))
                {
                    Result = false;
                    return(Result);
                }
            }

            return(Result);
        }
Ejemplo n.º 2
0
 public IfcArcIndex(IfcInteger value) : this()
 {
     this.Value = new IfcPositiveInteger(value);
 }