TrailGroup.hpp   TrailGroup.hpp 
skipping to change at line 27 skipping to change at line 27
* Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA. * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
*/ */
#ifndef TRAILGROUP_HPP #ifndef TRAILGROUP_HPP
#define TRAILGROUP_HPP #define TRAILGROUP_HPP
#include "VecMath.hpp" #include "VecMath.hpp"
#include "StelCore.hpp" #include "StelCore.hpp"
#include "StelObjectType.hpp" #include "StelObjectType.hpp"
class StelPainter;
class TrailGroup class TrailGroup
{ {
public: public:
TrailGroup(float atimeExtent); TrailGroup(float atimeExtent);
~TrailGroup(); void draw(StelCore* core, StelPainter*);
void draw(StelCore* core, class StelRenderer* renderer);
// Add 1 point to all the curves at current time and suppress too ol d points // Add 1 point to all the curves at current time and suppress too ol d points
void update(); void update();
// Set the matrix to use to post process J2000 positions before stor ing in the trail // Set the matrix to use to post process J2000 positions before stor ing in the trail
void setJ2000ToTrailNative(const Mat4d& m); void setJ2000ToTrailNative(const Mat4d& m);
void addObject(const StelObjectP&, const Vec3f* col=NULL); void addObject(const StelObjectP&, const Vec3f* col=NULL);
void setOpacity(float op) void setOpacity(float op) {opacity=op;}
{
opacity = op;
}
//! Reset all trails points //! Reset all trails points
void reset(); void reset();
private: private:
//! Vertex with a position and a color. class Trail
struct ColoredVertex
{
Vec3f position;
Vec4f color;
ColoredVertex(){}
VERTEX_ATTRIBUTES(Vec3f Position, Vec4f Color);
};
struct Trail
{ {
Trail(const StelObjectP& obj, const Vec3f& col) public:
: stelObject(obj), color(col), vertexBuffer(NULL) Trail(const StelObjectP& obj, const Vec3f& col) : stelObject
{ (obj), color(col) {;}
}
StelObjectP stelObject; StelObjectP stelObject;
// Using QVector instead of QList.
// QList is an array of pointers to elements, which are 8 by
te on 64-bit,
// while Vec3f is 12 byte, so not much space saved (or time,
at popFront).
// At the same time, it has a bad cache performance that slo
ws down drawing.
// All previous positions // All previous positions
QVector<Vec3f> posHistory; QList<Vec3d> posHistory;
Vec3f color; Vec3f color;
StelVertexBuffer<ColoredVertex>* vertexBuffer;
}; };
QList<Trail> allTrails; QList<Trail> allTrails;
// Maximum time extent in days // Maximum time extent in days
float timeExtent; float timeExtent;
QList<float> times; QList<float> times;
Mat4d j2000ToTrailNative; Mat4d j2000ToTrailNative;
Mat4d j2000ToTrailNativeInverted; Mat4d j2000ToTrailNativeInverted;
float opacity; float opacity;
//! Last time for which we have positions in history.
//!
//! We only add new positions to history after a long enough interva
l (one minute).
double lastTimeInHistory;
}; };
#endif // TRAILMGR_HPP #endif // TRAILMGR_HPP
 End of changes. 9 change blocks. 
41 lines changed or deleted 9 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/