コード例 #1
0
ファイル: NurbsCurve.cs プロジェクト: buaaqlyj/CurvePane
 public NurbsCurve(ICurveParam curveParam)
 {
     if (canDrawCurve(curveParam))
     {
         canDraw = true;
         this.curveParam = (NurbsCurveParam)curveParam;
     }
 }
コード例 #2
0
ファイル: CurveManager.cs プロジェクト: buaaqlyj/CurvePane
 public void DrawNURBSCurve(string curveName, string degree, string cutList, string weightList)
 {
     BaseDataPointList pointList = this.basePoints;
     ArrayString aString = new ArrayString(cutList);
     List<DoubleExtension> cutPoints = null, weightValues = null;
     if (!aString.TryParseDoubleExtension(out cutPoints))
     {
         throw new ArgumentException("The cutList contains unrecognised string: " + cutList, "cutList");
     }
     aString = new ArrayString(weightList);
     if (!aString.TryParseDoubleExtension(out weightValues))
     {
         throw new ArgumentException("The weightList contains unrecognised string: " + weightList, "weightList");
     }
     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");
     }
     NurbsCurveParam curveParam = new NurbsCurveParam(pointList.Points, degreeInt, cutPoints, weightValues);
     NurbsCurve curve = new NurbsCurve(curveParam);
     DrawLines(curveName, curve.sampleCurvePoints());
 }
コード例 #3
0
 public NurbsParametricCurveElement(NurbsCurveParam curveParam)
     : base(curveParam)
 {
     this.weights = curveParam.Weight;
 }
コード例 #4
0
 public NurbsCurveInterpolatedData(NurbsCurveParam curveParam)
     : base(curveParam)
 {
     this.curveParam = curveParam;
     InitialCurve(curveParam);
 }