diff options
author | neoraider <devnull@localhost> | 2008-04-06 15:29:03 +0200 |
---|---|---|
committer | neoraider <devnull@localhost> | 2008-04-06 15:29:03 +0200 |
commit | 356efaf89afdad141b313767e1a2b89de3c08d0a (patch) | |
tree | 37edb2a0fc0ea15f4f60e45ed411cbea7b4c12c5 /Line.h | |
parent | 258eb984bafe0f667d1e76de61c8afaa23f39ef4 (diff) | |
download | zoomedit-356efaf89afdad141b313767e1a2b89de3c08d0a.tar zoomedit-356efaf89afdad141b313767e1a2b89de3c08d0a.zip |
zoomedit: Recreated ZoomEdit based on Glademm.
Diffstat (limited to 'Line.h')
-rw-r--r-- | Line.h | 44 |
1 files changed, 0 insertions, 44 deletions
@@ -1,44 +0,0 @@ -#ifndef LINE_H_ -#define LINE_H_ - -#include "Vertex.h" -#include <math.h> - - -#define INTERSECTION_ERROR -1 -#define INTERSECTION_NONE 0 -#define INTERSECTION_IDENTICAL 1 -#define INTERSECTION_LINE 2 -#define INTERSECTION_LINE_LINE 2 -#define INTERSECTION_LINE_SEGMENT 3 -#define INTERSECTION_SEGMENT_LINE 6 -#define INTERSECTION_SEGMENT_SEGMENT 7 - -class Line { - private: - Vertex v1, v2; - public: - Line() {} - Line(const Vertex& vertex1, const Vertex& vertex2) : - v1(vertex1), v2(vertex2) {} - Line(float x1, float y1, float x2, float y2) : - v1(x1, y1), v2(x2, y2) {} - - Vertex &getVertex1() {return v1;} - const Vertex &getVertex1() const {return v1;} - void setVertex1(const Vertex &v) {v1 = v;} - - Vertex &getVertex2() {return v2;} - const Vertex &getVertex2() const {return v2;} - void setVertex2(const Vertex &v) {v2 = v;} - - float lengthSq() const {return v1.distanceSq(v2);} - float length() const {return sqrtf(lengthSq());} - - bool contains(const Vertex &v) const; - - int intersects(const Line &l, Vertex *v) const; -}; - - -#endif /*LINE_H_*/ |