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


C++ FaceList::push_back方法代码示例

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


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

示例1: f_handler

bool PLY2Reader::loadPLY2Mesh(std::shared_ptr<Shape> shape, std::string fname)
{
  std::ifstream f_handler(fname);
  if (!f_handler)
  {
    std::cout << "Open file failed.\n";
    return false;
  }

  std::string line;
  std::stringstream ss;

  int num_vertex = 0;
  int num_face = 0;
  VertexList vertexList;
  FaceList faceList;
  STLVectorf UVList;

  getline(f_handler, line);
  ss.str(line);
  ss >> num_vertex;
  getline(f_handler, line);
  ss.str(line);
  ss >> num_face;

  for (int i = 0; i < num_vertex; ++i)
  {
    float v;
    for (int j = 0; j < 3; ++j)
    {
      getline(f_handler, line);
      ss.str(line);
      ss >> v;
      vertexList.push_back(v);
    }
  }

  for (int i = 0; i < num_face; ++i)
  {
    int f;
    for (int j = 0; j < 3; ++j)
    {
      getline(f_handler, line);
      ss.str(line);
      ss >> f;
      faceList.push_back(f);
    }
  }

  shape->init(vertexList, faceList, UVList);
  return true;
}
开发者ID:xiaojhl,项目名称:Image-2-Shape,代码行数:52,代码来源:PLY2Reader.cpp

示例2: FaceList

/**
 * Prints the polyhedra on the screen by calculating the intersection of three meshes 
 * each time.
 */
FaceList *
Polyhedron::print()
{
    FaceList * printing = new FaceList();
    FaceList::iterator iter;

    /* Going through the list of points and copy them into the new list. */
    for (iter = faces.begin(); iter != faces.end(); iter++) {
        printing->push_back((*iter)->transform(org, angle));
    }

    return printing;
}
开发者ID:fenixGames,项目名称:GEngine,代码行数:17,代码来源:geometry3D.cpp

示例3: findNeighbors

void PolyMesh::findNeighbors( Face* f, FaceList& flist )
{
    unsigned int size = f->_pts.size();
    for ( unsigned int i=0; i<size; ++i )
    {
        Edge* edge = getEdge( (*f)[i%size], (*f)[(i+1)%size], _edges );
        if ( !edge ) continue;

        for ( FaceList::iterator itr=edge->_faces.begin();
            itr!=edge->_faces.end();
            ++itr )
        {
            if ( *itr!=f )
                flist.push_back( *itr );
        }
    }
}
开发者ID:kapecp,项目名称:osgmodeling,代码行数:17,代码来源:PolyMesh.cpp


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