diff --git a/libsrc/csg/csgeom.cpp b/libsrc/csg/csgeom.cpp index a1abe6d6..0cb2c8c2 100644 --- a/libsrc/csg/csgeom.cpp +++ b/libsrc/csg/csgeom.cpp @@ -648,7 +648,8 @@ namespace netgen int CSGeometry :: SetTopLevelObject (Solid * sol, Surface * surf) { - return toplevelobjects.Append (new TopLevelObject (sol, surf)) - 1; + toplevelobjects.Append (new TopLevelObject (sol, surf)); + return toplevelobjects.Size()-1; } TopLevelObject * CSGeometry :: diff --git a/libsrc/csg/edgeflw.cpp b/libsrc/csg/edgeflw.cpp index b2afbfdc..eaced993 100644 --- a/libsrc/csg/edgeflw.cpp +++ b/libsrc/csg/edgeflw.cpp @@ -1158,7 +1158,8 @@ namespace netgen //seg.surfnr2 = s2_rep; seg.surfnr1 = s1; seg.surfnr2 = s2; - hi = refedges.Append (seg); + refedges.Append (seg); + hi = refedges.Size(); refedgesinv.Append (edgeinv); edges_priority.Append((pre_ok[k-1]) ? 1 : 0); } diff --git a/libsrc/csg/polyhedra.cpp b/libsrc/csg/polyhedra.cpp index a09d7433..1bb1d1d2 100644 --- a/libsrc/csg/polyhedra.cpp +++ b/libsrc/csg/polyhedra.cpp @@ -499,7 +499,8 @@ int Polyhedra :: AddPoint (const Point<3> & p) else poly_bbox.Add(p); - return points.Append (p); + points.Append (p); + return points.Size(); } int Polyhedra :: AddFace (int pi1, int pi2, int pi3, int inputnum) diff --git a/libsrc/csg/specpoin.cpp b/libsrc/csg/specpoin.cpp index 10da4bb9..15d41d39 100644 --- a/libsrc/csg/specpoin.cpp +++ b/libsrc/csg/specpoin.cpp @@ -2027,7 +2027,8 @@ namespace netgen if (spi == -1) { - spi = specpoints.Append (SpecialPoint()) - 1; + specpoints.Append (SpecialPoint()); + spi = specpoints.Size()-1; specpoint2point.Append (i); specpoints.Last().unconditional = 0; searchtree.Insert (apoints[i], spi); diff --git a/libsrc/csg/vscsg.cpp b/libsrc/csg/vscsg.cpp index 1f10a003..8fab26bd 100644 --- a/libsrc/csg/vscsg.cpp +++ b/libsrc/csg/vscsg.cpp @@ -416,7 +416,7 @@ namespace netgen const Point3d & p = mesh->Point(i); glRasterPos3d (p.X(), p.Y(), p.Z()); - sprintf (buf, "%d", i); + sprintf (buf, "%d", int(i)); // glCallLists (GLsizei(strlen (buf)), GL_UNSIGNED_BYTE, buf); MyOpenGLText (buf); } diff --git a/libsrc/general/array.hpp b/libsrc/general/array.hpp index 69cf2f30..9c6bcbe5 100644 --- a/libsrc/general/array.hpp +++ b/libsrc/general/array.hpp @@ -293,13 +293,13 @@ namespace netgen /// Add element at end of array. reallocation if necessary. - int Append (const T & el) + void Append (const T & el) { if (size == allocsize) ReSize (size+1); data[size] = el; size++; - return size; + // return size; } template diff --git a/libsrc/interface/wuchemnitz.cpp b/libsrc/interface/wuchemnitz.cpp index 8641a8cd..46872fb0 100644 --- a/libsrc/interface/wuchemnitz.cpp +++ b/libsrc/interface/wuchemnitz.cpp @@ -202,7 +202,8 @@ namespace netgen fa.p1 = i3.I1(); fa.p2 = i3.I2(); fa.p3 = i3.I3(); - facei = faces.Append (fa); + faces.Append (fa); + facei = faces.Size(); faceindex.Set (i3, facei); } @@ -241,7 +242,8 @@ namespace netgen EDGE ed; ed.p1 = i2.I1(); ed.p2 = i2.I2(); - edgei = edges.Append (ed); + edges.Append (ed); + edgei = edges.Size(); edgeindex.Set (i2, edgei); } diff --git a/libsrc/meshing/adfront2.cpp b/libsrc/meshing/adfront2.cpp index 647de0b4..7eb426ad 100644 --- a/libsrc/meshing/adfront2.cpp +++ b/libsrc/meshing/adfront2.cpp @@ -88,7 +88,8 @@ namespace netgen } else { - pi = points.Append (FrontPoint2 (p, globind, mgi, pointonsurface)) - 1; + points.Append (FrontPoint2 (p, globind, mgi, pointonsurface)); + pi = points.Size()-1; } if (mgi) @@ -128,7 +129,8 @@ namespace netgen } else { - li = lines.Append(FrontLine (INDEX_2(pi1, pi2))) - 1; + lines.Append(FrontLine (INDEX_2(pi1, pi2))); + li = lines.Size()-1; } @@ -332,7 +334,8 @@ namespace netgen { pindex.Append (pi); invpindex[pi] = pindex.Size(); - loclines[i][j] = locpoints.Append (points[pi].P()); + locpoints.Append (points[pi].P()); + loclines[i][j] = locpoints.Size(); } else loclines[i][j] = invpindex[pi]; @@ -349,7 +352,8 @@ namespace netgen // Dist2 (points.Get(i).P(), p0) <= xh2 && invpindex[i] <= 0) { - invpindex[i] = locpoints.Append (points[i].P()); + locpoints.Append (points[i].P()); + invpindex[i] = locpoints.Size(); pindex.Append(i); } } diff --git a/libsrc/meshing/adfront3.cpp b/libsrc/meshing/adfront3.cpp index af9ed03c..089b96ab 100644 --- a/libsrc/meshing/adfront3.cpp +++ b/libsrc/meshing/adfront3.cpp @@ -159,8 +159,9 @@ INDEX AdFront3 :: AddFace (const MiniElement2d & aface) for (i = 1; i <= aface.GetNP(); i++) points[aface.PNum(i)].DecFrontNr (minfn+1); - - int nfn = faces.Append(FrontFace (aface)); + + faces.Append(FrontFace (aface)); + int nfn = faces.Size(); faces.Elem(nfn).cluster = cluster; if (hashon && hashcreated) diff --git a/libsrc/meshing/meshclass.hpp b/libsrc/meshing/meshclass.hpp index 1ac00716..9b747ac7 100644 --- a/libsrc/meshing/meshclass.hpp +++ b/libsrc/meshing/meshclass.hpp @@ -577,10 +577,10 @@ namespace netgen /// int AddFaceDescriptor(const FaceDescriptor& fd) - { return facedecoding.Append(fd); } + { facedecoding.Append(fd); return facedecoding.Size(); } int AddEdgeDescriptor(const EdgeDescriptor & fd) - { return edgedecoding.Append(fd) - 1; } + { edgedecoding.Append(fd); return edgedecoding.Size() - 1; } /// DLL_HEADER void SetMaterial (int domnr, const string & mat); diff --git a/libsrc/meshing/ruler2.cpp b/libsrc/meshing/ruler2.cpp index f1c84ee4..a6d5410f 100644 --- a/libsrc/meshing/ruler2.cpp +++ b/libsrc/meshing/ruler2.cpp @@ -593,8 +593,9 @@ namespace netgen Point2d np = rule->GetPoint(i); np.X() += newu (2 * (i-oldnp) - 2); np.Y() += newu (2 * (i-oldnp) - 1); - - pmap.Elem(i) = lpoints.Append (np); + + lpoints.Append (np); + pmap.Elem(i) = lpoints.Size(); } } diff --git a/libsrc/meshing/ruler3.cpp b/libsrc/meshing/ruler3.cpp index c43401ee..e33142bf 100644 --- a/libsrc/meshing/ruler3.cpp +++ b/libsrc/meshing/ruler3.cpp @@ -870,8 +870,8 @@ int Meshing3 :: ApplyRules np.X() += newu (3 * (i-oldnp) - 3); np.Y() += newu (3 * (i-oldnp) - 2); np.Z() += newu (3 * (i-oldnp) - 1); - - pmap.Elem(i) = lpoints.Append (np)-1+PointIndex::BASE; + lpoints.Append (np); + pmap.Elem(i) = lpoints.Size()-1+PointIndex::BASE; } // Set new Faces: diff --git a/libsrc/stlgeom/stlgeom.cpp b/libsrc/stlgeom/stlgeom.cpp index 91f3ab22..a89a1757 100644 --- a/libsrc/stlgeom/stlgeom.cpp +++ b/libsrc/stlgeom/stlgeom.cpp @@ -455,7 +455,8 @@ int STLGeometry :: AddEdge(int ap1, int ap2) STLEdge e(ap1,ap2); e.SetLeftTrig(GetLeftTrig(ap1,ap2)); e.SetRightTrig(GetRightTrig(ap1,ap2)); - return edges.Append(e); + edges.Append(e); + return edges.Size(); } void STLGeometry :: STLDoctorConfirmEdge() diff --git a/libsrc/stlgeom/stlgeom.hpp b/libsrc/stlgeom/stlgeom.hpp index 59a3342e..cb51cfae 100644 --- a/libsrc/stlgeom/stlgeom.hpp +++ b/libsrc/stlgeom/stlgeom.hpp @@ -302,11 +302,11 @@ namespace netgen DLL_HEADER int GetNodeOfSelTrig() const; - int AddNormal(const Vec3d& n) {return normals.Append(n);} + int AddNormal(const Vec3d& n) { normals.Append(n); return normals.Size(); } const Vec3d & GetNormal(int nr) const {return normals.Get(nr);} void SetNormal(int nr, const Vec3d& n) {normals.Elem(nr) = n;} - int AddEdge(const STLEdge& v) {return edges.Append(v);} + int AddEdge(const STLEdge& v) { edges.Append(v); return edges.Size(); } int AddEdge(int p1, int p2); STLEdge GetEdge(int nr) {return edges.Get(nr);} @@ -434,7 +434,7 @@ namespace netgen int ProjectOnWholeSurface (Point<3> & p3d) const; int GetNLines() const {return lines.Size();} - int AddLine(STLLine* line) {return lines.Append(line);} + int AddLine(STLLine* line) { lines.Append(line); return lines.Size(); } STLLine* GetLine(int nr) const {return lines.Get(nr);} int GetLineP(int lnr, int pnr) const {return lines.Get(lnr)->PNum(pnr);} int GetLineNP(int nr) const {return lines.Get(nr)->NP();} diff --git a/libsrc/stlgeom/stltool.cpp b/libsrc/stlgeom/stltool.cpp index 855cec42..ee42da1b 100644 --- a/libsrc/stlgeom/stltool.cpp +++ b/libsrc/stlgeom/stltool.cpp @@ -19,7 +19,8 @@ int AddPointIfNotExists(Array& ap, const Point3d& p, double eps) for (int i = 1; i <= ap.Size(); i++) if (Dist2(ap.Get(i),p) <= eps2 ) return i; - return ap.Append(p); + ap.Append(p); + return ap.Size(); } //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/libsrc/stlgeom/stltopology.cpp b/libsrc/stlgeom/stltopology.cpp index f4078ead..53d3d9f0 100644 --- a/libsrc/stlgeom/stltopology.cpp +++ b/libsrc/stlgeom/stltopology.cpp @@ -592,7 +592,8 @@ void STLTopology :: FindNeighbourTrigs() } else { - enr = topedges.Append (STLTopEdge (pi1, pi2, i, 0)); + topedges.Append (STLTopEdge (pi1, pi2, i, 0)); + enr = topedges.Size(); ht_topedges->Set (i2, enr); trig.EdgeNum(j) = enr; } diff --git a/libsrc/stlgeom/stltopology.hpp b/libsrc/stlgeom/stltopology.hpp index 37c13603..7351615d 100644 --- a/libsrc/stlgeom/stltopology.hpp +++ b/libsrc/stlgeom/stltopology.hpp @@ -293,7 +293,7 @@ public: int GetNP() const { return points.Size(); } - int AddPoint(const Point<3> & p) { return points.Append(p); } + int AddPoint(const Point<3> & p) { points.Append(p); return points.Size(); } const Point<3> & GetPoint(int nr) const { return points.Get(nr); } int GetPointNum (const Point<3> & p); void SetPoint(int nr, const Point<3> & p) { points.Elem(nr) = p; } diff --git a/libsrc/visualization/vssolution.cpp b/libsrc/visualization/vssolution.cpp index a83fd9c0..18b217a4 100644 --- a/libsrc/visualization/vssolution.cpp +++ b/libsrc/visualization/vssolution.cpp @@ -4216,8 +4216,8 @@ namespace netgen Point<3> p2 = locgrid[teti[pi2]]; cppt.lami = p2 + edgelam[ednr] * (p1-p2); - - pnr = pts.Append (cppt)-1; + pts.Append (cppt); + pnr = pts.Size()-1; edges.Set (pair, pnr); }