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


C++ GeometryPtr::clone方法代码示例

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


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

示例1: convert

void FaceSpatializeIndexed<BasicTraits>::Category::addData (OpenSGFaceBase<OpenSGTraits>* arg)
{
   FaceIterator face = arg->getOriginal();
   if (
       face.getGeometry()->getMaterial()->isTransparent() // transparent face
       && m_trans.find(arg->getObjectAdapter().getNode()) != m_trans.end() // not processed
       ) { 
      // create object adapter
      OSGObjectBase convert(arg->getObjectAdapter().getNode());
      convert.setObjectAdapter(&arg->getObjectAdapter());
      NodePtr             newNode = Node::create();
      m_trans[convert.getOriginal()] = newNode;
      GeometryPtr         oldCore = GeometryPtr::dcast(convert.getOriginal()->getCore());
      GeometryPtr         newCore = oldCore->clone();
      beginEditCP(newNode);
      newNode->setCore(newCore);
      endEditCP(newNode);
      beginEditCP(newCore);
      newCore->setPositions(convert.getPositions());
      newCore->setNormals  (convert.getNormals());
      endEditCP(newCore);

      beginEditCP(m_root);
      m_root->addChild(newNode);
      endEditCP(m_root);

      return;
   }
   ++m_totalFaces;

   typename CategoryList::iterator c;
   for (c = m_all.begin();
	c != m_all.end();
	++c) {
      if ((*c)->isThisCategory(face)) {
         break;
      }
   }
   if (c == m_all.end()) { // new category
#if 0
      MaterialGroupPtr mat = MaterialGroup::create();
      beginEditCP(mat);
      mat->setMaterial(face.getGeometry()->getMaterial());
      endEditCP(mat);
      NodePtr matNode = Node::create();
      beginEditCP(matNode);
      matNode->setCore(mat);
      endEditCP(matNode);
      beginEditCP(m_root);
      m_root->addChild(matNode);
      endEditCP(m_root);
      c = m_all.insert(m_all.end(), new CategoryGeneral(matNode, arg, face));
#else
      c = m_all.insert(m_all.end(), new CategoryGeneral(m_root, arg, face));
#endif
      ++m_numGeom;
   }
   (*c)->addData(arg, face);
}
开发者ID:BackupTheBerlios,项目名称:opensgplus,代码行数:59,代码来源:OSGGVFaceSpatializeIndexed.cpp

示例2: beginEditCP

typename Spatialize<BasicTraits>::ResultT  
Spatialize<BasicTraits>::LeafEnter  (AdapterType* node)
{
   // create new node with transformed positions and normals
   NodePtr     newNode = Node::create();
   GeometryPtr oldCore = GeometryPtr::dcast(node->getOriginal()->getCore());
   GeometryPtr newCore = oldCore->clone();
   beginEditCP(newNode);
   newNode->setCore(newCore);
   endEditCP(newNode);
   beginEditCP(newCore);
   newCore->setPositions(node->getPositions());
   newCore->setNormals  (node->getNormals());
   endEditCP(newCore);

   m_rootLevel->addChild(newNode);
   return SingleTraverserBase<BasicTraits>::CONTINUE;
}
开发者ID:BackupTheBerlios,项目名称:opensgplus,代码行数:18,代码来源:OSGGVSpatialize.cpp


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