# QT Viewer

Qt Viewer is the new PhysBAM viewer 
## Installation
If you're on **Linux(Ubuntu)** follow the following steps.
If you're on Mac the process is probably similar to Linux but please fill in the mac section yourself for others in the future.
### Linux Installation
Use the package manager apt to install qt5.

```bash
sudo apt-get install qt5-default
```
Add the following lines to your SConstruc.options file in your PhysBAM root directory
```asm
qt_enable=1

QT_BINPATH='/usr/lib/x86_64-linux-gnu/qt5/bin/'
QT_LIB=['Qt5Core','Qt5Gui','Qt5Widgets']
QT_CPPPATH=["/usr/include/x86_64-linux-gnu/qt5","/usr/include/x86_64-linux-gnu/qt5/QtGui","/usr/include/x86_64-linux-gnu/qt5/QtCore","/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++","/usr/include/x86_64-linux-gnu/qt5/QtWidgets"]
```
Now recompile PhysBAM
```bash
cs
```
Or if you don't have the alias:
```bash
nice scons --warn=no-duplicate-environment --warn=no-deprecated -Q --implicit-cache -u -j 16
```
While PhysBAM is being recompiled add this alias to your .bashrc file in ~
```bash
alias q='$PHYSBAM/Projects/qt_viewer/qt_viewer$SUFFIX'
```
## Usage
Now if you want to see something in the new viewer, you just type 
```bash
q ./Output_Directory_Name
```
If you don't have the alias set, instead of typing q2, type the path to the binary file in qt_viewer project.
```bash
PhysBAM/Projects/qt_viewer/qt_viewer
```
## Notes
***
1. Keyboard shortcuts from the old viewer don't work here
2. You can find everything you need and more from the items on the top bar of the viewer
3. You can use ```Alt+``` the top underscore key's as keyboard shortcuts.
   1. for example: to <span style="color:red">**play/Pause**</span> press ```Alt+P```
   2. Magnify velocities: ```Alt+Shift+<```
4. To go to the <span style="color:red">**next frame**</span> press ```→```
5. To go to the <span style="color:red">**previous frame**</span> press ```←```
6. To go to the <span style="color:red">**first frame**</span> press ```↑```
7. To go to the <span style="color:red">**last frame**</span> press ```↓```
8. To <span style="color:red">**zoom**</span> in on the viewer ```right click+move the mouse ↑/↓```
9. To <span style="color:red">**move**</span> the whole domain ```press scrolling/middle button+move the mouse```
## Contributing
Discuss the bugs you find with Craig Schroeder ([Contact](mailto:snubdodecahedron@gmail.com)).\
This README file was written by Mehrnaz Ayazi ([mayaz003@ucr.edu](mailto:mayaz003@ucr.edu)).

Feel free to modify it:)

## License

