//--------------------------------------------------------------------------- // Copyright (c) Jim Wright 2004 // // JimLine.h // This is a line class that combines both the math type of line stuff // such as finding the intersection of two lines, with the graphics stuff // //--------------------------------------------------------------------------- #pragma once class CJimLine : public CJimDrawingObject { private: CJimPoint m_a; CJimPoint m_b; bool m_intersectError; bool m_slopeError; int m_size; COLORREF m_color; public: CJimLine(void); CJimLine(CJimPoint a, CJimPoint b); CJimLine(CJimPoint a, CJimPoint b, COLORREF color); CJimLine(const CJimLine &right); CJimLine(CJimPoint a, double angle, double length); CJimLine(CJimPoint a, double angle, double length, COLORREF color); CJimLine & operator=(const CJimLine &right); ~CJimLine(void); virtual void Draw(CDC *hDC, int x, int y,double scale); virtual double FindTop(void); virtual double FindLeft(void); virtual double FindBottom(void); virtual double FindRight(void); CJimPoint GetA(void); CJimPoint GetB(void); CJimPoint Intersect(CJimLine anotherLine); bool PointOnLine(CJimPoint a); double Slope(void); double Length(void); };