diff --git a/SCHNApps/include/mapHandler.h b/SCHNApps/include/mapHandler.h index cc0feb5a36ecf1b28e7fb7318b811474e5bf1e9d..2c4aad8cd36ccb5344b91a2e20fd345fb6f4219e 100644 --- a/SCHNApps/include/mapHandler.h +++ b/SCHNApps/include/mapHandler.h @@ -366,6 +366,10 @@ public slots: */ void frameFromString(QString frame); + /** + * @brief reset the frame manipulator to its initial position + */ + void frameReset(); /********************************************************* * SIGNALS diff --git a/SCHNApps/src/mapHandler.cpp b/SCHNApps/src/mapHandler.cpp index 691057722bd6d6cc63196daacb0cc2f777c404c4..801f8ab393c858d07ea4e1943e70b56b3c32afa5 100644 --- a/SCHNApps/src/mapHandler.cpp +++ b/SCHNApps/src/mapHandler.cpp @@ -456,6 +456,22 @@ void MapHandlerGen::frameFromString(QString frame) frameModified(); } +void MapHandlerGen::frameReset() +{ + GLdouble mat[16]; + // Identity + for (int i = 0; i < 4; ++i) + for (int j = 0; j < 4; ++j) + if (i==j) + mat[i*4+j] = 1; + else + mat[i*4+j] = 0; + + m_frame->setFromMatrix(mat); + + frameModified(); +} +