diff --git a/contrib/mobile/drawContext.cpp b/contrib/mobile/drawContext.cpp index f84ba5562d242a560c3a9cd58eb4a7fc2e840f5b..ec9917f0b69e62b046b1b5fa82a070bd06a0d7d9 100644 --- a/contrib/mobile/drawContext.cpp +++ b/contrib/mobile/drawContext.cpp @@ -70,12 +70,12 @@ void drawContext::load(std::string filename) // open the file with Gmsh GmshOpenProject(filename); - // reset openGL view - eventHandler(10); - // run onelab clients to populate the database onelab_cb("check"); + // set openGL view using CTX options + eventHandler(8); + // mark all parameters as changed to force complete first run onelab::server::instance()->setChanged(3); } @@ -133,6 +133,16 @@ void drawContext::eventHandler(int event, float x, float y) case 7: // Z view setQuaternion(0., 0., 0., 1.); break; + case 8: // CTX options + for(int i = 0; i < 3; i++){ + _translate[i] = CTX::instance()->tmpTranslation[i]; + _scale[i] = CTX::instance()->tmpScale[i]; + } + setQuaternion(CTX::instance()->tmpQuaternion[0], + CTX::instance()->tmpQuaternion[1], + CTX::instance()->tmpQuaternion[2], + CTX::instance()->tmpQuaternion[3]); + break; default: // all other reset the position setQuaternion(0., 0., 0., 1.); for(int i = 0; i < 3; i++){