本文整理汇总了C++中NormsIndexesTableType::capacity方法的典型用法代码示例。如果您正苦于以下问题:C++ NormsIndexesTableType::capacity方法的具体用法?C++ NormsIndexesTableType::capacity怎么用?C++ NormsIndexesTableType::capacity使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NormsIndexesTableType
的用法示例。
在下文中一共展示了NormsIndexesTableType::capacity方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: loadFile
//.........这里部分代码省略.........
try
{
unsigned lineCount = 0;
unsigned polyCount = 0;
QString currentLine = stream.readLine();
while (!currentLine.isNull())
{
if ((++lineCount % 2048) == 0)
{
if (pDlg.wasCanceled())
{
error = true;
objWarnings[CANCELLED_BY_USER] = true;
break;
}
pDlg.setValue(static_cast<int>(file.pos()));
QApplication::processEvents();
}
QStringList tokens = QString(currentLine).split(QRegExp("\\s+"),QString::SkipEmptyParts);
//skip comments & empty lines
if( tokens.empty() || tokens.front().startsWith('/',Qt::CaseInsensitive) || tokens.front().startsWith('#',Qt::CaseInsensitive) )
{
currentLine = stream.readLine();
continue;
}
/*** new vertex ***/
if (tokens.front() == "v")
{
//reserve more memory if necessary
if (vertices->size() == vertices->capacity())
{
if (!vertices->reserve(vertices->capacity()+MAX_NUMBER_OF_ELEMENTS_PER_CHUNK))
{
objWarnings[NOT_ENOUGH_MEMORY] = true;
error = true;
break;
}
}
//malformed line?
if (tokens.size() < 4)
{
objWarnings[INVALID_LINE] = true;
error = true;
break;
}
CCVector3d Pd( tokens[1].toDouble(), tokens[2].toDouble(), tokens[3].toDouble() );
//first point: check for 'big' coordinates
if (pointsRead == 0)
{
if (HandleGlobalShift(Pd,Pshift,parameters))
{
vertices->setGlobalShift(Pshift);
ccLog::Warning("[OBJ] Cloud has been recentered! Translation: (%.2f,%.2f,%.2f)",Pshift.x,Pshift.y,Pshift.z);
}
}
//shifted point
CCVector3 P = CCVector3::fromArray((Pd + Pshift).u);
vertices->addPoint(P);