Changeset 15 in flair-src for trunk/lib/FlairCore/src/GeoCoordinate.cpp


Ignore:
Timestamp:
Apr 8, 2016, 3:40:57 PM (9 years ago)
Author:
Bayard Gildas
Message:

sources reformatted with flair-format-dir script

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/FlairCore/src/GeoCoordinate.cpp

    r2 r15  
    2020using std::string;
    2121
    22 namespace flair
    23 {
    24 namespace core
    25 {
     22namespace flair {
     23namespace core {
    2624
    27 GeoCoordinate::GeoCoordinate(const Object* parent,string name,const GeoCoordinate *point,int n): io_data(parent,name,n)
    28 {
    29     if(n>1) Warn("n>1 not supported\n");
    30     CopyFrom(point);
     25GeoCoordinate::GeoCoordinate(const Object *parent, string name,
     26                             const GeoCoordinate *point, int n)
     27    : io_data(parent, name, n) {
     28  if (n > 1)
     29    Warn("n>1 not supported\n");
     30  CopyFrom(point);
    3131}
    3232
    33 GeoCoordinate::GeoCoordinate(const Object* parent,string name,double latitude,double longitude,double altitude,int n): io_data(parent,name,n)
    34 {
    35     this->latitude=latitude;
    36     this->longitude=longitude;
    37     this->altitude=altitude;
     33GeoCoordinate::GeoCoordinate(const Object *parent, string name, double latitude,
     34                             double longitude, double altitude, int n)
     35    : io_data(parent, name, n) {
     36  this->latitude = latitude;
     37  this->longitude = longitude;
     38  this->altitude = altitude;
    3839}
    3940
    40 GeoCoordinate::~GeoCoordinate()
    41 {
     41GeoCoordinate::~GeoCoordinate() {}
    4242
     43void GeoCoordinate::CopyFrom(const GeoCoordinate *point) {
     44  double latitude, longitude, altitude;
     45  point->GetCoordinates(&latitude, &longitude, &altitude);
     46  GetMutex();
     47  this->latitude = latitude;
     48  this->longitude = longitude;
     49  this->altitude = altitude;
     50  ReleaseMutex();
    4351}
    4452
    45 void GeoCoordinate::CopyFrom(const GeoCoordinate *point)
    46 {
    47     double latitude,longitude,altitude;
    48     point->GetCoordinates(&latitude,&longitude,&altitude);
    49     GetMutex();
    50     this->latitude=latitude;
    51     this->longitude=longitude;
    52     this->altitude=altitude;
    53     ReleaseMutex();
     53void GeoCoordinate::SetCoordinates(double latitude, double longitude,
     54                                   double altitude) {
     55  GetMutex();
     56  this->latitude = latitude;
     57  this->longitude = longitude;
     58  this->altitude = altitude;
     59  ReleaseMutex();
    5460}
    5561
    56 void GeoCoordinate::SetCoordinates(double latitude,double longitude,double altitude)
    57 {
    58     GetMutex();
    59     this->latitude=latitude;
    60     this->longitude=longitude;
    61     this->altitude=altitude;
    62     ReleaseMutex();
     62void GeoCoordinate::GetCoordinates(double *latitude, double *longitude,
     63                                   double *altitude) const {
     64  GetMutex();
     65  *latitude = this->latitude;
     66  *longitude = this->longitude;
     67  *altitude = this->altitude;
     68  ReleaseMutex();
    6369}
    6470
    65 void GeoCoordinate::GetCoordinates(double *latitude,double *longitude,double *altitude) const
    66 {
    67     GetMutex();
    68     *latitude=this->latitude;
    69     *longitude=this->longitude;
    70     *altitude=this->altitude;
    71     ReleaseMutex();
    72 }
    73 
    74 void GeoCoordinate::CopyDatas(char* ptr) const
    75 {
    76     Warn("a ecrire");
    77 }
     71void GeoCoordinate::CopyDatas(char *ptr) const { Warn("a ecrire"); }
    7872
    7973} // end namespace core
Note: See TracChangeset for help on using the changeset viewer.