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


C++ Appearance::apply方法代码示例

本文整理汇总了C++中Appearance::apply方法的典型用法代码示例。如果您正苦于以下问题:C++ Appearance::apply方法的具体用法?C++ Appearance::apply怎么用?C++ Appearance::apply使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Appearance的用法示例。


在下文中一共展示了Appearance::apply方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: drawPrims

void DisplayList::drawPrims(string appearance) {
	vector<MyPrimitive *>::const_iterator it;

	for (it = prims.begin(); it != prims.end(); it++) {
		Appearance *app = Scene::getInstance()->getAppearance(appearance);
		app->apply();
		(*it)->setAppearance(appearance);
		(*it)->draw();
		(*it)->clearAppearance();
	}
}
开发者ID:diogojapinto,项目名称:laig_proj1,代码行数:11,代码来源:DisplayList.cpp

示例2: processDisplayLists

void ProjectScene::processDisplayLists(Node* n, Node* graphRoot){
	
	
	if (n->getAppearance() != NULL)
		n->getAppearance()->apply();
	int numFilhos = n->getDescendentes().size();
	for (int i = 0; i < numFilhos; i++){
		this->processDisplayLists(n->getDescendenteIndex(i), graphRoot);
	}


	if (n->getDisplayList()){
		//printf("nome do no: %s\n", n->getId().c_str());
		
		printf("---------------------------\nfazer lista:\n");

		Appearance*  temp = new Appearance();
		if (n->getAppearance() == NULL){
			//printf("vai procurar aparencia aos ascendentes\n");
			temp = getClosestParentAppearance(graphRoot, n);
		}
		else temp = n->getAppearance();
		
		if (temp != NULL) temp->apply();

		n->setAparencia(temp);
		printf("	nome aparencia: %s\n",temp->getId());




		if (n->getDisplayListID() == -1){
			int id = glGenLists(1);
			n->setDisplayListID(id);

			n->setDisplayList(false); //serve para forçar o drawAux a desenhar 
									  //este nó como um nó "normal" (sem lista)

			glNewList(n->getDisplayListID(), GL_COMPILE);
				this->drawAux(n);
			glEndList();

			n->setDisplayList(true); //restaura a "true" após o processamento do nó

			printf("fim lista:\n---------------------------\n");
		}
	
	}
}
开发者ID:Filfmira,项目名称:LAIG-Project,代码行数:49,代码来源:ProjectScene.cpp


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