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


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

本文整理汇总了C++中RendererPtr::isnull方法的典型用法代码示例。如果您正苦于以下问题:C++ RendererPtr::isnull方法的具体用法?C++ RendererPtr::isnull怎么用?C++ RendererPtr::isnull使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在RendererPtr的用法示例。


在下文中一共展示了RendererPtr::isnull方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: destroyRenderer

bool Object::destroyRenderer(qlib::uid_t uid)
{
  // get renderer ptr/check consistency
  rendtab_t::iterator i = m_rendtab.find(uid);
  if (i==m_rendtab.end())
    return false;

  RendererPtr pRend = i->second;
  ScenePtr pScene = getScene();

  if (pScene.isnull() || pRend.isnull()) {
    LOG_DPRINTLN("Object::destroyRenderer> fatal error pScene or pRend is NULL!");
    return false;
  }

  // detach renderer from the view-related resources (DL, VBO, etc)
  pRend->unloading();

  // Detach the parent scene from the renderer event source
  pRend->removeListener(pScene.get());

  // Fire the SCE_REND_REMOVING Event, before removing the renderer
  {
    MB_DPRINTLN("Object> Firing SCE_REND_REMOVING event...");
    SceneEvent ev;
    ev.setType(SceneEvent::SCE_REND_REMOVING);
    ev.setSource(getSceneID());
    ev.setTarget(pRend->getUID());
    pScene->fireSceneEvent(ev);
  }

  // remove the rend from the scene's cache list
  pScene->removeRendCache(pRend);

  // 2012/9/30
  // Detach the rend from obj HERE is very important!!
  // (This call remove the rend from object's event listener list.
  //  Otherwise, deleted ptr will remain in the listener list, and thus cause crash!!)
  qlib::uid_t objid = pRend->detachObj();
  // MB_ASSERT(objid==this->m_uid);
  
  // 2012/9/30
  // Setting scene ID to null will cause removing pRend from the scene's listener list
  // (Without this, deleted ptr will remain in scene's listener list, after clearing the UNDO data!!)
  pRend->setSceneID(qlib::invalid_uid);

  // Remove from the renderer table
  m_rendtab.erase(i);

  // Record undo/redo info
  UndoManager *pUM = pScene->getUndoMgr();
  if (pUM->isOK()) {
    ObjLoadEditInfo *pPEI = MB_NEW ObjLoadEditInfo;
    pPEI->setupRendDestroy(getUID(), pRend);
    pUM->addEditInfo(pPEI);
  }

  return true;
}
开发者ID:biochem-fan,项目名称:cuemol2,代码行数:59,代码来源:Object.cpp

示例2: onPropInit

void RealPropAnim::onPropInit(AnimMgr *pMgr, qlib::uid_t tgt_uid)
{
  RendererPtr pTgtRend = qsys::SceneManager::getRendererS(tgt_uid);
  if (pTgtRend.isnull()) {
    LOG_DPRINTLN("RealPropAnim.onPropInit> Unknown tgt uid %d", int(tgt_uid));
    return;
  }
  qlib::LVariant var(m_startValue);
  pTgtRend->setProperty(getPropName(), var);
}
开发者ID:CueMol,项目名称:cuemol2,代码行数:10,代码来源:RealPropAnim.cpp

示例3: onPropInit

void ShowHideAnim::onPropInit(AnimMgr *pMgr, qlib::uid_t tgt_uid)
{
  RendererPtr pTgtRend = qsys::SceneManager::getRendererS(tgt_uid);
  if (pTgtRend.isnull()) {
    LOG_DPRINTLN("ShowHideAnim.onPropInit> Unknown tgt uid %d", int(tgt_uid));
    return;
  }

  if (m_bHide) {
    setVisible(pTgtRend, true);
    if (m_bFade)
      pTgtRend->setPropReal("alpha", m_dTgtAlpha);
  }
  else {
    MB_DPRINTLN("ShowHideAnim.onPropInit> SetVisible FALSE!!!");
    setVisible(pTgtRend, false);
    if (m_bFade)
      pTgtRend->setPropReal("alpha", 0.0);
  }
}
开发者ID:CueMol,项目名称:cuemol2,代码行数:20,代码来源:ShowHideAnim.cpp

示例4: dump

void Object::dump() const
{
  ScenePtr rscn = getScene();

  MB_DPRINT("Object: %s", toString().c_str());
  MB_DPRINT(": {");

  RendIter iter = beginRend();
  for (; iter!=endRend(); ++iter) {
    RendererPtr rrend = iter->second;
    if (!rrend.isnull()) {
      MB_DPRINT("rend %p/%d (nref=%d): ", rrend.get(), rrend->getUID(), rrend.use_count());
      //rrend->dump();
    }
    else {
      MB_DPRINTLN("(invalid rend %d)", iter->first);
    }
  }
  
  MB_DPRINTLN("}");
}
开发者ID:biochem-fan,项目名称:cuemol2,代码行数:21,代码来源:Object.cpp


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