本文整理汇总了C++中Triangulation::all_cells_begin方法的典型用法代码示例。如果您正苦于以下问题:C++ Triangulation::all_cells_begin方法的具体用法?C++ Triangulation::all_cells_begin怎么用?C++ Triangulation::all_cells_begin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Triangulation
的用法示例。
在下文中一共展示了Triangulation::all_cells_begin方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
vector<int>
compute_smax(Triangulation& triang,
map<int, cell_cluster> &cluster_set,
const double& mr)
{
for(ACI cit = triang.all_cells_begin();
cit != triang.all_cells_end(); cit ++)
{
cluster_set[cit->id] = cell_cluster(cit->id);
cit->visited = false;
}
int max_cnt = 0;
for(FCI cit = triang.finite_cells_begin();
cit != triang.finite_cells_end(); cit ++)
{
if( ! is_maxima(cit) ) continue;
#ifndef __OUTSIDE__
if( cit->outside ) continue;
#endif
#ifndef __INSIDE__
if( ! cit->outside ) continue;
#endif
if(max_cnt++%1000 == 0) cerr << "+";
grow_maximum(cit, triang, cluster_set);
}
cerr << ".";
// club_segment(triang, cluster_set, mr );
// cerr << ".";
club_contiguous_segment(triang, cluster_set );
cerr << ".";
// Compute the volume of each cluster. Remember after merging the
// 'rep' field is more useful than cluster_id.
vector<int> cluster_ids;
vector<double> cluster_vol;
cluster_ids.clear();
cluster_vol.clear();
calc_cluster_volume_and_store_with_cluster_rep(triang,
cluster_set,
cluster_vol,
cluster_ids);
cerr << ".";
// Sort the clusters with respect to the volumes.
vector<int> sorted_indices;
sorted_indices.clear();
sort_cluster_wrt_volume(cluster_vol, cluster_ids, sorted_indices);
cerr << ".";
return sorted_indices;
}
示例2:
// ---------------------------------------------------------
// initialize
// ----------
// Initialize some of the attributes of the triangulation.
// ---------------------------------------------------------
void
initialize(Triangulation &triang)
{
// set vertex id.
int id = 0;
for(FVI vit = triang.finite_vertices_begin();
vit != triang.finite_vertices_end(); vit ++)
{
vit->id = id++;
vit->visited = false;
vit->bad = false;
vit->bad_neighbor = false;
}
// set cell id.
id = 0;
for(ACI cit = triang.all_cells_begin();
cit != triang.all_cells_end(); cit ++)
{
cit->id = id++;
cit->visited = false;
cit->outside = false;
cit->transp = false;
for(int id = 0 ; id < 4; id++)
{
cit->set_cocone_flag(id,false);
cit->neighbor(id)->set_cocone_flag(cit->neighbor(id)->index(cit),false);
cit->bdy[id] = false;
cit->opaque[id] = false;
for(int k = 0; k < 4; k ++)
cit->umbrella_member[id][k] = -1;
}
// set the convex hull points.
if(! triang.is_infinite(cit)) continue;
for(int i = 0; i < 4; i ++)
{
if(! triang.is_infinite(cit->vertex(i))) continue;
cit->vertex((i+1)%4)->set_convex_hull(true);
cit->vertex((i+2)%4)->set_convex_hull(true);
cit->vertex((i+3)%4)->set_convex_hull(true);
}
}
}