当前位置: 首页>>代码示例>>C++>>正文


C++ Manifold::halfedges_begin方法代码示例

本文整理汇总了C++中Manifold::halfedges_begin方法的典型用法代码示例。如果您正苦于以下问题:C++ Manifold::halfedges_begin方法的具体用法?C++ Manifold::halfedges_begin怎么用?C++ Manifold::halfedges_begin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Manifold的用法示例。


在下文中一共展示了Manifold::halfedges_begin方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: keyfun

void keyfun(unsigned char c, int x, int y)
{
	/*
	 * A little game, try to flip an edge when user presses any key.
	 * Not all edges can be flipped. Boundary edges cannot. Edges also
	 * cannot be flipped if it will render the mesh invalid.
	 */

	if(boundary(m, *flipper)) // If this is a boundary edge just drop the idea.
		cout << "boundary edge" << endl;
	else if(precond_flip_edge(m, *flipper))
  {
    m.flip_edge(*flipper);
		cout << "flipped" << endl;
  }
	else
  	cout << "could not flip" << endl;

	do
		{
			++flipper; // Get the next halfedge
			// If we have passed the last halfedge, go to the first.
			if(flipper==m.halfedges_end())
				{
					flipper = m.halfedges_begin();
					break;
				}
		}
	while(touched[*flipper] == 0); // Only visit halfedges marked '1'


	// Function call below informs glut that display should be called to
	// show the window again.
	glutPostRedisplay();
}
开发者ID:SimonThordal,项目名称:CPG-assignment1,代码行数:35,代码来源:flipper.cpp

示例2: dmin

#include <GLGraphics/gel_glut.h>
#include <CGLA/Vec2d.h>
#include <CGLA/Mat3x3d.h>
#include <CGLA/Mat3x3f.h>
#include <CGLA/Mat4x4f.h>

using namespace std;
using namespace CGLA;
using namespace HMesh;

// The range of the input data.
Vec2d dmin(99e99), dmax(-99e99);

Manifold m; // The triangle mesh data structure.
HalfEdgeIDIterator flipper = m.halfedges_begin(); // The halfedge we try to flip.
HalfEdgeAttributeVector<int> touched;

/*
 * Draw the triangle mesh. This function is called from GLUT (a library
 * which enables OpenGL drawing in windows.)
 */

void display()
{
	// Set up correct OpenGL projection
	glMatrixMode(GL_PROJECTION);
	glLoadIdentity();
	gluOrtho2D(dmin[0], dmax[0], dmin[1], dmax[1]);
	glMatrixMode(GL_MODELVIEW);
开发者ID:SimonThordal,项目名称:CPG-assignment1,代码行数:29,代码来源:flipper.cpp


注:本文中的Manifold::halfedges_begin方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。