本文整理汇总了C++中NormsIndexesTableType::resize方法的典型用法代码示例。如果您正苦于以下问题:C++ NormsIndexesTableType::resize方法的具体用法?C++ NormsIndexesTableType::resize怎么用?C++ NormsIndexesTableType::resize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NormsIndexesTableType
的用法示例。
在下文中一共展示了NormsIndexesTableType::resize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: loadFile
//.........这里部分代码省略.........
//}
if (error)
break;
currentLine = stream.readLine();
}
}
catch (const std::bad_alloc&)
{
//not enough memory
objWarnings[NOT_ENOUGH_MEMORY] = true;
error = true;
}
file.close();
//1st check
if (!error && pointsRead == 0)
{
//of course if there's no vertex, that's the end of the story ...
ccLog::Warning("[OBJ] Malformed file: no vertex in file!");
error = true;
}
if (!error)
{
ccLog::Print("[OBJ] %i points, %u faces",pointsRead,totalFacesRead);
if (texCoordsRead > 0 || normsRead > 0)
ccLog::Print("[OBJ] %i tex. coords, %i normals",texCoordsRead,normsRead);
//do some cleaning
if (vertices->size() < vertices->capacity())
vertices->resize(vertices->size());
if (normals && normals->currentSize() < normals->capacity())
normals->resize(normals->currentSize());
if (texCoords && texCoords->currentSize() < texCoords->capacity())
texCoords->resize(texCoords->currentSize());
if (baseMesh->size() == 0)
{
delete baseMesh;
baseMesh = 0;
}
else if (baseMesh->maxSize() > baseMesh->size())
{
baseMesh->resize(baseMesh->size());
}
if ( maxVertexIndex >= pointsRead
|| maxTexCoordIndex >= texCoordsRead
|| maxTriNormIndex >= normsRead)
{
//hum, we've got a problem here
ccLog::Warning("[OBJ] Malformed file: indexes go higher than the number of elements! (v=%i/tc=%i/n=%i)",maxVertexIndex,maxTexCoordIndex,maxTriNormIndex);
if (maxVertexIndex >= pointsRead)
{
error = true;
}
else
{
objWarnings[INVALID_INDEX] = true;
if (maxTexCoordIndex >= texCoordsRead)
{
texCoords->release();
texCoords = 0;
materials->release();