Скачиваний:
52
Добавлен:
01.05.2014
Размер:
2.21 Кб
Скачать
#include<iostream.h>
#include<math.h>
#include<values.h>
#include<conio.h>

#include "Planeta.h"

unsigned int Planeta::Next=1;

  //Konstruktor
  Planeta::Planeta(int _X,int _Y,int _Lmax,int _Lmin,double Fi,double FiP,int _V):Adr(Next)
		{V=_V;

		 el=new Ellips(_X,_Y,_Lmax,_Lmin,Fi);
		 if (FiP<0) {cout<<"Znachenie Fi doljno bit bolshe 0"<<endl;
			     Fi0=0;}
		 else {Fi0=FiP;}

		 Next++;
		}


  //Selectori
  unsigned int Planeta::getNom() const
	{return Adr.getAdress();}


  int Planeta::getV() const
	{return V;}


  double Planeta::getX() const
	{return el->getX();}

  double Planeta::getY() const
	{return el->getY();}


  double Planeta::getLmax() const
	{return el->getLmax();}

  double Planeta::getLmin() const
	{return el->getLmin();}

  double Planeta::getAngle() const
	{return el->getAngle();}

  double Planeta::getFi0() const
	{return Fi0;}


  void Planeta::Print() const
	{cout<<"---Parametri orbiti: ---"<<endl;
	 cout<<"-Koordinati centra: "<<endl;
	 cout<<"X:            "<<Planeta::getX()<<endl;
	 cout<<"Y:            "<<Planeta::getY()<<endl;
	 cout<<"-Poluosi: --------------"<<endl;
	 cout<<"Bolshaya: "<<Planeta::getLmax()<<endl;
	 cout<<"Menshaya: "<<Planeta::getLmin()<<endl;
	 cout<<"Naklon:   "<<Planeta::getAngle()<<endl;
	 cout<<"------------------------"<<endl<<endl;
	 }

  Message Planeta::Send(Adress _Pol,double _Msg) const
	{Message Msg;
	 Msg.setPol(_Pol);
	 Msg.setOtp(Adr.getAdress());
	 Msg.setMsg(_Msg);
	 return Msg;
	 }

  Adress Planeta::getAdr() const
	{return Adr;}



  //Modifikatori

  void Planeta::setV(int _V)
	{V=_V;}

  void Planeta::setLmax(int _Lmax)
	{if (_Lmax>0)
		{el->setLmax(_Lmax);}
	 else {cout<<"Dlina doljna bit bolshe 0"<<endl;getch();}
	}
  void Planeta::setLmin(int _Lmin)
	{if (_Lmin>0)
		{el->setLmin(_Lmin);}
	 else {cout<<"Dlina doljna bit bolshe 0"<<endl;getch();}
	}

  void Planeta::Revol(double dFi)
	{el->Revol(dFi);}

  void Planeta::Masht(double dN)
	{if (dN>0)
		{el->Masht(dN);}
	 else {cout<<"Dlina doljna bit bolshe 0"<<endl;getch();}
	}


  void Planeta::Move(double dX,double dY)
	{el->Move(dX,dY);}




Соседние файлы в папке Kurs3