本文整理汇总了C++中TIntSet::begin方法的典型用法代码示例。如果您正苦于以下问题:C++ TIntSet::begin方法的具体用法?C++ TIntSet::begin怎么用?C++ TIntSet::begin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TIntSet
的用法示例。
在下文中一共展示了TIntSet::begin方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: end
void end( const TWallVertexVector& vb, TIntVector& polygon, TIntVector& ib )
{
assert( polygonCount );
if( polygonCount == 1 ) {
// trivial case, just output input polygon
polygon.resize( 0 );
polygon.reserve( vertices.size() );
int idx0 = *vertices.begin();
int idx = idx0;
do {
polygon.push_back( idx );
const TIntVector& vnext = vertexNexts[idx];
assert( vnext.size() == 1 );
idx = vnext[0];
} while( idx != idx0 );
triangulator::process( vb, polygon, ib );
} else {
// mark vertex types
markVertexTypes();
// trace and triangulate the polygon(s)
traceBorder( vb, polygon, ib );
}
}
示例2: if
void markVertexTypes()
{
TIntSet::const_iterator vit, vitEnd = vertices.end();
// first pass: mark all interior and single-border vertices
for( vit = vertices.begin(); vit != vitEnd; ++vit ) {
int idx = *vit;
if( vertexUseCount[idx] == 1 ) {
vertexTypes[idx] = VTYPE_SINGLE;
borderVertices.insert( idx );
} else if( isVertexInterior(idx) )
vertexTypes[idx] = VTYPE_INTERIOR;
}
// now, the unmarked vertices are all shared and on border
for( vit = vertices.begin(); vit != vitEnd; ++vit ) {
int idx = *vit;
if( vertexTypes[idx] == VTYPE_NONE ) {
vertexTypes[idx] = VTYPE_MULTI;
borderVertices.insert( idx );
}
}
}
示例3:
int getBorderIndex()
{
if( borderVertices.empty() )
return -1;
return *borderVertices.begin();
}