Changeset 15:ab5bbeefd049 in rrlib_geometry


Ignore:
Timestamp:
14.07.2011 10:34:32 (8 years ago)
Author:
Tobias F?hst <foehst@…>
Branch:
default
Phase:
public
Rebase:
37306137653565376563623738313439343666336464633033663732663236613738613964353961
Message:

Renamed GetNearestPoint to GetClosestPoint

Files:
6 edited

Legend:

Unmodified
Added
Removed
  • tLine.h

    r8 r15  
    102102  const TElement GetDistanceToPoint(const typename tShape::tPoint &point) const; 
    103103 
    104   virtual const typename tShape::tPoint GetNearestPoint(const typename tShape::tPoint &reference_point) const; 
     104  virtual const typename tShape::tPoint GetClosestPoint(const typename tShape::tPoint &reference_point) const; 
    105105 
    106106  const bool GetIntersection(typename tShape::tPoint &intersection_point, const tLine &line) const; 
  • tLine.hpp

    r8 r15  
    112112const TElement tLine<Tdimension, TElement>::GetDistanceToPoint(const typename tShape::tPoint &point) const 
    113113{ 
    114   return (point - this->GetNearestPoint(point)).Length(); 
    115 } 
    116  
    117 //---------------------------------------------------------------------- 
    118 // tLine GetNearestPoint 
    119 //---------------------------------------------------------------------- 
    120 template <size_t Tdimension, typename TElement> 
    121 const typename tShape<Tdimension, TElement>::tPoint tLine<Tdimension, TElement>::GetNearestPoint(const typename tShape::tPoint &reference_point) const 
     114  return (point - this->GetClosestPoint(point)).Length(); 
     115} 
     116 
     117//---------------------------------------------------------------------- 
     118// tLine GetClosestPoint 
     119//---------------------------------------------------------------------- 
     120template <size_t Tdimension, typename TElement> 
     121const typename tShape<Tdimension, TElement>::tPoint tLine<Tdimension, TElement>::GetClosestPoint(const typename tShape::tPoint &reference_point) const 
    122122{ 
    123123  //          reference_point 
     
    270270void tLine<Tdimension, TElement>::UpdateCenterOfGravity(typename tShape::tPoint &center_of_gravity) const 
    271271{ 
    272   center_of_gravity = this->GetNearestPoint(tShape::tPoint::Zero()); 
     272  center_of_gravity = this->GetClosestPoint(tShape::tPoint::Zero()); 
    273273} 
    274274 
  • tLineSegment.h

    r8 r15  
    103103  } 
    104104 
    105   const TElement Length() const; 
     105  inline const TElement Length() const 
     106  { 
     107    return (this->Begin() - this->End()).Length(); 
     108  } 
    106109 
    107   virtual const typename tShape::tPoint GetNearestPoint(const typename tShape::tPoint &reference_point) const; 
     110  virtual const typename tShape::tPoint GetClosestPoint(const typename tShape::tPoint &reference_point) const; 
    108111 
    109112  virtual tLineSegment &Translate(const math::tVector<Tdimension, TElement> &translation); 
  • tLineSegment.hpp

    r8 r15  
    8989 
    9090//---------------------------------------------------------------------- 
    91 // tLineSegment GetNearestPoint 
     91// tLineSegment GetClosestPoint 
    9292//---------------------------------------------------------------------- 
    9393template <size_t Tdimension, typename TElement> 
    94 const typename tShape<Tdimension, TElement>::tPoint tLineSegment<Tdimension, TElement>::GetNearestPoint(const typename tShape::tPoint &reference_point) const 
     94const typename tShape<Tdimension, TElement>::tPoint tLineSegment<Tdimension, TElement>::GetClosestPoint(const typename tShape::tPoint &reference_point) const 
    9595{ 
    9696  math::tVector<Tdimension, TElement> from_begin_to_point(reference_point - this->Begin()); 
     
    103103  } 
    104104 
    105   // angle between direction and vecot end->point larger than 90° 
     105  // angle between direction and vector end->point larger than 90° 
    106106  if (from_end_to_point * this->Direction() > 0) 
    107107  { 
     
    109109  } 
    110110 
    111   return tLine::GetNearestPoint(reference_point); 
     111  return tLine::GetClosestPoint(reference_point); 
    112112} 
    113113 
  • tPlane.h

    r8 r15  
    103103  const TElement GetDistanceToPoint(const typename tShape::tPoint &point) const; 
    104104 
    105   virtual const typename tShape::tPoint GetNearestPoint(const typename tShape::tPoint &reference_point) const; 
     105  virtual const typename tShape::tPoint GetClosestPoint(const typename tShape::tPoint &reference_point) const; 
    106106 
    107107  virtual tPlane &Translate(const math::tVector<Tdimension, TElement> &translation); 
  • tPlane.hpp

    r10 r15  
    122122 
    123123//---------------------------------------------------------------------- 
    124 // tPlane GetNearestPoint 
    125 //---------------------------------------------------------------------- 
    126 template <size_t Tdimension, typename TElement> 
    127 const typename tShape<Tdimension, TElement>::tPoint tPlane<Tdimension, TElement>::GetNearestPoint(const typename tShape::tPoint &reference_point) const 
     124// tPlane GetClosestPoint 
     125//---------------------------------------------------------------------- 
     126template <size_t Tdimension, typename TElement> 
     127const typename tShape<Tdimension, TElement>::tPoint tPlane<Tdimension, TElement>::GetClosestPoint(const typename tShape::tPoint &reference_point) const 
    128128{ 
    129129  return -(this->normal *(reference_point - this->support)) * this->normal + reference_point; 
     
    196196void tPlane<Tdimension, TElement>::UpdateCenterOfGravity(typename tShape::tPoint &center_of_gravity) const 
    197197{ 
    198   center_of_gravity = this->GetNearestPoint(tShape::tPoint::Zero()); 
     198  center_of_gravity = this->GetClosestPoint(tShape::tPoint::Zero()); 
    199199} 
    200200 
Note: See TracChangeset for help on using the changeset viewer.