Changes in src/Line.hpp [6256f5:f932b7]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Line.hpp
r6256f5 rf932b7 16 16 class Vector; 17 17 class Plane; 18 class LinePoint;19 18 20 19 class Line : public Space 21 20 { 22 friend bool operator==(const Line&,const Line&);23 friend class LinePoint;24 21 public: 25 22 Line(const Vector &_origin, const Vector &_direction); 26 23 Line(const Line& _src); 27 24 virtual ~Line(); 28 29 Line &operator=(const Line& rhs);30 25 31 26 virtual double distance(const Vector &point) const; … … 45 40 std::vector<Vector> getSphereIntersections() const; 46 41 47 LinePoint getLinePoint(const Vector&) const;48 LinePoint posEndpoint() const;49 LinePoint negEndpoint() const;50 51 42 private: 52 43 std::auto_ptr<Vector> origin; 53 44 std::auto_ptr<Vector> direction; 54 45 }; 55 56 bool operator==(const Line&,const Line&);57 46 58 47 /** … … 61 50 Line makeLineThrough(const Vector &x1, const Vector &x2); 62 51 63 /**64 * Class for representing points on a line65 * These objects allow comparison of points on the same line as well as specifying the66 * 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 96 52 #endif /* LINE_HPP_ */
Note:
See TracChangeset
for help on using the changeset viewer.