Stellarium 0.13.3
TrailGroup.hpp
1 /*
2  * Stellarium
3  * Copyright (C) 2010 Fabien Chereau
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License
7  * as published by the Free Software Foundation; either version 2
8  * of the License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
18  */
19 
20 #ifndef TRAILGROUP_HPP
21 #define TRAILGROUP_HPP
22 
23 #include "VecMath.hpp"
24 #include "StelCore.hpp"
25 #include "StelObjectType.hpp"
26 
27 class StelPainter;
28 
30 {
31 public:
32  TrailGroup(float atimeExtent);
33 
34  void draw(StelCore* core, StelPainter*);
35 
36  // Add 1 point to all the curves at current time and suppress too old points
37  void update();
38 
39  // Set the matrix to use to post process J2000 positions before storing in the trail
40  void setJ2000ToTrailNative(const Mat4d& m);
41 
42  void addObject(const StelObjectP&, const Vec3f* col=NULL);
43 
44  void setOpacity(float op) {opacity=op;}
45 
47  void reset();
48 
49 private:
50  class Trail
51  {
52  public:
53  Trail(const StelObjectP& obj, const Vec3f& col) : stelObject(obj), color(col) {;}
54  StelObjectP stelObject;
55  // All previous positions
56  QList<Vec3d> posHistory;
57  Vec3f color;
58  };
59 
60  QList<Trail> allTrails;
61 
62  // Maximum time extent in days
63  float timeExtent;
64 
65  QList<float> times;
66 
67  Mat4d j2000ToTrailNative;
68  Mat4d j2000ToTrailNativeInverted;
69 
70  float opacity;
71 };
72 
73 #endif // TRAILMGR_HPP
Main class for Stellarium core processing.
Definition: StelCore.hpp:46
Define the StelObjectP type.
Provides functions for performing openGL drawing operations.
Definition: StelPainter.hpp:40
void reset()
Reset all trails points.