本文整理汇总了C++中SurfaceMesh::Get_FreeBoundary方法的典型用法代码示例。如果您正苦于以下问题:C++ SurfaceMesh::Get_FreeBoundary方法的具体用法?C++ SurfaceMesh::Get_FreeBoundary怎么用?C++ SurfaceMesh::Get_FreeBoundary使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SurfaceMesh
的用法示例。
在下文中一共展示了SurfaceMesh::Get_FreeBoundary方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
non_manifold_hf_REF[1].Set(6,0);
std::vector<HalfFacetType> non_manifold_hf;
TM.Get_Nonmanifold_HalfFacets(non_manifold_hf);
for (unsigned int jj = 0; jj < non_manifold_hf.size(); ++jj)
if (!non_manifold_hf[jj].Equal(non_manifold_hf_REF[jj]))
{
cout << "Non-manifold facet data is incorrect!" << endl;
OUTPUT_CODE = 10;
break;
}
// display non-manifold vertices
TM.Display_Nonmanifold_Vertices();
cout << endl;
// check non-manifold vertices against reference data
const VtxIndType non_manifold_vtx_REF[1] = {5};
std::vector<VtxIndType> non_manifold_vtx;
TM.Get_Nonmanifold_Vertices(non_manifold_vtx);
for (unsigned int jj = 0; jj < non_manifold_vtx.size(); ++jj)
if (non_manifold_vtx[jj]!=non_manifold_vtx_REF[jj])
{
cout << "Non-manifold vertex data is incorrect!" << endl;
OUTPUT_CODE = 11;
break;
}
TM.Display_Unique_Vertices();
cout << endl;
// check unique vertices against reference data
std::vector<VtxIndType> uv;
TM.Get_Unique_Vertices(uv);
const VtxIndType uv_REF[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
for (unsigned int jj = 0; jj < uv.size(); ++jj)
if (uv[jj]!=uv_REF[jj])
{
cout << "Unique vertex data is incorrect!" << endl;
OUTPUT_CODE = 12;
break;
}
// display all edges in the mesh
std::vector<MeshEdgeType> edges;
TM.Get_Edges(edges);
cout << "A unique list of edges in the mesh:" << endl;
std::vector<MeshEdgeType>::const_iterator it;
for (it = edges.begin(); it!=edges.end(); ++it)
{
cout << "[" << (*it).vtx[0] << ", " << (*it).vtx[1] << "]" << endl;
}
cout << endl;
// test if a pair of vertices is connected by an edge
cout << "Vtx #5 and Vtx #9 are connected." << endl;
if (!TM.Is_Connected(5, 9))
{
cout << "Incorrect! They are NOT connected!" << endl;
OUTPUT_CODE = 13;
}
// test if a pair of vertices is connected by an edge
cout << "Vtx #7 and Vtx #2 are NOT connected." << endl;
if (TM.Is_Connected(7, 2))
{
cout << "Incorrect! They ARE connected!" << endl;
OUTPUT_CODE = 14;
}
cout << endl;
// display all cells attached to an edge
std::vector<CellIndType> attached_cells;
MeshEdgeType EE;
EE.Set(1,5);
TM.Get_Cells_Attached_To_Edge(EE, attached_cells);
cout << "Here are the cell indices of cells attached to the edge [1, 5]:" << endl;
std::vector<CellIndType>::const_iterator ic;
for (ic = attached_cells.begin(); ic!=attached_cells.end(); ++ic)
cout << "Cell #" << (*ic) << endl;
cout << endl;
// display the free boundary
std::vector<HalfFacetType> free_bdy;
TM.Get_FreeBoundary(free_bdy);
cout << "Here are the half-facets that lie on the free boundary:" << endl;
std::vector<HalfFacetType>::const_iterator hfi;
for (hfi = free_bdy.begin(); hfi!=free_bdy.end(); ++hfi)
{
(*hfi).Print();
cout << endl;
}
cout << endl;
if (OUTPUT_CODE==0)
cout << "Unit test is successful!" << endl;
else
cout << "Unit test failed!" << endl;
cout << endl;
return OUTPUT_CODE;
}