本文整理汇总了C++中PolyhedronPtr::facets_begin方法的典型用法代码示例。如果您正苦于以下问题:C++ PolyhedronPtr::facets_begin方法的具体用法?C++ PolyhedronPtr::facets_begin怎么用?C++ PolyhedronPtr::facets_begin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PolyhedronPtr
的用法示例。
在下文中一共展示了PolyhedronPtr::facets_begin方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: tree
void MSDM2_Component::Matching_Multires_Init(PolyhedronPtr m_PolyDegrad, PolyhedronPtr m_PolyOriginal , Facet * _TabMatchedFacet)
{
// constructs AABB tree
AABB_Tree tree(m_PolyOriginal->facets_begin(),m_PolyOriginal->facets_end());
tree.accelerate_distance_queries();
//Searching for the closest point and facet for each vertex
int ind=0;
for(Vertex_iterator pVertex = m_PolyDegrad->vertices_begin();
pVertex != m_PolyDegrad->vertices_end();
pVertex++)
{
pVertex->MSDM2_Local=0;
// computes closest point and primitive id
Point_and_primitive_id pp = tree.closest_point_and_primitive(pVertex->point());
Point3d Nearest=pp.first;
Facet_iterator f_Nearest = pp.second; // closest primitive id
pVertex->match=Nearest;
_TabMatchedFacet[ind]=*f_Nearest;
ind++;
}
}
示例2: ConstructFaceColorMap
void VSA_Component::ConstructFaceColorMap(PolyhedronPtr pMesh)
{
//Vertex_iterator pVertex = NULL; // MT
Facet_iterator pFacet = pMesh->facets_begin();
for(;pFacet != pMesh->facets_end();pFacet++)
{
double R=(double)(pFacet->LabelVSA)/(double)pMesh->NbFaceLabel*255.;
int indiceLut=floor(R);
pFacet->color(LUT_Seg[3*indiceLut],LUT_Seg[3*indiceLut+1],LUT_Seg[3*indiceLut+2]);
}
}
示例3: Init
// Description : Initialize all flags -verticeces and facets- to FREE and give order to vertices
// This function is called within every conquest.
void Init(PolyhedronPtr pMesh)
{
int i = 0;
// vertices flags initialization
Vertex_iterator pVertex = NULL;
for(pVertex = pMesh->vertices_begin(); pVertex != pMesh->vertices_end(); i++,pVertex++)
{
pVertex->Vertex_Flag_S = FREE;
pVertex->Vertex_Number_S = i;
pVertex->Vertex_Sign_S = NOSIGN;
}
// facets flag initialization.
Facet_iterator pFace = NULL;
for(pFace = pMesh->facets_begin(); pFace != pMesh->facets_end(); pFace++)
{
pFace->Facet_Flag_S = FREE;
}
}
示例4: SubdiviserPolyedre
void Boolean_Operations_Component::SubdiviserPolyedre(PolyhedronPtr pMesh)
{
//Each facet must be triangular
if(!pMesh->is_pure_triangle())
{
pMesh->triangulate();
return;
}
Facet_iterator pFacet;
Vector Vcenter;
//Initialization of the tags
for (pFacet = pMesh->facets_begin(); pFacet != pMesh->facets_end(); pFacet++)
{
Halfedge_around_facet_circulator pHEcirc = pFacet->facet_begin();
pFacet->Issub = false;
pHEcirc->Isnew = false;
pHEcirc->vertex()->Isnew = false;
pHEcirc++;
pHEcirc->Isnew = false;
pHEcirc->vertex()->Isnew = false;
pHEcirc++;
pHEcirc->Isnew = false;
pHEcirc->vertex()->Isnew = false;
}
//For each facet of the polyhedron
for (pFacet = pMesh->facets_begin(); pFacet != pMesh->facets_end(); pFacet++)
{
//We subdivide the facet if it is not already done
if(!(pFacet->Issub))
{
Halfedge_handle pHE = pFacet->facet_begin();
for(unsigned int i = 0;i!=5;i++)
{
if(!pHE->Isnew)
{
//each edge is splited in its center
Vcenter = Vector(0.0, 0.0, 0.0);
Vcenter = ( (pHE->vertex()->point() - CGAL::ORIGIN) + (pHE->opposite()->vertex()->point() - CGAL::ORIGIN) ) / 2;
pHE = pMesh->split_edge(pHE);
pHE->vertex()->point() = CGAL::ORIGIN + Vcenter;
//update of the tags (the new vertex and the four new halfedges
pHE->vertex()->Isnew = true;
pHE->Isnew = true;
pHE->opposite()->Isnew = true;
pHE->next()->Isnew = true;
pHE->next()->opposite()->Isnew = true;
}
pHE = pHE->next();
}
//Three new edges are build between the three new vertices, and the tags of the facets are updated
if(!pHE->vertex()->Isnew) pHE = pHE->next();
pHE = pMesh->split_facet(pHE, pHE->next()->next());
pHE->opposite()->facet()->Issub = true;
pHE = pMesh->split_facet(pHE, pHE->next()->next());
pHE->opposite()->facet()->Issub = true;
pHE = pMesh->split_facet(pHE, pHE->next()->next());
pHE->opposite()->facet()->Issub = true;
pHE->facet()->Issub = true;
}
}
}