StelPainter.cpp   StelPainter.cpp 
skipping to change at line 125 skipping to change at line 125
{ {
// Restore openGL projection state for Qt drawings // Restore openGL projection state for Qt drawings
glMatrixMode(GL_TEXTURE); glMatrixMode(GL_TEXTURE);
glPopMatrix(); glPopMatrix();
glMatrixMode(GL_PROJECTION); glMatrixMode(GL_PROJECTION);
glPopMatrix(); glPopMatrix();
glMatrixMode(GL_MODELVIEW); glMatrixMode(GL_MODELVIEW);
glPopMatrix(); glPopMatrix();
glPopAttrib(); glPopAttrib();
glPopClientAttrib(); glPopClientAttrib();
#ifndef NDEBUG
GLenum er = glGetError(); GLenum er = glGetError();
if (er!=GL_NO_ERROR) if (er!=GL_NO_ERROR)
{ {
if (er==GL_INVALID_OPERATION) if (er==GL_INVALID_OPERATION)
qFatal("Invalid openGL operation in StelPainter::rev ertToQtPainting()"); qFatal("Invalid openGL operation in StelPainter::rev ertToQtPainting()");
} }
#endif
} }
void StelPainter::initSystemGLInfo() void StelPainter::initSystemGLInfo()
{ {
// TODO move that in static code // TODO move that in static code
QSettings* conf = StelApp::getInstance().getSettings(); QSettings* conf = StelApp::getInstance().getSettings();
Q_ASSERT(conf); Q_ASSERT(conf);
flagGlPointSprite = conf->value("projection/flag_use_gl_point_sprite ",false).toBool(); flagGlPointSprite = conf->value("projection/flag_use_gl_point_sprite ",false).toBool();
flagGlPointSprite = flagGlPointSprite && GLEE_ARB_point_sprite; flagGlPointSprite = flagGlPointSprite && GLEE_ARB_point_sprite;
if (flagGlPointSprite) if (flagGlPointSprite)
skipping to change at line 559 skipping to change at line 561
glPushMatrix(); glPushMatrix();
glTranslatef(x,y,0); glTranslatef(x,y,0);
glRotatef(angleDeg,0,0,1); glRotatef(angleDeg,0,0,1);
glTranslatef(0,font->getLineHeight(),0); glTranslatef(0,font->getLineHeight(),0);
font->print(xshift, yshift, str); font->print(xshift, yshift, str);
glPopMatrix(); glPopMatrix();
} }
// Recursive method cutting a small circle in small segments // Recursive method cutting a small circle in small segments
void fIter(const StelProjectorP& prj, const Vec3d& p1, const Vec3d& p2, con st Vec3d& win1, const Vec3d& win2, QLinkedList<Vec3d>& vertexList, const QL inkedList<Vec3d>::iterator& iter, double radius, const Vec3d& center, int n bI=0) void fIter(const StelProjectorP& prj, const Vec3d& p1, const Vec3d& p2, Vec 3d& win1, Vec3d& win2, QLinkedList<Vec3d>& vertexList, const QLinkedList<Ve c3d>::iterator& iter, double radius, const Vec3d& center, int nbI=0, bool c heckCrossDiscontinuity=true)
{ {
const bool crossDiscontinuity = checkCrossDiscontinuity && prj->inte
rsectViewportDiscontinuity(p1+center, p2+center);
if (crossDiscontinuity && nbI>=10)
{
win1[2]=-2.;
win2[2]=-2.;
vertexList.insert(iter, win1);
vertexList.insert(iter, win2);
return;
}
Vec3d win3; Vec3d win3;
Vec3d newVertex(p1+p2); Vec3d newVertex(p1+p2);
newVertex.normalize(); newVertex.normalize();
newVertex*=radius; newVertex*=radius;
const bool isValidVertex = prj->project(newVertex+center, win3); const bool isValidVertex = prj->project(newVertex+center, win3);
const Vec3d v1(win1[0]-win3[0], win1[1]-win3[1], 0); const Vec3d v1(win1[0]-win3[0], win1[1]-win3[1], 0);
const Vec3d v2(win2[0]-win3[0], win2[1]-win3[1], 0); const Vec3d v2(win2[0]-win3[0], win2[1]-win3[1], 0);
const double dist = std::sqrt((v1[0]*v1[0]+v1[1]*v1[1])*(v2[0]*v2[0] +v2[1]*v2[1])); const double dist = std::sqrt((v1[0]*v1[0]+v1[1]*v1[1])*(v2[0]*v2[0] +v2[1]*v2[1]));
const double cosAngle = (v1[0]*v2[0]+v1[1]*v2[1])/dist; const double cosAngle = (v1[0]*v2[0]+v1[1]*v2[1])/dist;
if ((cosAngle>-0.999 || dist>50*50) && nbI<10) if ((cosAngle>-0.999 || dist>50*50 || crossDiscontinuity) && nbI<10)
{ {
// Use the 3rd component of the vector to store whether the vertex is valid // Use the 3rd component of the vector to store whether the vertex is valid
win3[2]= isValidVertex ? 1.0 : -1.; win3[2]= isValidVertex ? 1.0 : -1.;
fIter(prj, p1, newVertex, win1, win3, vertexList, vertexList fIter(prj, p1, newVertex, win1, win3, vertexList, vertexList
.insert(iter, win3), radius, center, nbI+1); .insert(iter, win3), radius, center, nbI+1, crossDiscontinuity || dist>50*5
fIter(prj, newVertex, p2, win3, win2, vertexList, iter, radi 0);
us, center, nbI+1); fIter(prj, newVertex, p2, win3, win2, vertexList, iter, radi
us, center, nbI+1, crossDiscontinuity || dist>50*50 );
} }
} }
// Used by the method below // Used by the method below
static QVector<Vec3d> smallCircleVertexArray; static QVector<Vec3d> smallCircleVertexArray;
void drawSmallCircleVertexArray() void drawSmallCircleVertexArray()
{ {
if (smallCircleVertexArray.isEmpty()) if (smallCircleVertexArray.isEmpty())
return; return;
 End of changes. 6 change blocks. 
6 lines changed or deleted 20 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/