本文整理汇总了C++中RendererPtr::displayLabels方法的典型用法代码示例。如果您正苦于以下问题:C++ RendererPtr::displayLabels方法的具体用法?C++ RendererPtr::displayLabels怎么用?C++ RendererPtr::displayLabels使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RendererPtr
的用法示例。
在下文中一共展示了RendererPtr::displayLabels方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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);
}