Changeset 24:627bf1924b86 in rrlib_geometry for curves/tSplineCurve.h


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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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 
Note: See TracChangeset for help on using the changeset viewer.