本文整理汇总了C++中basicgl::Graphic::getSelectName方法的典型用法代码示例。如果您正苦于以下问题:C++ Graphic::getSelectName方法的具体用法?C++ Graphic::getSelectName怎么用?C++ Graphic::getSelectName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类basicgl::Graphic
的用法示例。
在下文中一共展示了Graphic::getSelectName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setSymbolType
//------------------------------------------------------------------------------
// setSymbolType() - change an existing symbol type to another type
//------------------------------------------------------------------------------
bool SymbolLoader::setSymbolType(const int idx, const int nType)
{
bool ok = false;
// Find the symbol
if (idx >= 1 && idx <= MAX_SYMBOLS) {
const int i = (idx - 1);
if (symbols[i] != 0) {
// Find the graphic template for this type symbol, and make
// sure that the template is a BasicGL::Graphic, since it
// will be use as the symbol's graphical component.
if (templates != 0) {
Basic::Pair* tpair = templates->getPosition(nType);
if (tpair != 0) {
BasicGL::Graphic* tg = dynamic_cast<BasicGL::Graphic*>(tpair->object());
if (tg != 0) {
// Get the symbol's old graphical component
Basic::Pair* oldPair = (Basic::Pair*) symbols[i]->getSymbolPair();
BasicGL::Graphic* oldG = (BasicGL::Graphic*) (oldPair->object());
// Clone the new graphical component from the template
Basic::Pair* newPair = tpair->clone();
// Set the new graphical component's select name using the old's
BasicGL::Graphic* newGraph = (BasicGL::Graphic*) newPair->object();
GLuint mySelName = oldG->getSelectName();
newGraph->setSelectName(mySelName);
// Add the new and remove the old components from our subcomponent list
{
Basic::PairStream* comp = getComponents();
Basic::Component::processComponents(comp, typeid(BasicGL::Graphic), newPair, oldG);
if (comp != 0) comp->unref();
}
// Set the symbol's graphical component pointer
symbols[i]->setSymbolPair( newPair );
newPair->unref(); // symbol[i] now owns it.
// Set new type
symbols[i]->setType( nType );
ok = true;
}
}
}
}
}
return ok;
}