Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Line.hpp

    r69baa4 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;
     
    4035
    4136  Vector rotateVector(const Vector &rhs, double alpha) const;
    42   Line rotateLine(const Line &rhs, double alpha) const;
    43   Plane rotatePlane(const Plane &rhs, double alpha) const;
    4437
    4538  Plane getOrthogonalPlane(const Vector &origin) const;
    4639
    4740  std::vector<Vector> getSphereIntersections() const;
    48 
    49   LinePoint getLinePoint(const Vector&) const;
    50   LinePoint posEndpoint() const;
    51   LinePoint negEndpoint() const;
    52 
    53 
    5441
    5542private:
     
    5845};
    5946
    60 bool operator==(const Line&,const Line&);
    61 
    6247/**
    6348 * Named constructor to make a line through two points
     
    6550Line makeLineThrough(const Vector &x1, const Vector &x2);
    6651
    67 /**
    68  * Class for representing points on a line
    69  * These objects allow comparison of points on the same line as well as specifying the
    70  * infinite "endpoints" of a line.
    71  */
    72 class LinePoint{
    73   friend class Line;
    74   friend bool operator==(const LinePoint&, const LinePoint&);
    75   friend bool operator<(const LinePoint&, const LinePoint&);
    76 public:
    77   LinePoint(const LinePoint&);
    78   LinePoint& operator=(const LinePoint&);
    79   Vector getPoint() const;
    80   Line getLine() const;
    81   bool isInfinite() const;
    82   bool isPosInfinity() const;
    83   bool isNegInfinity() const;
    84 
    85 private:
    86   LinePoint(const Line&,double);
    87   Line line;
    88   double param;
    89 };
    90 
    91 bool operator==(const LinePoint&, const LinePoint&);
    92 bool operator<(const LinePoint&, const LinePoint&);
    93 
    94 inline bool operator!= (const LinePoint& x, const LinePoint& y) { return !(x==y); }
    95 inline bool operator>  (const LinePoint& x, const LinePoint& y) { return y<x; }
    96 inline bool operator<= (const LinePoint& x, const LinePoint& y) { return !(y<x); }
    97 inline bool operator>= (const LinePoint& x, const LinePoint& y) { return !(x<y); }
    98 
    99 
    10052#endif /* LINE_HPP_ */
Note: See TracChangeset for help on using the changeset viewer.