A little bit like "void G4OpenGLQtViewer::toggleDrawingAction(int aAction)" But for all viewers, not only Qt FIXME : Should be a feedback when changing viewer ! */
| 5785 | |
| 5786 | */ |
| 5787 | void G4UIQt::ChangeSurfaceStyle(const QString& action) |
| 5788 | { |
| 5789 | // Theses actions should be in the app toolbar |
| 5790 | |
| 5791 | if (fToolbarApp == nullptr) return; |
| 5792 | QList<QAction*> list = fToolbarApp->actions(); |
| 5793 | for (auto i : list) { |
| 5794 | if (i->data().toString() == action) { |
| 5795 | i->setChecked(true); |
| 5796 | } |
| 5797 | else if (i->data().toString() == "hidden_line_removal") { |
| 5798 | i->setChecked(false); |
| 5799 | } |
| 5800 | else if (i->data().toString() == "hidden_line_and_surface_removal") { |
| 5801 | i->setChecked(false); |
| 5802 | } |
| 5803 | else if (i->data().toString() == "solid") { |
| 5804 | i->setChecked(false); |
| 5805 | } |
| 5806 | else if (i->data().toString() == "wireframe") { |
| 5807 | i->setChecked(false); |
| 5808 | } |
| 5809 | else if (i->data().toString() == "point_cloud") { |
| 5810 | i->setChecked(false); |
| 5811 | } |
| 5812 | } |
| 5813 | |
| 5814 | if (action == "hidden_line_removal") { |
| 5815 | G4UImanager::GetUIpointer()->ApplyCommand("/vis/viewer/set/style w"); |
| 5816 | G4UImanager::GetUIpointer()->ApplyCommand("/vis/viewer/set/hiddenEdge 1"); |
| 5817 | } |
| 5818 | else if (action == "hidden_line_and_surface_removal") { |
| 5819 | G4UImanager::GetUIpointer()->ApplyCommand("/vis/viewer/set/style s"); |
| 5820 | G4UImanager::GetUIpointer()->ApplyCommand("/vis/viewer/set/hiddenEdge 1"); |
| 5821 | } |
| 5822 | else if (action == "solid") { |
| 5823 | G4UImanager::GetUIpointer()->ApplyCommand("/vis/viewer/set/style s"); |
| 5824 | G4UImanager::GetUIpointer()->ApplyCommand("/vis/viewer/set/hiddenEdge 0"); |
| 5825 | } |
| 5826 | else if (action == "wireframe") { |
| 5827 | G4UImanager::GetUIpointer()->ApplyCommand("/vis/viewer/set/style w"); |
| 5828 | G4UImanager::GetUIpointer()->ApplyCommand("/vis/viewer/set/hiddenEdge 0"); |
| 5829 | } |
| 5830 | else if (action == "point_cloud") { |
| 5831 | G4UImanager::GetUIpointer()->ApplyCommand("/vis/viewer/set/style c"); |
| 5832 | G4UImanager::GetUIpointer()->ApplyCommand("/vis/viewer/set/hiddenEdge 0"); |
| 5833 | } |
| 5834 | } |
| 5835 | |
| 5836 | void G4UIQt::OpenIconCallback(const QString& aParam) |
| 5837 | { |
no test coverage detected