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

Method dolly_callback

source/visualization/OpenGL/src/G4OpenGLXmPanningCallbacks.cc:79–110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

77}
78
79void G4OpenGLXmViewer::dolly_callback (Widget w,
80 XtPointer clientData,
81 XtPointer callData)
82{
83 XmScaleCallbackStruct *cbs = (XmScaleCallbackStruct*) callData;
84 G4OpenGLXmViewer* pView = (G4OpenGLXmViewer*) clientData;
85 short dp = -1;
86 G4float ten_to_the_dp = 10.;
87
88 XtVaGetValues (w,
89 XmNdecimalPoints, &dp,
90 NULL);
91
92 if (dp == 0) {
93 ten_to_the_dp = 1.;
94 } else if ( dp > 0) {
95 for (G4int i = 1; i < (G4int)dp; i++) {
96 ten_to_the_dp *= 10.;
97 }
98 } else {
99 G4cout << "dp is " << dp << G4endl;
100 return;
101 }
102
103 G4double dolly = (G4double)(cbs->value) / ten_to_the_dp;
104
105 pView->fVP.SetDolly (dolly);
106 pView->SetView ();
107 pView->ClearView ();
108 pView->DrawView ();
109
110}
111
112void G4OpenGLXmViewer::pan_left_right_callback (Widget w,
113 XtPointer clientData,

Callers

nothing calls this directly

Calls 3

SetViewMethod · 0.45
ClearViewMethod · 0.45
DrawViewMethod · 0.45

Tested by

no test coverage detected