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


C++ ViewPtr::getHeight方法代码示例

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


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

示例1: write

void PovSceneExporter::write()
{
  PovDisplayContext *ppovdc = MB_NEW PovDisplayContext();

  LString str_povpath = getPath();
  LString str_incpath = getPath("inc");

  // Check and mangle the path names
  if (m_bMakeRelIncPath) {
    if (!str_povpath.isEmpty() && !str_incpath.isEmpty()) {
      // Check and modify the main pov file path
      fs::path povpath(str_povpath);
      if (!povpath.is_complete()) {
#if (BOOST_FILESYSTEM_VERSION==2)
        povpath = fs::complete(povpath);
        setPath(povpath.file_string());
#else
        povpath = fs::absolute(povpath);
        setPath(povpath.string());
#endif
      }
      fs::path base_path = povpath.parent_path();
      // Check and modify the inc file path
      fs::path incpath(str_incpath);
      if (!incpath.is_complete()) {
        ppovdc->setIncFileName(str_incpath);
#if (BOOST_FILESYSTEM_VERSION==2)
        incpath = fs::complete(incpath, base_path);
        setPath("inc", incpath.file_string());
#else
        incpath = fs::absolute(incpath, base_path);
        setPath("inc", incpath.string());
#endif
      }
      else {
        // make the inc-file path relative
#if (BOOST_FILESYSTEM_VERSION==2)
        LString relpath = qlib::makeRelativePath(str_incpath, base_path.directory_string());
#else
        LString relpath = qlib::makeRelativePath(str_incpath, base_path.string());
#endif
        ppovdc->setIncFileName(relpath);
      }
    }
  }
  else {
    ppovdc->setIncFileName(str_incpath);
  }
  
  // Main stream
  qlib::OutStream *pOutPov = createOutStream();
  // Sub stream (inc file)
  qlib::OutStream *pOutInc = createOutStream("inc");

  ScenePtr pScene = getClient();

  CameraPtr pCam = getCamera();
  qlib::ensureNotNull(pCam.get());

  // ppovdc->setTargetView(pView);
  ppovdc->init(pOutPov, pOutInc);
  //ppovdc->startPovRender();
  
  ppovdc->setClipZ(m_bUseClipZ);
  ppovdc->setPostBlend(m_bPostBlend);
  ppovdc->setPerspective(m_bPerspective);
  ppovdc->setBgColor(pScene->getBgColor());

  ppovdc->enableEdgeLines(m_bEnableEdgeLines);
  ppovdc->setCreaseLimit(m_dCreaseLimit);
  ppovdc->setEdgeRise(m_dEdgeRise);

  const double zoom = pCam->getZoom();
  ppovdc->setZoom(zoom);
  ppovdc->setSlabDepth(pCam->getSlabDepth());
  ppovdc->setViewDist(pCam->getCamDist());

  ppovdc->loadIdent();
  ppovdc->rotate(pCam->m_rotQuat);
  ppovdc->translate(-(pCam->m_center));
  
  // calc line width factor
  int height = getHeight();
  if (height<=0 && pScene->getViewCount()>0) {
    ViewPtr pView = pScene->beginView()->second;
    double hpix = pView->getHeight();
    ppovdc->setLineScale(zoom/hpix);
  }
  else {
    MB_DPRINTLN("POV> hint image height=%d", height);
    const double fac = zoom/( double(height)*1.5 );
    MB_DPRINTLN("POV> line scale factor=%f", fac);
    ppovdc->setLineScale(fac);
  }

  pScene->display(ppovdc);

  m_strBlendTab = ppovdc->getPostBlendTableJSON();

  //ppovdc->endPovRender();
//.........这里部分代码省略.........
开发者ID:biochem-fan,项目名称:cuemol2,代码行数:101,代码来源:PovSceneExporter.cpp


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