TrailGroup.hpp
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef TRAILGROUP_HPP
00021 #define TRAILGROUP_HPP
00022
00023 #include "VecMath.hpp"
00024 #include "StelCore.hpp"
00025 #include "StelObjectType.hpp"
00026
00027
00028 class TrailGroup
00029 {
00030 public:
00031 TrailGroup(float atimeExtent);
00032
00033 ~TrailGroup();
00034
00035 void draw(StelCore* core, class StelRenderer* renderer);
00036
00037
00038 void update();
00039
00040
00041 void setJ2000ToTrailNative(const Mat4d& m);
00042
00043 void addObject(const StelObjectP&, const Vec3f* col=NULL);
00044
00045 void setOpacity(float op)
00046 {
00047 opacity = op;
00048 }
00049
00051 void reset();
00052
00053 private:
00055 struct ColoredVertex
00056 {
00057 Vec3f position;
00058 Vec4f color;
00059
00060 ColoredVertex(){}
00061
00062 VERTEX_ATTRIBUTES(Vec3f Position, Vec4f Color);
00063 };
00064
00065 struct Trail
00066 {
00067 Trail(const StelObjectP& obj, const Vec3f& col)
00068 : stelObject(obj), color(col), vertexBuffer(NULL)
00069 {
00070 }
00071
00072 StelObjectP stelObject;
00073
00074
00075
00076
00077
00078
00079
00080 QVector<Vec3f> posHistory;
00081 Vec3f color;
00082 StelVertexBuffer<ColoredVertex>* vertexBuffer;
00083 };
00084
00085 QList<Trail> allTrails;
00086
00087
00088 float timeExtent;
00089
00090 QList<float> times;
00091
00092 Mat4d j2000ToTrailNative;
00093 Mat4d j2000ToTrailNativeInverted;
00094
00095 float opacity;
00096
00100 double lastTimeInHistory;
00101 };
00102
00103 #endif // TRAILMGR_HPP