From 47dec485e56c278014ef89bef9b173b88eae41dd Mon Sep 17 00:00:00 2001 From: Peter Sadrozinski Date: Thu, 18 Oct 2012 22:46:35 -0400 Subject: [PATCH] Add SGGeod read and write to gzFile --- simgear/io/lowlevel.hxx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/simgear/io/lowlevel.hxx b/simgear/io/lowlevel.hxx index bab26ab5..2367d0d4 100644 --- a/simgear/io/lowlevel.hxx +++ b/simgear/io/lowlevel.hxx @@ -110,6 +110,17 @@ inline void sgWriteMat4 ( gzFile fd, const SGMatrixf& var ) { sgWriteFloat ( fd, 16, (float *)var.data() ) ; } +inline void sgReadGeod ( gzFile fd, SGGeod& var ) { + double data[3]; + sgReadDouble ( fd, 3, data ); + var = SGGeod::fromDegM( data[0], data[1], data[2] ); +} +inline void sgWriteGeod ( gzFile fd, const SGGeod& var ) { + sgWriteDouble( fd, var.getLongitudeDeg() ); + sgWriteDouble( fd, var.getLatitudeDeg() ); + sgWriteDouble( fd, var.getElevationM() ); +} + void sgClearReadError(); void sgClearWriteError(); int sgReadError(); -- 2.39.5