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


C++ RendererPtr::getName方法代码示例

本文整理汇总了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();
  
}
开发者ID:biochem-fan,项目名称:cuemol2,代码行数:22,代码来源:Object.cpp

示例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);
  }
开发者ID:CueMol,项目名称:cuemol2,代码行数:80,代码来源:LWViewerManager.cpp


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