some more PointNd to Point<N>

This commit is contained in:
Christopher Lackner 2019-09-30 10:50:01 +02:00
parent e956ca0fdc
commit 6bfbaa1179

View File

@ -625,15 +625,12 @@ namespace netgen
if (!morerisc) if (!morerisc)
{ {
// use one end of line // use one end of line
int pini, pouti; int pini = loclines.Get(i).I(innerp);
Vec2d v; int pouti = loclines.Get(i).I(3-innerp);
pini = loclines.Get(i).I(innerp); const auto& pin = plainpoints.Get(pini);
pouti = loclines.Get(i).I(3-innerp); const auto& pout = plainpoints.Get(pouti);
auto v = pout - pin;
Point2d pin (plainpoints.Get(pini));
Point2d pout (plainpoints.Get(pouti));
v = pout - pin;
double len = v.Length(); double len = v.Length();
if (len <= 1e-6) if (len <= 1e-6)
(*testout) << "WARNING(js): inner-outer: short vector" << endl; (*testout) << "WARNING(js): inner-outer: short vector" << endl;
@ -647,12 +644,12 @@ namespace netgen
v *= -1; v *= -1;
*/ */
Point2d newpout = pin + 1000 * v; Point<2> newpout = pin + 1000. * v;
newpout = pout; newpout = pout;
plainpoints.Append (newpout); plainpoints.Append (newpout);
Point3d pout3d = locpoints.Get(pouti); const auto& pout3d = locpoints.Get(pouti);
locpoints.Append (pout3d); locpoints.Append (pout3d);
plainzones.Append (0); plainzones.Append (0);
@ -706,7 +703,7 @@ namespace netgen
{ {
if (plainzones[i] < 0) if (plainzones[i] < 0)
{ {
plainpoints[i] = Point2d (1e4, 1e4); plainpoints[i] = {1e4, 1e4};
legalpoints[i] = 0; legalpoints[i] = 0;
} }
if (pindex[i] == -1) if (pindex[i] == -1)
@ -1780,12 +1777,12 @@ namespace netgen
if (pi1 >= 1 && pi2 >= 1) if (pi1 >= 1 && pi2 >= 1)
{ {
Point2d p1 = plainpoints.Get(pi1); const auto& p1 = plainpoints.Get(pi1);
Point2d p2 = plainpoints.Get(pi2); const auto& p2 = plainpoints.Get(pi2);
glBegin (GL_LINES); glBegin (GL_LINES);
glVertex3f (scalex * p1.X() + shiftx, scaley * p1.Y() + shifty, -5); glVertex3f (scalex * p1[0] + shiftx, scaley * p1[1] + shifty, -5);
glVertex3f (scalex * p2.X() + shiftx, scaley * p2.Y() + shifty, -5); glVertex3f (scalex * p2[0] + shiftx, scaley * p2[1] + shifty, -5);
glEnd(); glEnd();
} }
} }
@ -1796,8 +1793,8 @@ namespace netgen
glBegin (GL_POINTS); glBegin (GL_POINTS);
for (int i = 1; i <= plainpoints.Size(); i++) for (int i = 1; i <= plainpoints.Size(); i++)
{ {
Point2d p = plainpoints.Get(i); const auto& p = plainpoints.Get(i);
glVertex3f (scalex * p.X() + shiftx, scaley * p.Y() + shifty, -5); glVertex3f (scalex * p[0] + shiftx, scaley * p[1] + shifty, -5);
} }
glEnd(); glEnd();