Changeset 25:2a634441d8ef in rrlib_geometry


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

Reformatted with astyle 2.02.1

Files:
9 edited

Legend:

Unmodified
Added
Removed
  • curves/tBezierCurve.hpp

    r24 r25  
    6868template <typename TIterator> 
    6969tBezierCurve<Tdimension, TElement, Tdegree>::tBezierCurve(TIterator begin, TIterator end) 
    70     : tShape() 
     70  : tShape() 
    7171{ 
    7272  static_assert(Tdegree > 0, "The degree of Bezier curves must be greater than zero"); 
     
    101101    twist = std::max(twist, ((this->control_points[i + 2] - this->control_points[i + 1]) - (this->control_points[i + 1] - this->control_points[i])).Length()); 
    102102  } 
    103   return Tdegree *(Tdegree - 1) * twist; 
     103  return Tdegree * (Tdegree - 1) * twist; 
    104104} 
    105105 
     
    208208  { 
    209209    tSubdivision subdivision(this->GetSubdivision()); 
    210     tParameter middle_parameter(0.5 *(min_parameter + max_parameter)); 
     210    tParameter middle_parameter(0.5 * (min_parameter + max_parameter)); 
    211211    bool result = false; 
    212212    result |= subdivision.first.GetIntersections(intersection_points, intersection_parameters, other, min_parameter, middle_parameter); 
     
    244244{ 
    245245  // check if intersection with line is possible 
    246   typename tShape::tPoint center_of_bounding_box(math::tVector<Tdimension, TElement>(0.5 *(this->BoundingBox().Min() + this->BoundingBox().Max()))); 
     246  typename tShape::tPoint center_of_bounding_box(math::tVector<Tdimension, TElement>(0.5 * (this->BoundingBox().Min() + this->BoundingBox().Max()))); 
    247247  double radius_of_bounding_sphere = 0.5 * (this->BoundingBox().Max() - this->BoundingBox().Min()).Length(); 
    248248  if (line.GetDistanceToPoint(center_of_bounding_box) > radius_of_bounding_sphere) 
     
    255255  { 
    256256    tSubdivision subdivision(this->GetSubdivision()); 
    257     tParameter middle_parameter(0.5 *(min_parameter + max_parameter)); 
     257    tParameter middle_parameter(0.5 * (min_parameter + max_parameter)); 
    258258    bool result = false; 
    259259    result |= subdivision.first.GetIntersections(intersection_points, intersection_parameters, line, min_parameter, middle_parameter); 
  • curves/tCardinalSplineCurve.hpp

    r24 r25  
    6868template <typename TIterator> 
    6969tCardinalSplineCurve<Tdimension, TElement>::tCardinalSplineCurve(TIterator begin, TIterator end, double tension) 
    70     : tSplineCurve(begin, end), 
     70  : tSplineCurve(begin, end), 
    7171    tension(tension) 
    7272{} 
  • curves/tUniformBSplineCurve.hpp

    r24 r25  
    6868template <typename TIterator> 
    6969tUniformBSplineCurve<Tdimension, TElement>::tUniformBSplineCurve(TIterator begin, TIterator end, double tension) 
    70     : tSplineCurve(begin, end), 
     70  : tSplineCurve(begin, end), 
    7171    tension(tension) 
    7272{} 
  • functions.h

    r18 r25  
    6969 
    7070template <size_t Tdimension, typename TElement, unsigned int Tdegree> 
    71 inline const typename boost::enable_if_c<(Tdimension <= 3), double>::type GetCurvature(const tBezierCurve<Tdimension, TElement, Tdegree> &curve, TElement parameter) 
     71inline const typename boost::enable_if_c < (Tdimension <= 3), double >::type GetCurvature(const tBezierCurve<Tdimension, TElement, Tdegree> &curve, TElement parameter) 
    7272{ 
    7373  typename tBezierCurve<Tdimension, TElement, Tdegree>::tDerivative first_derivative(curve.GetDerivative()); 
  • space_partitioning/tKDTree.hpp

    r22 r25  
    6969template <typename TIterator> 
    7070tKDTree<Tdimension, TElement>::tKDTree(TIterator begin_points, TIterator end_points, tMetric metric) 
    71     : root(new tNode(begin_points, end_points, metric)) 
     71  : root(new tNode(begin_points, end_points, metric)) 
    7272{} 
    7373 
     
    9797template <typename TIterator> 
    9898tKDTree<Tdimension, TElement>::tNode::tNode(TIterator points_begin, TIterator points_end, tMetric metric) 
    99     : bounding_box(points_begin, points_end), 
     99  : bounding_box(points_begin, points_end), 
    100100    split_axis(SelectSplitAxis(metric)), 
    101     split_value(0.5 *(this->bounding_box.Min()[this->split_axis] + this->bounding_box.Max()[this->split_axis])), 
     101    split_value(0.5 * (this->bounding_box.Min()[this->split_axis] + this->bounding_box.Max()[this->split_axis])), 
    102102    left_child(0), 
    103103    right_child(0), 
     
    106106  if (this->number_of_points > 1) 
    107107  { 
    108     std::sort(points_begin, points_end, [this](const tPoint &a, const tPoint &b) 
     108    std::sort(points_begin, points_end, [this](const tPoint & a, const tPoint & b) 
    109109    { 
    110110      return a[this->split_axis] < b[this->split_axis]; 
  • tLine.hpp

    r24 r25  
    7676template <size_t Tdimension, typename TElement> 
    7777tLine<Tdimension, TElement>::tLine(const typename tShape::tPoint &support, const math::tVector<Tdimension, TElement> &direction) 
    78     : support(support), 
     78  : support(support), 
    7979    direction(direction.Normalized()) 
    8080{} 
     
    8282template <size_t Tdimension, typename TElement> 
    8383tLine<Tdimension, TElement>::tLine(const typename tShape::tPoint &support, const typename tShape::tPoint &second_support) 
    84     : support(support), 
     84  : support(support), 
    8585    direction((second_support - support).Normalized()) 
    8686{} 
  • tLineSegment.hpp

    r24 r25  
    7474template <size_t Tdimension, typename TElement> 
    7575tLineSegment<Tdimension, TElement>::tLineSegment(const typename tShape::tPoint &begin, const typename tShape::tPoint &end) 
    76     : tLine(begin, end - begin), 
     76  : tLine(begin, end - begin), 
    7777    end(end) 
    7878{} 
  • tPlane.hpp

    r17 r25  
    7474template <size_t Tdimension, typename TElement> 
    7575tPlane<Tdimension, TElement>::tPlane(const typename tShape::tPoint &support, const math::tVector<Tdimension, TElement> &normal) 
    76     : support(support), 
     76  : support(support), 
    7777    normal(normal.Normalized()) 
    7878{} 
     
    8080template <size_t Tdimension, typename TElement> 
    8181tPlane<Tdimension, TElement>::tPlane(const typename tShape::tPoint &p1, const typename tShape::tPoint &p2, const typename tShape::tPoint &p3) 
    82     : support(p1), 
     82  : support(p1), 
    8383    normal(CrossProduct(p2 - p1, p3 - p1).Normalized()) 
    8484{} 
     
    118118const TElement tPlane<Tdimension, TElement>::GetDistanceToPoint(const typename tShape::tPoint &point) const 
    119119{ 
    120   return math::AbsoluteValue(this->normal *(point - this->support)); 
     120  return math::AbsoluteValue(this->normal * (point - this->support)); 
    121121} 
    122122 
     
    127127const typename tShape<Tdimension, TElement>::tPoint tPlane<Tdimension, TElement>::GetClosestPoint(const typename tShape::tPoint &reference_point) const 
    128128{ 
    129   return -(this->normal *(reference_point - this->support)) * this->normal + reference_point; 
     129  return -(this->normal * (reference_point - this->support)) * this->normal + reference_point; 
    130130} 
    131131 
  • tShape.hpp

    r18 r25  
    6767template <size_t Tdimension, typename TElement> 
    6868tShape<Tdimension, TElement>::tShape() 
    69     : changed(false), 
     69  : changed(false), 
    7070    bounding_box(NULL), 
    7171    center_of_gravity(NULL) 
Note: See TracChangeset for help on using the changeset viewer.