Changeset 15 in flair-src for trunk/lib/FlairCore/src/GeoCoordinate.cpp
- Timestamp:
- Apr 8, 2016, 3:40:57 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/FlairCore/src/GeoCoordinate.cpp
r2 r15 20 20 using std::string; 21 21 22 namespace flair 23 { 24 namespace core 25 { 22 namespace flair { 23 namespace core { 26 24 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); 25 GeoCoordinate::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); 31 31 } 32 32 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; 33 GeoCoordinate::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; 38 39 } 39 40 40 GeoCoordinate::~GeoCoordinate() 41 { 41 GeoCoordinate::~GeoCoordinate() {} 42 42 43 void 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(); 43 51 } 44 52 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(); 53 void 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(); 54 60 } 55 61 56 void GeoCoordinate:: SetCoordinates(double latitude,double longitude,double altitude)57 {58 59 this->latitude=latitude;60 this->longitude=longitude;61 this->altitude=altitude;62 62 void 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(); 63 69 } 64 70 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 } 71 void GeoCoordinate::CopyDatas(char *ptr) const { Warn("a ecrire"); } 78 72 79 73 } // end namespace core
Note:
See TracChangeset
for help on using the changeset viewer.