Stellarium 0.15.2
SphericMirrorCalculator.hpp
1 /*
2  * Stellarium
3  * Copyright (C) Fabien Chereau
4  * Author 2006 Johannes Gajdosik
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2
9  * of the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
19  */
20 
21 #ifndef _SPHERICMIRRORCALCULATOR_HPP_
22 #define _SPHERICMIRRORCALCULATOR_HPP_
23 
24 #include "VecMath.hpp"
25 
26 class QSettings;
27 
29 public:
30  SphericMirrorCalculator(const QSettings& conf);
31  float getHorzZoomFactor() const {return horzZoomFactor;}
32  float getVertZoomFactor() const {return vertZoomFactor;}
33  bool transform(const Vec3f &v,float &x,float &y) const;
34  bool retransform(float x,float y,Vec3f &v) const;
35  // for calculating partial derivatives:
36  bool retransform(float x,float y, Vec3f& v, Vec3f& vX, Vec3f& vY) const;
37 private:
38  void initRotMatrix(float alpha,float delta,float phi);
39 private:
40  Vec3f P; // projector
41  Vec3f DomeCenter;
42  float DomeRadius;
43  float PP;
44  float lP;
45  Vec3f p;
46  float horzZoomFactor;
47  float vertZoomFactor;
48  float alphaDeltaPhi[9];
49 };
50 
51 #endif // _SPHERICMIRRORCALCULATOR_HPP_