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

Last change on this file since 350 was 252, checked in by Sanahuja Guillaume, 6 years ago

change io_data CopyDate to RawRead

File size: 1.9 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 {
23namespace core {
24
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);
31}
32
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;
39}
40
41GeoCoordinate::~GeoCoordinate() {}
42
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();
51}
52
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();
60}
61
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();
69}
70
71void GeoCoordinate::RawRead(char *ptr) const { Warn("a ecrire"); }
72
73} // end namespace core
74} // end namespace flair
Note: See TracBrowser for help on using the repository browser.