MCPcopy Create free account
hub / github.com/Geant4/geant4 / ChangeSurfaceStyle

Method ChangeSurfaceStyle

source/interfaces/implementation/src/G4UIQt.cc:5787–5834  ·  view source on GitHub ↗

A little bit like "void G4OpenGLQtViewer::toggleDrawingAction(int aAction)" But for all viewers, not only Qt FIXME : Should be a feedback when changing viewer ! */

Source from the content-addressed store, hash-verified

5785
5786 */
5787void 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
5836void G4UIQt::OpenIconCallback(const QString& aParam)
5837{

Callers 1

AddIconMethod · 0.95

Calls 3

toStringMethod · 0.45
dataMethod · 0.45
ApplyCommandMethod · 0.45

Tested by

no test coverage detected