本文整理汇总了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();
}
}
示例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");
}
}
}