From c87aea14eb2b00fff331ec348205e50f2deed892 Mon Sep 17 00:00:00 2001 From: Joachim Schoeberl Date: Mon, 12 Feb 2024 07:36:15 +0100 Subject: [PATCH] rename INT to IVec (avoiding windows name conflict) --- libsrc/core/hashtable.hpp | 106 ++++++++++++++--------------- libsrc/geom2d/csg2d.cpp | 6 +- libsrc/meshing/delaunay.cpp | 6 +- libsrc/meshing/delaunay2d.cpp | 20 +++--- libsrc/meshing/delaunay2d.hpp | 5 +- libsrc/meshing/topology.cpp | 117 ++++++++++++++++---------------- libsrc/visualization/mvdraw.hpp | 2 +- libsrc/visualization/vsmesh.cpp | 4 +- 8 files changed, 131 insertions(+), 135 deletions(-) diff --git a/libsrc/core/hashtable.hpp b/libsrc/core/hashtable.hpp index 8ef05200..4ba73451 100644 --- a/libsrc/core/hashtable.hpp +++ b/libsrc/core/hashtable.hpp @@ -41,39 +41,39 @@ namespace ngcore /// N integers template - class INT + class IVec { /// data T i[(N>0)?N:1]; public: /// - NETGEN_INLINE INT () { } + NETGEN_INLINE IVec () { } /// init all - NETGEN_INLINE INT (T ai1) + NETGEN_INLINE IVec (T ai1) { for (int j = 0; j < N; j++) { i[j] = ai1; } } /// init i[0], i[1] - constexpr NETGEN_INLINE INT (T ai1, T ai2) + constexpr NETGEN_INLINE IVec (T ai1, T ai2) : i{ai1, ai2} { ; } /// init i[0], i[1], i[2] - constexpr NETGEN_INLINE INT (T ai1, T ai2, T ai3) + constexpr NETGEN_INLINE IVec (T ai1, T ai2, T ai3) : i{ai1, ai2, ai3} { ; } /// init i[0], i[1], i[2] - constexpr NETGEN_INLINE INT (T ai1, T ai2, T ai3, T ai4) + constexpr NETGEN_INLINE IVec (T ai1, T ai2, T ai3, T ai4) : i{ai1, ai2, ai3, ai4} { ; } /// init i[0], i[1], i[2] - constexpr NETGEN_INLINE INT (T ai1, T ai2, T ai3, T ai4, T ai5) + constexpr NETGEN_INLINE IVec (T ai1, T ai2, T ai3, T ai4, T ai5) : i{ai1, ai2, ai3, ai4, ai5} { ; } /// init i[0], i[1], i[2] - NETGEN_INLINE INT (T ai1, T ai2, T ai3, T ai4, T ai5, T ai6, T ai7, T ai8, T ai9) + NETGEN_INLINE IVec (T ai1, T ai2, T ai3, T ai4, T ai5, T ai6, T ai7, T ai8, T ai9) : i{ai1, ai2, ai3, ai4, ai5, ai6, ai7, ai8, ai9 } { ; } template @@ -83,7 +83,7 @@ namespace ngcore } template - NETGEN_INLINE INT (const INT & in2) + NETGEN_INLINE IVec (const IVec & in2) { if (N2 <= N) { @@ -100,7 +100,7 @@ namespace ngcore } template - NETGEN_INLINE INT (const BaseArrayObject & ao) + NETGEN_INLINE IVec (const BaseArrayObject & ao) { for (int j = 0; j < N; j++) i[j] = ao.Spec()[j]; @@ -108,7 +108,7 @@ namespace ngcore NETGEN_INLINE size_t Size() const { return N; } /// all ints equal ? - NETGEN_INLINE bool operator== (const INT & in2) const + NETGEN_INLINE bool operator== (const IVec & in2) const { for (int j = 0; j < N; j++) if (i[j] != in2.i[j]) return 0; @@ -116,7 +116,7 @@ namespace ngcore } /// any ints unequal ? - NETGEN_INLINE bool operator!= (const INT & in2) const + NETGEN_INLINE bool operator!= (const IVec & in2) const { for (int j = 0; j < N; j++) if (i[j] != in2.i[j]) return 1; @@ -124,7 +124,7 @@ namespace ngcore } /// sort integers - NETGEN_INLINE INT & Sort () & + NETGEN_INLINE IVec & Sort () & { for (int k = 0; k < N; k++) for (int l = k+1; l < N; l++) @@ -133,7 +133,7 @@ namespace ngcore return *this; } - NETGEN_INLINE INT Sort () && + NETGEN_INLINE IVec Sort () && { for (int k = 0; k < N; k++) for (int l = k+1; l < N; l++) @@ -155,7 +155,7 @@ namespace ngcore operator FlatArray () { return FlatArray (N, &i[0]); } - NETGEN_INLINE INT & operator= (T value) + NETGEN_INLINE IVec & operator= (T value) { for (int j = 0; j < N; j++) i[j] = value; @@ -163,7 +163,7 @@ namespace ngcore } template - NETGEN_INLINE INT & operator= (INT v2) + NETGEN_INLINE IVec & operator= (IVec v2) { for (int j = 0; j < N; j++) i[j] = v2[j]; @@ -186,14 +186,14 @@ namespace ngcore /// sort 2 integers template <> - NETGEN_INLINE INT<2> & INT<2>::Sort () & + NETGEN_INLINE IVec<2> & IVec<2>::Sort () & { if (i[0] > i[1]) Swap (i[0], i[1]); return *this; } template <> - NETGEN_INLINE INT<2> INT<2>::Sort () && + NETGEN_INLINE IVec<2> IVec<2>::Sort () && { if (i[0] > i[1]) Swap (i[0], i[1]); return *this; @@ -201,7 +201,7 @@ namespace ngcore /// sort 3 integers template <> - NETGEN_INLINE INT<3> INT<3>::Sort () && + NETGEN_INLINE IVec<3> IVec<3>::Sort () && { if (i[0] > i[1]) Swap (i[0], i[1]); if (i[1] > i[2]) Swap (i[1], i[2]); @@ -211,7 +211,7 @@ namespace ngcore /// Print integers template - inline ostream & operator<<(ostream & s, const INT & i2) + inline ostream & operator<<(ostream & s, const IVec & i2) { for (int j = 0; j < N; j++) s << (int) i2[j] << " "; @@ -219,15 +219,15 @@ namespace ngcore } template - auto begin(const INT & ind) + auto begin(const IVec & ind) { - return AOWrapperIterator> (ind, 0); + return AOWrapperIterator> (ind, 0); } template - auto end(const INT & ind) + auto end(const IVec & ind) { - return AOWrapperIterator> (ind, N); + return AOWrapperIterator> (ind, N); } @@ -236,9 +236,9 @@ namespace ngcore template - NETGEN_INLINE size_t HashValue (const INT & ind, size_t size) + NETGEN_INLINE size_t HashValue (const IVec & ind, size_t size) { - INT lind = ind; + IVec lind = ind; size_t sum = 0; for (int i = 0; i < N; i++) sum += lind[i]; @@ -247,24 +247,24 @@ namespace ngcore /// hash value of 1 int template - NETGEN_INLINE size_t HashValue (const INT<1,TI> & ind, size_t size) + NETGEN_INLINE size_t HashValue (const IVec<1,TI> & ind, size_t size) { return ind[0] % size; } /// hash value of 2 int template - NETGEN_INLINE size_t HashValue (const INT<2,TI> & ind, size_t size) + NETGEN_INLINE size_t HashValue (const IVec<2,TI> & ind, size_t size) { - INT<2,size_t> lind = ind; + IVec<2,size_t> lind = ind; return (113*lind[0]+lind[1]) % size; } /// hash value of 3 int template - NETGEN_INLINE size_t HashValue (const INT<3,TI> & ind, size_t size) + NETGEN_INLINE size_t HashValue (const IVec<3,TI> & ind, size_t size) { - INT<3,size_t> lind = ind; + IVec<3,size_t> lind = ind; return (113*lind[0]+59*lind[1]+lind[2]) % size; } @@ -284,9 +284,9 @@ namespace ngcore template - NETGEN_INLINE size_t HashValue2 (const INT & ind, size_t mask) + NETGEN_INLINE size_t HashValue2 (const IVec & ind, size_t mask) { - INT lind = ind; + IVec lind = ind; size_t sum = 0; for (int i = 0; i < N; i++) sum += lind[i]; @@ -295,24 +295,24 @@ namespace ngcore /// hash value of 1 int template - NETGEN_INLINE size_t HashValue2 (const INT<1,TI> & ind, size_t mask) + NETGEN_INLINE size_t HashValue2 (const IVec<1,TI> & ind, size_t mask) { return ind[0] & mask; } /// hash value of 2 int template - NETGEN_INLINE size_t HashValue2 (const INT<2,TI> & ind, size_t mask) + NETGEN_INLINE size_t HashValue2 (const IVec<2,TI> & ind, size_t mask) { - INT<2,size_t> lind = ind; + IVec<2,size_t> lind = ind; return (113*lind[0]+lind[1]) & mask; } /// hash value of 3 int template - NETGEN_INLINE size_t HashValue2 (const INT<3,TI> & ind, size_t mask) + NETGEN_INLINE size_t HashValue2 (const IVec<3,TI> & ind, size_t mask) { - INT<3,size_t> lind = ind; + IVec<3,size_t> lind = ind; return (113*lind[0]+59*lind[1]+lind[2]) & mask; } @@ -332,7 +332,7 @@ namespace ngcore // using ngstd::max; template - NETGEN_INLINE T Max (const INT & i) + NETGEN_INLINE T Max (const IVec & i) { if (D == 0) return 0; T m = i[0]; @@ -342,7 +342,7 @@ namespace ngcore } template - NETGEN_INLINE T Min (const INT & i) + NETGEN_INLINE T Min (const IVec & i) { if (D == 0) return 0; T m = i[0]; @@ -352,18 +352,18 @@ namespace ngcore } template - NETGEN_INLINE INT Max (INT i1, INT i2) + NETGEN_INLINE IVec Max (IVec i1, IVec i2) { - INT tmp; + IVec tmp; for (int i = 0; i < D; i++) tmp[i] = std::max(i1[i], i2[i]); return tmp; } template - NETGEN_INLINE INT operator+ (INT i1, INT i2) + NETGEN_INLINE IVec operator+ (IVec i1, IVec i2) { - INT tmp; + IVec tmp; for (int i = 0; i < D; i++) tmp[i] = i1[i]+i2[i]; return tmp; @@ -828,21 +828,21 @@ namespace ngcore } template - NETGEN_INLINE size_t HashValue (const INT<3,TI> ind) + NETGEN_INLINE size_t HashValue (const IVec<3,TI> ind) { - INT<3,size_t> lind = ind; + IVec<3,size_t> lind = ind; return 113*lind[0]+59*lind[1]+lind[2]; } template - NETGEN_INLINE size_t HashValue (const INT<2,TI> ind) + NETGEN_INLINE size_t HashValue (const IVec<2,TI> ind) { - INT<2,size_t> lind = ind; + IVec<2,size_t> lind = ind; return 113*lind[0]+lind[1]; } template - NETGEN_INLINE size_t HashValue (const INT<1,TI> ind) + NETGEN_INLINE size_t HashValue (const IVec<1,TI> ind) { return ind[0]; } @@ -1075,7 +1075,7 @@ namespace ngcore #ifdef PARALLEL namespace ngcore { template - class MPI_typetrait > + class MPI_typetrait > { public: /// gets the MPI datatype @@ -1099,7 +1099,7 @@ namespace ngcore template struct MPI_typetrait; template - struct MPI_typetrait > { + struct MPI_typetrait > { static auto MPIType () { return MPI_typetrait>::MPIType(); } @@ -1112,8 +1112,8 @@ namespace std { // structured binding support template - struct tuple_size> : std::integral_constant {}; - template struct tuple_element> { using type = T; }; + struct tuple_size> : std::integral_constant {}; + template struct tuple_element> { using type = T; }; } #endif diff --git a/libsrc/geom2d/csg2d.cpp b/libsrc/geom2d/csg2d.cpp index 20143d15..667c7514 100644 --- a/libsrc/geom2d/csg2d.cpp +++ b/libsrc/geom2d/csg2d.cpp @@ -12,8 +12,6 @@ namespace netgen { -using ngcore::INT; - constexpr static double EPSILON=0.000000001; void ComputeWeight( Spline & s, Point<2> p ) @@ -2037,13 +2035,13 @@ shared_ptr CSG2d :: GenerateSplineGeometry() } netgen::BoxTree <2> solid_tree(box); - Array> loop_list; + Array> loop_list; for(auto i : Range(solids)) for(auto li : Range(solids[i].polys)) { solid_tree.Insert(solids[i].polys[li].GetBoundingBox(), loop_list.Size()); - loop_list.Append(INT<2>(i, li)); + loop_list.Append(IVec<2>(i, li)); } for(auto i1 : Range(solids)) diff --git a/libsrc/meshing/delaunay.cpp b/libsrc/meshing/delaunay.cpp index 51b594b4..2ebc031e 100644 --- a/libsrc/meshing/delaunay.cpp +++ b/libsrc/meshing/delaunay.cpp @@ -840,12 +840,12 @@ namespace netgen tets_with_3_bnd_points.SetSize(cnt); static Timer t1("Build face table"); t1.Start(); - ngcore::ClosedHashTable< ngcore::INT<3>, int > face_table( 4*cnt + 3 ); + ngcore::ClosedHashTable< ngcore::IVec<3>, int > face_table( 4*cnt + 3 ); for(auto ei : tets_with_3_bnd_points) for(auto j : Range(4)) { auto i3_ = tempels[ei].GetFace (j); - ngcore::INT<3> i3 = {i3_[0], i3_[1], i3_[2]}; + ngcore::IVec<3> i3 = {i3_[0], i3_[1], i3_[2]}; if(bnd_points[i3[0]] && bnd_points[i3[1]] && bnd_points[i3[2]]) { i3.Sort(); @@ -860,7 +860,7 @@ namespace netgen for (int i = 1; i <= mesh.GetNOpenElements(); i++) { const Element2d & tri = mesh.OpenElement(i); - ngcore::INT<3> i3(tri[0], tri[1], tri[2]); + ngcore::IVec<3> i3(tri[0], tri[1], tri[2]); i3.Sort(); if(!face_table.Used(i3)) openels.Append(i); diff --git a/libsrc/meshing/delaunay2d.cpp b/libsrc/meshing/delaunay2d.cpp index 7a7b2b2d..c6674719 100644 --- a/libsrc/meshing/delaunay2d.cpp +++ b/libsrc/meshing/delaunay2d.cpp @@ -38,7 +38,7 @@ namespace netgen if(p1 hash = {p0,p1}; + IVec<2> hash = {p0,p1}; auto pos = edge_to_trig.Position(hash); if (pos == -1) return -1; @@ -53,7 +53,7 @@ namespace netgen if(p1 hash = {p0,p1}; + IVec<2> hash = {p0,p1}; auto pos = edge_to_trig.Position(hash); if (pos == -1) edge_to_trig[hash] = {eli, -1}; @@ -80,7 +80,7 @@ namespace netgen if(p1 hash = {p0,p1}; + IVec<2> hash = {p0,p1}; auto pos = edge_to_trig.Position(hash); auto i2 = edge_to_trig.GetData(pos); @@ -256,7 +256,7 @@ namespace netgen { int p1 = trig[k]; int p2 = trig[(k+1)%3]; - INT<2> edge{p1,p2}; + IVec<2> edge{p1,p2}; edge.Sort(); bool found = false; for (int l = 0; l < edges.Size(); l++) @@ -801,13 +801,13 @@ namespace netgen // Mark edges and trigs as inside or outside, starting with boundary edges enum POSITION { UNKNOWN, BOUNDARY, INSIDE, OUTSIDE }; Array trig_pos(tempmesh.SurfaceElements().Size()); - ngcore::ClosedHashTable, POSITION> edge_pos(3*tempmesh.SurfaceElements().Size()); + ngcore::ClosedHashTable, POSITION> edge_pos(3*tempmesh.SurfaceElements().Size()); trig_pos = UNKNOWN; for (auto & seg : tempmesh.LineSegments()) { ArrayMem els; - INT<2> edge{seg[0], seg[1]}; + IVec<2> edge{seg[0], seg[1]}; edge.Sort(); edge_pos[edge] = BOUNDARY; @@ -828,8 +828,8 @@ namespace netgen else pos = OUTSIDE; - INT<2> e1{seg[0], pi2}; - INT<2> e2{seg[1], pi2}; + IVec<2> e1{seg[0], pi2}; + IVec<2> e2{seg[1], pi2}; e1.Sort(); e2.Sort(); if(!edge_pos.Used(e1)) @@ -857,7 +857,7 @@ namespace netgen // any edge of unknown trig already marked? for(auto i : IntRange(3)) { - INT<2> edge{el[(i+1)%3], el[(i+2)%3]}; + IVec<2> edge{el[(i+1)%3], el[(i+2)%3]}; edge.Sort(); if(edge_pos.Used(edge) && edge_pos[edge]!=BOUNDARY) { @@ -871,7 +871,7 @@ namespace netgen if(trig_pos[sei] != UNKNOWN) for(auto i : IntRange(3)) { - INT<2> edge{el[(i+1)%3], el[(i+2)%3]}; + IVec<2> edge{el[(i+1)%3], el[(i+2)%3]}; edge.Sort(); if(!edge_pos.Used(edge) || edge_pos[edge]==BOUNDARY) edge_pos[edge] = trig_pos[sei]; diff --git a/libsrc/meshing/delaunay2d.hpp b/libsrc/meshing/delaunay2d.hpp index 40f3b000..52b3d952 100644 --- a/libsrc/meshing/delaunay2d.hpp +++ b/libsrc/meshing/delaunay2d.hpp @@ -2,7 +2,6 @@ namespace netgen { - using ngcore::INT; static inline Point<2> P2( Point<3> p ) { @@ -44,14 +43,14 @@ namespace netgen class DelaunayMesh { - ngcore::ClosedHashTable, INT<2>> edge_to_trig; + ngcore::ClosedHashTable, IVec<2>> edge_to_trig; Array trigs; unique_ptr> tree; Array, PointIndex> & points; Array closeels; Array intersecting; - Array> edges; + Array> edges; int GetNeighbour( int eli, int edge ); diff --git a/libsrc/meshing/topology.cpp b/libsrc/meshing/topology.cpp index e12fe2cc..e7a87032 100644 --- a/libsrc/meshing/topology.cpp +++ b/libsrc/meshing/topology.cpp @@ -5,7 +5,6 @@ namespace netgen { using ngcore::ParallelForRange; using ngcore::ParallelFor; - using ngcore::INT; using ngcore::TasksPerThread; /* @@ -699,20 +698,20 @@ namespace netgen // edge is splitting edge in middle of triangle: for (int j = 1; j <= 2; j++) { - INT<2> paedge1, paedge2, paedge3; + IVec<2> paedge1, paedge2, paedge3; int orient_inner = 0; if (j == 1) { - paedge1 = INT<2> (pa0[0], verts[1]); - paedge2 = INT<2> (pa0[1], verts[1]); - paedge3 = INT<2> (pa0[0], pa0[1]); + paedge1 = IVec<2> (pa0[0], verts[1]); + paedge2 = IVec<2> (pa0[1], verts[1]); + paedge3 = IVec<2> (pa0[0], pa0[1]); orient_inner = 0; } else { - paedge1 = INT<2> (pa1[0], verts[0]); - paedge2 = INT<2> (pa1[1], verts[0]); - paedge3 = INT<2> (pa1[0], pa1[1]); + paedge1 = IVec<2> (pa1[0], verts[0]); + paedge2 = IVec<2> (pa1[1], verts[0]); + paedge3 = IVec<2> (pa1[0], pa1[1]); orient_inner = 1; } if (paedge1[0] > paedge1[1]) @@ -752,21 +751,21 @@ namespace netgen if (!bisect_edge) // not a bisect edge (then a red edge) { - INT<2> paedge1, paedge2, paedge3; + IVec<2> paedge1, paedge2, paedge3; int orient1 = 0, orient2 = 0, orient3=0; // int orient_inner = 0; - paedge1 = INT<2> (pa0[0], pa0[1]); - paedge2 = INT<2> (pa1[0], pa1[1]); + paedge1 = IVec<2> (pa0[0], pa0[1]); + paedge2 = IVec<2> (pa1[0], pa1[1]); // find common vertex and the third pa edge if (pa0[0]==pa1[0]){// 00 //orient1 = 0; orient2 = 1; if (pa0[1] (pa0[1], pa1[1]); + paedge3 = IVec<2> (pa0[1], pa1[1]); }else{ //orient3 = 0; - paedge3 = INT<2> (pa1[1], pa0[1]); + paedge3 = IVec<2> (pa1[1], pa0[1]); } } else if (pa0[0]==pa1[1]){//01 @@ -774,10 +773,10 @@ namespace netgen //orient2 = 0; if (pa0[1] (pa0[1], pa1[0]); + paedge3 = IVec<2> (pa0[1], pa1[0]); }else{ //orient3 = 0; - paedge3 = INT<2> (pa1[0], pa0[1]); + paedge3 = IVec<2> (pa1[0], pa0[1]); } } else if (pa0[1]==pa1[0]){//10 @@ -785,10 +784,10 @@ namespace netgen orient2 = 1; if (pa0[0] (pa0[0], pa1[1]); + paedge3 = IVec<2> (pa0[0], pa1[1]); }else{ //orient3 = 0; - paedge3 = INT<2> (pa1[1], pa0[0]); + paedge3 = IVec<2> (pa1[1], pa0[0]); } } else if (pa0[1]==pa1[1]){//11 @@ -796,10 +795,10 @@ namespace netgen //orient2 = 0; if (pa0[0] (pa0[0], pa1[0]); + paedge3 = IVec<2> (pa0[0], pa1[0]); }else{ //orient3 = 0; - paedge3 = INT<2> (pa1[0], pa0[0]); + paedge3 = IVec<2> (pa1[0], pa0[0]); } } @@ -832,16 +831,16 @@ namespace netgen pa1[1] != pa2[1]) for (int j = 1; j <= 2; j++) { - INT<2> paedge1, paedge2; + IVec<2> paedge1, paedge2; if (j == 1) { - paedge1 = INT<2> (pa1[0], pa2[0]); - paedge2 = INT<2> (pa1[1], pa2[1]); + paedge1 = IVec<2> (pa1[0], pa2[0]); + paedge2 = IVec<2> (pa1[1], pa2[1]); } else { - paedge1 = INT<2> (pa1[0], pa2[1]); - paedge2 = INT<2> (pa1[1], pa2[0]); + paedge1 = IVec<2> (pa1[0], pa2[1]); + paedge2 = IVec<2> (pa1[1], pa2[0]); } int paedgenr1 = 0, paedgenr2 = 0; @@ -877,7 +876,7 @@ namespace netgen for (int j = 0; j < 2; j++) for (int k = 0; k < 2; k++) { - INT<2> paedge (pa1[1-j], pa2[1-k]); + IVec<2> paedge (pa1[1-j], pa2[1-k]); int orientpa = 1; if (paedge[0] > paedge[1]) { @@ -909,12 +908,12 @@ namespace netgen // edge hashtable:: needed for getting parent faces - ngcore::ClosedHashTable, int> v2e(nv); + ngcore::ClosedHashTable, int> v2e(nv); if (build_parent_faces) for (auto i : Range(edge2vert)) { auto edge = edge2vert[i]; - INT<2> e2(edge[0], edge[1]); + IVec<2> e2(edge[0], edge[1]); e2.Sort(); v2e[e2] = i; } @@ -947,7 +946,7 @@ namespace netgen vert2oldface.AddSave (face2vert[i][0], i); // find all potential intermediate faces - Array> intermediate_faces; + Array> intermediate_faces; if (build_parent_faces) { for (ElementIndex ei = 0; ei < ne; ei++) @@ -957,7 +956,7 @@ namespace netgen // cout << "element: " << (*mesh)[ei].PNums() << endl; (*mesh)[ei].GetFace(i+1, face); // cout << "face " << face.PNums() << endl; - INT<3,PointIndex> f3 = { face[0], face[1], face[2] }; + IVec<3,PointIndex> f3 = { face[0], face[1], face[2] }; for (int j = 0; j < 3; j++) { PointIndex v = f3[j]; @@ -973,10 +972,10 @@ namespace netgen PointIndex v2 = f3[0]+f3[1]+f3[2] - v - v0; // if there is an edge connecting v1 and v2, accept // the new face - INT<2> parentedge(v1, v2); + IVec<2> parentedge(v1, v2); parentedge.Sort(); if (v2e.Used(parentedge)){ - INT<3> cf3 = { v0, v1, v2 }; + IVec<3> cf3 = { v0, v1, v2 }; cf3.Sort(); // cout << "intermediate: " << cf3 << " of " << f3 << endl; intermediate_faces.Append (cf3); @@ -988,7 +987,7 @@ namespace netgen for (SurfaceElementIndex sei = 0; sei < nse; sei++) { const Element2d & sel = (*mesh)[sei]; - INT<3,PointIndex> f3 = { sel[0], sel[1], sel[2] }; + IVec<3,PointIndex> f3 = { sel[0], sel[1], sel[2] }; for (int j = 0; j < 3; j++) { PointIndex v = f3[j]; @@ -1004,10 +1003,10 @@ namespace netgen PointIndex v2 = f3[0]+f3[1]+f3[2] - v - v0; // if there is an edge connecting v1 and v2, accept // the new face - INT<2> parentedge(v1, v2); + IVec<2> parentedge(v1, v2); parentedge.Sort(); if (v2e.Used(parentedge)){ - INT<3> cf3 = { v0, v1, v2 }; + IVec<3> cf3 = { v0, v1, v2 }; cf3.Sort(); // cout << "intermediate: " << cf3 << " of " << f3 << endl; intermediate_faces.Append (cf3); @@ -1377,11 +1376,11 @@ namespace netgen // cout << "f2v = " << face2vert << endl; - ngcore::ClosedHashTable, int> v2f(nv); + ngcore::ClosedHashTable, int> v2f(nv); for (auto i : Range(face2vert)) { auto face = face2vert[i]; - INT<3> f3(face[0], face[1], face[2]); + IVec<3> f3(face[0], face[1], face[2]); f3.Sort(); v2f[f3] = i; } @@ -1393,7 +1392,7 @@ namespace netgen for (auto i : Range(nfa)) { - INT<3,PointIndex> f3(face2vert[i][0], face2vert[i][1], face2vert[i][2]); + IVec<3,PointIndex> f3(face2vert[i][0], face2vert[i][1], face2vert[i][2]); // face on coarses level ? @@ -1433,10 +1432,10 @@ namespace netgen // if there is an edge connecting v1 and v2, accept // the new face - INT<2> parentedge(v1, v2); + IVec<2> parentedge(v1, v2); parentedge.Sort(); if (v2e.Used(parentedge)){ - INT<3> parentverts(v0, v1, v2); + IVec<3> parentverts(v0, v1, v2); parentverts.Sort(); int classnr = 0; @@ -1476,13 +1475,13 @@ namespace netgen PointIndex v1 = parents[1]; PointIndex v2 = f3[(k+1)%3]; PointIndex v3 = f3[(k+2)%3]; - INT<3> parentedge1(v0, v2); + IVec<3> parentedge1(v0, v2); parentedge1.Sort(); - INT<3> parentedge2(v0, v3); + IVec<3> parentedge2(v0, v3); parentedge2.Sort(); - INT<3> parentedge3(v1, v2); + IVec<3> parentedge3(v1, v2); parentedge3.Sort(); - INT<3> parentedge4(v1, v3); + IVec<3> parentedge4(v1, v3); parentedge4.Sort(); // if edges [v0,v2], [v0, v3], [v1,v2], [v1,v3] exists // then vb is the bisecting edge @@ -1507,13 +1506,13 @@ namespace netgen // by default v0 < v1 < vb < v2 < v3 classnr=9; } - INT<3> parentverts1(v0, v2, v3); + IVec<3> parentverts1(v0, v2, v3); parentverts1.Sort(); - INT<3> parentverts2(v1, v2, v3); + IVec<3> parentverts2(v1, v2, v3); parentverts2.Sort(); - INT<3> parentverts3(v0, v1, v2); + IVec<3> parentverts3(v0, v1, v2); parentverts3.Sort(); - INT<3> parentverts4(v0, v1, v3); + IVec<3> parentverts4(v0, v1, v3); parentverts4.Sort(); int pafacenr1=-1, pafacenr2=-1, pafacenr3=-1, pafacenr4=-1; if (v2f.Used(parentverts1)) @@ -1561,13 +1560,13 @@ namespace netgen PointIndex v1 = parents[1]; PointIndex v2 = f3[(k+1)%3]; PointIndex v3 = f3[(k+2)%3]; - INT<2> parentedge1(v0, v2); + IVec<2> parentedge1(v0, v2); parentedge1.Sort(); - INT<2> parentedge2(v0, v3); + IVec<2> parentedge2(v0, v3); parentedge2.Sort(); - INT<2> parentedge3(v1, v2); + IVec<2> parentedge3(v1, v2); parentedge3.Sort(); - INT<2> parentedge4(v1, v3); + IVec<2> parentedge4(v1, v3); parentedge4.Sort(); // if edges [v0,v2], [v0, v3], [v1,v2], [v1,v3] exists @@ -1595,13 +1594,13 @@ namespace netgen } // cout << "classnr = " << classnr << endl; - INT<3> parentverts1(v1, v2, v3); + IVec<3> parentverts1(v1, v2, v3); parentverts1.Sort(); - INT<3> parentverts2(v0, v2, v3); + IVec<3> parentverts2(v0, v2, v3); parentverts2.Sort(); - INT<3> parentverts3(v0, v1, v3); + IVec<3> parentverts3(v0, v1, v3); parentverts3.Sort(); - INT<3> parentverts4(v0, v1, v2); + IVec<3> parentverts4(v0, v1, v2); parentverts4.Sort(); if (!v2f.Used(parentverts1) || !v2f.Used(parentverts2) || @@ -1634,17 +1633,17 @@ namespace netgen // v0 is a coarse vertex ==> f3 is a boundary face if (v0==pa1[0] || v0==pa1[1]){ if (pa1[0]==v0){// type 0: bottom left corner - INT<3> parentverts(v0, pa1[1], pa2[1]); + IVec<3> parentverts(v0, pa1[1], pa2[1]); int pafacenr = v2f[parentverts]; parent_faces[i] = { 16, { pafacenr, -1, -1, -1} }; //cout << "f "< parentverts(pa1[0], v0, pa2[1]); + IVec<3> parentverts(pa1[0], v0, pa2[1]); int pafacenr = v2f[parentverts]; parent_faces[i] = { 17, { pafacenr, -1, -1, -1} }; //cout << "f "< parentverts(pa1[0], pa2[0], v0); + IVec<3> parentverts(pa1[0], pa2[0], v0); int pafacenr = v2f[parentverts]; parent_faces[i] = { 18, { pafacenr, -1, -1, -1} }; //cout << "f "< parentverts(pa0[0], pa0[1], pa1[1]); + IVec<3> parentverts(pa0[0], pa0[1], pa1[1]); int pafacenr = v2f[parentverts]; parent_faces[i] = { 19, { pafacenr, -1, -1, -1} }; //cout << "f "< &p, bool select_on_clipping_plane); bool Unproject(int px, int py, Point<3> &p); - ngcore::INT<2> Project(Point<3> p); + ngcore::IVec<2> Project(Point<3> p); }; NGGUI_API extern VisualSceneMesh vsmesh; diff --git a/libsrc/visualization/vsmesh.cpp b/libsrc/visualization/vsmesh.cpp index 7e439d0f..b1f3971d 100644 --- a/libsrc/visualization/vsmesh.cpp +++ b/libsrc/visualization/vsmesh.cpp @@ -3405,13 +3405,13 @@ namespace netgen return pz<1 && pz>0; } - ngcore::INT<2> VisualSceneMesh :: Project(Point<3> p) + ngcore::IVec<2> VisualSceneMesh :: Project(Point<3> p) { Point<3> pwin; gluProject(p[0], p[1], p[2], transformationmat, select.projmat, select.viewport, &pwin[0], &pwin[1], &pwin[2]); - return ngcore::INT<2>(pwin[0]+0.5, select.viewport[3]-pwin[1]+0.5); + return ngcore::IVec<2>(pwin[0]+0.5, select.viewport[3]-pwin[1]+0.5); }