Changes in src/Line.hpp [69baa4:f932b7]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Line.hpp
r69baa4 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; … … 40 35 41 36 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;44 37 45 38 Plane getOrthogonalPlane(const Vector &origin) const; 46 39 47 40 std::vector<Vector> getSphereIntersections() const; 48 49 LinePoint getLinePoint(const Vector&) const;50 LinePoint posEndpoint() const;51 LinePoint negEndpoint() const;52 53 54 41 55 42 private: … … 58 45 }; 59 46 60 bool operator==(const Line&,const Line&);61 62 47 /** 63 48 * Named constructor to make a line through two points … … 65 50 Line makeLineThrough(const Vector &x1, const Vector &x2); 66 51 67 /**68 * Class for representing points on a line69 * These objects allow comparison of points on the same line as well as specifying the70 * 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 100 52 #endif /* LINE_HPP_ */
Note:
See TracChangeset
for help on using the changeset viewer.