Skip to content

Commit

Permalink
Renamed setupKnots to fillKnots.
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcel Steinbeck committed Apr 21, 2017
1 parent 0030325 commit fe98681
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions library/tinyspline.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ void ts_internal_bspline_copy(
copy->knots = copy->ctrlp + n_ctrlp*dim;
}

void ts_internal_bspline_setup_knots(
void ts_internal_bspline_fill_knots(
const tsBSpline* original, const tsBSplineType type,
const tsRational min, const tsRational max,
tsBSpline* result, jmp_buf buf
Expand Down Expand Up @@ -197,7 +197,7 @@ void ts_internal_bspline_new(
bspline->knots = bspline->ctrlp + n_ctrlp*dim;

TRY(b, e)
ts_internal_bspline_setup_knots(bspline, type, 0.f, 1.f, bspline, b);
ts_internal_bspline_fill_knots(bspline, type, 0.f, 1.f, bspline, b);
CATCH
free(bspline->ctrlp);
longjmp(buf, e);
Expand Down Expand Up @@ -988,7 +988,7 @@ tsError ts_bspline_set_knots(
return err;
}

tsError ts_bspline_setup_knots(
tsError ts_bspline_fill_knots(
const tsBSpline* original, const tsBSplineType type,
const tsRational min, const tsRational max,
tsBSpline* result
Expand All @@ -997,7 +997,7 @@ tsError ts_bspline_setup_knots(
tsError err;
jmp_buf buf;
TRY(buf, err)
ts_internal_bspline_setup_knots(original, type, min, max, result, buf);
ts_internal_bspline_fill_knots(original, type, min, max, result, buf);
CATCH
if (original != result)
ts_bspline_default(result);
Expand Down
6 changes: 3 additions & 3 deletions library/tinyspline.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@ typedef enum
*/
typedef enum
{
/* setup knots as... */
/* fill knots... */
TS_OPENED = 0, /* [uniformly spaced] */
TS_CLAMPED = 1, /* [u_1 = u_2 = ..., uniformly spaced, ... = u_n-1 = u_n] */
TS_BEZIERS = 2, /* uniformly spaced with s(u) = order for all u in knots */
TS_NONE = 3 /* do not setup the knots; they may have any values */
TS_NONE = 3 /* do not fill the knots; they may have any values */
} tsBSplineType;

typedef struct
Expand Down Expand Up @@ -323,7 +323,7 @@ tsError ts_bspline_set_knots(
* @return TS_KNOTS_DECR if \min >= \max.
* (The function uses ::ts_fequals in order to determine if \min == \max)
*/
tsError ts_bspline_setup_knots(
tsError ts_bspline_fill_knots(
const tsBSpline* original, const tsBSplineType type,
const tsRational min, const tsRational max,
tsBSpline* result
Expand Down
4 changes: 2 additions & 2 deletions library/tinysplinecpp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,12 +247,12 @@ void tinyspline::BSpline::setKnots(
throw std::runtime_error(ts_enum_str(err));
}

tinyspline::BSpline tinyspline::BSpline::setupKnots(
tinyspline::BSpline tinyspline::BSpline::fillKnots(
const tsBSplineType type, const tinyspline::rational min,
const tinyspline::rational max) const
{
tinyspline::BSpline bs;
const tsError err = ts_bspline_setup_knots(
const tsError err = ts_bspline_fill_knots(
&bspline, type, min, max, &bs.bspline);
if (err < 0)
throw std::runtime_error(ts_enum_str(err));
Expand Down
2 changes: 1 addition & 1 deletion library/tinysplinecpp.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class BSpline {
void setKnots(const std::vector<rational> &knots);

/* Transformations */
BSpline setupKnots(const tsBSplineType type, const rational min,
BSpline fillKnots(const tsBSplineType type, const rational min,
const rational max) const;
BSpline insertKnot(const rational u, const size_t n) const;
BSpline resize(const int n, const int back) const;
Expand Down

0 comments on commit fe98681

Please sign in to comment.