Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
38
Добавлен:
16.04.2013
Размер:
1.05 Кб
Скачать
#ifndef UNITCOMPLEXH
#define UNITCOMPLEXH
#include <iostream.h>
class CComplex
{
  public:
    CComplex(TImage* _Img,int _x,int _y,double _rho,double _phi);
    CComplex(int _x,int _y,TImage* _Img,double _rx,double _ry);
    ~CComplex();
  private:
    int x,y,w,h;
    bool _Marked;
    TImage* Img;
  public:
    long double rho,phi;

    long double Angle(CComplex& z);
    void Draw();
    bool IsSelected(int X,int Y){return (X >= x) && (X < x+w) && (Y >= y) && (Y < y + h + 2);};
    void Mark(bool mark)
    {
      if(_Marked != mark)
      {
        _Marked = mark;
        Draw();
      }
    };
    bool Marked(){return _Marked;};
    void Rotate(long double dphi){phi+=dphi;};
    CComplex& operator=(CComplex z);
    CComplex operator+(CComplex& z);
    CComplex operator-(CComplex& z);
    CComplex operator*(CComplex& z);
    CComplex operator/(CComplex& z);
    friend ostream& operator<<(ostream& os, const CComplex& z);
    friend istream& operator>>(istream& is,       CComplex& z);
};
#endif