Skip to content

Commit

Permalink
Merge pull request #1024 from kerautret/AddKeyViewer3D
Browse files Browse the repository at this point in the history
add key Shift-L to save configuration file.
  • Loading branch information
dcoeurjo committed Jul 17, 2015
2 parents 09a560e + d62f36d commit f97cd55
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
3 changes: 3 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@
[#1002](https:/DGtal-team/DGtal/pull/1002))
- MeshWriter class can now export OBJ file including colors. (Bertrand Kerautret,
[#1016](https:/DGtal-team/DGtal/pull/1016))
- Viewer3D: Shift-L / L key binding added to save and restore camera settings. (Bertrand Kerautret,
[#1024](https:/DGtal-team/DGtal/pull/1024))


- *Kernel Package*
- HyperRectDomain can now be empty (lowerBound == upperBound + diagonal(1)). Warning about the use
Expand Down
12 changes: 9 additions & 3 deletions src/DGtal/io/viewers/Viewer3D.ih
Original file line number Diff line number Diff line change
Expand Up @@ -849,6 +849,7 @@ DGtal::Viewer3D<Space, KSpace>::init()
setKeyDescription ( Qt::Key_W, "Switch display with and without wired view of triangle and quad faces." );
setKeyDescription ( Qt::Key_T, "Sort elements for display improvements." );
setKeyDescription ( Qt::Key_L, "Load last visualisation settings." );
setKeyDescription ( Qt::ShiftModifier+Qt::Key_L, "Save visualisation settings." );
setKeyDescription ( Qt::Key_B, "Switch background color with White/Black colors." );
setKeyDescription ( Qt::Key_C, "Show camera informations." );
setKeyDescription ( Qt::Key_R, "Reset default scale for 3 axes to 1.0f." );
Expand Down Expand Up @@ -1185,10 +1186,15 @@ DGtal::Viewer3D<Space, KSpace>::keyPressEvent ( QKeyEvent *e )
}
updateGL();
}
if ( ( e->key() ==Qt::Key_L ) )

if ( ( e->key() ==Qt::Key_L ) )
{
restoreStateFromFile();
updateGL();
if(e->modifiers()==Qt::ShiftModifier){
saveStateToFile();
}else{
restoreStateFromFile();
updateGL();
}
}
if ( ( e->key() ==Qt::Key_C ) )
{
Expand Down

0 comments on commit f97cd55

Please sign in to comment.