source: flair-src/trunk/lib/FlairCore/src/GeoCoordinate.cpp @ 2

Last change on this file since 2 was 2, checked in by Sanahuja Guillaume, 5 years ago

flaircore

File size: 1.8 KB
Line 
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
20using std::string;
21
22namespace flair
23{
24namespace core
25{
26
27GeoCoordinate::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
33GeoCoordinate::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
40GeoCoordinate::~GeoCoordinate()
41{
42
43}
44
45void 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
56void 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
65void 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
74void GeoCoordinate::CopyDatas(char* ptr) const
75{
76    Warn("a ecrire");
77}
78
79} // end namespace core
80} // end namespace flair
Note: See TracBrowser for help on using the repository browser.