Changeset 65:b4f7906764d3 in rrlib_geometry


Ignore:
Timestamp:
07.01.2014 14:15:34 (6 years ago)
Author:
Tobias Föhst <foehst@…>
Branch:
default
Parents:
62:98bb003e6f95 (diff), 64:046379da1097 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Phase:
public
Message:

Merged with 13.10

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • curves/tBezierCurve.hpp

    r62 r65  
    131131const typename tBezierCurve<Tdimension, TElement, Tdegree>::tSubdivision tBezierCurve<Tdimension, TElement, Tdegree>::GetSubdivision() const 
    132132{ 
    133   typename tShape::tPoint left_half[this->NumberOfControlPoints()]; 
    134   typename tShape::tPoint right_half[this->NumberOfControlPoints()]; 
    135   typename tShape::tPoint temp_points[this->NumberOfControlPoints()]; 
    136   std::memcpy(temp_points, this->control_points, this->NumberOfControlPoints() * sizeof(typename tShape::tPoint)); 
     133  const size_t cNUMBER_OF_CONTROL_POINTS = Tdegree + 1; 
     134  typename tShape::tPoint left_half[cNUMBER_OF_CONTROL_POINTS]; 
     135  typename tShape::tPoint right_half[cNUMBER_OF_CONTROL_POINTS]; 
     136  typename tShape::tPoint temp_points[cNUMBER_OF_CONTROL_POINTS]; 
     137  std::memcpy(temp_points, this->control_points, cNUMBER_OF_CONTROL_POINTS * sizeof(typename tShape::tPoint)); 
    137138 
    138139  left_half[0] = temp_points[0]; 
     
    151152  } 
    152153 
    153   return std::make_pair(tBezierCurve(left_half, left_half + this->NumberOfControlPoints()), tBezierCurve(right_half, right_half + this->NumberOfControlPoints())); 
     154  return std::make_pair(tBezierCurve(left_half, left_half + cNUMBER_OF_CONTROL_POINTS), tBezierCurve(right_half, right_half + cNUMBER_OF_CONTROL_POINTS)); 
    154155} 
    155156 
     
    162163  assert((0.0 <= t) && (t <= 1.0)); 
    163164 
    164   typename tShape::tPoint temp_points[this->NumberOfControlPoints()]; 
    165   std::memcpy(temp_points, this->control_points, (this->NumberOfControlPoints()) * sizeof(typename tShape::tPoint)); 
     165  const size_t cNUMBER_OF_CONTROL_POINTS = Tdegree + 1; 
     166  typename tShape::tPoint temp_points[cNUMBER_OF_CONTROL_POINTS]; 
     167  std::memcpy(temp_points, this->control_points, cNUMBER_OF_CONTROL_POINTS * sizeof(typename tShape::tPoint)); 
    166168 
    167169  size_t k = 0; 
  • curves/tBezierCurve.hpp

    r64 r65  
    9393  static_assert(sizeof...(rest) + 1 == Tdegree, "A Bezier curve must have degree + 1 control points"); 
    9494  size_t index = 0; 
    95   util::ProcessVariadicValues<typename tShape::tPoint>([this, index](const typename tShape::tPoint & x) mutable { this->control_points[index++] = x; }, p1, p2, rest...); 
     95  util::ProcessVariadicValues([this, &index](const typename tShape::tPoint & x) 
     96  { 
     97    this->control_points[index++] = x; 
     98  }, 
     99  p1, p2, rest...); 
    96100} 
    97101 
Note: See TracChangeset for help on using the changeset viewer.