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

Last change on this file since 16 was 15, checked in by Bayard Gildas, 6 years ago

sources reformatted with flair-format-dir script

File size: 1.9 KB
RevLine 
[2]1// %flair:license{
[15]2// This file is part of the Flair framework distributed under the
3// CECILL-C License, Version 1.0.
[2]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
[15]22namespace flair {
23namespace core {
[2]24
[15]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);
[2]31}
32
[15]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;
[2]39}
40
[15]41GeoCoordinate::~GeoCoordinate() {}
[2]42
[15]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();
[2]51}
52
[15]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();
[2]60}
61
[15]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();
[2]69}
70
[15]71void GeoCoordinate::CopyDatas(char *ptr) const { Warn("a ecrire"); }
[2]72
73} // end namespace core
74} // end namespace flair
Note: See TracBrowser for help on using the repository browser.