]> git.mxchange.org Git - simgear.git/blobdiff - simgear/timing/geocoord.cxx
Add a function to calculate the normalmap from a regular texture.
[simgear.git] / simgear / timing / geocoord.cxx
index 939ca42abe149b0a2732677411a186abb9abf4a6..b904ca054e0d6eaf0edccd1790f5e37db955a4e9 100644 (file)
@@ -2,26 +2,27 @@
  * geocoord.h
  * Written by Durk Talsma. Started March 1998.
  *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
  *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
+ * Library General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA  02111-1307, USA.
  *
  **************************************************************************/
 
 /*************************************************************************
  *
  * This file defines a small and simple class to store geocentric 
- * coordinates. Basically, class GeoCoord is intended as a base class for
+ * coordinates. Basically, class SGGeoCoord is intended as a base class for
  * any kind of of object, that can be categorized according to its 
  * location on earth, be it navaids, or aircraft. This class for originally
  * written for FlightGear, in order to store Timezone control points. 
 #include "geocoord.h"
 #include <plib/sg.h>
 
-GeoCoord::GeoCoord(const GeoCoord& other)
+SGGeoCoord::SGGeoCoord(const SGGeoCoord& other)
 {
   lat = other.lat;
   lon = other.lon;
 }
 
-// double GeoCoord::getAngle(const GeoCoord& other) const
+// double SGGeoCoord::getAngle(const SGGeoCoord& other) const
 // {
 //   Vector first(      getX(),       getY(),       getZ());
 //   Vector secnd(other.getX(), other.getY(), other.getZ());
@@ -56,14 +57,14 @@ GeoCoord::GeoCoord(const GeoCoord& other)
 //     return angle;
 // }
 
-// GeoCoord* GeoCoordContainer::getNearest(const GeoCoord& ref) const
+// SGGeoCoord* SGGeoCoordContainer::getNearest(const SGGeoCoord& ref) const
 // {
 //   float angle, maxAngle = 180;
 
-//   GeoCoordVectorConstIterator i, nearest;
+//   SGGeoCoordVectorConstIterator i, nearest;
 //   for (i = data.begin(); i != data.end(); i++)
 //     {
-//       angle = RAD_TO_DEG * (*i)->getAngle(ref);
+//       angle = SGD_RADIANS_TO_DEGREES * (*i)->getAngle(ref);
 //       if (angle < maxAngle)
 //     {
 //       maxAngle = angle;
@@ -74,12 +75,12 @@ GeoCoord::GeoCoord(const GeoCoord& other)
 // }
 
 
-GeoCoord* GeoCoordContainer::getNearest(const GeoCoord& ref) const
+SGGeoCoord* SGGeoCoordContainer::getNearest(const SGGeoCoord& ref) const
 {
   sgVec3 first, secnd;
   float dist, maxDist=SG_MAX;
   sgSetVec3( first, ref.getX(), ref.getY(), ref.getZ());
-  GeoCoordVectorConstIterator i, nearest;
+  SGGeoCoordVectorConstIterator i, nearest;
   for (i = data.begin(); i != data.end(); i++)
     {
       sgSetVec3(secnd, (*i)->getX(), (*i)->getY(), (*i)->getZ());
@@ -94,9 +95,9 @@ GeoCoord* GeoCoordContainer::getNearest(const GeoCoord& ref) const
 }
 
 
-GeoCoordContainer::~GeoCoordContainer()
+SGGeoCoordContainer::~SGGeoCoordContainer()
 {
-    GeoCoordVectorIterator i = data.begin();
+    SGGeoCoordVectorIterator i = data.begin();
   while (i != data.end())
     delete *i++;
 }