StelPainter.hpp   StelPainter.hpp 
skipping to change at line 99 skipping to change at line 99
//! @param noGravity don't take into account the fact that the text should be written with gravity. //! @param noGravity don't take into account the fact that the text should be written with gravity.
//! @param v direction vector of object to draw. GZ20120826: Will dr aw only if this is in the visible hemisphere. //! @param v direction vector of object to draw. GZ20120826: Will dr aw only if this is in the visible hemisphere.
void drawText(float x, float y, const QString& str, float angleDeg=0 .f, void drawText(float x, float y, const QString& str, float angleDeg=0 .f,
float xshift=0.f, float yshift=0.f, bool noGravity=true); float xshift=0.f, float yshift=0.f, bool noGravity=true);
void drawText(const Vec3d& v, const QString& str, float angleDeg=0.f , void drawText(const Vec3d& v, const QString& str, float angleDeg=0.f ,
float xshift=0.f, float yshift=0.f, bool noGravity=true); float xshift=0.f, float yshift=0.f, bool noGravity=true);
//! Draw the given SphericalRegion. //! Draw the given SphericalRegion.
//! @param region The SphericalRegion to draw. //! @param region The SphericalRegion to draw.
//! @param drawMode define whether to draw the outline or the fill o r both. //! @param drawMode define whether to draw the outline or the fill o r both.
//! @param clippingCap if not set to NULL, tells the painter to try to clip part of the region outside the cap. //! @param clippingCap if not set to Q_NULLPTR, tells the painter to try to clip part of the region outside the cap.
//! @param doSubDivise if true tesselates the object to follow proje ction distortions. //! @param doSubDivise if true tesselates the object to follow proje ction distortions.
//! Typically set that to false if you think that the region is full y contained in the viewport. //! Typically set that to false if you think that the region is full y contained in the viewport.
void drawSphericalRegion(const SphericalRegion* region, SphericalPol ygonDrawMode drawMode=SphericalPolygonDrawModeFill, const SphericalCap* cli ppingCap=NULL, bool doSubDivise=true, double maxSqDistortion=5.); void drawSphericalRegion(const SphericalRegion* region, SphericalPol ygonDrawMode drawMode=SphericalPolygonDrawModeFill, const SphericalCap* cli ppingCap=Q_NULLPTR, bool doSubDivise=true, double maxSqDistortion=5.);
void drawGreatCircleArcs(const StelVertexArray& va, const SphericalC ap* clippingCap=NULL); void drawGreatCircleArcs(const StelVertexArray& va, const SphericalC ap* clippingCap=Q_NULLPTR);
void drawSphericalTriangles(const StelVertexArray& va, bool textured , bool colored, const SphericalCap* clippingCap=NULL, bool doSubDivide=true , double maxSqDistortion=5.); void drawSphericalTriangles(const StelVertexArray& va, bool textured , bool colored, const SphericalCap* clippingCap=Q_NULLPTR, bool doSubDivide =true, double maxSqDistortion=5.);
//! Draw a small circle arc between points start and stop with rotat ion point in rotCenter. //! Draw a small circle arc between points start and stop with rotat ion point in rotCenter.
//! The angle between start and stop must be < 180 deg. //! The angle between start and stop must be < 180 deg.
//! The algorithm ensures that the line will look smooth, even for n on linear distortion. //! The algorithm ensures that the line will look smooth, even for n on linear distortion.
//! Each time the small circle crosses the edge of the viewport, the viewportEdgeIntersectCallback is called with the //! Each time the small circle crosses the edge of the viewport, the viewportEdgeIntersectCallback is called with the
//! screen 2d position, direction of the currently drawn arc toward the inside of the viewport. //! screen 2d position, direction of the currently drawn arc toward the inside of the viewport.
//! Example: A latitude circle has 0/0/sin(latitude) as rotCenter. //! Example: A latitude circle has 0/0/sin(latitude) as rotCenter.
//! If rotCenter is equal to 0,0,0, the method draws a great circle. //! If rotCenter is equal to 0,0,0, the method draws a great circle.
void drawSmallCircleArc(const Vec3d& start, const Vec3d& stop, const Vec3d& rotCenter, void (*viewportEdgeIntersectCallback)(const Vec3d& scree nPos, const Vec3d& direction, void* userData)=NULL, void* userData=NULL); void drawSmallCircleArc(const Vec3d& start, const Vec3d& stop, const Vec3d& rotCenter, void (*viewportEdgeIntersectCallback)(const Vec3d& scree nPos, const Vec3d& direction, void* userData)=Q_NULLPTR, void* userData=Q_N ULLPTR);
//! Draw a great circle arc between points start and stop. //! Draw a great circle arc between points start and stop.
//! The angle between start and stop must be < 180 deg. //! The angle between start and stop must be < 180 deg.
//! The algorithm ensures that the line will look smooth, even for n on linear distortion. //! The algorithm ensures that the line will look smooth, even for n on linear distortion.
//! Each time the small circle crosses the edge of the viewport, the viewportEdgeIntersectCallback is called with the //! Each time the small circle crosses the edge of the viewport, the viewportEdgeIntersectCallback is called with the
//! screen 2d position, direction of the currently drawn arc toward the inside of the viewport. //! screen 2d position, direction of the currently drawn arc toward the inside of the viewport.
//! @param clippingCap if not set to NULL, tells the painter to try //! @param clippingCap if not set to Q_NULLPTR, tells the painter to
to clip part of the region outside the cap. try to clip part of the region outside the cap.
void drawGreatCircleArc(const Vec3d& start, const Vec3d& stop, const void drawGreatCircleArc(const Vec3d& start, const Vec3d& stop, const
SphericalCap* clippingCap=NULL, void (*viewportEdgeIntersectCallback)(cons SphericalCap* clippingCap=Q_NULLPTR, void (*viewportEdgeIntersectCallback)
t Vec3d& screenPos, const Vec3d& direction, void* userData)=NULL, void* use (const Vec3d& screenPos, const Vec3d& direction, void* userData)=Q_NULLPTR,
rData=NULL); void* userData=Q_NULLPTR);
//! Draw a curve defined by a list of points. //! Draw a curve defined by a list of points.
//! The points should be already tesselated to ensure that the path will look smooth. //! The points should be already tesselated to ensure that the path will look smooth.
//! The algorithm take care of cutting the path if it crosses a view port discontinutiy. //! The algorithm take care of cutting the path if it crosses a view port discontinuity.
void drawPath(const QVector<Vec3d> &points, const QVector<Vec4f> &co lors); void drawPath(const QVector<Vec3d> &points, const QVector<Vec4f> &co lors);
//! Draw a simple circle, 2d viewport coordinates in pixel //! Draw a simple circle, 2d viewport coordinates in pixel
void drawCircle(float x, float y, float r); void drawCircle(float x, float y, float r);
//! Draw a square using the current texture at the given projected 2 d position. //! Draw a square using the current texture at the given projected 2 d position.
//! This method is not thread safe. //! This method is not thread safe.
//! @param x x position in the viewport in pixel. //! @param x x position in the viewport in pixel.
//! @param y y position in the viewport in pixel. //! @param y y position in the viewport in pixel.
//! @param radius the half size of a square side in pixel. //! @param radius the half size of a square side in pixel.
skipping to change at line 290 skipping to change at line 290
//! use instead of glNormalPointer //! use instead of glNormalPointer
void setNormalPointer(int type, const void* pointer) void setNormalPointer(int type, const void* pointer)
{ {
normalArray.size = 3; normalArray.type = type; normalArray.p ointer = pointer; normalArray.size = 3; normalArray.type = type; normalArray.p ointer = pointer;
} }
//! Simulates glEnableClientState, basically you describe what data the ::drawFromArray call has available //! Simulates glEnableClientState, basically you describe what data the ::drawFromArray call has available
void enableClientStates(bool vertex, bool texture=false, bool color= false, bool normal=false); void enableClientStates(bool vertex, bool texture=false, bool color= false, bool normal=false);
//! convenience method that enable and set all the given arrays. //! convenience method that enable and set all the given arrays.
//! It is equivalent to calling enableClientState and set the array //! It is equivalent to calling enableClientStates() and set the arr
pointer for each arrays. ay pointer for each array.
void setArrays(const Vec3d* vertices, const Vec2f* texCoords=NULL, c void setArrays(const Vec3d* vertices, const Vec2f* texCoords=Q_NULLP
onst Vec3f* colorArray=NULL, const Vec3f* normalArray=NULL); TR, const Vec3f* colorArray=Q_NULLPTR, const Vec3f* normalArray=Q_NULLPTR);
void setArrays(const Vec3f* vertices, const Vec2f* texCoords=NULL, c void setArrays(const Vec3f* vertices, const Vec2f* texCoords=Q_NULLP
onst Vec3f* colorArray=NULL, const Vec3f* normalArray=NULL); TR, const Vec3f* colorArray=Q_NULLPTR, const Vec3f* normalArray=Q_NULLPTR);
//! Draws primitives using vertices from the arrays specified by set VertexArray(). //! Draws primitives using vertices from the arrays specified by set Arrays() or enabled via enableClientStates().
//! @param mode The type of primitive to draw. //! @param mode The type of primitive to draw.
//! If @param indices is NULL, this operation will consume @param co unt values from the enabled arrays, starting at @param offset. //! If @param indices is Q_NULLPTR, this operation will consume @par am count values from the enabled arrays, starting at @param offset.
//! Else it will consume @param count elements of @param indices, st arting at @param offset, which are used to index into the //! Else it will consume @param count elements of @param indices, st arting at @param offset, which are used to index into the
//! enabled arrays. //! enabled arrays.
void drawFromArray(DrawingMode mode, int count, int offset=0, bool d oProj=true, const unsigned short *indices=NULL); void drawFromArray(DrawingMode mode, int count, int offset=0, bool d oProj=true, const unsigned short *indices=Q_NULLPTR);
//! Draws the primitives defined in the StelVertexArray. //! Draws the primitives defined in the StelVertexArray.
//! @param checkDiscontinuity will check and suppress discontinuitie s if necessary. //! @param checkDiscontinuity will check and suppress discontinuitie s if necessary.
void drawStelVertexArray(const StelVertexArray& arr, bool checkDisco ntinuity=true); void drawStelVertexArray(const StelVertexArray& arr, bool checkDisco ntinuity=true);
//! Link an opengl program and show a message in case of error or wa rnings. //! Link an opengl program and show a message in case of error or wa rnings.
//! @return true if the link was successful. //! @return true if the link was successful.
static bool linkProg(class QOpenGLShaderProgram* prog, const QString & name); static bool linkProg(class QOpenGLShaderProgram* prog, const QString & name);
private: private:
skipping to change at line 343 skipping to change at line 343
QOpenGLFunctions* gl; QOpenGLFunctions* gl;
} glState; } glState;
// From text-use-opengl-buffer // From text-use-opengl-buffer
static QCache<QByteArray, struct StringTexture> texCache; static QCache<QByteArray, struct StringTexture> texCache;
struct StringTexture* getTexTexture(const QString& str, int pixelSiz e); struct StringTexture* getTexTexture(const QString& str, int pixelSiz e);
//! Struct describing one opengl array //! Struct describing one opengl array
typedef struct ArrayDesc typedef struct ArrayDesc
{ {
ArrayDesc() : size(0), type(0), pointer(NULL), enabled(false ) {} ArrayDesc() : size(0), type(0), pointer(Q_NULLPTR), enabled( false) {}
int size; // The number of coo rdinates per vertex. int size; // The number of coo rdinates per vertex.
int type; // The data type of each coordinate (GL_SHORT, GL_INT, GL_FLOAT, or GL_DOUBLE). int type; // The data type of each coordinate (GL_SHORT, GL_INT, GL_FLOAT, or GL_DOUBLE).
const void* pointer; // Pointer to the first coordinate o f the first vertex in the array. const void* pointer; // Pointer to the first coordinate o f the first vertex in the array.
bool enabled; // Define whether the array is enabled or not. bool enabled; // Define whether the array is enabled or not.
} ArrayDesc; } ArrayDesc;
//! Project an array using the current projection. //! Project an array using the current projection.
//! @return a descriptor of the new array //! @return a descriptor of the new array
ArrayDesc projectArray(const ArrayDesc& array, int offset, int count , const unsigned short *indices=NULL); ArrayDesc projectArray(const ArrayDesc& array, int offset, int count , const unsigned short *indices=Q_NULLPTR);
//! Project the passed triangle on the screen ensuring that it will look smooth, even for non linear distortion //! Project the passed triangle on the screen ensuring that it will look smooth, even for non linear distortion
//! by splitting it into subtriangles. The resulting vertex arrays a re appended to the passed out* ones. //! by splitting it into subtriangles. The resulting vertex arrays a re appended to the passed out* ones.
//! The size of each edge must be < 180 deg. //! The size of each edge must be < 180 deg.
//! @param vertices a pointer to an array of 3 vertices. //! @param vertices a pointer to an array of 3 vertices.
//! @param edgeFlags a pointer to an array of 3 flags indicating whe ther the next segment is an edge. //! @param edgeFlags a pointer to an array of 3 flags indicating whe ther the next segment is an edge.
//! @param texturePos a pointer to an array of 3 texture coordinates //! @param texturePos a pointer to an array of 3 texture coordinates
, or NULL if the triangle should not be textured. , or Q_NULLPTR if the triangle should not be textured.
//! @param colors a pointer to an array of 3 colors, or NULL if the //! @param colors a pointer to an array of 3 colors, or Q_NULLPTR if
triangle should not be vertex-colored. If texture and color coords are pres the triangle should not be vertex-colored. If texture and color coords are
ent, texture is modulated by vertex colors. (e.g. extinction) present, texture is modulated by vertex colors. (e.g. extinction)
void projectSphericalTriangle(const SphericalCap* clippingCap, const Vec3d* vertices, QVarLengthArray<Vec3f, 4096>* outVertices, void projectSphericalTriangle(const SphericalCap* clippingCap, const Vec3d* vertices, QVarLengthArray<Vec3f, 4096>* outVertices,
const Vec2f* texturePos=NULL, QVarLengthArray<Vec2f, const Vec2f* texturePos=Q_NULLPTR, QVarLengthArray<V
4096>* outTexturePos=NULL, ec2f, 4096>* outTexturePos=Q_NULLPTR,
const Vec3f* colors=NULL, QVarLengthArray<Vec3f, 409 const Vec3f* colors=Q_NULLPTR, QVarLengthArray<Vec3f
6>* outColors=NULL, , 4096>* outColors=Q_NULLPTR,
double maxSqDistortion=5., int nbI=0, double maxSqDistortion=5., int nbI=0,
bool checkDisc1=true, bool checkDisc2=true, bool checkDisc3=tru e) const; bool checkDisc1=true, bool checkDisc2=true, bool checkDisc3=tru e) const;
void drawTextGravity180(float x, float y, const QString& str, float xshift = 0, float yshift = 0); void drawTextGravity180(float x, float y, const QString& str, float xshift = 0, float yshift = 0);
// Used by the method below // Used by the method below
static QVector<Vec2f> smallCircleVertexArray; static QVector<Vec2f> smallCircleVertexArray;
static QVector<Vec4f> smallCircleColorArray; static QVector<Vec4f> smallCircleColorArray;
void drawSmallCircleVertexArray(); void drawSmallCircleVertexArray();
 End of changes. 15 change blocks. 
32 lines changed or deleted 32 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/