#if !defined(LINE_H)
#define LINE_H

#include "Hashable.h"
#include "OurConstants.h"
#include "utils.h"
#include "Elements.h"
#include <iostream>
using namespace std;

class Line: virtual public CElement{

//	DECLARE_SERIAL(Line)

	private:

	    static unsigned long int count;

	    static unsigned long int total;

		const unsigned long int id;

	protected:

		void buildEnclosingRectangle();

		CPoint p1; 

		CPoint p2;

	public:

		Line();

		Line(CPoint p1, CPoint p2, COLORREF aColor = BLACK);

		Line(const Line& o);

		Line(const Line* o);

		virtual ~Line();

		CPoint getPoint(int n);

		ostream& print(ostream& os) const;

		string toString() const;

		Line& operator= (const Line& o);

		int operator==(const Line& o) const;

		void Move(CSize& aSize);  // Move an element

		virtual void Draw(CDC* pDC, CElement* pElement=0, string key = "");

		unsigned long int getObjectId() const{
			return id;
		}

		static unsigned long int getNumberOfObjects(){ //const
			return count;
		}

		int hashCode() const{
			return buildHashCode(toString());
		}

		virtual CArchive& save(CArchive& ar);

		virtual CArchive& load(CArchive& ar);
};

#endif
Соседние файлы в папке OLEApp