StelGeodesicGrid.cpp   StelGeodesicGrid.cpp 
skipping to change at line 143 skipping to change at line 143
const int *const corners = icosahedron_triangles[index].corn ers; const int *const corners = icosahedron_triangles[index].corn ers;
h0 = icosahedron_corners[corners[0]]; h0 = icosahedron_corners[corners[0]];
h1 = icosahedron_corners[corners[1]]; h1 = icosahedron_corners[corners[1]];
h2 = icosahedron_corners[corners[2]]; h2 = icosahedron_corners[corners[2]];
} }
else else
{ {
lev--; lev--;
const int i = index>>2; const int i = index>>2;
Triangle &t(triangles[lev][i]); Triangle &t(triangles[lev][i]);
Vec3f c0,c1,c2;
switch (index&3) switch (index&3)
{ {
case 0: case 0:
{ getTriangleCorners(lev,i,c0,c1,c2);
Vec3f c0,c1,c2; h0 = c0;
getTriangleCorners(lev,i,c0,c1,c2); h1 = t.e2;
h0 = c0; h2 = t.e1;
h1 = t.e2;
h2 = t.e1;
}
break; break;
case 1: case 1:
{
Vec3f c0,c1,c2;
getTriangleCorners(lev,i,c0,c1,c2); getTriangleCorners(lev,i,c0,c1,c2);
h0 = t.e2; h0 = t.e2;
h1 = c1; h1 = c1;
h2 = t.e0; h2 = t.e0;
} break;
break; case 2:
case 2:
{
Vec3f c0,c1,c2;
getTriangleCorners(lev,i,c0,c1,c2); getTriangleCorners(lev,i,c0,c1,c2);
h0 = t.e1; h0 = t.e1;
h1 = t.e0; h1 = t.e0;
h2 = c2; h2 = c2;
} break;
break; case 3:
case 3: h0 = t.e0;
h0 = t.e0; h1 = t.e1;
h1 = t.e1; h2 = t.e2;
h2 = t.e2; break;
break;
} }
} }
} }
int StelGeodesicGrid::getPartnerTriangle(int lev, int index) const int StelGeodesicGrid::getPartnerTriangle(int lev, int index) const
{ {
if (lev==0) if (lev==0)
{ {
Q_ASSERT(index<20); Q_ASSERT(index<20);
return (index&1) ? index+1 : index-1; return (index&1) ? index+1 : index-1;
} }
switch(index&7) switch(index&7)
{ {
case 2: case 2:
case 6: case 6:
return index+1; return index+1;
case 3: case 3:
case 7: case 7:
return index-1; return index-1;
case 0: case 0:
return (lev==1) ? index+5 : (getPartnerTriangle(lev-1, index return (lev==1) ? index+5 : (getPartnerTriangle(lev-
>>2)<<2)+1; 1, index>>2)<<2)+1;
case 1: case 1:
return (lev==1) ? index+3 : (getPartnerTriangle(lev-1, index return (lev==1) ? index+3 : (getPartnerTriangle(lev-
>>2)<<2)+0; 1, index>>2)<<2)+0;
case 4: case 4:
return (lev==1) ? index-3 : (getPartnerTriangle(lev-1, index return (lev==1) ? index-3 : (getPartnerTriangle(lev-
>>2)<<2)+1; 1, index>>2)<<2)+1;
case 5: case 5:
return (lev==1) ? index-5 : (getPartnerTriangle(lev-1, index return (lev==1) ? index-5 : (getPartnerTriangle(lev-
>>2)<<2)+0; 1, index>>2)<<2)+0;
default: default:
Q_ASSERT(0); Q_ASSERT(0);
} }
return 0; return 0;
} }
void StelGeodesicGrid::initTriangle(int lev,int index, void StelGeodesicGrid::initTriangle(int lev,int index,
const Vec3f &c0, const Vec3f &c0,
const Vec3f &c1, const Vec3f &c1,
const Vec3f &c2) const Vec3f &c2)
{ {
Q_ASSERT((c0^c1)*c2 >= 0.0); Q_ASSERT((c0^c1)*c2 >= 0.0);
skipping to change at line 339 skipping to change at line 331
bool *corner_inside[12]; bool *corner_inside[12];
for(int ci=0; ci < 12; ci++) corner_inside[ci]= new bool[convex.size ()]; for(int ci=0; ci < 12; ci++) corner_inside[ci]= new bool[convex.size ()];
#else #else
bool corner_inside[12][convex.size()]; bool corner_inside[12][convex.size()];
#endif #endif
for (int h=0;h<convex.size();h++) for (int h=0;h<convex.size();h++)
{ {
const SphericalCap& half_space(convex.at(h)); const SphericalCap& half_space(convex.at(h));
for (int i=0;i<12;i++) for (int i=0;i<12;i++)
{ {
const Vec3f corner = icosahedron_corners[i]; corner_inside[i][h] = half_space.contains(icosahedro
corner_inside[i][h] = n_corners[i]);
half_space.contains(Vec3d(corner[0], corner[
1], corner[2]));
} }
} }
for (int i=0;i<20;i++) for (int i=0;i<20;i++)
{ {
searchZones(0,i, searchZones(0,i,
convex,halfs_used,convex.size(), convex,halfs_used,convex.size(),
corner_inside[icosahedron_triangles[i].corners[0 ]], corner_inside[icosahedron_triangles[i].corners[0 ]],
corner_inside[icosahedron_triangles[i].corners[1 ]], corner_inside[icosahedron_triangles[i].corners[1 ]],
corner_inside[icosahedron_triangles[i].corners[2 ]], corner_inside[icosahedron_triangles[i].corners[2 ]],
inside_list,border_list,maxSearchLevel); inside_list,border_list,maxSearchLevel);
skipping to change at line 423 skipping to change at line 413
bool *edge2_inside = new bool[convex.size()]; bool *edge2_inside = new bool[convex.size()];
#else #else
bool edge0_inside[convex.size()]; bool edge0_inside[convex.size()];
bool edge1_inside[convex.size()]; bool edge1_inside[convex.size()];
bool edge2_inside[convex.size()]; bool edge2_inside[convex.size()];
#endif #endif
for (int h=0;h<halfs_used_count;h++) for (int h=0;h<halfs_used_count;h++)
{ {
const int i = halfs_used[h]; const int i = halfs_used[h];
const SphericalCap& half_space(convex.at(i)) ; const SphericalCap& half_space(convex.at(i)) ;
edge0_inside[i] = half_space.contains(Vec3d( edge0_inside[i] = half_space.contains(t.e0);
t.e0[0], t.e0[1], t.e0[2])); edge1_inside[i] = half_space.contains(t.e1);
edge1_inside[i] = half_space.contains(Vec3d( edge2_inside[i] = half_space.contains(t.e2);
t.e1[0], t.e1[1], t.e1[2]));
edge2_inside[i] = half_space.contains(Vec3d(
t.e2[0], t.e2[1], t.e2[2]));
} }
searchZones(lev,index+0, searchZones(lev,index+0,
convex,halfs_used,halfs_used_count, convex,halfs_used,halfs_used_count,
corner0_inside,edge2_inside,edge1_inside , corner0_inside,edge2_inside,edge1_inside ,
inside_list,border_list,maxSearchLevel); inside_list,border_list,maxSearchLevel);
searchZones(lev,index+1, searchZones(lev,index+1,
convex,halfs_used,halfs_used_count, convex,halfs_used,halfs_used_count,
edge2_inside,corner1_inside,edge0_inside , edge2_inside,corner1_inside,edge0_inside ,
inside_list,border_list,maxSearchLevel); inside_list,border_list,maxSearchLevel);
searchZones(lev,index+2, searchZones(lev,index+2,
 End of changes. 8 change blocks. 
53 lines changed or deleted 40 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/