Re: Confusion about splitting classes to allow sharing of resources





m.a.stijnman@xxxxxxxxxxxxxx wrote:

probably should generate an error when the knot vectors are shared. I imagine further that any spline that share a knot vector that is not explicitly expanded (such as Splines for p and q) gets expanded with a default value - or it might be better to require all splines to be given a new value explicitely before more points can be added.


Share the KnotVector class via reference counted pointers. If the reference count is not one when adding a point to a curve then copy the KnotVector and replace the reference pointer in the curve with the copy.


Alternatively avoid all the complication and don't bother sharing. Unless you can share vast numbers of KVs the amount of memory saving will be fairly minimal.

.



Relevant Pages

  • Confusion about splitting classes to allow sharing of resources
    ... I'm using cubic splines to model two-dimensional parametric curves ... I use this in my current Curve class. ... the Spline class a reference to a external knot vector. ... Adding new interpolation variables in subclasses of Curve will then ...
    (comp.object)
  • Re: solving the equation [ spline way ]
    ... Information about the location of its endpoints ... Information about the slope of the fitted curve ... At the end Tis not a single cubic curve, ... the complications of cubic splines. ...
    (sci.math)
  • Re: Confusion about splitting classes to allow sharing of resources
    ... I think you are confusing Curves and Splines here, but beyond that, it ... Unless you can share vast numbers of KVs the amount of memory saving will be fairly minimal. ... guarantees that the knot vectors stay in sync at all times. ... interpolate a method on Curve, ...
    (comp.object)
  • Re: Confusion about splitting classes to allow sharing of resources
    ... >> probably should generate an error when the knot vectors are shared. ... >> default value - or it might be better to require all splines to be ... > Share the KnotVector class via reference counted pointers. ... > reference count is not one when adding a point to a curve then copy ...
    (comp.object)
  • Re: Getting smooth Bezier curves in SVG
    ... open source library that can convert clothoid splines into bezier ... splines: libsprio. ... So you could calculate just a bunch of points on your curve (probably ... that into a bezier spline for output into SVG. ...
    (comp.graphics.algorithms)