Changeset 24:627bf1924b86 in rrlib_geometry


Ignore:
Timestamp:
22.01.2012 02:17:02 (8 years ago)
Author:
Tobias Föhst <foehst@…>
Branch:
default
Phase:
public
Message:

Added streaming operators for rrlib_canvas

Files:
14 edited

Legend:

Unmodified
Added
Removed
  • curves/tBezierCurve.h

    r18 r24  
    4242//---------------------------------------------------------------------- 
    4343#include <vector> 
     44 
     45#ifdef _LIB_RRLIB_CANVAS_PRESENT_ 
     46#include "rrlib/canvas/tCanvas2D.h" 
     47#endif 
    4448 
    4549//---------------------------------------------------------------------- 
     
    101105  tBezierCurve(TIterator begin, TIterator end); 
    102106 
    103   template <typename TSTLContainer> 
    104   explicit tBezierCurve(const TSTLContainer &control_points); 
    105  
    106   inline const typename tShape::tPoint &GetControlPoint(size_t i) const 
     107  inline const typename tShape::tPoint *ControlPoints() const 
    107108  { 
    108     return this->control_points[i]; 
     109    return this->control_points; 
    109110  } 
    110111 
     
    170171 
    171172//---------------------------------------------------------------------- 
     173// Operators for rrlib_canvas 
     174//---------------------------------------------------------------------- 
     175#ifdef _LIB_RRLIB_CANVAS_PRESENT_ 
     176 
     177template <typename TElement> 
     178canvas::tCanvas2D &operator << (canvas::tCanvas2D &canvas, const tBezierCurve<2, TElement, 2> &bezier_curve); 
     179 
     180template <typename TElement> 
     181canvas::tCanvas2D &operator << (canvas::tCanvas2D &canvas, const tBezierCurve<2, TElement, 3> &bezier_curve); 
     182 
     183#endif 
     184 
     185//---------------------------------------------------------------------- 
    172186// End of namespace declaration 
    173187//---------------------------------------------------------------------- 
  • curves/tBezierCurve.hpp

    r18 r24  
    7979} 
    8080 
    81 template <size_t Tdimension, typename TElement, unsigned int Tdegree> 
    82 template <typename TSTLContainer> 
    83 tBezierCurve<Tdimension, TElement, Tdegree>::tBezierCurve(const TSTLContainer &control_points) 
    84 { 
    85   std::cout << "control_points: " << control_points.size() << std::endl; 
    86   std::cout << "degree: " << Tdegree << std::endl; 
    87   std::cout << "expected number of points: " << this->NumberOfControlPoints() << std::endl; 
    88   static_assert(Tdegree > 0, "The degree of Bezier curves must be greater than zero"); 
    89   assert(control_points.size() == this->NumberOfControlPoints()); 
    90   for (size_t i = 0; i < control_points.size(); ++i) 
    91   { 
    92     this->control_points[i] = control_points[i]; 
    93   } 
    94 } 
    95  
    9681//---------------------------------------------------------------------- 
    9782// tBezierCurve SetControlPoint 
     
    240225  // compute the intersection using the baselines of the two control polygons 
    241226  tLine<Tdimension, TElement> own_line_segment(this->control_points[0], this->control_points[Tdegree]); 
    242   tLine<Tdimension, TElement> other_line_segment(other.GetControlPoint(0), other.GetControlPoint(Tother_degree)); 
     227  tLine<Tdimension, TElement> other_line_segment(other.ControlPoints()[0], other.ControlPoints()[Tother_degree]); 
    243228  typename tShape::tPoint intersection_point; 
    244229  if (own_line_segment.GetIntersection(intersection_point, other_line_segment) && !math::IsEqual(intersection_point, intersection_points.back(), 0.001)) 
     
    299284  tSubdivision subdivision(this->GetSubdivision()); 
    300285 
    301   tLineSegment<Tdimension, TElement> first_segment_base_line(subdivision.first.GetControlPoint(0), subdivision.first.GetControlPoint(Tdegree)); 
    302   tLineSegment<Tdimension, TElement> second_segment_base_line(subdivision.second.GetControlPoint(0), subdivision.second.GetControlPoint(Tdegree)); 
     286  tLineSegment<Tdimension, TElement> first_segment_base_line(subdivision.first.ControlPoints()[0], subdivision.first.ControlPoints()[Tdegree]); 
     287  tLineSegment<Tdimension, TElement> second_segment_base_line(subdivision.second.ControlPoints()[0], subdivision.second.ControlPoints()[Tdegree]); 
    303288 
    304289  typename tShape::tPoint first_candidate = first_segment_base_line.GetClosestPoint(reference_point); 
     
    408393} 
    409394 
    410  
     395//---------------------------------------------------------------------- 
     396// Operators for rrlib_canvas 
     397//---------------------------------------------------------------------- 
     398#ifdef _LIB_RRLIB_CANVAS_PRESENT_ 
     399 
     400template <typename TElement> 
     401canvas::tCanvas2D &operator << (canvas::tCanvas2D &canvas, const tBezierCurve<2, TElement, 2> &bezier_curve) 
     402{ 
     403  canvas.StartPath(bezier_curve.ControlPoints()[0]); 
     404  canvas.AppendQuadraticBezierCurve(bezier_curve.ControlPoints() + 1, bezier_curve.ControlPoints() + 3); 
     405 
     406  return canvas; 
     407} 
     408 
     409template <typename TElement> 
     410canvas::tCanvas2D &operator << (canvas::tCanvas2D &canvas, const tBezierCurve<2, TElement, 3> &bezier_curve) 
     411{ 
     412  canvas.DrawCubicBezierCurve(bezier_curve.ControlPoints(), bezier_curve.ControlPoints() + 4); 
     413 
     414  return canvas; 
     415} 
     416 
     417#endif 
    411418 
    412419//---------------------------------------------------------------------- 
  • curves/tCardinalSplineCurve.h

    r14 r24  
    8383  tCardinalSplineCurve(TIterator begin, TIterator end, double tension = 0.0); 
    8484 
    85   template <typename TSTLContainer> 
    86   explicit tCardinalSplineCurve(const TSTLContainer &control_points, double tension = 0.0); 
    87  
    8885  inline double GetTension() const 
    8986  { 
  • curves/tCardinalSplineCurve.hpp

    r14 r24  
    7272{} 
    7373 
    74 template <size_t Tdimension, typename TElement> 
    75 template <typename TSTLContainer> 
    76 tCardinalSplineCurve<Tdimension, TElement>::tCardinalSplineCurve(const TSTLContainer &control_points, double tension) 
    77     : tSplineCurve(control_points), 
    78     tension(tension) 
    79 {} 
    80  
    8174//---------------------------------------------------------------------- 
    8275// tCardinalSplineCurve SetTension 
     
    9588const typename tSplineCurve<Tdimension, TElement, 3>::tBezierCurve tCardinalSplineCurve<Tdimension, TElement>::GetBezierCurveForSegment(unsigned int i) const 
    9689{ 
    97   std::vector<typename tShape::tPoint> bezier_control_points; 
     90  typename tShape::tPoint bezier_control_points[4]; 
    9891 
    99   bezier_control_points.push_back(this->GetControlPoint(i + 1)); 
    100   bezier_control_points.push_back(this->GetControlPoint(i + 1) + (1.0 - this->tension) / 2.0 *(this->GetControlPoint(i + 2) - this->GetControlPoint(i))); 
    101   bezier_control_points.push_back(this->GetControlPoint(i + 2) + (1.0 - this->tension) / 2.0 *(this->GetControlPoint(i + 1) - this->GetControlPoint(i + 3))); 
    102   bezier_control_points.push_back(this->GetControlPoint(i + 2)); 
     92  bezier_control_points[0] = this->ControlPoints()[i + 1]; 
     93  bezier_control_points[1] = this->ControlPoints()[i + 1] + (1.0 - this->tension) / 2.0 * (this->ControlPoints()[i + 2] - this->ControlPoints()[i]); 
     94  bezier_control_points[2] = this->ControlPoints()[i + 2] + (1.0 - this->tension) / 2.0 * (this->ControlPoints()[i + 1] - this->ControlPoints()[i + 3]); 
     95  bezier_control_points[3] = this->ControlPoints()[i + 2]; 
    10396 
    104   return typename tSplineCurve::tBezierCurve(bezier_control_points); 
     97  return typename tSplineCurve::tBezierCurve(bezier_control_points, bezier_control_points + 4); 
    10598}; 
    10699 
  • curves/tSplineCurve.h

    r17 r24  
    4141// External includes (system with <>, local with "") 
    4242//---------------------------------------------------------------------- 
     43#ifdef _LIB_RRLIB_CANVAS_PRESENT_ 
     44#include "rrlib/canvas/tCanvas2D.h" 
     45#include "rrlib/canvas/tCanvas3D.h" 
     46#endif 
    4347 
    4448//---------------------------------------------------------------------- 
     
    8185public: 
    8286 
    83   static const unsigned int cDEGREE; 
     87  static inline const unsigned int Degree() 
     88  { 
     89    return Tdegree; 
     90  } 
    8491 
    8592  typedef geometry::tBezierCurve<Tdimension, TElement, Tdegree> tBezierCurve; 
     
    8996  tSplineCurve(TIterator begin, TIterator end); 
    9097 
    91   template <typename TSTLContainer> 
    92   explicit tSplineCurve(const TSTLContainer &control_points); 
    93  
    94   inline const size_t GetNumberOfControlPoints() const 
     98  inline const size_t NumberOfControlPoints() const 
    9599  { 
    96100    return this->control_points.size(); 
    97101  } 
    98102 
    99   inline const std::vector<typename tShape::tPoint> &GetControlPoints() const 
     103  inline const unsigned int NumberOfSegments() const 
     104  { 
     105    return this->control_points.size() - Tdegree; 
     106  }; 
     107 
     108  inline const std::vector<typename tShape::tPoint> &ControlPoints() const 
    100109  { 
    101110    return this->control_points; 
    102   } 
    103  
    104   inline const typename tShape::tPoint &GetControlPoint(size_t i) const 
    105   { 
    106     return this->control_points[i]; 
    107111  } 
    108112 
     
    114118 
    115119  const typename tShape::tPoint operator()(tParameter t) const; 
    116  
    117   const unsigned int GetNumberOfSegments() const; 
    118120 
    119121  const tBezierCurve GetBezierCurveForParameter(tParameter t) const; 
     
    153155 
    154156//---------------------------------------------------------------------- 
     157// Operators for rrlib_canvas 
     158//---------------------------------------------------------------------- 
     159#ifdef _LIB_RRLIB_CANVAS_PRESENT_ 
     160 
     161template <typename TElement> 
     162inline canvas::tCanvas2D &operator << (canvas::tCanvas2D &canvas, const tSplineCurve<2, TElement, 3> &spline); 
     163 
     164#endif 
     165 
     166//---------------------------------------------------------------------- 
    155167// End of namespace declaration 
    156168//---------------------------------------------------------------------- 
     
    158170} 
    159171 
    160  
    161172#include "rrlib/geometry/curves/tSplineCurve.hpp" 
    162173 
  • curves/tSplineCurve.hpp

    r17 r24  
    7474} 
    7575 
    76 template <size_t Tdimension, typename TElement, unsigned int Tdegree> 
    77 template <typename TSTLContainer> 
    78 tSplineCurve<Tdimension, TElement, Tdegree>::tSplineCurve(const TSTLContainer &control_points) 
    79 { 
    80   std::copy(control_points.begin(), control_points.end(), std::back_inserter(this->control_points)); 
    81   assert(control_points.size() > Tdegree); 
    82 } 
    83  
    8476//---------------------------------------------------------------------- 
    8577// tSplineCurve SetControlPoint 
     
    123115  return bezier_curve(t); 
    124116} 
    125  
    126 //---------------------------------------------------------------------- 
    127 // tSplineCurve GetNumberOfSegments 
    128 //---------------------------------------------------------------------- 
    129 template <size_t Tdimension, typename TElement, unsigned int Tdegree> 
    130 const unsigned int tSplineCurve<Tdimension, TElement, Tdegree>::GetNumberOfSegments() const 
    131 { 
    132   return this->control_points.size() - Tdegree; 
    133 }; 
    134117 
    135118//---------------------------------------------------------------------- 
     
    202185    const tLine<Tdimension, TElement> &line) const 
    203186{ 
    204   for (unsigned int i = 0; i < this->GetNumberOfSegments(); ++i) 
     187  for (unsigned int i = 0; i < this->NumberOfSegments(); ++i) 
    205188  { 
    206189    size_t last_size = intersection_parameters.size(); 
     
    232215  double min_distance = (closest_point - reference_point).Length(); 
    233216 
    234   for (size_t i = 1; i < this->GetNumberOfSegments(); ++i) 
     217  for (size_t i = 1; i < this->NumberOfSegments(); ++i) 
    235218  { 
    236219    typename tShape::tPoint candidate = this->GetBezierCurveForSegment(i).GetClosestPoint(reference_point); 
     
    312295void tSplineCurve<Tdimension, TElement, Tdegree>::UpdateBoundingBox(typename tShape::tBoundingBox &bounding_box) const 
    313296{ 
    314   for (size_t i = 0; i < this->GetNumberOfSegments(); ++i) 
     297  for (size_t i = 0; i < this->NumberOfSegments(); ++i) 
    315298  { 
    316299    bounding_box.Add(this->GetBezierCurveForSegment(i).BoundingBox()); 
     
    324307void tSplineCurve<Tdimension, TElement, Tdegree>::UpdateCenterOfGravity(typename tShape::tPoint &center_of_gravity) const 
    325308{ 
    326   for (size_t i = 0; i < this->GetNumberOfSegments(); ++i) 
     309  for (size_t i = 0; i < this->NumberOfSegments(); ++i) 
    327310  { 
    328311    center_of_gravity += this->GetBezierCurveForSegment(i).CenterOfGravity(); 
    329312  } 
    330   center_of_gravity /= this->GetNumberOfSegments(); 
    331 } 
     313  center_of_gravity /= this->NumberOfSegments(); 
     314} 
     315 
     316//---------------------------------------------------------------------- 
     317// Operators for rrlib_canvas 
     318//---------------------------------------------------------------------- 
     319#ifdef _LIB_RRLIB_CANVAS_PRESENT_ 
     320 
     321template <typename TElement> 
     322inline canvas::tCanvas2D &operator << (canvas::tCanvas2D &canvas, const tSplineCurve<2, TElement, 3> &spline) 
     323{ 
     324  unsigned int number_of_segments = spline.NumberOfSegments(); 
     325  typename tSplineCurve<2, TElement, 3>::tBezierCurve bezier_curve = spline.GetBezierCurveForSegment(0); 
     326  canvas.StartPath(bezier_curve.ControlPoints()[0]); 
     327  for (unsigned int i = 1; i < number_of_segments; ++i) 
     328  { 
     329    canvas.AppendCubicBezierCurve(bezier_curve.ControlPoints() + 1, bezier_curve.ControlPoints() + 4); 
     330    bezier_curve = spline.GetBezierCurveForSegment(i); 
     331  } 
     332  canvas.AppendCubicBezierCurve(bezier_curve.ControlPoints() + 1, bezier_curve.ControlPoints() + 4); 
     333 
     334  return canvas; 
     335} 
     336 
     337#endif 
    332338 
    333339//---------------------------------------------------------------------- 
  • curves/tUniformBSplineCurve.hpp

    r14 r24  
    7272{} 
    7373 
    74 template <size_t Tdimension, typename TElement> 
    75 template <typename TSTLContainer> 
    76 tUniformBSplineCurve<Tdimension, TElement>::tUniformBSplineCurve(const TSTLContainer &control_points, double tension) 
    77     : tSplineCurve(control_points), 
    78     tension(tension) 
    79 {} 
    80  
    8174//---------------------------------------------------------------------- 
    8275// tUniformBSplineCurve SetTension 
     
    9790  typename tShape::tPoint bezier_control_points[4]; 
    9891 
    99   bezier_control_points[0] = (1.0 - this->tension) / 4.0 * (this->GetControlPoint(i) + this->GetControlPoint(i + 2)) + (1.0 + this->tension) / 2.0 * this->GetControlPoint(i + 1); 
    100   bezier_control_points[1] = (1.0 + this->tension) / 2.0 * this->GetControlPoint(i + 1) + (1.0 - this->tension) / 2.0 * this->GetControlPoint(i + 2); 
    101   bezier_control_points[2] = (1.0 - this->tension) / 2.0 * this->GetControlPoint(i + 1) + (1.0 + this->tension) / 2.0 * this->GetControlPoint(i + 2); 
    102   bezier_control_points[3] = (1.0 - this->tension) / 4.0 * (this->GetControlPoint(i + 1) + this->GetControlPoint(i + 3)) + (1.0 + this->tension) / 2.0 * this->GetControlPoint(i + 2); 
     92  bezier_control_points[0] = (1.0 - this->tension) / 4.0 * (this->ControlPoints()[i] + this->ControlPoints()[i + 2]) + (1.0 + this->tension) / 2.0 * this->ControlPoints()[i + 1]; 
     93  bezier_control_points[1] = (1.0 + this->tension) / 2.0 * this->ControlPoints()[i + 1] + (1.0 - this->tension) / 2.0 * this->ControlPoints()[i + 2]; 
     94  bezier_control_points[2] = (1.0 - this->tension) / 2.0 * this->ControlPoints()[i + 1] + (1.0 + this->tension) / 2.0 * this->ControlPoints()[i + 2]; 
     95  bezier_control_points[3] = (1.0 - this->tension) / 4.0 * (this->ControlPoints()[i + 1] + this->ControlPoints()[i + 3]) + (1.0 + this->tension) / 2.0 * this->ControlPoints()[i + 2]; 
    10396 
    10497  return typename tSplineCurve::tBezierCurve(bezier_control_points, bezier_control_points + 4); 
  • tLine.h

    r17 r24  
    4141// External includes (system with <>, local with "") 
    4242//---------------------------------------------------------------------- 
     43#ifdef _LIB_RRLIB_CANVAS_PRESENT_ 
     44#include "rrlib/canvas/tCanvas2D.h" 
     45#endif 
    4346 
    4447//---------------------------------------------------------------------- 
     
    143146 
    144147//---------------------------------------------------------------------- 
     148// Operators for rrlib_canvas 
     149//---------------------------------------------------------------------- 
     150#ifdef _LIB_RRLIB_CANVAS_PRESENT_ 
     151 
     152template <typename TElement> 
     153canvas::tCanvas2D &operator << (canvas::tCanvas2D &canvas, const tLine<2, TElement> &line); 
     154 
     155#endif 
     156 
     157//---------------------------------------------------------------------- 
    145158// End of namespace declaration 
    146159//---------------------------------------------------------------------- 
  • tLine.hpp

    r17 r24  
    274274 
    275275//---------------------------------------------------------------------- 
     276// Operators for rrlib_canvas 
     277//---------------------------------------------------------------------- 
     278#ifdef _LIB_RRLIB_CANVAS_PRESENT_ 
     279 
     280template <typename TElement> 
     281canvas::tCanvas2D &operator << (canvas::tCanvas2D &canvas, const tLine<2, TElement> &line) 
     282{ 
     283  canvas.DrawLine(line.Support(), line.Support() + line.Direction()); 
     284 
     285  return canvas; 
     286} 
     287 
     288#endif 
     289 
     290//---------------------------------------------------------------------- 
    276291// End of namespace declaration 
    277292//---------------------------------------------------------------------- 
  • tLineSegment.h

    r17 r24  
    4444// External includes (system with <>, local with "") 
    4545//---------------------------------------------------------------------- 
     46#ifdef _LIB_RRLIB_CANVAS_PRESENT_ 
     47#include "rrlib/canvas/tCanvas2D.h" 
     48#endif 
    4649 
    4750//---------------------------------------------------------------------- 
     
    146149 
    147150//---------------------------------------------------------------------- 
     151// Operators for rrlib_canvas 
     152//---------------------------------------------------------------------- 
     153#ifdef _LIB_RRLIB_CANVAS_PRESENT_ 
     154 
     155template <typename TElement> 
     156canvas::tCanvas2D &operator << (canvas::tCanvas2D &canvas, const tLineSegment<2, TElement> &line); 
     157 
     158#endif 
     159 
     160//---------------------------------------------------------------------- 
    148161// End of namespace declaration 
    149162//---------------------------------------------------------------------- 
  • tLineSegment.hpp

    r17 r24  
    164164} 
    165165 
     166//---------------------------------------------------------------------- 
     167// Operators for rrlib_canvas 
     168//---------------------------------------------------------------------- 
     169#ifdef _LIB_RRLIB_CANVAS_PRESENT_ 
    166170 
     171template <typename TElement> 
     172canvas::tCanvas2D &operator << (canvas::tCanvas2D &canvas, const tLineSegment<2, TElement> &line_segment) 
     173{ 
     174  canvas.DrawLineSegment(line_segment.Begin(), line_segment.End()); 
     175 
     176  return canvas; 
     177} 
     178 
     179#endif 
    167180 
    168181//---------------------------------------------------------------------- 
  • tPoint.cpp

    r14 r24  
    4545// Namespace usage 
    4646//---------------------------------------------------------------------- 
    47 using namespace rrlib::geometry; 
     47 
     48//---------------------------------------------------------------------- 
     49// Namespace declaration 
     50//---------------------------------------------------------------------- 
     51namespace rrlib 
     52{ 
     53namespace geometry 
     54{ 
    4855 
    4956//---------------------------------------------------------------------- 
     
    7077template class tPoint<2, unsigned int>; 
    7178template class tPoint<3, unsigned int>; 
     79 
     80//---------------------------------------------------------------------- 
     81// Namespace declaration 
     82//---------------------------------------------------------------------- 
     83} 
     84} 
  • tPoint.h

    r23 r24  
    4141// External includes (system with <>, local with "") 
    4242//---------------------------------------------------------------------- 
     43#ifdef _LIB_RRLIB_CANVAS_PRESENT_ 
     44#include "rrlib/canvas/tCanvas2D.h" 
     45#endif 
    4346 
    4447//---------------------------------------------------------------------- 
     
    125128 
    126129//---------------------------------------------------------------------- 
     130// Operators for rrlib_canvas 
     131//---------------------------------------------------------------------- 
     132#ifdef _LIB_RRLIB_CANVAS_PRESENT_ 
     133 
     134template <typename TElement> 
     135canvas::tCanvas2D &operator << (canvas::tCanvas2D &canvas, const tPoint<2, TElement> &point) 
     136{ 
     137  canvas.DrawPoint(point); 
     138 
     139  return canvas; 
     140} 
     141 
     142#endif 
     143 
     144//---------------------------------------------------------------------- 
    127145// End of namespace declaration 
    128146//---------------------------------------------------------------------- 
  • test/test_geometries.cpp

    r18 r24  
    6969typedef rrlib::geometry::tBezierCurve<2, tElement, 3> tBezierCurve; 
    7070typedef rrlib::geometry::tSplineCurve<2, tElement, 3> tSplineCurve; 
    71 typedef rrlib::geometry::tUniformBSplineCurve<2, tElement> tConcreteSplineCurve; 
    72 //typedef rrlib::geometry::tCardinalSplineCurve<2, tElement> tConcreteSplineCurve; 
     71//typedef rrlib::geometry::tUniformBSplineCurve<2, tElement> tConcreteSplineCurve; 
     72typedef rrlib::geometry::tCardinalSplineCurve<2, tElement> tConcreteSplineCurve; 
    7373 
    7474//---------------------------------------------------------------------- 
     
    120120  for (size_t i = 1; i < bezier_curve.NumberOfControlPoints(); ++i) 
    121121  { 
    122     const tPoint &start(bezier_curve.GetControlPoint(i - 1)); 
    123     const tPoint &stop(bezier_curve.GetControlPoint(i)); 
     122    const tPoint &start(bezier_curve.ControlPoints()[i - 1]); 
     123    const tPoint &stop(bezier_curve.ControlPoints()[i]); 
    124124 
    125125    window.DrawLineNormalized(start.X(), start.Y(), stop.X(), stop.Y()); 
     
    129129void DrawControlPolygon(tWindow &window, const tSplineCurve &spline_curve) 
    130130{ 
    131   for (size_t i = 1; i < spline_curve.GetNumberOfControlPoints(); ++i) 
    132   { 
    133     const tPoint &start(spline_curve.GetControlPoint(i - 1)); 
    134     const tPoint &stop(spline_curve.GetControlPoint(i)); 
     131  for (size_t i = 1; i < spline_curve.NumberOfControlPoints(); ++i) 
     132  { 
     133    const tPoint &start(spline_curve.ControlPoints()[i - 1]); 
     134    const tPoint &stop(spline_curve.ControlPoints()[i]); 
    135135 
    136136    window.DrawLineNormalized(start.X(), start.Y(), stop.X(), stop.Y()); 
     
    153153void DrawSplineCurve(tWindow &window, const tSplineCurve &spline_curve, float epsilon = 1.0E-6) 
    154154{ 
    155   for (size_t i = 0; i < spline_curve.GetNumberOfSegments(); ++i) 
     155  for (size_t i = 0; i < spline_curve.NumberOfSegments(); ++i) 
    156156  { 
    157157    DrawBezierCurve(window, spline_curve.GetBezierCurveForSegment(i), epsilon); 
     
    198198  std::cout << std::endl << "=== Control polygon and bounding box ===" << std::endl; 
    199199 
    200   tBezierCurve bezier_curve(control_points); 
     200  tBezierCurve bezier_curve(control_points.begin(), control_points.end()); 
    201201 
    202202  window.Clear(); 
     
    269269  control_points2.push_back(tPoint(0.4, 0.9)); 
    270270 
    271   tBezierCurve bezier_curve2(control_points2); 
     271  tBezierCurve bezier_curve2(control_points2.begin(), control_points2.end()); 
    272272 
    273273  rrlib::math::tAngleDeg angle = -40; 
     
    309309  control_points.push_back(tPoint(0.9, 0.4)); 
    310310 
    311   tConcreteSplineCurve spline(control_points); 
     311  tConcreteSplineCurve spline(control_points.begin(), control_points.end()); 
    312312 
    313313  window.Clear(); 
Note: See TracChangeset for help on using the changeset viewer.