1 | // %flair:license{
|
---|
2 | // This file is part of the Flair framework distributed under the
|
---|
3 | // CECILL-C License, Version 1.0.
|
---|
4 | // %flair:license}
|
---|
5 | // created: 2013/07/29
|
---|
6 | // filename: GeoCoordinate.cpp
|
---|
7 | //
|
---|
8 | // author: Guillaume Sanahuja
|
---|
9 | // Copyright Heudiasyc UMR UTC/CNRS 7253
|
---|
10 | //
|
---|
11 | // version: $Id: $
|
---|
12 | //
|
---|
13 | // purpose: Class defining a point by its lla coordinates
|
---|
14 | //
|
---|
15 | //
|
---|
16 | /*********************************************************************/
|
---|
17 |
|
---|
18 | #include "GeoCoordinate.h"
|
---|
19 |
|
---|
20 | using std::string;
|
---|
21 |
|
---|
22 | namespace flair
|
---|
23 | {
|
---|
24 | namespace core
|
---|
25 | {
|
---|
26 |
|
---|
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);
|
---|
31 | }
|
---|
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;
|
---|
38 | }
|
---|
39 |
|
---|
40 | GeoCoordinate::~GeoCoordinate()
|
---|
41 | {
|
---|
42 |
|
---|
43 | }
|
---|
44 |
|
---|
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();
|
---|
54 | }
|
---|
55 |
|
---|
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();
|
---|
63 | }
|
---|
64 |
|
---|
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 | }
|
---|
78 |
|
---|
79 | } // end namespace core
|
---|
80 | } // end namespace flair
|
---|