moved kdeaccessibility kdeaddons kdeadmin kdeartwork kdebindings kdeedu kdegames...
[kdeedu.git] / kstars / kstars / ksutils.h
blob95c9b7e120ad36f791a10aaae7c78d2a09ed821d
1 /***************************************************************************
2 kstars.h - K Desktop Planetarium
3 -------------------
4 begin : Mon Jan 7 2002
5 copyright : (C) 2002 by Mark Hollomon
6 email : mhh@mindspring.com
7 ***************************************************************************/
8 /***************************************************************************
9 * *
10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. *
14 * *
15 ***************************************************************************/
17 /**@class KSUtils
18 *@short KStars utility functions
19 *@author Mark Hollomon
20 *@version 1.0
21 *Static functions for various purposes.
22 *The openDataFile() function searches the standard KDE directories
23 *for the data filename given as an argument.
24 *(it is impossible to instantiate a KSUtils object; just use the static functions).
27 #ifndef KSTARS_KSUTILS_H_
28 #define KSTARS_KSUTILS_H_
30 class QFile;
32 class KSUtils {
33 public:
34 /**Attempt to open the data file named filename, using the QFile object "file".
35 *First look in the standard KDE directories, then look in a local "data"
36 *subdirectory. If the data file cannot be found or opened, display a warning
37 *messagebox.
38 *@short Open a data file.
39 *@param &file The QFile object to be opened
40 *@param filename The name of the data file.
41 *@returns bool Returns true if data file was opened successfully.
42 *@returns a reference to the opened file.
44 static bool openDataFile( QFile &file, const QString &filename );
46 /** Lagrange interpolation using a maximum number of 10 points.
47 *@param x[] double array with x values
48 *@param v[] double array with y values
49 *@param n number of points to use for interpolation
50 *@param xval value for which we are looking for the y value.
52 static long double lagrangeInterpolation(const long double x[], const long double v[], int n, long double xval);
54 private:
55 /**Constructor. This class is just a collection of static functions, so
56 *we have made the constructor private (so it is not possible to
57 *instantiate a KSUtils object).
59 KSUtils();
62 #endif