StelPainter.hpp   StelPainter.hpp 
skipping to change at line 48 skipping to change at line 48
//! 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 SphericalPolygonDrawModeFill=0, //!<
e interior of the polygon Draw the interior of the polygon
SphericalPolygonDrawModeBoundary=1, //!< Draw th SphericalPolygonDrawModeBoundary=1, //!<
e boundary of the polygon Draw the boundary of the polygon
SphericalPolygonDrawModeTextureFill=2 //!< Draw the interi SphericalPolygonDrawModeTextureFill=2, //!<
or of the polygon filled with the current texture Draw the interior of the polygon filled with the current texture
SphericalPolygonDrawModeTextureFillColormodulated=3 //!<
Draw the interior of the polygon filled with the current texture multiplie
d by vertex colors
}; };
//! Define the drawing mode when drawing vertex //! Define the drawing mode when drawing vertex
enum DrawingMode enum DrawingMode
{ {
Points = 0x0000, //!< GL_POINTS Points = 0x0000, //!< GL_POINTS
Lines = 0x0001, //!< GL_LINES Lines = 0x0001, //!< GL_LINES
LineLoop = 0x0002, //!< GL_LINE_LOOP LineLoop = 0x0002, //!< GL_LINE_LOOP
LineStrip = 0x0003, //!< GL_LINE_STRIP LineStrip = 0x0003, //!< GL_LINE_STRIP
Triangles = 0x0004, //!< GL_TRIANGLES Triangles = 0x0004, //!< GL_TRIANGLES
skipping to change at line 73 skipping to change at line 74
}; };
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 drawViewportShape(void);
void drawViewportShape(const GLfloat innerRadius);
//! 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.
//! @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, const bool noG float xshift=0.f, float yshift=0.f, bool noGravity=true);
ravity=true); void drawText(const Vec3d& v, const QString& str, float angleDeg=0.f
void drawText(const Vec3d& v, const QString& str, const float angleD ,
eg=0.f, float xshift=0.f, float yshift=0.f, bool noGravity=true);
const float xshift=0.f, const float yshift=0.f, co
nst 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, double maxSqDistortion=5.); 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, const bool te xtured, const SphericalCap* clippingCap=NULL, const bool doSubDivide=true, const double maxSqDistortion=5.); void drawSphericalTriangles(const StelVertexArray& va, bool textured , bool colored, const SphericalCap* clippingCap=NULL, 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.
//! 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.
//! 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 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.
void drawGreatCircleArc(const Vec3d& start, const Vec3d& stop, const SphericalCap* clippingCap=NULL, void (*viewportEdgeIntersectCallback)(cons t Vec3d& screenPos, const Vec3d& direction, void* userData)=NULL, void* use rData=NULL); void drawGreatCircleArc(const Vec3d& start, const Vec3d& stop, const SphericalCap* clippingCap=NULL, void (*viewportEdgeIntersectCallback)(cons t Vec3d& screenPos, const Vec3d& direction, void* userData)=NULL, void* use rData=NULL);
//! Draw a simple circle, 2d viewport coordinates in pixel //! Draw a simple circle, 2d viewport coordinates in pixel
void drawCircle(const float x, const 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.
//! @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 drawSprite2dMode(const float x, const float y, float radius); void drawSprite2dMode(float x, float y, float radius);
void drawSprite2dMode(const Vec3d& v, const float radius); void drawSprite2dMode(const Vec3d& v, float radius);
//! Same as drawSprite2dMode but don't scale according to display de vice scaling. //! Same as drawSprite2dMode but don't scale according to display de vice scaling.
void drawSprite2dModeNoDeviceScale(const float x, const float y, con st float radius); void drawSprite2dModeNoDeviceScale(float x, float y, float radius);
//! Draw a rotated square using the current texture at the given pro jected 2d position. //! Draw a rotated square using the current texture at the given pro jected 2d 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.
//! @param rotation rotation angle in degree. //! @param rotation rotation angle in degree.
void drawSprite2dMode(float x, float y, float radius, float rotation ); void drawSprite2dMode(float x, float y, float radius, float rotation );
//! Draw a GL_POINT at the given position. //! Draw a GL_POINT at the given position.
//! @param x x position in the viewport in pixels. //! @param x x position in the viewport in pixels.
//! @param y y position in the viewport in pixels. //! @param y y position in the viewport in pixels.
void drawPoint2d(const float x, const float y); void drawPoint2d(float x, float y);
//! Draw a line between the 2 points. //! Draw a line between the 2 points.
//! @param x1 x position of point 1 in the viewport in pixels. //! @param x1 x position of point 1 in the viewport in pixels.
//! @param y1 y position of point 1 in the viewport in pixels. //! @param y1 y position of point 1 in the viewport in pixels.
//! @param x2 x position of point 2 in the viewport in pixels. //! @param x2 x position of point 2 in the viewport in pixels.
//! @param y2 y position of point 2 in the viewport in pixels. //! @param y2 y position of point 2 in the viewport in pixels.
void drawLine2d(const float x1, const float y1, const float x2, cons t float y2); void drawLine2d(float x1, float y1, float x2, float y2);
//! Draw a rectangle using the current texture at the given projecte d 2d position. //! Draw a rectangle using the current texture at the given projecte d 2d position.
//! This method is not thread safe. //! This method is not thread safe.
//! @param x x position of the top left corner in the viewport in pi xel. //! @param x x position of the top left corner in the viewport in pi xel.
//! @param y y position of the tope left corner in the viewport in p ixel. //! @param y y position of the tope left corner in the viewport in p ixel.
//! @param width width in pixel. //! @param width width in pixel.
//! @param height height in pixel. //! @param height height in pixel.
//! @param textured whether the current texture should be used for p ainting. //! @param textured whether the current texture should be used for p ainting.
void drawRect2d(const float x, const float y, const float width, con st float height, const bool textured=true); void drawRect2d(float x, float y, float width, float height, bool te xtured=true);
//! Re-implementation of gluSphere : glu is overridden for non-stand ard projection. //! Re-implementation of gluSphere : glu is overridden for non-stand ard projection.
//! @param radius //! @param radius
//! @param oneMinusOblateness //! @param oneMinusOblateness
//! @param slices: number of vertical segments ("meridian zones") //! @param slices: number of vertical segments ("meridian zones")
//! @param stacks: number of horizontal segments ("latitude zones") //! @param stacks: number of horizontal segments ("latitude zones")
//! @param orientInside: 1 to have normals point inside, e.g. for la ndscape horizons //! @param orientInside: 1 to have normals point inside, e.g. for la ndscape horizons
//! @param flipTexture: if texture should be mapped to inside of she re, e.g. landscape horizons. //! @param flipTexture: if texture should be mapped to inside of sph ere, e.g. landscape horizons.
//! @param topAngle GZ: new parameter. An opening angle [radians] at top of the sphere. Useful if there is an empty //! @param topAngle GZ: new parameter. An opening angle [radians] at top of the sphere. Useful if there is an empty
//! region around the top pole, like for a spherical equirect angular horizon panorama (@class SphericalLandscape). //! region around the top pole, like for a spherical equirect angular horizon panorama (@class SphericalLandscape).
//! Example: your horizon line (pano photo) goes up to 26 deg rees altitude (highest mountains/trees): //! Example: your horizon line (pano photo) goes up to 26 deg rees altitude (highest mountains/trees):
//! topAngle = 64 degrees = 64*M_PI/180.0f //! topAngle = 64 degrees = 64*M_PI/180.0f
//! @param bottomAngle GZ: new parameter. An opening angle [radians] at bottom of the sphere. Useful if there is an empty //! @param bottomAngle GZ: new parameter. An opening angle [radians] at bottom of the sphere. Useful if there is an empty
//! region around the bottom pole, like for a spherical equir ectangular horizon panorama (SphericalLandscape class). //! region around the bottom pole, like for a spherical equir ectangular horizon panorama (SphericalLandscape class).
//! Example: your light pollution image (pano photo) goes dow n to just -5 degrees altitude (lowest street lamps below you): //! Example: your light pollution image (pano photo) goes dow n to just -5 degrees altitude (lowest street lamps below you):
//! bottomAngle = 95 degrees = 95*M_PI/180.0f //! bottomAngle = 95 degrees = 95*M_PI/180.0f
void sSphere(const float radius, const float oneMinusOblateness, con void sSphere(float radius, float oneMinusOblateness, int slices, int
st int slices, const int stacks, const int orientInside = 0, const bool fli stacks, int orientInside = 0, bool flipTexture = false,
pTexture = false, float topAngle=0.0f, float bottomAngle=M_PI);
const float topAngle=0.0f, const float bott
omAngle=M_PI);
//! Generate a StelVertexArray for a sphere. //! Generate a StelVertexArray for a sphere.
static StelVertexArray computeSphereNoLight(const float radius, cons //! @param radius
t float oneMinusOblateness, const int slices, const int stacks, //! @param oneMinusOblateness
//! @param slices: number of vertical segments ("meridian zones")
const int orientInside = 0, const bool flipTexture = fa //! @param stacks: number of horizontal segments ("latitude zones")
lse); //! @param orientInside: 1 to have normals point inside, e.g. for Mi
lky Way, Zodiacal Light, etc.
//! @param flipTexture: if texture should be mapped to inside of sph
ere, e.g. Milky Way.
//! @param topAngle GZ: new parameter. An opening angle [radians] at
top of the sphere. Useful if there is an empty
//! region around the top pole, like North Galactic Pole.
//! @param bottomAngle GZ: new parameter. An opening angle [radians]
at bottom of the sphere. Useful if there is an empty
//! region around the bottom pole, like South Galactic Pole.
static StelVertexArray computeSphereNoLight(float radius, float oneM
inusOblateness, int slices, int stacks,
int orientInside = 0, bool flipTexture = false,
float topAngle=0.0f, float bottomAngle=M_PI);
//! Re-implementation of gluCylinder : glu is overridden for non-sta ndard projection. //! Re-implementation of gluCylinder : glu is overridden for non-sta ndard projection.
void sCylinder(const float radius, const float height, const int sli ces, const int orientInside = 0); void sCylinder(float radius, float height, int slices, int orientIns ide = 0);
//! Draw a disk with a special texturing mode having texture center at center of disk. //! Draw a disk with a special texturing mode having texture center at center of disk.
//! The disk is made up of concentric circles with increasing refine ment. //! The disk is made up of concentric circles with increasing refine ment.
//! The number of slices of the outmost circle is (innerFanSlices<<l evel). //! The number of slices of the outmost circle is (innerFanSlices<<l evel).
//! @param radius the radius of the disk. //! @param radius the radius of the disk.
//! @param innerFanSlices the number of slices. //! @param innerFanSlices the number of slices.
//! @param level the number of concentric circles. //! @param level the number of concentric circles.
//! @param vertexArr the vertex array in which the resulting vertice s are returned. //! @param vertexArr the vertex array in which the resulting vertice s are returned.
//! @param texCoordArr the vertex array in which the resulting textu re coordinates are returned. //! @param texCoordArr the vertex array in which the resulting textu re coordinates are returned.
static void computeFanDisk(float radius, int innerFanSlices, int lev el, QVector<double>& vertexArr, QVector<float>& texCoordArr); static void computeFanDisk(float radius, int innerFanSlices, int lev el, QVector<double>& vertexArr, QVector<float>& texCoordArr);
//! Draw a fisheye texture in a sphere. //! Draw a fisheye texture in a sphere.
void sSphereMap(const float radius, const int slices, const int stac ks, const float textureFov = 2.f*M_PI, const int orientInside = 0); void sSphereMap(float radius, int slices, int stacks, float textureF ov = 2.f*M_PI, int orientInside = 0);
//! Set the font to use for subsequent text drawing. //! Set the font to use for subsequent text drawing.
void setFont(const QFont& font); void setFont(const QFont& font);
//! Set the color to use for subsequent drawing. //! Set the color to use for subsequent drawing.
void setColor(float r, float g, float b, float a=1.f); void setColor(float r, float g, float b, float a=1.f);
//! Get the color currently used for drawing. //! Get the color currently used for drawing.
Vec4f getColor() const; Vec4f getColor() const;
skipping to change at line 221 skipping to change at line 234
//! Create the OpenGL shaders programs used by the StelPainter. //! Create the OpenGL shaders programs used by the StelPainter.
//! This method needs to be called once at init. //! This method needs to be called once at init.
static void initGLShaders(); static void initGLShaders();
//! Delete the OpenGL shaders objects. //! Delete the OpenGL shaders objects.
//! This method needs to be called once before exit. //! This method needs to be called once before exit.
static void deinitGLShaders(); static void deinitGLShaders();
//! Set whether texturing is enabled. //! Set whether texturing is enabled.
void enableTexture2d(const bool b); void enableTexture2d(bool b);
// Thoses methods should eventually be replaced by a single setVerte xArray // Thoses methods should eventually be replaced by a single setVerte xArray
//! use instead of glVertexPointer //! use instead of glVertexPointer
void setVertexPointer(const int size, const int type, const void* po inter) { void setVertexPointer(int size, int type, const void* pointer) {
vertexArray.size = size; vertexArray.type = type; vertexArra y.pointer = pointer; vertexArray.size = size; vertexArray.type = type; vertexArra y.pointer = pointer;
} }
//! use instead of glTexCoordPointer //! use instead of glTexCoordPointer
void setTexCoordPointer(const int size, const int type, const void* pointer) void setTexCoordPointer(int size, int type, const void* pointer)
{ {
texCoordArray.size = size; texCoordArray.type = type; texCoo rdArray.pointer = pointer; texCoordArray.size = size; texCoordArray.type = type; texCoo rdArray.pointer = pointer;
} }
//! use instead of glColorPointer //! use instead of glColorPointer
void setColorPointer(const int size, const int type, const void* poi nter) void setColorPointer(int size, int type, const void* pointer)
{ {
colorArray.size = size; colorArray.type = type; colorArray.p ointer = pointer; colorArray.size = size; colorArray.type = type; colorArray.p ointer = pointer;
} }
//! use instead of glNormalPointer //! use instead of glNormalPointer
void setNormalPointer(const 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;
} }
//! use instead of glEnableClient //! use instead of glEnableClient
void enableClientStates(const bool vertex, const bool texture=false, const bool color=false, const 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 pointer for each arrays. //! It is equivalent to calling enableClientState and set the array pointer for each arrays.
void setArrays(const Vec3d* vertices, const Vec2f* texCoords=NULL, c onst Vec3f* colorArray=NULL, const Vec3f* normalArray=NULL); void setArrays(const Vec3d* vertices, const Vec2f* texCoords=NULL, c onst Vec3f* colorArray=NULL, const Vec3f* normalArray=NULL);
void setArrays(const Vec3f* vertices, const Vec2f* texCoords=NULL, c onst Vec3f* colorArray=NULL, const Vec3f* normalArray=NULL); void setArrays(const Vec3f* vertices, const Vec2f* texCoords=NULL, c onst 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().
//! @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 NULL, this operation will consume @param co unt 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(const DrawingMode mode, const int count, const in t offset=0, const bool doProj=true, const unsigned short *indices=NULL); void drawFromArray(DrawingMode mode, int count, int offset=0, bool d oProj=true, const unsigned short *indices=NULL);
//! 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, const bool chec kDiscontinuity=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:
friend class StelTextureMgr; friend class StelTextureMgr;
friend class StelTexture; friend class StelTexture;
skipping to change at line 307 skipping to change at line 320
//! 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=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.
//! @param colors a pointer to an array of 3 colors, or NULL if the triangle should not be vertex-colored. If texture and color coords are pres ent, 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=NULL, QVarLengthArray<Vec2f,
4096>* outTexturePos=NULL, const double maxSqDistortion=5., const int nbI= 4096>* outTexturePos=NULL,
0, const Vec3f* colors=NULL, QVarLengthArray<Vec3f, 409
const bool checkDisc1=true, const bool checkDisc2=tr 6>* outColors=NULL,
ue, const bool checkDisc3=true) const; double maxSqDistortion=5., int nbI=0,
bool checkDisc1=true, bool checkDisc2=true, bool checkDisc3=tru
e) const;
void drawTextGravity180(float x, float y, const QString& str, const float xshift = 0, const 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;
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. 26 change blocks. 
48 lines changed or deleted 64 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/