Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Line.hpp

    r6256f5 rf932b7  
    1616class Vector;
    1717class Plane;
    18 class LinePoint;
    1918
    2019class Line : public Space
    2120{
    22   friend bool operator==(const Line&,const Line&);
    23   friend class LinePoint;
    2421public:
    2522  Line(const Vector &_origin, const Vector &_direction);
    2623  Line(const Line& _src);
    2724  virtual ~Line();
    28 
    29   Line &operator=(const Line& rhs);
    3025
    3126  virtual double distance(const Vector &point) const;
     
    4540  std::vector<Vector> getSphereIntersections() const;
    4641
    47   LinePoint getLinePoint(const Vector&) const;
    48   LinePoint posEndpoint() const;
    49   LinePoint negEndpoint() const;
    50 
    5142private:
    5243  std::auto_ptr<Vector> origin;
    5344  std::auto_ptr<Vector> direction;
    5445};
    55 
    56 bool operator==(const Line&,const Line&);
    5746
    5847/**
     
    6150Line makeLineThrough(const Vector &x1, const Vector &x2);
    6251
    63 /**
    64  * Class for representing points on a line
    65  * These objects allow comparison of points on the same line as well as specifying the
    66  * infinite "endpoints" of a line.
    67  */
    68 class LinePoint{
    69   friend class Line;
    70   friend bool operator==(const LinePoint&, const LinePoint&);
    71   friend bool operator<(const LinePoint&, const LinePoint&);
    72 public:
    73   LinePoint(const LinePoint&);
    74   LinePoint& operator=(const LinePoint&);
    75   Vector getPoint() const;
    76   Line getLine() const;
    77   bool isInfinite() const;
    78   bool isPosInfinity() const;
    79   bool isNegInfinity() const;
    80 
    81 private:
    82   LinePoint(const Line&,double);
    83   Line line;
    84   double param;
    85 };
    86 
    87 bool operator==(const LinePoint&, const LinePoint&);
    88 bool operator<(const LinePoint&, const LinePoint&);
    89 
    90 inline bool operator!= (const LinePoint& x, const LinePoint& y) { return !(x==y); }
    91 inline bool operator>  (const LinePoint& x, const LinePoint& y) { return y<x; }
    92 inline bool operator<= (const LinePoint& x, const LinePoint& y) { return !(y<x); }
    93 inline bool operator>= (const LinePoint& x, const LinePoint& y) { return !(x<y); }
    94 
    95 
    9652#endif /* LINE_HPP_ */
Note: See TracChangeset for help on using the changeset viewer.