yade-dev team mailing list archive
-
yade-dev team
-
Mailing list archive
-
Message #10759
[Branch ~yade-pkg/yade/git-trunk] Rev 3924: enable run/pause from QGLViewer (retun key) + fix compile warning
------------------------------------------------------------
revno: 3924
committer: Bruno Chareyre <bruno.chareyre@xxxxxxxxxxx>
timestamp: Wed 2014-04-16 21:53:59 +0200
message:
enable run/pause from QGLViewer (retun key) + fix compile warning
modified:
gui/qt4/GLViewer.cpp
pkg/common/OpenGLRenderer.cpp
--
lp:yade
https://code.launchpad.net/~yade-pkg/yade/git-trunk
Your team Yade developers is subscribed to branch lp:yade.
To unsubscribe from this branch go to https://code.launchpad.net/~yade-pkg/yade/git-trunk/+edit-subscription
=== modified file 'gui/qt4/GLViewer.cpp'
--- gui/qt4/GLViewer.cpp 2014-03-18 16:40:43 +0000
+++ gui/qt4/GLViewer.cpp 2014-04-16 19:53:59 +0000
@@ -78,7 +78,7 @@
#if QGLVIEWER_VERSION>=0x020500
manipulatedFrame()->setWheelSensitivity(-1.0f);
#endif
-
+ setKeyDescription(Qt::Key_Return,"Run simulation.");
setKeyDescription(Qt::Key_A,"Toggle visibility of global axes.");
setKeyDescription(Qt::Key_C,"Set scene center so that all bodies are visible; if a body is selected, center around this body.");
setKeyDescription(Qt::Key_C & Qt::AltModifier,"Set scene center to median body position (same as space)");
@@ -263,6 +263,11 @@
}
}
else if(e->key()==Qt::Key_Period) gridSubdivide = !gridSubdivide;
+ else if(e->key()==Qt::Key_Return){
+ if (Omega::instance().isRunning()) Omega::instance().pause();
+ else Omega::instance().run();
+ LOG_INFO("Running...");
+ }
#ifdef YADE_GL2PS
else if(e->key()==Qt::Key_V){
for(int i=0; ;i++){
=== modified file 'pkg/common/OpenGLRenderer.cpp'
--- pkg/common/OpenGLRenderer.cpp 2014-02-16 16:42:06 +0000
+++ pkg/common/OpenGLRenderer.cpp 2014-04-16 19:53:59 +0000
@@ -87,7 +87,7 @@
void OpenGLRenderer::setBodiesDispInfo(){
if(scene->bodies->size()!=bodyDisp.size()) {
bodyDisp.resize(scene->bodies->size());
- for (Body::id_t k=0; k<scene->bodies->size(); k++) bodyDisp[k].hidden=0;}
+ for (unsigned k=0; k<scene->bodies->size(); k++) bodyDisp[k].hidden=0;}
bool scaleRotations=(rotScale!=1.0);
bool scaleDisplacements=(dispScale!=Vector3r::Ones());
FOREACH(const shared_ptr<Body>& b, *scene->bodies){