本文整理汇总了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();
}
示例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());
}
}
示例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();
}