Ejemplo n.º 1
0
 public BSplineCurve(ICurveParam curveParam)
 {
     if (canDrawCurve(curveParam))
     {
         canDraw = true;
         this.curveParam = (BSplineCurveParam)curveParam;
     }
 }
 public BSplineParametricCurveElement(BSplineCurveParam curveParam)
 {
     this.pointList = curveParam.PointList;
     this.interval = new DataInterval(curveParam.Interval.CutPoints[curveParam.Degree], curveParam.Interval.CutPoints[curveParam.PointList.Count]);
     calculateBasisFunction(curveParam);
 }
 public BSplineCurveInterpolatedData(BSplineCurveParam curveParam)
 {
     this.curveParam = curveParam;
     this.interval = curveParam.Interval;
     InitialCurve(curveParam);
 }
Ejemplo n.º 4
0
 public void DrawBSplineCurve(string curveName, string degree, string cutList)
 {
     BaseDataPointList pointList = this.basePoints;
     ArrayString aString = new ArrayString(cutList);
     List<DoubleExtension> cutPoints = null;
     if (!aString.TryParseDoubleExtension(out cutPoints))
     {
         throw new ArgumentException("The cutList contains unrecognised string: " + cutList, "cutList");
     }
     int degreeInt = 0;
     if (!Int32.TryParse(degree, out degreeInt))
     {
         throw new ArgumentException("The degree is not a integer string: " + degree, "degree");
     }
     if (degreeInt < 1)
     {
         throw new ArgumentException("The degree is invalid: " + degree, "degree");
     }
     BSplineCurveParam curveParam = new BSplineCurveParam(pointList.Points, degreeInt, cutPoints);
     BSplineCurve curve = new BSplineCurve(curveParam);
     DrawLines(curveName, curve.sampleCurvePoints());
 }