31 #ifndef poly_Mesh_HeaderFile
32 #define poly_Mesh_HeaderFile
35 #include <mobius/poly_Edge.h>
36 #include <mobius/poly_Jacobian.h>
37 #include <mobius/poly_Quad.h>
38 #include <mobius/poly_SurfAdapter.h>
39 #include <mobius/poly_Triangle.h>
40 #include <mobius/poly_Vertex.h>
43 #include <mobius/core_IAlgorithm.h>
44 #include <mobius/core_Precision.h>
47 #include <mobius/geom_PlaneSurface.h>
52 #include <unordered_map>
53 #include <unordered_set>
58 class geom_PlaneSurface;
72 mobiusPoly_EXPORT
static void
85 mobiusPoly_EXPORT
static bool
96 mobiusPoly_EXPORT
static double
103 mobiusPoly_EXPORT
static bool
125 template <
typename ElemTraits = poly_Traits>
141 typedef std::map< poly_TriangleHandle, std::unordered_set<poly_TriangleHandle> >
t_adjacencyMx;
171 copy->__triangles.push_back(t);
199 t_ptr< poly_Mesh<ElemTraits> >
206 std::unordered_map<poly_VertexHandle, poly_VertexHandle> ovh2rvh;
210 if ( tids.find(tit.Current().iIdx) == tids.end() )
219 t.GetVertices(hv0, hv1, hv2);
224 auto vhpair = ovh2rvh.find(hv0);
225 if ( vhpair != ovh2rvh.cend() )
228 hv0 = (*vhpair).second;
242 vhpair = ovh2rvh.find(hv1);
243 if ( vhpair != ovh2rvh.cend() )
246 hv1 = (*vhpair).second;
260 vhpair = ovh2rvh.find(hv2);
261 if ( vhpair != ovh2rvh.cend() )
264 hv2 = (*vhpair).second;
280 region->ChangeTriangle(newTh).traits = t.traits;
293 other->GetTriangle(tit.Current(), t);
298 t.GetVertices(hv0, hv1, hv2);
301 other->GetVertex(hv0, v);
304 other->GetVertex(hv1, v);
307 other->GetVertex(hv2, v);
324 std::unordered_set<poly_TriangleHandle>& region)
330 std::unordered_set<poly_TriangleHandle> processedRows;
331 std::stack<poly_TriangleHandle> stack;
334 while ( !stack.empty() )
336 const auto& next = stack.top();
339 processedRows.insert(next);
341 const auto& row = mx.find(next);
343 for (
const auto& curr : row->second )
347 if ( processedRows.find(curr) == processedRows.end() )
358 std::unordered_set<poly_TriangleHandle>& region)
365 std::unordered_set<poly_TriangleHandle> adjacent;
368 adj.insert({tit.Current(), adjacent});
384 std::unordered_set<poly_TriangleHandle> adjacent;
387 adj.insert({tit.Current(), adjacent});
391 std::unordered_set<poly_TriangleHandle> processed;
393 for (
const auto& tuple : adj )
398 if ( processed.find(curr) != processed.end() )
401 std::unordered_set<poly_TriangleHandle> nextRegion;
405 processed.insert( nextRegion.begin(), nextRegion.end() );
408 ccomps.push_back(nextRegion);
432 mobiusPoly_EXPORT
bool
443 mobiusPoly_EXPORT
bool
445 const std::vector<poly_EdgeHandle>& ehs0,
446 const std::vector<poly_EdgeHandle>& ehs1)
const;
451 mobiusPoly_EXPORT
bool
465 double& yMin,
double& yMax,
466 double& zMin,
double& zMax)
const
468 double x_min = DBL_MAX, x_max = -DBL_MAX;
469 double y_min = DBL_MAX, y_max = -DBL_MAX;
470 double z_min = DBL_MAX, z_max = -DBL_MAX;
475 const double x = V.X(),
557 t.GetVertices(htv[0], htv[1], htv[2]);
592 static double pntWg[] =
594 1. / 3., 1. / 3., 1. / 2.,
595 1. / 6., 1. / 6., 1. / 6.,
596 2. / 3., 1. / 6., 1. / 6.,
597 1. / 6., 2. / 3., 1. / 6.
601 double* gaussPnts = &pntWg[0];
602 if ( density == PropsComputationDensity::ThreePoints )
605 gaussPnts = &pntWg[3];
609 double gProps[10] = { 0., 0., 0., 0., 0., 0., 0., 0., 0., 0 };
633 firstAxisOfInertia =
core_XYZ(gProps[1], gProps[2], gProps[3]);
634 secondAxisOfInertia =
core_XYZ(gProps[4], gProps[5], gProps[6]);
635 thirdAxisOfInertia =
core_XYZ(gProps[7], gProps[8], gProps[9]);
657 t.GetVertices(htv[0], htv[1], htv[2]);
661 for (
size_t k = 0; k < 3; ++k )
674 ht0 = this->
AddTriangle( htv[0], htv[1], hmv, t.GetFaceRef() );
675 ht1 = this->
AddTriangle( hmv, htv[1], htv[2], t.GetFaceRef() );
676 ht2 = this->
AddTriangle( htv[0], hmv, htv[2], t.GetFaceRef() );
699 std::vector<poly_TriangleHandle>& hts)
711 t.GetVertices(hv[0], hv[1], hv[2]);
722 for (
int j = 0; j < 3; ++j )
724 if ( hes[j].iIdx == Mobius_InvalidHandleIndex )
738 hmv[0] = this->
AddVertex( 0.5*(v[0] + v[1]) );
739 hmv[1] = this->
AddVertex( 0.5*(v[1] + v[2]) );
740 hmv[2] = this->
AddVertex( 0.5*(v[2] + v[0]) );
742 std::unordered_map<poly_EdgeHandle, poly_VertexHandle> eSplits;
743 eSplits.insert({hes[0], hmv[0]});
744 eSplits.insert({hes[1], hmv[1]});
745 eSplits.insert({hes[2], hmv[2]});
748 hts.push_back( this->
AddTriangle( hv [0], hmv[0], hmv[2], t.GetFaceRef() ) );
749 hts.push_back( this->
AddTriangle( hmv[0], hv [1], hmv[1], t.GetFaceRef() ) );
750 hts.push_back( this->
AddTriangle( hmv[1], hv [2], hmv[2], t.GetFaceRef() ) );
751 hts.push_back( this->
AddTriangle( hmv[0], hmv[1], hmv[2], t.GetFaceRef() ) );
754 std::unordered_map<poly_Edge, std::pair<poly_TriangleHandle, poly_TriangleHandle>> newEdges;
757 newEdges.insert( {
poly_Edge(hmv[0], hmv[2]), { hts[0], hts[3] } } );
762 newEdges.insert( {
poly_Edge(hmv[1], hmv[0]), { hts[1], hts[3] } } );
766 newEdges.insert( {
poly_Edge(hmv[2], hmv[1]), { hts[2], hts[3] } } );
768 std::unordered_map<poly_TriangleHandle, poly_EdgeHandle> tris2Split;
769 for (
int j = 0; j < 3; ++j )
771 std::vector<poly_TriangleHandle> edgeTris;
776 for (
const auto& eth : edgeTris )
778 tris2Split.insert({eth, hes[j]});
782 for (
const auto& toSplit : tris2Split )
786 if ( !this->
GetEdge(toSplit.second, cmnEdge) )
824 if ( testN[0].Dot(refNorm) > 0 )
833 if ( testN[1].Dot(refNorm) > 0 )
843 newEdges[
poly_Edge(b, c)].second = thLeft;
844 newEdges[
poly_Edge(c, d)].second = thRight;
846 newEdges.insert( {
poly_Edge(a, c), { thLeft, thRight } } );
868 for (
const auto& edge2Insert : newEdges )
872 std::vector<poly_TriangleHandle> newTris;
874 if ( edge2Insert.second.first.IsValid() )
875 newTris.push_back(edge2Insert.second.first);
877 if ( edge2Insert.second.second.IsValid() )
878 newTris.push_back(edge2Insert.second.second);
880 __links.insert({newEh, newTris});
891 std::vector<poly_TriangleHandle> hts;
905 if ( !this->
GetEdge(he, edge) )
916 for (
int vidx = 0; vidx < 3; ++vidx )
986 t.GetVertices(htv[0], htv[1], htv[2]);
1011 double res = DBL_MAX;
1012 for (
int k = 0; k < 3; ++k )
1015 double J[2][2] = { {0, 0}, {0, 0} };
1017 double J_det_n = 0.;
1022 res = std::min(res, J_det_n);
1036 const t_xyz& v2)
const
1038 double res = DBL_MAX;
1039 for (
int k = 0; k < 3; ++k )
1042 double J[2][2] = { {0, 0}, {0, 0} };
1044 double J_det_n = 0.;
1048 res = std::min(res, J_det_n);
1069 t.GetVertices(htv[0], htv[1], htv[2]);
1071 for (
size_t k = 0; k < 3; ++k )
1075 const double maxLen = std::max( (tv[1] - tv[0]).Modulus(),
1076 std::max( (tv[2] - tv[1]).Modulus(),
1077 (tv[2] - tv[0]).Modulus() ) );
1092 const double prec)
const
1094 t_xyz tv[3] = {v0, v1, v2};
1097 t_xyz vec01 = tv[1] - tv[0];
1098 const double sqNorm01 = vec01.SquaredModulus();
1099 if ( sqNorm01 <= prec )
1105 t_xyz vec02 = tv[2] - tv[0];
1106 const double sqNorm02 = vec02.SquaredModulus();
1107 if ( sqNorm02 <= prec )
1113 t_xyz vec12 = tv[2] - tv[1];
1114 const double sqNorm12 = vec12.SquaredModulus();
1115 if ( sqNorm12 <= prec )
1124 const double SP0102 = vec01 * vec02;
1125 t_xyz vec = vec02 - (SP0102 / sqNorm01) * vec01;
1126 if ( vec.SquaredModulus() <= prec )
1131 vec = vec01 - (SP0102 / sqNorm02) * vec02;
1132 if ( vec.SquaredModulus() <= prec )
1137 vec = ((vec01 * vec12) / sqNorm12) * vec12 - vec01;
1139 return (vec.SquaredModulus() <= prec);
1149 const double prec)
const
1160 t.GetVertices(htv[0], htv[1], htv[2]);
1162 for (
size_t k = 0; k < 3; ++k )
1185 t.GetVertices(htv[0], htv[1], htv[2]);
1187 for (
size_t k = 0; k < 3; ++k )
1196 t_xyz mv[3] = { (tv[0] + tv[1])*0.5,
1197 (tv[1] + tv[2])*0.5,
1198 (tv[2] + tv[0])*0.5 };
1205 this->
AddTriangle( htv[0], hmv[0], hmv[2], t.GetFaceRef() );
1206 this->
AddTriangle( hmv[0], htv[1], hmv[1], t.GetFaceRef() );
1207 this->
AddTriangle( hmv[1], htv[2], hmv[2], t.GetFaceRef() );
1208 this->
AddTriangle( hmv[0], hmv[1], hmv[2], t.GetFaceRef() );
1230 typedef std::unordered_map<poly_VertexHandle, poly_EdgeHandle> t_vheh;
1231 std::unordered_map<poly_VertexHandle, t_vheh> visitedEdges;
1241 if ( t.IsDeleted() )
1245 t.GetVertices(vh[0], vh[1], vh[2]);
1256 for (
int eidx = 0; eidx < 3; ++eidx )
1258 auto linkIt1 = visitedEdges.find(edges[eidx].hVertices[0]);
1260 if ( linkIt1 == visitedEdges.end() )
1264 t_vheh rec; rec.insert({edges[eidx].
hVertices[1], eh});
1266 visitedEdges.insert( {edges[eidx].
hVertices[0], rec});
1267 __links .insert ( {eh, {th}} );
1274 auto linkIt2 = linkIt1->second.find(edges[eidx].hVertices[1]);
1276 if ( linkIt2 == linkIt1->second.end() )
1280 linkIt1->second.insert({edges[eidx].
hVertices[1], eh});
1289 __links.find(linkIt2->second)->second.push_back(th);
1310 auto linkIt =
__links.find(he);
1311 if ( linkIt ==
__links.end() )
1314 return int( linkIt->second.size() );
1324 std::vector<poly_TriangleHandle>& hts)
const
1326 auto linkIt =
__links.find(he);
1327 if ( linkIt ==
__links.end() )
1330 hts = linkIt->second;
1341 std::unordered_set<poly_TriangleHandle>& hts)
const
1343 auto linkIt =
__links.find(he);
1344 if ( linkIt ==
__links.end() )
1347 for (
const auto& ht : linkIt->second )
1360 std::vector<poly_TriangleHandle>& hts)
const
1362 std::unordered_set<poly_TriangleHandle> tset;
1364 for (
const auto& eth : tset)
1379 std::unordered_set<poly_TriangleHandle>& hts)
const
1388 t.GetVertices(hv[0], hv[1], hv[2]);
1398 for (
int j = 0; j < 3; ++j )
1400 if ( hes[j].iIdx == Mobius_InvalidHandleIndex )
1405 for (
int j = 0; j < 3; ++j )
1407 std::unordered_set<poly_TriangleHandle> edgeTris;
1412 for (
const auto& eth : edgeTris )
1427 std::unordered_set<poly_TriangleHandle>& hts,
1428 const std::unordered_set<int>& domain = std::unordered_set<int>())
const
1430 const std::unordered_set<poly_TriangleHandle>&
1433 for (
const auto& vth : vertexTris )
1435 if ( !domain.empty() && ( domain.find(
__triangles[vth.iIdx].GetFaceRef() ) == domain.end() ) )
1453 std::unordered_set<poly_VertexHandle>& hvs,
1455 std::unordered_set<int>& faceRefs,
1456 const std::unordered_set<int>& domain)
const
1464 std::unordered_set<poly_TriangleHandle> ths;
1468 std::unordered_map<poly_VertexHandle, int> vDomains;
1471 for (
const auto& th : ths )
1476 if ( t.IsDeleted() )
1479 faceRefs.insert( t.GetFaceRef() );
1481 for (
int k = 0; k < 3; ++k )
1483 if ( t.hVertices[k] != hv )
1485 vDomains.insert({t.hVertices[k], t.GetFaceRef()});
1491 for (
int j = 0; j < 3; ++j )
1495 if ( ((eCandidate.
hVertices[0] == hv) && (eCandidate.
hVertices[1] == t.hVertices[k])) ||
1503 auto linkIt =
__links.find(eh);
1505 if ( ( linkIt !=
__links.end() ) && (linkIt->second.size() < 2) )
1513 if ( !isBoundary && (faceRefs.size() > 1) )
1517 for (
const auto& tuple : vDomains )
1519 if ( domain.empty() || domain.count(tuple.second) )
1521 hvs.insert(tuple.first);
1533 std::vector<poly_TriangleHandle>& hts)
const
1538 auto linkIt =
__links.find(he);
1540 if ( linkIt ==
__links.end() )
1543 hts = linkIt->second;
1552 std::unordered_set<poly_TriangleHandle>& hts)
const
1586 const double normDevRad,
1587 const double planeDevRad,
1588 const bool checkJacobian,
1589 const bool checkWing,
1615 std::vector<poly_TriangleHandle> hts;
1619 if ( hts.size() != 2 )
1624 double J_before[2] = {0., 0.};
1626 if ( checkJacobian )
1639 if ( t[0].IsDeleted() || t[1].IsDeleted() )
1647 if ( norm0.Angle(norm1) > normDevRad )
1660 t[0].GetVertices(t0_v[0], t0_v[1], t0_v[2]);
1661 t[1].GetVertices(t1_v[0], t1_v[1], t1_v[2]);
1664 for (
int j = 0; j < 3; ++j )
1666 if ( t0_v[j] == x || t0_v[j] == y )
1673 for (
int j = 0; j < 3; ++j )
1675 if ( t1_v[j] == x || t1_v[j] == y )
1682 if ( a.GetIdx() == Mobius_InvalidHandleIndex )
1685 if ( b.GetIdx() == Mobius_InvalidHandleIndex )
1688 t_xyz a_coords, b_coords, x_coords, y_coords;
1695 if ( checkJacobian )
1700 if ( std::min(J_after[0], J_after[1]) < std::min(J_before[0], J_before[1]) )
1708 t_xyz bx = (b_coords - x_coords).Normalized();
1709 t_xyz ax = (a_coords - x_coords).Normalized();
1710 t_xyz xy = (y_coords - x_coords).Normalized();
1711 t_xyz by = (b_coords - y_coords).Normalized();
1712 t_xyz ay = (a_coords - y_coords).Normalized();
1713 t_xyz yx = (x_coords - y_coords).Normalized();
1715 const double adot1 = ax.Dot(xy);
1716 const double bdot1 = bx.Dot(xy);
1717 const double adot2 = ay.Dot(yx);
1718 const double bdot2 = by.Dot(yx);
1720 if ( adot1 < 0 || bdot1 < 0 || adot2 < 0 || bdot2 < 0 )
1742 const double normDevRad = 1./180.*M_PI,
1743 const double planeDevRad = 15./180.*M_PI,
1744 const bool checkJacobian =
true,
1745 const bool checkWing =
true)
const
1751 return this->
CanFlip(he, normDevRad, planeDevRad, checkJacobian, checkWing,
1752 hts[0], hts[1], a, b, x, y, norm0, norm1);
1769 const double normDevRad = 1./180.*M_PI,
1770 const double planeDevRad = 15./180.*M_PI,
1771 const bool checkJacobian =
true,
1772 const bool checkWing =
true)
1778 if ( !this->
CanFlip(he, normDevRad, planeDevRad, checkJacobian, checkWing,
1779 hts[0], hts[1], a, b, x, y, norm0, norm1) )
1795 if ( testN[0].Dot(norm0) > 0 )
1797 newHts[0] = this->
AddTriangle( a, x, b, ts[0].GetFaceRef() );
1801 newHts[0] = this->
AddTriangle( b, x, a, ts[0].GetFaceRef() );
1804 if ( testN[1].Dot(norm1) > 0 )
1806 newHts[1] = this->
AddTriangle( b, y, a, ts[1].GetFaceRef() );
1810 newHts[1] = this->
AddTriangle( a, y, b, ts[1].GetFaceRef() );
1830 const double planeDevRad = 15./180.*M_PI)
1838 if ( this->
FlipEdge(eh, normDevRad, planeDevRad) )
1854 for (
size_t eidx = 0; eidx <
__edges.size(); ++eidx )
1900 for (
int i = 0; i < 3; ++i )
1901 for (
int j = 0; j < 3; ++j )
1902 if ( t0_edges[i] == t1_edges[j] )
1903 return this->
FindEdge(t0_edges[i]);
1915 std::vector<poly_TriangleHandle>& bndTris)
const
1918 for (
const auto& linkIt :
__links )
1921 const std::vector<poly_TriangleHandle>& hts = linkIt.second;
1924 std::vector<poly_TriangleHandle> alive;
1926 for (
const auto& ht : hts )
1929 alive.push_back(ht);
1932 if ( (alive.size() != 2) || (
__triangles[alive[0].iIdx].GetFaceRef() !=
__triangles[alive[1].iIdx].GetFaceRef()) )
1934 bndEdges.push_back(he);
1937 for (
const auto& ht : alive )
1938 bndTris.push_back(ht);
1949 std::vector<poly_EdgeHandle>& innerEdges,
1950 std::vector<poly_EdgeHandle>& bndEdges)
const
1953 for (
const auto& linkIt :
__links )
1956 const std::vector<poly_TriangleHandle>& hts = linkIt.second;
1959 int numDomainTris = 0;
1961 for (
const auto& ht : hts )
1966 if (
__triangles[ht.iIdx].GetFaceRef() == domainId )
1970 if ( numDomainTris == 1 )
1971 bndEdges.push_back(he);
1972 else if ( numDomainTris == 2 )
1973 innerEdges.push_back(he);
2000 for (
int i = 0; i < 3; ++i )
2001 for (
int j = 0; j < 2; ++j )
2005 return t.hVertices[i];
2024 const bool checkBorderOn =
true,
2025 const bool checkDegenOn =
true,
2026 const double prec = core_Precision::Resolution3D(),
2027 const std::unordered_set<int>& domain = std::unordered_set<int>())
2030 std::unordered_set<poly_TriangleHandle> hts2Remove;
2034 if ( checkBorderOn && (hts2Remove.size() < 2) )
2047 t_xyz Vm = (V[0] + V[1])*0.5;
2052 for (
const auto& ht2Remove : hts2Remove )
2054 std::unordered_set<poly_TriangleHandle> ths2Edit;
2064 for (
const auto& th2Check : ths2Edit )
2067 if ( hts2Remove.find(th2Check) != hts2Remove.end() )
2076 std::vector<t_xyz> t2CheckVerts;
2080 for (
int j = 0; j < 3; ++j )
2087 t2CheckVerts.push_back(Vj);
2092 t2CheckVerts.push_back(Vm);
2094 if ( t2CheckVerts.size() != 3 )
2097 if ( this->
IsDegenerated(t2CheckVerts[0], t2CheckVerts[1], t2CheckVerts[2], prec) )
2110 if ( checkBorderOn )
2113 std::unordered_set<int> faceIDs;
2115 for (
const auto& ht2Remove : hts2Remove )
2117 std::unordered_set<poly_TriangleHandle> ths2Check;
2121 for (
const auto& th2Check : ths2Check )
2130 if ( !domain.empty() && ( domain.find( t2Check.
GetFaceRef() ) == domain.end() ) )
2140 for (
int i = 0; i < 3; ++i )
2143 if ( numEdgeTris != 2 )
2149 if ( faceIDs.size() > 1 )
2161 for (
const auto& ht2Remove : hts2Remove )
2163 std::unordered_set<poly_TriangleHandle> ths2Edit;
2177 for (
const auto& th2Edit : ths2Edit )
2180 if ( hts2Remove.find(th2Edit) != hts2Remove.end() )
2198 for (
int ei = 0; ei < 3; ++ei )
2204 int numVertAffected = 0;
2206 for (
int k = 0; k < 3; ++k )
2222 if ( numVertAffected == 1 )
2228 if ( numVertAffected == 2 )
2230 t2Edit.
hEdges[ei] = sharedEdgeHandle;
2260 std::vector<poly_TriangleHandle> hts;
2266 for (
int k = 0; k < 2; ++k )
2269 bool isBoundary =
false;
2270 std::unordered_set<poly_VertexHandle> adjVerts;
2271 std::unordered_set<int> faceRefs;
2272 std::unordered_set<int> domain;
2276 if ( faceRefs.size() > 2 )
2288 t_xyz Vm = (V[0] + V[1])*0.5;
2298 std::vector<poly_TriangleHandle> xths, yths;
2301 for (
const auto& ht : hts )
2329 for (
int j = 0; j < 3; ++j )
2361 if ( testNorm[0].Dot(refNorm) > 0 )
2363 splitHts[0] = this->
AddTriangle( x, hVm, hOppVert, t.GetFaceRef() );
2367 splitHts[0] = this->
AddTriangle( hVm, x, hOppVert, t.GetFaceRef() );
2370 if ( testNorm[1].Dot(refNorm) > 0 )
2372 splitHts[1] = this->
AddTriangle( hVm, y, hOppVert, t.GetFaceRef() );
2376 splitHts[1] = this->
AddTriangle( y, hVm, hOppVert, t.GetFaceRef() );
2388 xths.push_back(splitHts[0]);
2389 yths.push_back(splitHts[1]);
2411 const bool checkInter)
2413 std::unordered_set<int> domain = {tag};
2416 std::unordered_map< poly_VertexHandle, std::unordered_set<poly_VertexHandle> > adj;
2423 bool isBoundary =
false;
2424 std::unordered_set<poly_VertexHandle> adjVerts;
2425 std::unordered_set<int> faceRefs;
2427 this->
FindAdjacent(vh, adjVerts, isBoundary, faceRefs, domain);
2430 adj.insert({vh, adjVerts});
2434 std::unordered_map<poly_VertexHandle, t_xyz> origCoordsMap;
2437 while ( it++ < iter )
2439 for (
const auto& vTuple : adj )
2443 this->
GetVertex(vTuple.first, origCoords);
2445 if ( origCoordsMap.find(vTuple.first) == origCoordsMap.end() )
2446 origCoordsMap.insert({vTuple.first, origCoords});
2452 for (
const auto& nvs : vTuple.second )
2475 std::vector<poly_EdgeHandle> innerEdges, bndEdges;
2481 for (
const auto& tuple : origCoordsMap )
2493 const std::unordered_set<int>& domain = std::unordered_set<int>(),
2494 const bool checkInter =
false)
2496 for (
auto tag : domain )
2497 this->
Smooth(iter, tag, checkInter);
2509 const int idx = h.GetIdx();
2510 if ( idx < 0 || idx >
int(
__vertices.size() ) )
return false;
2521 t_xyz& vertex)
const
2523 const int idx = h.GetIdx();
2524 if ( idx < 0 || idx >
int(
__vertices.size() ) )
return false;
2546 const int idx = h.GetIdx();
2547 if ( idx < 0 || idx >
int(
__edges.size() ) )
return false;
2560 const int idx = h.GetIdx();
2561 if ( idx < 0 || idx >
int(
__triangles.size() ) )
return false;
2583 const int idx = h.GetIdx();
2584 if ( idx < 0 || idx >
int(
__quads.size() ) )
return false;
2594 return this->
AddVertex( core_XYZ::O() );
2624 return this->
AddEdge(inv, inv);
2653 const int idx = h.GetIdx();
2654 if ( idx < 0 || idx >
int(
__edges.size() ) )
return false;
2715 const int idx = h.GetIdx();
2716 if ( idx < 0 || idx >
int(
__triangles.size() ) )
return false;
2727 return this->
AddQuad(inv, inv, inv, inv);
2768 if ( !tri.IsDeleted() )
2792 bool More()
const {
return m_pos < m_mesh->__vertices.size(); }
2793 void Next() { m_pos++; }
2794 poly_VertexHandle Current()
const {
return poly_VertexHandle(
int(m_pos) ); }
2798 t_ptr<poly_Mesh<ElemTraits>> m_mesh;
2812 bool More()
const {
return m_pos < m_mesh->__edges.size(); }
2813 void Next() { m_pos++; }
2814 poly_EdgeHandle Current()
const {
return poly_EdgeHandle(
int(m_pos) ); }
2818 t_ptr<poly_Mesh<ElemTraits>> m_mesh;
2832 bool More()
const {
return m_pos < m_mesh->__triangles.size(); }
2833 void Next() { m_pos++; }
2834 poly_TriangleHandle Current()
const {
return poly_TriangleHandle(
int(m_pos) ); }
2838 t_ptr<poly_Mesh<ElemTraits>> m_mesh;
2852 bool More()
const {
return m_pos < m_mesh->__quads.size(); }
2853 void Next() { m_pos++; }
2854 poly_QuadHandle Current()
const {
return poly_QuadHandle(
int(m_pos) ); }
2858 t_ptr<poly_Mesh<ElemTraits>> m_mesh;
2875 std::vector<poly_TriangleHandle> newTuple;
2877 for (
const auto& ht : link->second )
2880 newTuple.push_back(htNew);
2882 newTuple.push_back(ht);
2896 std::unordered_map< poly_EdgeHandle, std::vector<poly_TriangleHandle> >
__links;