本文整理汇总了C++中AnsiStr::lfindstr方法的典型用法代码示例。如果您正苦于以下问题:C++ AnsiStr::lfindstr方法的具体用法?C++ AnsiStr::lfindstr怎么用?C++ AnsiStr::lfindstr使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AnsiStr
的用法示例。
在下文中一共展示了AnsiStr::lfindstr方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: resetMesh
void resetMesh() {
//remove it from scenegraph
if(g_lpTissue) {
TheSceneGraph::Instance().world()->removeRawRigidBody(g_lpTissue->getB3RigidBody());
TheSceneGraph::Instance().remove(g_lpTissue);
SAFE_DELETE(g_lpTissue);
}
VolMesh* temp = NULL;
if(FileExists(g_strFilePath)) {
temp = new PS::MESH::VolMesh();
LogInfoArg1("Begin to read vega file from: %s", g_strFilePath.cptr());
bool res = PS::MESH::VolMeshIO::readVega(temp, g_strFilePath);
if(!res)
LogErrorArg1("Unable to load mesh from: %s", g_strFilePath.cptr());
}
else {
AnsiStr strExample = g_parser.value<AnsiStr>("example");
int pos = -1;
if(strExample == "one")
temp = PS::MESH::VolMeshSamples::CreateOneTetra();
else if(strExample == "two")
temp = PS::MESH::VolMeshSamples::CreateTwoTetra();
else if(strExample.lfindstr(AnsiStr("cube"), pos)) {
U32 nx, ny, nz = 0;
sscanf(strExample.cptr(), "cube_%u_%u_%u", &nx, &ny, &nz);
temp = PS::MESH::VolMeshSamples::CreateTruthCube(nx, ny, nz, 0.2);
}
else if(strExample.lfindstr(AnsiStr("eggshell"), pos)) {
U32 nx, ny;
//float radius, thickness;
sscanf(strExample.cptr(), "eggshell_%u_%u", &nx, &ny);
temp = PS::MESH::VolMeshSamples::CreateEggShell(nx, ny);
}
else
temp = PS::MESH::VolMeshSamples::CreateOneTetra();
}
LogInfo("Loaded mesh to temp");
g_lpTissue = new SGBulletRigidBodyCuttableMesh(*temp, temp->countNodes());
g_lpTissue->setFlagDrawSweepSurf(false);
g_lpTissue->setDrawNodes(false);
g_lpTissue->setDrawWireFrame(false);
g_lpTissue->setFlagSplitMeshAfterCut(false);
g_lpTissue->setFlagDrawAABB(false);
TheSceneGraph::Instance().world()->addRawRigidBody(g_lpTissue->getB3RigidBody());
TheSceneGraph::Instance().add(g_lpTissue);
g_lpTissue->setAnimate(false);
SAFE_DELETE(temp);
g_lpAvatar->setTissue(g_lpTissue);
LogInfo("Mesh loaded");
}
示例2: gpuInfo
AnsiStr SceneGraph::gpuInfo() {
AnsiStr strVendorName = AnsiStr((const char*)glGetString(GL_VENDOR));
AnsiStr strRenderer = AnsiStr((const char*)glGetString(GL_RENDERER));
AnsiStr strVersion = AnsiStr((const char*)glGetString(GL_VERSION));
AnsiStr strExtensions = AnsiStr((const char*)glGetString(GL_EXTENSIONS));
int pos;
if(strVendorName.lfindstr("Intel", pos)) {
cout << "WARNING: Integrated GPU is being used!" << endl;
LogWarning("Non-Discrete GPU selected for rendering!");
}
return AnsiStr("GPU: ") + strVendorName + ", " + strRenderer + ", " + strVersion;
}