@@ -648,20 +648,24 @@ class TwistSpline {
648648 std::vector<Float> getRemap () const { return remap; }
649649 Float getTotalLength () const { return totalLength; }
650650
651- // / Copy constructor
652- TwistSpline (TwistSpline const &old){
653- this ->verts = old.verts ;
654- this ->quats = old.quats ;
655- this ->scales = old.scales ;
656- this ->lockPositions = old.lockPositions ;
657- this ->lockValues = old.lockValues ;
658- this ->userTwists = old.userTwists ;
659- this ->twistLocks = old.twistLocks ;
660- this ->orientLocks = old.orientLocks ;
661- this ->remap = old.remap ;
662- this ->projSteps = old.projSteps ;
663- this ->lutSteps = old.lutSteps ;
664- this ->totalLength = old.totalLength ;
651+ // / Copy constructor by reference and by shared_ptr just for convenience
652+ TwistSpline (TwistSpline const &old) : TwistSpline(&old){}
653+ TwistSpline (const std::shared_ptr<TwistSpline> &old) : TwistSpline(old.get()){}
654+
655+ // / Copy constructor by pointer
656+ TwistSpline (const TwistSpline * const old){
657+ this ->verts = old->verts ;
658+ this ->quats = old->quats ;
659+ this ->scales = old->scales ;
660+ this ->lockPositions = old->lockPositions ;
661+ this ->lockValues = old->lockValues ;
662+ this ->userTwists = old->userTwists ;
663+ this ->twistLocks = old->twistLocks ;
664+ this ->orientLocks = old->orientLocks ;
665+ this ->remap = old->remap ;
666+ this ->projSteps = old->projSteps ;
667+ this ->lutSteps = old->lutSteps ;
668+ this ->totalLength = old->totalLength ;
665669 IndexType numVerts = size (verts);
666670 if (numVerts < 2 ) {
667671 segments.clear ();
@@ -677,7 +681,7 @@ class TwistSpline {
677681 ss = {&(scales[3 *i]), &(scales[3 *i + 1 ]), &(scales[3 *i + 2 ]), &(scales[3 *i + 3 ])};
678682 qq = {&(quats[3 *i]), &(quats[3 *i + 1 ]), &(quats[3 *i + 2 ]), &(quats[3 *i + 3 ])};
679683 segments[i] = std::unique_ptr<TwistSplineSegment<PointArray, Point, VectorArray, Vector, QuatArray, Quat, Float>>(
680- new TwistSplineSegment<PointArray, Point, VectorArray, Vector, QuatArray, Quat, Float>(*(old. segments [i]), vv, ss, qq)
684+ new TwistSplineSegment<PointArray, Point, VectorArray, Vector, QuatArray, Quat, Float>(*(old-> segments [i]), vv, ss, qq)
681685 );
682686 }
683687 }
0 commit comments