本文整理汇总了C++中RendererPtr::getName方法的典型用法代码示例。如果您正苦于以下问题:C++ RendererPtr::getName方法的具体用法?C++ RendererPtr::getName怎么用?C++ RendererPtr::getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RendererPtr
的用法示例。
在下文中一共展示了RendererPtr::getName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: attachRenderer
void Object::attachRenderer(const RendererPtr &pRend)
{
if (pRend->getClientObjID()!=qlib::invalid_uid) {
// Error !! object is already attached to another object!!
LOG_DPRINTLN("ERROR !! Renderer already attached");
LString msg = LString::format("Renderer already attached %s", pRend->getName().c_str());
MB_THROW(qlib::RuntimeException, msg);
return;
}
MB_DPRINTLN("attachRenderer clientObjID=%d", (int)pRend->getClientObjID());
if (!registerRendererImpl(pRend)) {
// Error !! cannot register renderer.
LOG_DPRINTLN("ERROR !! cannot register renderer");
LString msg = LString::format("Cannot register renderer %s", pRend->getName().c_str());
MB_THROW(qlib::RuntimeException, msg);
return;
}
// update stylesheet settings
pRend->reapplyStyle();
}
示例2: convToLWScene
void LWViewerManager::convToLWScene(qsys::ScenePtr pScene, qsys::ScenePtr pNewScene)
{
#ifndef QM_BUILD_LW
qsys::AutoStyleCtxt(pScene->getUID());
Scene::ObjIter iter = pScene->beginObj();
Scene::ObjIter eiter = pScene->endObj();
std::deque<ObjectPtr> newobjs;
LString objname, rendname;
for (; iter!=eiter; ++iter) {
ObjectPtr pObj = iter->second;
LWObjPtr pNewObj(new LWObject);
objname = pObj->getName();
pNewObj->setName(objname);
pNewObj->setDefaultPropFlag("name", false);
if (!pObj->isVisible()) {
pNewObj->setVisible(false);
pNewObj->setDefaultPropFlag("visible", false);
}
pNewObj->startBuild();
Object::RendIter riter = pObj->beginRend();
Object::RendIter reiter = pObj->endRend();
for (; riter!=reiter; ++riter) {
RendererPtr pRend = riter->second;
// ignore selection renderer
if (qlib::LChar::equals(pRend->getTypeName(), "*selection"))
continue;
LWRendPtr pNewRend = pNewObj->createRenderer("lwrend");
// set name
rendname = pRend->getName();
if (rendname.isEmpty())
rendname = LString("(") + pRend->getTypeName() + LString(")");
pNewRend->setName(rendname);
pNewRend->setDefaultPropFlag("name", false);
if (!pRend->isVisible()) {
pNewRend->setVisible(false);
pNewRend->setDefaultPropFlag("visible", false);
}
// Set Data ID of LWRend
pNewRend->setDataID(pNewRend->getUID());
pNewRend->setDefaultPropFlag("data_id", false);
LWRendDisplayContext *pdc = MB_NEW LWRendDisplayContext();
pdc->init(pNewRend.get(), pNewObj.get());
pdc->setAlpha(pRend->getDefaultAlpha());
pdc->startRender();
pdc->startSection(objname+":"+rendname);
pRend->display(pdc);
pRend->displayLabels(pdc);
pdc->endSection();
pdc->endRender();
// make hittest data
if (pRend->isHitTestSupported()) {
pdc->startHit(pRend->getUID());
pRend->displayHit(pdc);
pdc->endHit();
}
delete pdc;
}
pNewObj->endBuild();
newobjs.push_back(pNewObj);
}
BOOST_FOREACH (ObjectPtr pElem, newobjs) {
pNewScene->addObject(pElem);
}