当前位置: 首页>>代码示例>>C++>>正文


C++ AnsiStr::lfindstr方法代码示例

本文整理汇总了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");
}
开发者ID:GraphicsEmpire,项目名称:softrigiddynamics,代码行数:57,代码来源:main.cpp

示例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;
}
开发者ID:dxd39,项目名称:tetcutter,代码行数:14,代码来源:SceneGraph.cpp


注:本文中的AnsiStr::lfindstr方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。