StelSphereGeometry.cpp   StelSphereGeometry.cpp 
skipping to change at line 461 skipping to change at line 461
va.a=vertices->a; va.a=vertices->a;
va.b=vertices->a;va.b+=vertices->b; va.b=vertices->a;va.b+=vertices->b;
va.b.normalize(); va.b.normalize();
va.c=vertices->c; va.c=vertices->c;
if (NULL != texCoords) if (NULL != texCoords)
{ {
ta.a=texCoords->a; ta.a=texCoords->a;
ta.b=(texCoords->a+texCoords->b)*0.5; ta.b=(texCoords->a+texCoords->b)*0.5;
ta.c=texCoords->c; ta.c=texCoords->c;
} }
projectSphericalTriangle(projector, clippingCap, &va, &ta, b uffer, maxSqDistortion, nbI+1, true, true, false); projectSphericalTriangle(projector, clippingCap, &va, texCoo rds ? &ta : 0, buffer, maxSqDistortion, nbI+1, true, true, false);
//va.a=vertices->a+vertices->b; //va.a=vertices->a+vertices->b;
//va.a.normalize(); //va.a.normalize();
va.a=va.b; va.a=va.b;
va.b=vertices->b; va.b=vertices->b;
va.c=vertices->c; va.c=vertices->c;
if (NULL != texCoords) if (NULL != texCoords)
{ {
ta.a=(texCoords->a+texCoords->b)*0.5; ta.a=(texCoords->a+texCoords->b)*0.5;
ta.b=texCoords->b; ta.b=texCoords->b;
ta.c=texCoords->c; ta.c=texCoords->c;
} }
projectSphericalTriangle(projector, clippingCap, &va, &ta, b uffer, maxSqDistortion, nbI+1, true, false, true); projectSphericalTriangle(projector, clippingCap, &va, texCoo rds ? &ta : 0, buffer, maxSqDistortion, nbI+1, true, false, true);
return; return;
} }
if (!cDiscontinuity1 && cDiscontinuity2 && !cDiscontinuity3) if (!cDiscontinuity1 && cDiscontinuity2 && !cDiscontinuity3)
{ {
va.a=vertices->a; va.a=vertices->a;
va.b=vertices->b; va.b=vertices->b;
va.c=vertices->b;va.c+=vertices->c; va.c=vertices->b;va.c+=vertices->c;
va.c.normalize(); va.c.normalize();
if (NULL != texCoords) if (NULL != texCoords)
{ {
ta.a=texCoords->a; ta.a=texCoords->a;
ta.b=texCoords->b; ta.b=texCoords->b;
ta.c=(texCoords->b+texCoords->c)*0.5; ta.c=(texCoords->b+texCoords->c)*0.5;
} }
projectSphericalTriangle(projector, clippingCap, &va, &ta, b uffer, maxSqDistortion, nbI+1, false, true, true); projectSphericalTriangle(projector, clippingCap, &va, texCoo rds ? &ta : 0, buffer, maxSqDistortion, nbI+1, false, true, true);
va.a=vertices->a; va.a=vertices->a;
//va.b=vertices->b+vertices->c; //va.b=vertices->b+vertices->c;
//va.b.normalize(); //va.b.normalize();
va.b=va.c; va.b=va.c;
va.c=vertices->c; va.c=vertices->c;
if (NULL != texCoords) if (NULL != texCoords)
{ {
ta.a=texCoords->a; ta.a=texCoords->a;
ta.b=(texCoords->b+texCoords->c)*0.5; ta.b=(texCoords->b+texCoords->c)*0.5;
ta.c=texCoords->c; ta.c=texCoords->c;
} }
projectSphericalTriangle(projector, clippingCap, &va, &ta, b uffer, maxSqDistortion, nbI+1, true, true, false); projectSphericalTriangle(projector, clippingCap, &va, texCoo rds ? &ta : 0, buffer, maxSqDistortion, nbI+1, true, true, false);
return; return;
} }
if (!cDiscontinuity1 && !cDiscontinuity2 && cDiscontinuity3) if (!cDiscontinuity1 && !cDiscontinuity2 && cDiscontinuity3)
{ {
va.a=vertices->a; va.a=vertices->a;
va.b=vertices->b; va.b=vertices->b;
va.c=vertices->a;va.c+=vertices->c; va.c=vertices->a;va.c+=vertices->c;
va.c.normalize(); va.c.normalize();
if (NULL != texCoords) if (NULL != texCoords)
{ {
ta.a=texCoords->a; ta.a=texCoords->a;
ta.b=texCoords->b; ta.b=texCoords->b;
ta.c=(texCoords->a+texCoords->c)*0.5; ta.c=(texCoords->a+texCoords->c)*0.5;
} }
projectSphericalTriangle(projector, clippingCap, &va, &ta, b uffer, maxSqDistortion, nbI+1, false, true, true); projectSphericalTriangle(projector, clippingCap, &va, texCoo rds ? &ta : 0, buffer, maxSqDistortion, nbI+1, false, true, true);
//va.a=vertices->a+vertices->c; //va.a=vertices->a+vertices->c;
//va.a.normalize(); //va.a.normalize();
va.a=va.c; va.a=va.c;
va.b=vertices->b; va.b=vertices->b;
va.c=vertices->c; va.c=vertices->c;
if (NULL != texCoords) if (NULL != texCoords)
{ {
ta.a=(texCoords->a+texCoords->c)*0.5; ta.a=(texCoords->a+texCoords->c)*0.5;
ta.b=texCoords->b; ta.b=texCoords->b;
ta.c=texCoords->c; ta.c=texCoords->c;
} }
projectSphericalTriangle(projector, clippingCap, &va, &ta, b uffer, maxSqDistortion, nbI+1, true, false, true); projectSphericalTriangle(projector, clippingCap, &va, texCoo rds ? &ta : 0, buffer, maxSqDistortion, nbI+1, true, false, true);
return; return;
} }
// 2 sides have to be split: split the triangle in 3 // 2 sides have to be split: split the triangle in 3
if (cDiscontinuity1 && cDiscontinuity2 && !cDiscontinuity3) if (cDiscontinuity1 && cDiscontinuity2 && !cDiscontinuity3)
{ {
va.a=vertices->a; va.a=vertices->a;
va.b=vertices->a;va.b+=vertices->b; va.b=vertices->a;va.b+=vertices->b;
va.b.normalize(); va.b.normalize();
va.c=vertices->b;va.c+=vertices->c; va.c=vertices->b;va.c+=vertices->c;
va.c.normalize(); va.c.normalize();
if (NULL != texCoords) if (NULL != texCoords)
{ {
ta.a=texCoords->a; ta.a=texCoords->a;
ta.b=(texCoords->a+texCoords->b)*0.5; ta.b=(texCoords->a+texCoords->b)*0.5;
ta.c=(texCoords->b+texCoords->c)*0.5; ta.c=(texCoords->b+texCoords->c)*0.5;
} }
projectSphericalTriangle(projector, clippingCap, &va, &ta, b uffer, maxSqDistortion, nbI+1); projectSphericalTriangle(projector, clippingCap, &va, texCoo rds ? &ta : 0, buffer, maxSqDistortion, nbI+1);
//va.a=vertices->a+vertices->b; //va.a=vertices->a+vertices->b;
//va.a.normalize(); //va.a.normalize();
va.a=va.b; va.a=va.b;
va.b=vertices->b; va.b=vertices->b;
//va.c=vertices->b+vertices->c; //va.c=vertices->b+vertices->c;
//va.c.normalize(); //va.c.normalize();
if (NULL != texCoords) if (NULL != texCoords)
{ {
ta.a=(texCoords->a+texCoords->b)*0.5; ta.a=(texCoords->a+texCoords->b)*0.5;
ta.b=texCoords->b; ta.b=texCoords->b;
ta.c=(texCoords->b+texCoords->c)*0.5; ta.c=(texCoords->b+texCoords->c)*0.5;
} }
projectSphericalTriangle(projector, clippingCap, &va, &ta, b uffer, maxSqDistortion, nbI+1); projectSphericalTriangle(projector, clippingCap, &va, texCoo rds ? &ta : 0, buffer, maxSqDistortion, nbI+1);
va.a=vertices->a; va.a=vertices->a;
//va.b=vertices->b+vertices->c; //va.b=vertices->b+vertices->c;
//va.b.normalize(); //va.b.normalize();
va.b=va.c; va.b=va.c;
va.c=vertices->c; va.c=vertices->c;
if (NULL != texCoords) if (NULL != texCoords)
{ {
ta.a=texCoords->a; ta.a=texCoords->a;
ta.b=(texCoords->b+texCoords->c)*0.5; ta.b=(texCoords->b+texCoords->c)*0.5;
ta.c=texCoords->c; ta.c=texCoords->c;
} }
projectSphericalTriangle(projector, clippingCap, &va, &ta, b uffer, maxSqDistortion, nbI+1, true, true, false); projectSphericalTriangle(projector, clippingCap, &va, texCoo rds ? &ta : 0, buffer, maxSqDistortion, nbI+1, true, true, false);
return; return;
} }
if (cDiscontinuity1 && !cDiscontinuity2 && cDiscontinuity3) if (cDiscontinuity1 && !cDiscontinuity2 && cDiscontinuity3)
{ {
va.a=vertices->a; va.a=vertices->a;
va.b=vertices->a;va.b+=vertices->b; va.b=vertices->a;va.b+=vertices->b;
va.b.normalize(); va.b.normalize();
va.c=vertices->a;va.c+=vertices->c; va.c=vertices->a;va.c+=vertices->c;
va.c.normalize(); va.c.normalize();
if (NULL != texCoords) if (NULL != texCoords)
{ {
ta.a=texCoords->a; ta.a=texCoords->a;
ta.b=(texCoords->a+texCoords->b)*0.5; ta.b=(texCoords->a+texCoords->b)*0.5;
ta.c=(texCoords->a+texCoords->c)*0.5; ta.c=(texCoords->a+texCoords->c)*0.5;
} }
projectSphericalTriangle(projector, clippingCap, &va, &ta, b uffer, maxSqDistortion, nbI+1); projectSphericalTriangle(projector, clippingCap, &va, texCoo rds ? &ta : 0, buffer, maxSqDistortion, nbI+1);
//va.a=vertices->a+vertices->b; //va.a=vertices->a+vertices->b;
//va.a.normalize(); //va.a.normalize();
va.a=va.b; va.a=va.b;
va.b=vertices->c; va.b=vertices->c;
//va.c=vertices->a+vertices->c; //va.c=vertices->a+vertices->c;
//va.c.normalize(); //va.c.normalize();
if (NULL != texCoords) if (NULL != texCoords)
{ {
ta.a=(texCoords->a+texCoords->b)*0.5; ta.a=(texCoords->a+texCoords->b)*0.5;
ta.b=texCoords->c; ta.b=texCoords->c;
ta.c=(texCoords->a+texCoords->c)*0.5; ta.c=(texCoords->a+texCoords->c)*0.5;
} }
projectSphericalTriangle(projector, clippingCap, &va, &ta, b uffer, maxSqDistortion, nbI+1); projectSphericalTriangle(projector, clippingCap, &va, texCoo rds ? &ta : 0, buffer, maxSqDistortion, nbI+1);
//va.a=vertices->a+vertices->b; //va.a=vertices->a+vertices->b;
//va.a.normalize(); //va.a.normalize();
va.b=vertices->b; va.b=vertices->b;
va.c=vertices->c; va.c=vertices->c;
if (NULL != texCoords) if (NULL != texCoords)
{ {
ta.a=(texCoords->a+texCoords->b)*0.5; ta.a=(texCoords->a+texCoords->b)*0.5;
ta.b=texCoords->b; ta.b=texCoords->b;
ta.c=texCoords->c; ta.c=texCoords->c;
} }
projectSphericalTriangle(projector, clippingCap, &va, &ta, b uffer, maxSqDistortion, nbI+1, true, false, true); projectSphericalTriangle(projector, clippingCap, &va, texCoo rds ? &ta : 0, buffer, maxSqDistortion, nbI+1, true, false, true);
return; return;
} }
if (!cDiscontinuity1 && cDiscontinuity2 && cDiscontinuity3) if (!cDiscontinuity1 && cDiscontinuity2 && cDiscontinuity3)
{ {
va.a=vertices->a; va.a=vertices->a;
va.b=vertices->b; va.b=vertices->b;
va.c=vertices->b;va.c+=vertices->c; va.c=vertices->b;va.c+=vertices->c;
va.c.normalize(); va.c.normalize();
if (NULL != texCoords) if (NULL != texCoords)
{ {
ta.a=texCoords->a; ta.a=texCoords->a;
ta.b=texCoords->b; ta.b=texCoords->b;
ta.c=(texCoords->b+texCoords->c)*0.5; ta.c=(texCoords->b+texCoords->c)*0.5;
} }
projectSphericalTriangle(projector, clippingCap, &va, &ta, b uffer, maxSqDistortion, nbI+1, false, true, true); projectSphericalTriangle(projector, clippingCap, &va, texCoo rds ? &ta : 0, buffer, maxSqDistortion, nbI+1, false, true, true);
//va.a=vertices->b+vertices->c; //va.a=vertices->b+vertices->c;
//va.a.normalize(); //va.a.normalize();
va.a=va.c; va.a=va.c;
va.b=vertices->c; va.b=vertices->c;
va.c=vertices->a;va.c+=vertices->c; va.c=vertices->a;va.c+=vertices->c;
va.c.normalize(); va.c.normalize();
if (NULL != texCoords) if (NULL != texCoords)
{ {
ta.a=(texCoords->b+texCoords->c)*0.5; ta.a=(texCoords->b+texCoords->c)*0.5;
ta.b=texCoords->c; ta.b=texCoords->c;
ta.c=(texCoords->a+texCoords->c)*0.5; ta.c=(texCoords->a+texCoords->c)*0.5;
} }
projectSphericalTriangle(projector, clippingCap, &va, &ta, b uffer, maxSqDistortion, nbI+1); projectSphericalTriangle(projector, clippingCap, &va, texCoo rds ? &ta : 0, buffer, maxSqDistortion, nbI+1);
va.b=va.a; va.b=va.a;
va.a=vertices->a; va.a=vertices->a;
//va.b=vertices->b+vertices->c; //va.b=vertices->b+vertices->c;
//va.b.normalize(); //va.b.normalize();
//va.c=vertices->a+vertices->c; //va.c=vertices->a+vertices->c;
//va.c.normalize(); //va.c.normalize();
if (NULL != texCoords) if (NULL != texCoords)
{ {
ta.a=texCoords->a; ta.a=texCoords->a;
ta.b=(texCoords->b+texCoords->c)*0.5; ta.b=(texCoords->b+texCoords->c)*0.5;
ta.c=(texCoords->a+texCoords->c)*0.5; ta.c=(texCoords->a+texCoords->c)*0.5;
} }
projectSphericalTriangle(projector, clippingCap, &va, &ta, b uffer, maxSqDistortion, nbI+1); projectSphericalTriangle(projector, clippingCap, &va, texCoo rds ? &ta : 0, buffer, maxSqDistortion, nbI+1);
return; return;
} }
// Last case: the 3 sides have to be split: cut in 4 triangles a' la HTM // Last case: the 3 sides have to be split: cut in 4 triangles a' la HTM
va.a=vertices->a;va.a+=vertices->b; va.a=vertices->a;va.a+=vertices->b;
va.a.normalize(); va.a.normalize();
va.b=vertices->b;va.b+=vertices->c; va.b=vertices->b;va.b+=vertices->c;
va.b.normalize(); va.b.normalize();
va.c=vertices->a;va.c+=vertices->c; va.c=vertices->a;va.c+=vertices->c;
va.c.normalize(); va.c.normalize();
if (NULL != texCoords) if (NULL != texCoords)
{ {
ta.a=(texCoords->a+texCoords->b)*0.5; ta.a=(texCoords->a+texCoords->b)*0.5;
ta.b=(texCoords->b+texCoords->c)*0.5; ta.b=(texCoords->b+texCoords->c)*0.5;
ta.c=(texCoords->a+texCoords->c)*0.5; ta.c=(texCoords->a+texCoords->c)*0.5;
} }
projectSphericalTriangle(projector, clippingCap, &va, &ta, buffer, m axSqDistortion, nbI+1); projectSphericalTriangle(projector, clippingCap, &va, texCoords ? &t a : 0, buffer, maxSqDistortion, nbI+1);
va.b=va.a; va.b=va.a;
va.a=vertices->a; va.a=vertices->a;
//va.b=vertices->a+vertices->b; //va.b=vertices->a+vertices->b;
//va.b.normalize(); //va.b.normalize();
//va.c=vertices->a+vertices->c; //va.c=vertices->a+vertices->c;
//va.c.normalize(); //va.c.normalize();
if (NULL != texCoords) if (NULL != texCoords)
{ {
ta.a=texCoords->a; ta.a=texCoords->a;
ta.b=(texCoords->a+texCoords->b)*0.5; ta.b=(texCoords->a+texCoords->b)*0.5;
ta.c=(texCoords->a+texCoords->c)*0.5; ta.c=(texCoords->a+texCoords->c)*0.5;
} }
projectSphericalTriangle(projector, clippingCap, &va, &ta, buffer, m axSqDistortion, nbI+1); projectSphericalTriangle(projector, clippingCap, &va, texCoords ? &t a : 0, buffer, maxSqDistortion, nbI+1);
//va.a=vertices->a+vertices->b; //va.a=vertices->a+vertices->b;
//va.a.normalize(); //va.a.normalize();
va.a=va.b; va.a=va.b;
va.b=vertices->b; va.b=vertices->b;
va.c=vertices->b;va.c+=vertices->c; va.c=vertices->b;va.c+=vertices->c;
va.c.normalize(); va.c.normalize();
if (NULL != texCoords) if (NULL != texCoords)
{ {
ta.a=(texCoords->a+texCoords->b)*0.5; ta.a=(texCoords->a+texCoords->b)*0.5;
ta.b=texCoords->b; ta.b=texCoords->b;
ta.c=(texCoords->b+texCoords->c)*0.5; ta.c=(texCoords->b+texCoords->c)*0.5;
} }
projectSphericalTriangle(projector, clippingCap, &va, &ta, buffer, m axSqDistortion, nbI+1); projectSphericalTriangle(projector, clippingCap, &va, texCoords ? &t a : 0, buffer, maxSqDistortion, nbI+1);
va.a=vertices->a;va.a+=vertices->c; va.a=vertices->a;va.a+=vertices->c;
va.a.normalize(); va.a.normalize();
//va.b=vertices->b+vertices->c; //va.b=vertices->b+vertices->c;
//va.b.normalize(); //va.b.normalize();
va.b=va.c; va.b=va.c;
va.c=vertices->c; va.c=vertices->c;
if (NULL != texCoords) if (NULL != texCoords)
{ {
ta.a=(texCoords->a+texCoords->c)*0.5; ta.a=(texCoords->a+texCoords->c)*0.5;
ta.b=(texCoords->b+texCoords->c)*0.5; ta.b=(texCoords->b+texCoords->c)*0.5;
ta.c=texCoords->c; ta.c=texCoords->c;
} }
projectSphericalTriangle(projector, clippingCap, &va, &ta, buffer, m axSqDistortion, nbI+1); projectSphericalTriangle(projector, clippingCap, &va, texCoords ? &t a : 0, buffer, maxSqDistortion, nbI+1);
return; return;
} }
//! Prepare a cached vertex buffer for update, constructing it if needed, u nlocking and clearing. //! Prepare a cached vertex buffer for update, constructing it if needed, u nlocking and clearing.
//! //!
//! @param buffer Pointer to pointer to buffer to prepare. //! @param buffer Pointer to pointer to buffer to prepare.
//! @param renderer Renderer to construct the buffer if not constructed yet . //! @param renderer Renderer to construct the buffer if not constructed yet .
template<class V> template<class V>
void prepareVertexBufferUpdate(StelVertexBuffer<V>** buffer, StelRenderer* renderer) void prepareVertexBufferUpdate(StelVertexBuffer<V>** buffer, StelRenderer* renderer)
skipping to change at line 756 skipping to change at line 756
//! @param triangle Positions of vertices in the triangle. //! @param triangle Positions of vertices in the triangle.
bool triangleIntersectsDiscontinuity(StelProjector* projector, const Triple t<Vec3d>& triangle) bool triangleIntersectsDiscontinuity(StelProjector* projector, const Triple t<Vec3d>& triangle)
{ {
return projector->intersectViewportDiscontinuity(triangle.a, triangl e.b) || return projector->intersectViewportDiscontinuity(triangle.a, triangl e.b) ||
projector->intersectViewportDiscontinuity(triangle.b, triangl e.c) || projector->intersectViewportDiscontinuity(triangle.b, triangl e.c) ||
projector->intersectViewportDiscontinuity(triangle.c, triangl e.a); projector->intersectViewportDiscontinuity(triangle.c, triangl e.a);
} }
void SphericalRegion::updateFillVertexBuffer(StelRenderer* renderer, const DrawParams& params, bool handleDiscontinuity) void SphericalRegion::updateFillVertexBuffer(StelRenderer* renderer, const DrawParams& params, bool handleDiscontinuity)
{ {
const QVector<Vec3d>& vertices = getOctahedronPolygon().fillVertices const OctahedronPolygon &octahedron = getOctahedronPolygon();
(); const QVector<Vec3d>& vertices = octahedron.fillVertices();
StelProjector* projector = params.projector_; StelProjector* projector = params.projector_;
prepareVertexBufferUpdate(&fillPlainVertexBuffer, renderer); prepareVertexBufferUpdate(&fillPlainVertexBuffer, renderer);
if(!params.subdivide_) if(!params.subdivide_)
{ {
// The simplest case, we don't need to iterate through the t riangles at all. // The simplest case, we don't need to iterate through the t riangles at all.
if (handleDiscontinuity) if (handleDiscontinuity)
{ {
// We don't use indices here, since we don't have a vertex buffer yet. // We don't use indices here, since we don't have a vertex buffer yet.
 End of changes. 20 change blocks. 
21 lines changed or deleted 21 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/