Changeset 48:dda7030ef9f2 in rrlib_geometry


Ignore:
Timestamp:
22.05.2013 15:32:55 (6 years ago)
Author:
Tobias Föhst <foehst@…>
Branch:
default
Phase:
public
Message:

Added no-argument constructors to curve types

Location:
curves
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • curves/tBSplineCurve.h

    r47 r48  
    7979//---------------------------------------------------------------------- 
    8080public: 
     81 
     82  tBSplineCurve(); 
    8183 
    8284  /*! 
  • curves/tBSplineCurve.hpp

    r47 r48  
    6262// tBSplineCurve constructor 
    6363//---------------------------------------------------------------------- 
     64template <size_t Tdimension, typename TElement, unsigned int Tdegree> 
     65tBSplineCurve<Tdimension, TElement, Tdegree>::tBSplineCurve() : 
     66  tSplineCurve() 
     67{ 
     68  this->CalculateKnotVector(); 
     69  this->CalculateBezierControlPoints(); 
     70} 
     71 
    6472template<size_t Tdimension, typename TElement, unsigned int Tdegree> 
    6573template<typename TIterator, typename TKnotIterator> 
  • curves/tBezierCurve.h

    r47 r48  
    106106  typedef std::pair<tBezierCurve, tBezierCurve> tSubdivision; 
    107107 
     108  tBezierCurve(); 
     109 
    108110  template <typename TIterator> 
    109111  tBezierCurve(TIterator begin, TIterator end); 
  • curves/tBezierCurve.hpp

    r47 r48  
    6767//---------------------------------------------------------------------- 
    6868template <size_t Tdimension, typename TElement, unsigned int Tdegree> 
     69tBezierCurve<Tdimension, TElement, Tdegree>::tBezierCurve() 
     70{ 
     71  static_assert(Tdegree > 0, "The degree of Bezier curves must be greater than zero"); 
     72  memset(this->control_points, 0, sizeof(this->control_points)); 
     73} 
     74 
     75template <size_t Tdimension, typename TElement, unsigned int Tdegree> 
    6976template <typename TIterator> 
    7077tBezierCurve<Tdimension, TElement, Tdegree>::tBezierCurve(TIterator begin, TIterator end) 
  • curves/tCardinalSplineCurve.h

    r29 r48  
    8080public: 
    8181 
     82  tCardinalSplineCurve(); 
     83 
    8284  template <typename TIterator> 
    8385  tCardinalSplineCurve(TIterator begin, TIterator end, double tension = 0.0); 
  • curves/tCardinalSplineCurve.hpp

    r29 r48  
    6666//---------------------------------------------------------------------- 
    6767template <size_t Tdimension, typename TElement> 
     68tCardinalSplineCurve<Tdimension, TElement>::tCardinalSplineCurve() : 
     69  tSplineCurve() 
     70{} 
     71 
     72template <size_t Tdimension, typename TElement> 
    6873template <typename TIterator> 
    6974tCardinalSplineCurve<Tdimension, TElement>::tCardinalSplineCurve(TIterator begin, TIterator end, double tension) 
  • curves/tSplineCurve.h

    r47 r48  
    101101  typedef typename tBezierCurve::tParameter tParameter; 
    102102 
     103  tSplineCurve(); 
     104 
    103105  template <typename TIterator> 
    104106  tSplineCurve(TIterator begin, TIterator end); 
  • curves/tSplineCurve.hpp

    r47 r48  
    6767//---------------------------------------------------------------------- 
    6868template <size_t Tdimension, typename TElement, unsigned int Tdegree> 
     69tSplineCurve<Tdimension, TElement, Tdegree>::tSplineCurve() : 
     70  control_points(Tdegree + 1, tShape::tPoint::Zero()) 
     71{ 
     72  static_assert(Tdegree > 0, "The degree of spline curves must be greater than zero"); 
     73  assert(control_points.size() > Tdegree && "A spline curve needs at least degree + 1 control points"); 
     74  this->bezier_curve_cache.resize(this->NumberOfSegments()); 
     75} 
     76 
     77template <size_t Tdimension, typename TElement, unsigned int Tdegree> 
    6978template <typename TIterator> 
    7079tSplineCurve<Tdimension, TElement, Tdegree>::tSplineCurve(TIterator begin, TIterator end) 
Note: See TracChangeset for help on using the changeset viewer.