StelPainter.hpp   StelPainter.hpp 
skipping to change at line 102 skipping to change at line 102
Vec4f emission; Vec4f emission;
float shininess; float shininess;
}; };
//! @class StelPainter //! @class StelPainter
//! Provides functions for performing openGL drawing operations. //! Provides functions for performing openGL drawing operations.
//! All coordinates are converted using the StelProjector instance passed a t construction. //! All coordinates are converted using the StelProjector instance passed a t construction.
//! Because openGL is not thread safe, only one instance of StelPainter can exist at a time, enforcing thread safety. //! Because openGL is not thread safe, only one instance of StelPainter can exist at a time, enforcing thread safety.
//! As a coding rule, no openGL calls should be performed when no instance of StelPainter exist. //! As a coding rule, no openGL calls should be performed when no instance of StelPainter exist.
//! Typical usage is to create a local instance of StelPainter where drawin g operations are needed. //! Typical usage is to create a local instance of StelPainter where drawin g operations are needed.
class StelPainter class StelPainter
{ {
public: public:
friend class VertexArrayProjector; friend class VertexArrayProjector;
//! Define the drawing mode when drawing polygons //! Define the drawing mode when drawing polygons
enum SphericalPolygonDrawMode enum SphericalPolygonDrawMode
{ {
SphericalPolygonDrawModeFill=0, //!< Draw th e interior of the polygon SphericalPolygonDrawModeFill=0, //!< Draw th e interior of the polygon
SphericalPolygonDrawModeBoundary=1, //!< Draw th e boundary of the polygon SphericalPolygonDrawModeBoundary=1, //!< Draw th e boundary of the polygon
skipping to change at line 143 skipping to change at line 142
}; };
explicit StelPainter(const StelProjectorP& prj); explicit StelPainter(const StelProjectorP& prj);
~StelPainter(); ~StelPainter();
//! Return the instance of projector associated to this painter //! Return the instance of projector associated to this painter
const StelProjectorP& getProjector() const {return prj;} const StelProjectorP& getProjector() const {return prj;}
void setProjector(const StelProjectorP& p); void setProjector(const StelProjectorP& p);
//! Fill with black around the viewport. //! Fill with black around the viewport.
void drawViewportShape(void); void drawViewportShape();
//! Draw the string at the given position and angle with the given f ont. //! Draw the string at the given position and angle with the given f ont.
//! If the gravity label flag is set, uses drawTextGravity180. //! If the gravity label flag is set, uses drawTextGravity180.
//! @param x horizontal position of the lower left corner of the fir st character of the text in pixel. //! @param x horizontal position of the lower left corner of the fir st character of the text in pixel.
//! @param y horizontal position of the lower left corner of the fir st character of the text in pixel. //! @param y horizontal position of the lower left corner of the fir st character of the text in pixel.
//! @param str the text to print. //! @param str the text to print.
//! @param angleDeg rotation angle in degree. Rotation is around x,y . //! @param angleDeg rotation angle in degree. Rotation is around x,y .
//! @param xshift shift in pixel in the rotated x direction. //! @param xshift shift in pixel in the rotated x direction.
//! @param yshift shift in pixel in the rotated y direction. //! @param yshift shift in pixel in the rotated y direction.
//! @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.
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) const; 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) const; 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 NULL, 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); void drawSphericalRegion(const SphericalRegion* region, SphericalPol ygonDrawMode drawMode=SphericalPolygonDrawModeFill, const SphericalCap* cli ppingCap=NULL, 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=NULL);
void drawSphericalTriangles(const StelVertexArray& va, bool textured , const SphericalCap* clippingCap=NULL, bool doSubDivide=true); void drawSphericalTriangles(const StelVertexArray& va, bool textured , const SphericalCap* clippingCap=NULL, bool doSubDivide=true, double maxSq Distortion=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.
//! 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)=NULL, void* userData=NULL);
//! Draw a great circle arc between points start and stop. //! Draw a great circle arc between points start and stop.
skipping to change at line 335 skipping to change at line 334
void setArrays(const Vec3d* vertice, const Vec2f* texCoords=NULL, co nst Vec3f* colorArray=NULL, const Vec3f* normalArray=NULL); void setArrays(const Vec3d* vertice, const Vec2f* texCoords=NULL, co nst Vec3f* colorArray=NULL, const Vec3f* normalArray=NULL);
//! Draws primitives using vertices from the arrays specified by set VertexArray(). //! Draws primitives using vertices from the arrays specified by set VertexArray().
//! The type of primitive to draw is specified by mode. //! The type of primitive to draw is specified by mode.
//! If indices is NULL, this operation will consume count values fro m the enabled arrays, starting at offset. //! If indices is NULL, this operation will consume count values fro m the enabled arrays, starting at offset.
//! Else it will consume count elements of indices, starting at offs et, which are used to index into the //! Else it will consume count elements of indices, starting at offs et, 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 int* indices=NULL); void drawFromArray(DrawingMode mode, int count, int offset=0, bool d oProj=true, const unsigned int* indices=NULL);
//! Draws the primitives defined in the StelVertexArray. //! Draws the primitives defined in the StelVertexArray.
void drawStelVertexArray(const StelVertexArray& arr); //! @param checkDiscontinuity will check and suppress discontinuitie
s if necessary.
void drawStelVertexArray(const StelVertexArray& arr, bool checkDisco
ntinuity=true);
private: private:
friend class StelTextureMgr; friend class StelTextureMgr;
friend class StelTexture; friend class StelTexture;
//! Struct describing one opengl array //! Struct describing one opengl array
typedef struct typedef struct
{ {
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).
skipping to change at line 361 skipping to change at line 361
//! @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 int* indices=NULL); ArrayDesc projectArray(const ArrayDesc& array, int offset, int count , const unsigned int* indices=NULL);
//! 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 , or NULL if the triangle should not be textured. //! @param texturePos a pointer to an array of 3 texture coordinates , or NULL if the triangle should not be textured.
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, 4096>* outTexturePos=NULL,int nbI=0, const Vec2f* texturePos=NULL, QVarLengthArray<Vec2f, 4096>* outTexturePos=NULL, double maxSqDistortion=5., int nbI=0,
bool checkDisc1=true, bool checkDisc2=true, bool che ckDisc3=true) const; bool checkDisc1=true, bool checkDisc2=true, bool che ckDisc3=true) const;
void drawTextGravity180(float x, float y, const QString& str, float xshift = 0, float yshift = 0) const; 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;
void drawSmallCircleVertexArray(); void drawSmallCircleVertexArray();
//! The associated instance of projector //! The associated instance of projector
StelProjectorP prj; StelProjectorP prj;
#ifndef NDEBUG #ifndef NDEBUG
//! Mutex allowing thread safety //! Mutex allowing thread safety
 End of changes. 9 change blocks. 
9 lines changed or deleted 11 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/