本文整理汇总了C++中IndexVector::end方法的典型用法代码示例。如果您正苦于以下问题:C++ IndexVector::end方法的具体用法?C++ IndexVector::end怎么用?C++ IndexVector::end使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IndexVector
的用法示例。
在下文中一共展示了IndexVector::end方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: while
void
AdjacencyRansac::InvalidateQueryIndices(IndexVector &query_indices)
{
if (query_indices.empty())
return;
// Figure out the points with those query indices
std::sort(query_indices.begin(), query_indices.end());
IndexVector::iterator end = std::unique(query_indices.begin(), query_indices.end());
query_indices.resize(end - query_indices.begin());
IndexVector indices_to_remove;
indices_to_remove.reserve(query_indices_.size());
IndexVector::const_iterator iter = query_indices.begin();
BOOST_FOREACH(unsigned int index, valid_indices_){
unsigned int query_index = query_indices_[index];
if (query_index < *iter)
continue;
// If the match has a keypoint in the inliers, remove the match
while ((iter != end) && (query_index > *iter))
++iter;
if (query_index == *iter)
{
indices_to_remove.push_back(index);
continue;
}
if (iter == end)
break;
}
示例2: removeIndex
void
Selection::removeIndex (const IndexVector &indices)
{
IndexVector::const_iterator it;
for(it = indices.begin(); it != indices.end(); ++it)
removeIndex(*it);
}
示例3: testInterleavedSortingWithPops
void testInterleavedSortingWithPops()
{
DPQ dpq;
IndexVector idVector;
const Index MAXI( 101 );
for( int n( MAXI-1 ); n != 0 ; n-=2 )
{
const Index id( dpq.push( n ) );
if( n == 12 || n == 46 )
{
idVector.push_back( id );
}
}
dpq.pop( idVector.back() );
idVector.pop_back();
BOOST_CHECK_EQUAL( MAXI/2 -1, dpq.getSize() );
BOOST_CHECK( dpq.checkConsistency() );
for( int n( MAXI ); n != -1 ; n-=2 )
{
const Index id( dpq.push( n ) );
if( n == 17 || n == 81 )
{
idVector.push_back( id );
}
}
for( typename IndexVector::const_iterator i( idVector.begin() );
i != idVector.end(); ++i )
{
dpq.pop( *i );
}
BOOST_CHECK( dpq.checkConsistency() );
BOOST_CHECK_EQUAL( MAXI-4, dpq.getSize() );
int n( 0 );
while( ! dpq.isEmpty() )
{
++n;
if( n == 12 || n == 46 || n == 17 || n == 81 )
{
continue;
}
BOOST_CHECK_EQUAL( n, dpq.getTop() );
dpq.popTop();
}
BOOST_CHECK_EQUAL( MAXI, Index( n ) );
BOOST_CHECK( dpq.isEmpty() );
BOOST_CHECK( dpq.checkConsistency() );
}
示例4:
osg::Vec3f TriangleMeshSmoother::cumulateTriangleNormals(const IndexVector& triangles) const {
osg::Vec3f normal;
normal.set(0.f, 0.f, 0.f);
for(IndexVector::const_iterator triangle = triangles.begin() ; triangle != triangles.end() ; ++ triangle) {
const Triangle& t = _graph->triangle(*triangle);
normal += (t._normal * t._area);
}
return normal;
}
示例5: replaceVertexIndexInTriangles
void TriangleMeshSmoother::replaceVertexIndexInTriangles(const IndexVector& triangles, unsigned int oldIndex, unsigned int newIndex) {
for(IndexVector::const_iterator tri = triangles.begin() ; tri != triangles.end() ; ++ tri) {
Triangle& triangle = _graph->triangle(*tri);
if(triangle.v1() == oldIndex) {
triangle.v1() = newIndex;
}
else if(triangle.v2() == oldIndex) {
triangle.v2() = newIndex;
}
else if(triangle.v3() == oldIndex) {
triangle.v3() = newIndex;
}
}
}
示例6: testSimpleSortingWithPops
void testSimpleSortingWithPops()
{
DPQ dpq;
IndexVector idVector;
const Index MAXI( 100 );
for( int n( MAXI ); n != 0 ; --n )
{
Index id( dpq.push( n ) );
if( n == 11 || n == 45 )
{
idVector.push_back( id );
}
}
BOOST_CHECK( dpq.checkConsistency() );
BOOST_CHECK_EQUAL( MAXI, dpq.getSize() );
for( typename IndexVector::const_iterator i( idVector.begin() );
i != idVector.end(); ++i )
{
dpq.pop( *i );
}
BOOST_CHECK_EQUAL( MAXI - 2, dpq.getSize() );
int n( 0 );
while( ! dpq.isEmpty() )
{
++n;
if( n == 11 || n == 45 )
{
continue; // skip
}
BOOST_CHECK_EQUAL( int( n ), dpq.getTop() );
dpq.popTop();
}
BOOST_CHECK_EQUAL( MAXI, Index( n ) );
BOOST_CHECK( dpq.isEmpty() );
BOOST_CHECK( dpq.checkConsistency() );
}
示例7: pen
postTable::postTable (OpenTypeFile &aFont, MemoryBlockPtr memory) : Table (aFont)
{
MemoryPen pen (memory);
version = pen.readFixed();
if (version != 0x00020000 && version != 0x00030000)
throw Exception ("Unsupported table version: " + String (version, 16));
italicAngle = pen.readFixed();
underlinePosition = pen.readFWord();
underlineThickness = pen.readFWord();
isFixedPitch = pen.readULong();
minMemType42 = pen.readULong();
maxMemType42 = pen.readULong();
minMemType1 = pen.readULong();
maxMemType1 = pen.readULong();
if (version == 0x00020000) {
// Read glyph names
UShort glyphNum = pen.readUShort();
typedef vector<UShort> IndexVector;
IndexVector glyphNameIndices;
glyphNameIndices.reserve (glyphNum);
UShort i;
for (i = 0; i < glyphNum; i++)
glyphNameIndices.push_back (pen.readUShort());
vector<String> extraNames;
IndexVector::iterator index;
for (index = glyphNameIndices.begin(); index != glyphNameIndices.end(); index ++) {
if (*index < MACINTOSH_SET_SIZE)
postNames.push_back (macGlyphs [*index]);
else {
UShort extraIndex = *index - MACINTOSH_SET_SIZE;
while (extraNames.size() <= extraIndex) {
Byte nameLength = pen.readByte();
extraNames.push_back (pen.readString (nameLength));
}
postNames.push_back (extraNames [extraIndex]);
}
}
}
}
示例8:
void
TopologyGraph::dumpBoundary(const IndexVector& boundary, const std::string& filename)
{
if (boundary.empty())
return;
osg::Vec3Array* v = new osg::Vec3Array();
for (IndexVector::const_iterator i = boundary.begin(); i != boundary.end(); ++i)
{
const Index& index = *i;
v->push_back(osg::Vec3(index->x(), index->y(), 0));
}
osg::ref_ptr<osg::Geometry> g = new osg::Geometry();
g->setVertexArray(v);
g->addPrimitiveSet(new osg::DrawArrays(GL_LINE_LOOP, 0, v->size()));
g->addPrimitiveSet(new osg::DrawArrays(GL_POINTS, 0, v->size()));
g->getOrCreateStateSet()->setAttributeAndModes(new osg::Point(3));
osgDB::writeNodeFile(*(g.get()), filename);
}
示例9:
void
Selection::addIndex (const IndexVector &indices)
{
selected_indices_.insert(indices.begin(), indices.end());
}