23 #ifndef VCG_HEDGE_TOPOLOGY
24 #define VCG_HEDGE_TOPOLOGY
26 #include <vcg/connectors/halfedge_pos.h>
41 typedef typename MeshType::VertexPointer VertexPointer;
42 typedef typename MeshType::EdgePointer EdgePointer;
43 typedef typename MeshType::HEdgePointer HEdgePointer;
44 typedef typename MeshType::FacePointer FacePointer;
46 typedef typename MeshType::VertexIterator VertexIterator;
47 typedef typename MeshType::EdgeIterator EdgeIterator;
48 typedef typename MeshType::HEdgeIterator HEdgeIterator;
49 typedef typename MeshType::FaceIterator FaceIterator;
66 assert(MeshType::HEdgeType::HasHVAdjacency());
67 assert(hp->HVp() == vp || hp->HOp()->HVp() == vp);
68 assert(hp->HFp()->VN() == 4);
69 assert(hp->HOp()->HFp()->VN() == 4);
102 assert(MeshType::VertexType::HasVHAdjacency());
103 assert(MeshType::FaceType::HasFHAdjacency());
104 assert(MeshType::HEdgeType::HasHVAdjacency());
105 assert(MeshType::HEdgeType::HasHFAdjacency());
106 assert(MeshType::HEdgeType::HasHOppAdjacency());
107 assert(MeshType::HEdgeType::HasHPrevAdjacency());
111 assert(fp->VN() == 4);
117 bool HasHE = MeshType::HEdgeType::HasHEAdjacency();
118 bool HasEH = MeshType::EdgeType::HasEHAdjacency();
124 assert(vps.size()==4);
126 for(
unsigned int i = 0; i< vps.size(); i++)
129 assert( count(vps.begin(), vps.end(), vps[i]) == 1 );
134 while(hp->HVp() != vp)
137 std::vector<HEdgePointer> hps =
getHEdges(fp,hp);
139 assert(vp == hps[0]->HVp());
141 VertexPointer opposite_vertex = hps[2]->HVp();
143 vp->P() = (vp->P() + opposite_vertex->P() )/2;
146 hps[0]->HOp()->HOp()=hps[1]->HOp();
147 hps[1]->HOp()->HOp()=hps[0]->HOp();
149 hps[2]->HOp()->HOp()=hps[3]->HOp();
150 hps[3]->HOp()->HOp()=hps[2]->HOp();
152 for(
int i=0; i<4; i++)
154 if(hps[i]->HVp()->VHp() == hps[i])
155 hps[i]->HVp()->VHp() = hps[(i+4-1)%4]->HOp();
160 hps[1]->HOp()->HEp()=hps[0]->HEp();
161 hps[3]->HOp()->HEp()=hps[2]->HEp();
166 for(
int i=0; i<3; i+=2)
168 if(hps[i]->HEp()->EHp() == hps[i])
169 hps[i]->HEp()->EHp() = hps[i]->HOp();
186 b[0] = (hps[0]->HOp()->HFp() == NULL && hps[1]->HOp()->HFp() == NULL);
187 b[1] = (hps[2]->HOp()->HFp() == NULL && hps[3]->HOp()->HFp() == NULL);
189 for(
int i=0, j=0; i < 4; i+=2, j++ )
199 hps[i+1]->HVp()->VHp() = NULL;
203 hps[i]->HOp()->HNp()->HPp() = hps[i+1]->HOp()->HPp();
204 hps[i+1]->HOp()->HPp()->HNp() = hps[i]->HOp()->HNp();
206 if(vp->VHp() == hps[i+1]->HOp())
207 vp->VHp() = hps[(i+3)%4]->HOp();
245 HEdgePointer hp = vp->VHp();
249 FacePointer fp1 = hp->HFp();
250 FacePointer fp2 = hp->HOp()->HFp();
259 assert( hp->HOp()->HNp()->HOp() == hp->HPp() );
261 assert( fp1->VN() == 4);
262 assert( fp2->VN() == 4);
266 hp->HNp()->HPp() = hp->HOp()->HPp();
267 hp->HOp()->HPp()->HNp() = hp->HNp();
269 hp->HPp()->HPp()->HNp() = hp->HOp()->HNp()->HNp();
270 hp->HOp()->HNp()->HNp()->HPp() = hp->HPp()->HPp();
273 if( hp->HOp()->HVp()->VHp() == hp->HOp() )
274 hp->HOp()->HVp()->VHp() = hp->HNp();
276 if( hp->HPp()->HVp()->VHp() == hp->HPp() )
277 hp->HPp()->HVp()->VHp() = hp->HPp()->HPp()->HNp();
280 hp->HNp()->HPp()->HFp() = fp1;
281 hp->HOp()->HNp()->HNp()->HFp() = fp1;
283 if(fp1->FHp() == hp || fp1->FHp() == hp->HPp())
284 fp1->FHp() = hp->HNp();
288 if(MeshType::HEdgeType::HasHEAdjacency())
331 bool HasHE = MeshType::HEdgeType::HasHEAdjacency();
332 bool HasEH = MeshType::EdgeType::HasEHAdjacency();
334 std::vector<HEdgePointer> ext_hedges;
336 std::vector<HEdgePointer> int_hedges =
getHEdges(fp);
340 for(
typename std::vector<HEdgePointer>::iterator hi = int_hedges.begin(); hi != int_hedges.end();++hi)
343 if((*hi)->HOp()->HFp() != fp)
344 ext_hedges.push_back((*hi)->HOp());
355 for(
typename std::vector<HEdgePointer>::iterator hi = int_hedges.begin(); hi != int_hedges.end();++hi)
358 assert(ext_hedges.size() == 2);
361 if(ext_hedges[0]->HFp() || ext_hedges[1]->HFp())
363 ext_hedges[0]->HOp() = ext_hedges[1];
364 ext_hedges[1]->HOp() = ext_hedges[0];
370 ext_hedges[1]->HEp() = ext_hedges[0]->HEp();
373 ext_hedges[0]->HEp()->EHp() = ext_hedges[0];
376 ext_hedges[0]->HVp()->VHp() = ext_hedges[0];
377 ext_hedges[1]->HVp()->VHp() = ext_hedges[1];
379 return ext_hedges[0];
384 ext_hedges[0]->HVp()->VHp() = NULL;
385 ext_hedges[1]->HVp()->VHp() = NULL;
412 assert( MeshType::HEdgeType::HasHFAdjacency() );
413 assert( MeshType::HEdgeType::HasHOppAdjacency() );
414 assert( MeshType::FaceType::HasFHAdjacency() );
417 FacePointer fp1 = hp->HFp();
418 FacePointer fp2 = hp->HOp()->HFp();
422 assert( fp1->VN() == 4 );
425 assert( fp2->VN() == 4 );
433 std::vector<FacePointer> fps;
434 typedef std::vector<HEdgePointer> hedge_vect;
435 std::vector<hedge_vect> hps;
442 hps.push_back(
getHEdges( fp2, hp->HOp() ) );
445 for(
int i=0; i< 2; i++)
451 hps[i][1]->HPp() = hps[j][3];
452 hps[j][3]->HNp() = hps[i][1];
454 if(hps[j][0]->HVp()->VHp() == hps[j][0])
455 hps[j][0]->HVp()->VHp() = hps[i][1];
459 hps[i][0]->HNp() = hps[j][3];
460 hps[j][3]->HPp() = hps[i][0];
462 hps[j][2]->HNp() = hps[j][0];
463 hps[j][0]->HPp() = hps[j][2];
465 hps[j][0]->HVp() = hps[j][3]->HVp();
467 hps[j][3]->HFp() = fps[i];
469 if(fps[j]->FHp() == hps[j][3])
470 fps[j]->FHp() = hps[j][0];
474 hps[i][0]->HNp() = hps[i][2];
475 hps[i][2]->HPp() = hps[i][0];
477 hps[i][1]->HNp() = hps[j][0];
478 hps[j][0]->HPp() = hps[i][1];
480 hps[j][0]->HVp() = hps[i][2]->HVp();
482 hps[i][1]->HFp() = fps[j];
484 if(fps[i]->FHp() == hps[i][1])
485 fps[i]->FHp() = hps[i][0];
506 assert(MeshType::VertexType::HasVHAdjacency());
509 vcg::hedge::Pos<MeshType> p(vp->VHp(),
true);
511 HEdgePointer hep = p.HE();
513 typedef std::vector<HEdgePointer> hedge_vect;
514 std::vector<hedge_vect> hedges;
519 assert( p.F()->VN() == 4);
521 hedges.push_back(
getHEdges(p.F(), p.HE()));
526 }
while(p.HE() != hep);
529 int size = hedges.size();
531 for(
int i=0; i< size; i++)
533 hedges[i][0]->HNp() = hedges[i][2];
534 hedges[i][2]->HPp() = hedges[i][0];
536 assert(hedges[i][0]->HOp() == hedges[(i+size-1)%size][3]);
538 hedges[i][2]->HNp() = hedges[(i+1)%size][1];
539 hedges[(i+1)%size][1]->HPp() = hedges[i][2];
541 hedges[(i+1)%size][1]->HNp() = hedges[i][3];
542 hedges[i][3]->HPp() = hedges[(i+1)%size][1];
544 hedges[(i+1)%size][1]->HFp() = hedges[i][3]->HFp();
546 if(hedges[i][3]->HVp()->VHp() == hedges[i][3])
547 hedges[i][3]->HVp()->VHp() = hedges[(i+1)%size][1];
549 hedges[i][3]->HVp() = hedges[(i+1)%size][2]->HVp();
551 if(hedges[i][0]->HFp()->FHp() == hedges[i][1])
552 hedges[i][0]->HFp()->FHp() = hedges[i][0];
569 static VertexPointer
edge_collapse(MeshType &m, HEdgePointer hp, VertexPointer vp)
572 assert(MeshType::VertexType::HasVHAdjacency());
573 assert(MeshType::HEdgeType::HasHOppAdjacency());
574 assert(MeshType::HEdgeType::HasHVAdjacency());
575 assert(MeshType::HEdgeType::HasHPrevAdjacency());
578 assert(hp->HFp()->VN() > 3);
580 if( hp->HOp()->HFp())
581 assert(hp->HOp()->HFp()->VN() > 3);
583 assert(hp->HFp() || hp->HOp()->HFp());
584 assert(hp->HVp() == vp || hp->HOp()->HVp() == vp);
587 HEdgePointer hopp = hp->HOp();
591 if( hp->HVp() == vp )
599 hp->HNp()->HPp() = hp->HPp();
600 hopp->HNp()->HPp() = hopp->HPp();
603 hp->HPp()->HNp() = hp->HNp();
604 hopp->HPp()->HNp() = hopp->HNp();
608 if( hp->HFp()->FHp() == hp )
609 hp->HFp()->FHp() = hp->HNp();
612 if( hopp->HFp()->FHp() == hopp )
613 hopp->HFp()->FHp() = hopp->HNp();
616 if( vp1->VHp() == hopp )
617 vp1->VHp() = hopp->HNp();
619 if(HasHEAdjacency(m))
637 static FacePointer
add_face(MeshType &m, std::vector<VertexPointer> &vps)
640 assert(MeshType::VertexType::HasVHAdjacency());
641 assert(MeshType::HEdgeType::HasHVAdjacency());
642 assert(MeshType::HEdgeType::HasHFAdjacency());
643 assert(MeshType::HEdgeType::HasHOppAdjacency());
644 assert(MeshType::HEdgeType::HasHPrevAdjacency());
646 unsigned int size = vps.size();
650 for(
unsigned int i = 0; i< size; i++)
653 assert( count(vps.begin(), vps.end(), vps[i]) == 1 );
656 std::vector<HEdgePointer> hps;
658 while(hps.size() < size)
662 std::vector<bool> non_manifold_vertices(size,
false);
680 assert(MeshType::VertexType::HasVHAdjacency());
681 assert(MeshType::FaceType::HasFHAdjacency());
682 assert(MeshType::HEdgeType::HasHVAdjacency());
683 assert(MeshType::HEdgeType::HasHFAdjacency());
684 assert(MeshType::HEdgeType::HasHOppAdjacency());
685 assert(MeshType::HEdgeType::HasHPrevAdjacency());
708 unsigned int size = vps.size();
710 std::vector<HEdgePointer> hps;
711 std::vector<bool> non_manifold_vertices;
713 while(hps.size() < size)
716 non_manifold_vertices.push_back(
false );
718 non_manifold_vertices.push_back( hps.back() == NULL );
735 static FacePointer
add_face_unsafe(MeshType &m, std::vector<VertexPointer> &vps, std::vector<HEdgePointer> &hps, std::vector<bool> &non_manifold_vertices)
738 assert(MeshType::VertexType::HasVHAdjacency());
739 assert(MeshType::HEdgeType::HasHVAdjacency());
740 assert(MeshType::HEdgeType::HasHFAdjacency());
741 assert(MeshType::HEdgeType::HasHOppAdjacency());
742 assert(MeshType::HEdgeType::HasHPrevAdjacency());
744 unsigned int size = vps.size();
754 bool HasHE = MeshType::HEdgeType::HasHEAdjacency();
755 bool HasEH = MeshType::EdgeType::HasEHAdjacency();
759 assert(hps.size() == size);
761 HEdgePointer nullPointer = NULL;
762 int edge_n = count(hps.begin(), hps.end(), nullPointer);
780 for(EdgeIterator ei1 = ei; ei1 != m.edge.end(); ++ei1)
790 pu.oldBase = &*(m.hedge.begin());
791 pu.oldEnd = &m.hedge.back()+1;
796 pu.newBase = &*(m.hedge.begin());
797 pu.newEnd = &m.hedge.back()+1;
803 for(EdgeIterator ei1 = ei; ei1 != m.edge.end(); ++ei1)
807 if( pu.NeedUpdate() )
808 for(
typename std::vector<HEdgePointer>::iterator hpsi = hps.begin(); hpsi != hps.end(); ++hpsi)
815 HEdgeIterator hi1 = hi;
816 HEdgeIterator hi2 = hi;
820 EdgeIterator ei1 = ei;
822 for(; hi2 != m.hedge.end(); ++hi1, ++hi2)
826 (*ei1).EHp() = &(*hi1);
831 (*hi1).HEp() = &(*ei1);
832 (*hi2).HEp() = &(*ei1);
836 (*hi1).HOp() = &(*hi2);
837 (*hi2).HOp() = &(*hi1);
847 std::vector<HEdgePointer> hps1;
849 for(
unsigned int i = 0; i < size; i++)
853 hps1.push_back(&(*hi));
858 hps1.push_back(hps[i]);
861 assert( hps1.size() == size );
863 for(
unsigned int i = 0; i < size; i++)
866 int next = (i+1)%size;
877 hps1[next]->HOp()->HNp() = hps1[i]->HNp();
879 hps1[i]->HNp()->HPp() = hps1[next]->HOp();
881 hps1[i]->HNp() = hps1[next];
883 hps1[next]->HPp() = hps1[i];
891 hps1[i]->HVp() = vps[i];
892 hps1[i]->HOp()->HVp() = vps[next];
895 hps1[i]->HNp() = hps1[next];
900 hps1[i]->HOp()->HPp() = hps1[next]->HPp();
901 hps1[next]->HPp()->HNp() = hps1[i]->HOp();
908 if(non_manifold_vertices[next])
910 vcg::hedge::Pos<MeshType> p(vps[next]->VHp(),
true);
918 if(p.HE() == vps[next]->VHp())
923 p.HE()->HPp()->HNp() = hps1[i]->HOp();
924 hps1[i]->HOp()->HPp() = p.HE()->HPp();
926 p.HE()->HPp() = hps1[next]->HOp();
927 hps1[next]->HOp()->HNp() = p.HE();
932 hps1[i]->HOp()->HPp() = hps1[next]->HOp();
933 hps1[next]->HOp()->HNp() = hps1[i]->HOp();
939 hps1[next]->HPp() = hps1[i];
943 vps[i]->VHp() = hps1[i];
948 fp->FHp() = hps1.front();
964 std::vector<HEdgePointer> hps =
getHEdges(fp);
966 int size = hps.size();
968 for(
int i = 0; i< size; i++ )
970 if( hps[i]->HOp()->HFp() )
972 hps[i]->HFp() = NULL;
974 if( !hps[(i+size-1)%size]->HOp()->HFp() )
977 hps[i]->HPp() = hps[(i+size-1)%size]->HOp()->HPp();
978 hps[(i+size-1)%size]->HOp()->HPp()->HNp() = hps[i];
981 if( !hps[(i+1)%size]->HOp()->HFp() )
984 hps[i]->HNp() = hps[(i+1)%size]->HOp()->HNp();
985 hps[(i+1)%size]->HOp()->HNp()->HPp() = hps[i];
993 if(MeshType::HEdgeType::HasHEAdjacency())
996 if( !hps[(i+size-1)%size]->HOp()->HFp() )
998 hps[i]->HOp()->HNp()->HPp() = hps[(i+size-1)%size]->HOp()->HPp();
999 hps[(i+size-1)%size]->HOp()->HPp()->HNp() = hps[i]->HOp()->HNp();
1006 for(
int i = 0; i< size; i++ )
1008 if( hps[i]->HVp()->VHp()->IsD() )
1010 if( !hps[i]->IsD() )
1011 hps[i]->HVp()->VHp() = hps[i];
1013 else if( !hps[(i+size-1)%size]->IsD() )
1014 hps[i]->HVp()->VHp() = hps[(i+size-1)%size]->HOp();
1018 bool manifold =
true;
1020 vcg::hedge::Pos<MeshType> p(hps[i]->HVp()->VHp(),
true);
1027 while( !p.HE()->IsV() )
1029 if( !p.HE()->IsD() )
1032 hps[i]->HVp()->VHp() = p.HE();
1043 hps[i]->HVp()->VHp() = NULL;
1064 static bool can_add_hedge( std::vector<VertexPointer> &vps, std::vector<HEdgePointer> &hps )
1067 unsigned int i = hps.size();
1069 assert( i < vps.size() );
1071 HEdgePointer he = vps[i]->VHp();
1075 hps.push_back(NULL);
1080 bool disconnected =
false;
1082 bool hasEdge =
false;
1084 unsigned int size = vps.size();
1086 vcg::hedge::Pos<MeshType> p(he,
false);
1090 while(p.V() != vps[(i+1)%size])
1093 hasEdge= ( find( vps.begin(), vps.end(), p.V()) != (vps.end() ) );
1104 disconnected =
true;
1114 hps.push_back(NULL);
1123 while( (p.V() == vps[(i+1)%size]) && (i < size) )
1125 hps.push_back( p.HE() );
1127 if(p.HE()->HFp() != NULL)
1154 vcg::hedge::Pos<MeshType> p(fp->FHp(),
true);
1160 unsigned int size = incident_faces.size();
1164 for(
unsigned int i = 0; i < size; i++)
1166 if(incident_faces[i] == NULL)
1167 if(incident_faces[(i+1)%size] != fp && incident_faces[((i+size)-1)%size] != fp )
1175 }
while( p.HE() != fp->FHp() );
1193 assert(hp->HFp()->VN() == 4);
1196 std::vector<FacePointer> faces;
1198 HEdgePointer hopp = hp->HNp()->HNp();
1202 faces.assign(faces1.begin()+1, faces1.end());
1203 faces.assign(faces2.begin()+1, faces2.end());
1208 unsigned int size = faces.size();
1209 bool null_face =
false;
1215 for(
unsigned int i = 0; i < size; i++)
1217 if(faces[i] == NULL)
1219 if(faces[(i+1)%size] != NULL && faces[((i+size)-1)%size] != NULL )
1235 std::set<VertexPointer> set1;
1236 std::set<VertexPointer> set2;
1238 std::vector<VertexPointer> vect1 =
getVertices(hp->HVp());
1239 std::vector<VertexPointer> vect2 =
getVertices(hp->HNp()->HNp()->HVp());
1241 set1.insert(vect1.begin(), vect1.end());
1242 set2.insert(vect2.begin(), vect2.end());
1244 size = vect1.size();
1245 if(vect2.size() < size)
1246 size = vect2.size();
1248 std::vector<VertexPointer> intersection(size);
1250 typename std::vector<VertexPointer>::iterator it;
1251 it = set_intersection(set1.begin(), set1.end(), set2.begin(), set2.end(), intersection.begin());
1253 size = it- intersection.begin();
1255 assert( size >= 2 );
1277 std::set<HEdgePointer> set1;
1278 for(HEdgeIterator hi = m.hedge.begin(); hi != m.hedge.end(); ++hi)
1280 if(!(*hi).IsD() && (*hi).HVp() == vp)
1281 set1.insert(&(*hi));
1287 std::set<HEdgePointer> set2;
1288 set2.insert(vect2.begin(), vect2.end());
1290 return !equal(set1.begin(), set1.end(), set2.begin());
1309 unsigned int size = faces.size();
1314 for(
unsigned int i = 0; i < size; i++)
1316 if(faces[i] == NULL)
1339 return hp->HOp()->HVp();
1354 HEdgePointer hp = vp->VHp();
1356 std::vector<VertexPointer> ret;
1361 vcg::hedge::Pos<MeshType> p(hp);
1367 assert(!p.F()->IsD());
1369 ret.push_back(
opp_vert( p.HE() ) );
1371 ret.push_back(
opp_vert( p.HE()->HNp() ) );
1378 }
while( p.HE() != hp);
1391 static std::set<FacePointer>
getFaces(VertexPointer vp)
1396 std::set<FacePointer> ret;
1398 std::vector<VertexPointer> vertices =
getVertices(vp);
1400 for(
typename std::vector<VertexPointer>::iterator vi = vertices.begin(); vi!= vertices.end(); ++vi)
1403 ret.insert(incident_faces.begin(), incident_faces.end());
1425 vcg::hedge::Pos<MeshType> p( fp->FHp() );
1435 }
while(p.HE() != fp->FHp());
1449 static std::vector<VertexPointer>
getVertices(FacePointer fp, HEdgePointer starting_he = NULL)
1455 starting_he = fp->FHp();
1457 assert( starting_he->HFp() == fp );
1459 vcg::hedge::Pos<MeshType> p( starting_he,
true );
1461 std::vector<VertexPointer> ret;
1466 assert(!(p.V()->IsD()));
1468 ret.push_back( p.V() );
1473 assert(ret.size() <= (
unsigned int)(fp->VN()));
1475 }
while(p.HE() != starting_he);
1490 static std::vector<HEdgePointer>
getHEdges(FacePointer fp, HEdgePointer starting_he = NULL)
1496 assert( starting_he->HFp() == fp );
1498 starting_he = fp->FHp();
1500 vcg::hedge::Pos<MeshType> p( starting_he,
true );
1502 std::vector<HEdgePointer> ret;
1506 ret.push_back( p.HE() );
1511 assert(ret.size() <= (
unsigned int) (fp->VN()));
1513 }
while(p.HE() != starting_he);
1535 assert( starting_he->HVp() == vp );
1537 starting_he = vp->VHp();
1539 std::vector<FacePointer> ret;
1544 vcg::hedge::Pos<MeshType> p( starting_he,
true );
1548 ret.push_back( p.F() );
1553 }
while(p.HE() != starting_he);
1560 static std::vector<FacePointer> get_adjacent_faces(FacePointer fp)
1565 std::vector<FacePointer> ret;
1567 vcg::hedge::Pos<MeshType> p( fp->FHp() );
1568 assert(p.F() == fp);
1573 ret.push_back( p.F() );
1579 }
while(p.HE() != fp->FHp());
1599 assert( starting_he->HVp() == vp );
1601 starting_he = vp->VHp();
1603 std::vector<HEdgePointer> ret;
1608 vcg::hedge::Pos<MeshType> p( starting_he,
true );
1612 assert(!p.HE()->IsD());
1614 ret.push_back( p.HE() );
1620 }
while(p.HE() != starting_he);
1652 std::vector<HEdgePointer> ret;
1654 vcg::hedge::Pos<MeshType> p( fp->FHp(),
true );
1660 ret.push_back(p.HE());
1662 assert(ret.size() <= 4);
1667 }
while(p.HE() != fp->FHp());
1689 vcg::hedge::Pos<MeshType> p( vp->VHp() );
1699 }
while(p.HE() != vp->VHp());
1721 vcg::hedge::Pos<MeshType> p( vp->VHp() );
1725 assert(!p.HE()->IsD());
1731 }
while(p.HE() != vp->VHp());
1748 assert(old_vp != new_vp);
1749 assert(!old_vp->IsD());
1751 vcg::hedge::Pos<MeshType> p(old_vp->VHp(),
true);
1757 p.HE()->HVp() = new_vp;
1762 }
while( !p.HE()->IsV() );
1766 if( !new_vp->VHp() )
1767 new_vp->VHp() = old_vp->VHp();
Class to safely add and delete elements in a mesh.
Definition: allocate.h:97
static EdgeIterator AddEdges(MeshType &m, size_t n, PointerUpdater< EdgePointer > &pu)
Add n edges to the mesh. Function to add n edges to the mesh. The elements are added always to the en...
Definition: allocate.h:333
static void DeleteFace(MeshType &m, FaceType &f)
Definition: allocate.h:923
static void DeleteVertex(MeshType &m, VertexType &v)
Definition: allocate.h:935
static void DeleteHEdge(MeshType &m, HEdgeType &h)
Definition: allocate.h:957
static FaceIterator AddFaces(MeshType &m, size_t n)
Function to add n faces to the mesh. First wrapper, with no parameters.
Definition: allocate.h:615
static void DeleteEdge(MeshType &m, EdgeType &e)
Definition: allocate.h:946
static HEdgeIterator AddHEdges(MeshType &m, size_t n, PointerUpdater< HEdgePointer > &pu)
Definition: allocate.h:453
Class containing functions to modify the topology of a halfedge based mesh.
Definition: halfedge_topology.h:38
static std::vector< HEdgePointer > get_incident_hedges(VertexPointer vp, HEdgePointer starting_he=NULL)
Definition: halfedge_topology.h:1593
static bool remove_face(MeshType &m, FacePointer fp)
Definition: halfedge_topology.h:677
static std::vector< HEdgePointer > getHEdges(FacePointer fp, HEdgePointer starting_he=NULL)
Definition: halfedge_topology.h:1490
static std::set< FacePointer > getFaces(VertexPointer vp)
Definition: halfedge_topology.h:1391
static bool is_singlet_quad(FacePointer fp)
Definition: halfedge_topology.h:1419
static bool isBorderVertex(VertexPointer vp)
Definition: halfedge_topology.h:1681
static bool can_remove_face(FacePointer fp)
Definition: halfedge_topology.h:1148
static bool check_diagonal_collapse_quad(HEdgePointer hp)
Definition: halfedge_topology.h:1188
static HEdgePointer singlet_remove_quad(MeshType &m, FacePointer fp)
Definition: halfedge_topology.h:314
static std::vector< VertexPointer > getVertices(VertexPointer vp)
Definition: halfedge_topology.h:1349
static VertexPointer vertex_rotate_quad(VertexPointer vp)
Definition: halfedge_topology.h:503
static std::vector< VertexPointer > getVertices(FacePointer fp, HEdgePointer starting_he=NULL)
Definition: halfedge_topology.h:1449
static FacePointer add_face_unsafe(MeshType &m, std::vector< VertexPointer > &vps, std::vector< HEdgePointer > &hps, std::vector< bool > &non_manifold_vertices)
Definition: halfedge_topology.h:735
static bool can_add_hedge(std::vector< VertexPointer > &vps, std::vector< HEdgePointer > &hps)
Definition: halfedge_topology.h:1064
static bool is_nonManifold_vertex(MeshType &m, VertexPointer vp)
Definition: halfedge_topology.h:1272
static bool has_doublet_quad(FacePointer fp)
Definition: halfedge_topology.h:1634
static void change_vertex(VertexPointer old_vp, VertexPointer new_vp)
Definition: halfedge_topology.h:1744
static VertexPointer opp_vert(HEdgePointer hp)
Definition: halfedge_topology.h:1337
static FacePointer add_face(MeshType &m, std::vector< VertexPointer > &vps)
Definition: halfedge_topology.h:637
static HEdgePointer edge_rotate_quad(HEdgePointer hp, bool cw)
Definition: halfedge_topology.h:409
static bool is_nonManifold_vertex(VertexPointer vp)
Definition: halfedge_topology.h:1302
static void remove_face_unsafe(MeshType &m, FacePointer fp)
Definition: halfedge_topology.h:961
static VertexPointer edge_collapse_quad(MeshType &m, HEdgePointer hp, VertexPointer vp)
Definition: halfedge_topology.h:62
static VertexPointer edge_collapse(MeshType &m, HEdgePointer hp, VertexPointer vp)
Definition: halfedge_topology.h:569
static FacePointer add_face_unsafe(MeshType &m, std::vector< VertexPointer > &vps)
Definition: halfedge_topology.h:706
static std::vector< HEdgePointer > find_doublet_hedges_quad(FacePointer fp)
Definition: halfedge_topology.h:1646
static FacePointer doublet_remove_quad(MeshType &m, VertexPointer vp)
Definition: halfedge_topology.h:241
static std::vector< FacePointer > get_incident_faces(VertexPointer vp, HEdgePointer starting_he=NULL)
Definition: halfedge_topology.h:1529
static VertexPointer diagonal_collapse_quad(MeshType &m, FacePointer fp, VertexPointer vp)
Definition: halfedge_topology.h:99
static int vertex_valence(VertexPointer vp)
Definition: halfedge_topology.h:1711
Definition: namespaces.dox:6