本文整理汇总了C++中Triangulation::incident_facets方法的典型用法代码示例。如果您正苦于以下问题:C++ Triangulation::incident_facets方法的具体用法?C++ Triangulation::incident_facets怎么用?C++ Triangulation::incident_facets使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Triangulation
的用法示例。
在下文中一共展示了Triangulation::incident_facets方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: while
bool
is_outside_VF(const Triangulation& triang,
const Edge& e)
{
Facet_circulator fcirc = triang.incident_facets(e);
Facet_circulator begin = fcirc;
do{
if( ! (*fcirc).first->outside) return false;
fcirc ++;
} while(fcirc != begin);
return true;
}
示例2: is_degenerate_VF
bool is_degenerate_VF(const Triangulation& triang, const Cell_handle& c, const int& fid, const int& uid, const int& vid, const Point& d, const char* prefix)
{
char degen_op_filename[200];
strcat(strcpy(degen_op_filename, prefix), ".degen_VF");
// an extra check - probably not needed.
if (triang.is_infinite(c) || triang.is_infinite(c->neighbor(fid)) || triang.is_infinite(c->neighbor(6 - fid - uid - vid)))
{
return true;
}
vector<Cell_handle> VF;
Facet_circulator fcirc = triang.incident_facets(Edge(c,uid,vid));
Facet_circulator begin = fcirc;
do
{
if (triang.is_infinite((*fcirc).first))
{
cerr << "< Inf VF >";
return true; // by check-1 it is degenerate.
}
Cell_handle cur_c = (*fcirc).first;
int cur_fid = (*fcirc).second;
// check if cur_c and its cur_fid neighbors are cospherical.
if (is_cospherical_pair(triang, Facet(cur_c,cur_fid)))
{
cerr << "< Cosph VF >";
return true; // by check-2 it is degenerate.
}
fcirc ++;
}
while (fcirc != begin);
// check-3
Point vv[3];
vv[0] = c->voronoi();
vv[1] = c->neighbor(fid)->voronoi();
vv[2] = c->neighbor(6 - fid - uid - vid)->voronoi();
Vector v[3];
v[0] = vv[0] - d;
v[1] = vv[1] - d;
v[2] = vv[2] - d;
Vector v1xv0 = CGAL::cross_product(v[1], v[0]);
Vector v0xv2 = CGAL::cross_product(v[0], v[2]);
if (CGAL::to_double(v1xv0 * v0xv2) < 0)
{
ofstream fout;
fout.open(degen_op_filename, ofstream::app);
fout << "# prob : v1xv0 * v0xv2 = " <<
CGAL::to_double(v1xv0 * v0xv2) << endl;
fout << "{LIST " << endl;
fout << "# VF - color yellow " << endl;
draw_VF(triang, Edge(c, uid, vid), 1, 1, 0, 1, fout);
fout << "# v0 : segment(driver, voronoi(c)) - color red " << endl;
draw_segment(Segment(d, vv[0]), 1, 0, 0, 1, fout);
fout << "# v1 : segment(driver, voronoi(c->neighbor1)) - color green " << endl;
draw_segment(Segment(d, vv[1]), 0, 1, 0, 1, fout);
fout << "# v2 : segment(driver, voronoi(c->neighbor2)) - color blue " << endl;
draw_segment(Segment(d, vv[2]), 0, 0, 1, 1, fout);
fout << "}" << endl;
fout.close();
cerr << "< - v1xv0 * v0xv2 < 0 - >";
return true;
}
return false;
}