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


C++ Viewer::frame方法代码示例

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


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

示例1: pw

void mepp_component_CGAL_Example_plugin::step5()
{
	QApplication::setOverrideCursor(Qt::WaitCursor);

	// active viewer
	if (mw->activeMdiChild() != 0)
	{
		Viewer* viewer = (Viewer *)mw->activeMdiChild();
		PolyhedronPtr polyhedron_ptr = viewer->getScenePtr()->get_polyhedron();

		CGAL_Example_ComponentPtr component_ptr = findOrCreateComponentForViewer<CGAL_Example_ComponentPtr, CGAL_Example_Component>(viewer, polyhedron_ptr);
		
		Vec pw(2, 0, 0); viewer->frame(viewer->getScenePtr()->get_current_polyhedron())->setPosition(pw); // position in world coordinate system
		//Vec pl(2, 0, 0); viewer->frame(viewer->getScenePtr()->get_current_polyhedron())->setTranslation(pl); // local frame translation

		Quaternion qw(0, 0, 0, 1); // identity quaternion (i.e., no rotation)
		viewer->frame(viewer->getScenePtr()->get_current_polyhedron())->setOrientation(qw); // rotation in world coordinate system
		/*Quaternion ql(0, 0, 0, 1); // identity quaternion (i.e., no rotation)
		viewer->frame(viewer->getScenePtr()->get_current_polyhedron())->setRotation(ql); // local frame rotation*/

		viewer->updateGL();
	}

	QApplication::restoreOverrideCursor();
}
开发者ID:VisualComputeLabinXDU,项目名称:MeshDisplay,代码行数:25,代码来源:mepp_component_CGAL_Example_plugin.cpp

示例2: Viewer_mainLoop

void Viewer_mainLoop() {
	long lastTime = currentTimeMillis();
	while(true) {
		bool haveEvent = false;
		SDL_Event event;
		if(viewer.isCurrentlyAnimating()) {
			SDL_Delay(10);
			haveEvent = SDL_PollEvent(&event) > 0;
		}
		else {
			haveEvent = SDL_WaitEvent(&event) > 0;
			lastTime = currentTimeMillis();
		}
		while(haveEvent) {
			if(!HandleEvent(event)) return;
			/* Read further events if there are any. It's important that we do this to keep
			 * the SDL queue as empty as possible. The ReadStdinThread will push a lot of
			 * events into it and we want to keep it responsible to other real input events.
			 */
			haveEvent = SDL_PollEvent(&event) > 0;			
		}
		
		long dt = currentTimeMillis() - lastTime;
		lastTime += dt;
		
		FillSurface(SDL_GetVideoSurface(), backgroundCol);
		viewer.frame(SDL_GetVideoSurface(), dt);
		SDL_Flip(SDL_GetVideoSurface());
	}
}
开发者ID:albertz,项目名称:planet_wars-cpp,代码行数:30,代码来源:viewer.cpp

示例3: New_Position

void mepp_component_Boolean_Operations_plugin::New_Position()
{
    QApplication::setOverrideCursor(Qt::WaitCursor);

    // active viewer
    if (mw->activeMdiChild() != 0)
    {
        float x, y, z;
        double a, b, c, w;
        Viewer* viewer = (Viewer *)mw->activeMdiChild();

        ScenePtr S = viewer->getScenePtr();

        for(int i = 0; i<viewer->getScenePtr()->get_nb_polyhedrons(); i++)
        {
            Vertex_iterator pVertex = NULL;

            PolyhedronPtr P = S->get_polyhedron(i);

            viewer->frame(i)->getPosition(x,y,z);
            viewer->frame(i)->getOrientation(a,b,c,w);

            Vec T(x, y, z);
            Quaternion Q(a, b, c, w);

            for (pVertex = P->vertices_begin(); pVertex != P->vertices_end(); pVertex++)
            {
                Vec V = Q * Vec(pVertex->point().x(), pVertex->point().y(), pVertex->point().z()) + T;
                pVertex->point() = CGAL::ORIGIN + Vector(V[0], V[1], V[2]);
            }

            viewer->frame(i)->setPosition(0,0,0);
            viewer->frame(i)->setOrientation(0,0,0,1);
        }
        viewer->show();
        viewer->recreateListsAndUpdateGL();
    }
    QApplication::restoreOverrideCursor();
}
开发者ID:hmfkz7,项目名称:MEPP,代码行数:39,代码来源:mepp_component_Boolean_Operations_plugin.cpp


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