本文整理汇总了C++中HalfEdge::ccw_rotate_about_source方法的典型用法代码示例。如果您正苦于以下问题:C++ HalfEdge::ccw_rotate_about_source方法的具体用法?C++ HalfEdge::ccw_rotate_about_source怎么用?C++ HalfEdge::ccw_rotate_about_source使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HalfEdge
的用法示例。
在下文中一共展示了HalfEdge::ccw_rotate_about_source方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: most_ccw_in_halfedge
HalfEdge * Vertex::most_ccw_out_halfedge()
{
if( !m_boundary )
{
return most_ccw_in_halfedge()->he_sym();
}
HalfEdge * he = m_halfedge->he_next();
HalfEdge * ne = he->ccw_rotate_about_source();
HalfEdge * origNe = ne;
while( ne != NULL )
{
he = ne;
ne = he->ccw_rotate_about_source();
if( origNe == ne )
{
std::cout<< "[Error] Non-manifold -- Vertex id " << id() << "\n";
exit(-1);
}
}
return he;
}
示例2: main
//.........这里部分代码省略.........
SolidEdgeIterator edgeiter(&mesh);
double tuetteEnergy = 0.0;
double newTEnergy = 0.0;
double harmoincEnergy = 0.0;
double newHEnergy = 0.0;
double stepLength = 0.01;
double eThreshold = 0.00001;
for (; !edgeiter.end(); ++edgeiter) {
Edge *e = *edgeiter;
Vertex *s = mesh.edgeVertex1(e);
Vertex *t = mesh.edgeVertex2(e);
tuetteEnergy += (Normal[s->id() - 1] - Normal[t->id() - 1]).norm2();
}
//harmonic K
double K, cota, cotb;
edgeiter.reset();
for (; !edgeiter.end(); ++edgeiter) {
Edge *e = *edgeiter;
Vertex *s = mesh.edgeVertex1(e);
Vertex *t = mesh.edgeVertex2(e);
HalfEdge *he = e->halfedge(1);
he = he->ccw_rotate_about_source();
Vertex *v1 = he->target();
he = he->clw_rotate_about_source()->clw_rotate_about_source();
Vertex *v2 = he->target();
cota = (s->point() - v1->point())*(t->point() - v1->point()) / ((s->point() - v1->point()) ^ (t->point() - v1->point())).norm();
cotb = (s->point() - v2->point())*(t->point() - v2->point()) / ((s->point() - v2->point()) ^ (t->point() - v2->point())).norm();
K = (cota + cotb) / 2.0;
edgemap.insert({ e, K });
}
viter.reset();
//Gauss map update
for (; !viter.end(); ++viter) {
Vertex *vertmp = *viter;
vertmp->point() = Normal[vertmp->id() - 1] ;
}
viter.reset();
for (; !viter.end(); ++viter)//step2
{
Vertex *vertmp = *viter;
VertexOutHalfedgeIterator voh(&mesh, vertmp);
Point u = vertmp->point();
int id = vertmp->id()-1;