CBoundary Boundary class. More...
#include <boundary.h>

Public Member Functions | |
| CBoundary (CBaseMesh< CVertex, CEdge, CFace, CHalfEdge > *pMesh) | |
| ~CBoundary () | |
| std::vector< TLoop * > & | loops () |
Protected Member Functions | |
| void | _bubble_sort (std::vector< CLoop< CVertex, CEdge, CFace, CHalfEdge > * > &loops) |
Protected Attributes | |
| CBaseMesh< CVertex, CEdge, CFace, CHalfEdge > * | m_pMesh |
| std::vector< TLoop * > | m_loops |
Private Types | |
| typedef CLoop< CVertex, CEdge, CFace, CHalfEdge > | TLoop |
CBoundary Boundary class.
Definition at line 88 of file boundary.h.
typedef CLoop<CVertex,CEdge, CFace, CHalfEdge> MeshLib::CBoundary< CVertex, CEdge, CFace, CHalfEdge >::TLoop [private] |
Definition at line 90 of file boundary.h.
| MeshLib::CBoundary< CVertex, CEdge, CFace, CHalfEdge >::CBoundary | ( | CBaseMesh< CVertex, CEdge, CFace, CHalfEdge > * | pMesh | ) |
CBoundary constructor
| pMesh | pointer to the current mesh |
CBoundary constructor
| pMesh | the current mesh |
Definition at line 190 of file boundary.h.
{
m_pMesh = pMesh;
//collect all boundary halfedges
std::set<CHalfEdge*> boundary_hes;
for( MeshEdgeIterator<CVertex, CEdge, CFace, CHalfEdge> eiter( m_pMesh); !eiter.end(); eiter ++ )
{
CEdge * e = *eiter;
if( !m_pMesh->isBoundary(e) ) continue;
CHalfEdge * he = m_pMesh->edgeHalfedge( e, 0);
boundary_hes.insert( he );
}
//trace all the boundary loops
while( !boundary_hes.empty() )
{
//get the first boundary halfedge
std::set<CHalfEdge*>::iterator siter = boundary_hes.begin();
CHalfEdge * he = *siter;
//trace along this boundary halfedge
CLoop<CVertex, CEdge, CFace, CHalfEdge> * pL = new CLoop<CVertex, CEdge, CFace, CHalfEdge>( m_pMesh, he );
assert(pL);
m_loops.push_back( pL );
//remove all the boundary halfedges, which are in the same boundary loop as the head, from the halfedge list
for( std::list<CHalfEdge*>::iterator hiter = pL->halfedges().begin();
hiter != pL->halfedges().end(); hiter ++ )
{
CHalfEdge * he = *hiter;
siter = boundary_hes.find( he );
if( siter == boundary_hes.end() ) continue;
boundary_hes.erase( siter );
}
}
//std::sort( vlps.begin(), vlps.end(), loop_compare<CVertex,CFace,CEdge,CHalfEdge> );
| void MeshLib::CBoundary< CVertex, CEdge, CFace, CHalfEdge >::_bubble_sort | ( | std::vector< CLoop< CVertex, CEdge, CFace, CHalfEdge > * > & | loops | ) | [protected] |
Bubble sort the loops
| loops | the vector of loops |
_bubble_sort bubble sort a vector of boundary loop objects, according to their lengths
| loops | vector of loops |
Definition at line 164 of file boundary.h.
{
int i, j, flag = 1; // set flag to 1 to start first pass
CLoop<CVertex,CEdge,CFace,CHalfEdge> * temp; // holding variable
int numLength = (int)loops.size( );
for(i = 1; (i <= numLength) && flag; i++)
{
flag = 0;
for (j=0; j < (numLength -1); j++)
{
if (loops[j+1]->length() > loops[j]->length() ) // ascending order simply changes to <
{
temp = loops[j]; // swap elements
loops[j] = loops[j+1];
loops[j+1] = temp;
flag = 1; // indicates that a swap occurred.
}
}
std::vector<TLoop*> MeshLib::CBoundary< CVertex, CEdge, CFace, CHalfEdge >::m_loops [protected] |
List of boundary loops.
Definition at line 118 of file boundary.h.
CBaseMesh<CVertex,CEdge,CFace,CHalfEdge>* MeshLib::CBoundary< CVertex, CEdge, CFace, CHalfEdge >::m_pMesh [protected] |
Pointer to the current mesh.
Definition at line 114 of file boundary.h.
1.7.1