Re: Confusion about splitting classes to allow sharing of resources
- From: "m.a.stijnman@xxxxxxxxxxxxxx" <m.a.stijnman@xxxxxxxxxxxxxx>
- Date: 20 Apr 2005 08:07:58 -0700
Hang Dog wrote:
> 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.
I think you are confusing Curves and Splines here, but beyond that, it
does sound like a good idea to provide the functionality of splines
being allowed to split off with a local copy of the knotvector. I think
in this context it doesn't really apply though - it will make adding
points to each of a linked set of splines highly efficient and loose
the coupling in the process.
> 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.
It's not just the memory saving I'm after (although that would be very
nice indeed) but also so it would be easier to manipulate the knots of
the spline in unison - and hopefully more efficient too. It also
guarantees that the knot vectors stay in sync at all times. But I
agree, it might not be worth the trouble...
.
- Follow-Ups:
- References:
- Confusion about splitting classes to allow sharing of resources
- From: m.a.stijnman@xxxxxxxxxxxxxx
- Re: Confusion about splitting classes to allow sharing of resources
- From: Hang Dog
- Confusion about splitting classes to allow sharing of resources
- Prev by Date: Re: responsibilites - 'active' and 'passive' classes
- Next by Date: Re: responsibilites - 'active' and 'passive' classes
- Previous by thread: Re: Confusion about splitting classes to allow sharing of resources
- Next by thread: Re: Confusion about splitting classes to allow sharing of resources
- Index(es):
Relevant Pages
|