Geant4 Cross Reference

Cross-Referencing   Geant4
Geant4/visualization/OpenGL/src/G4OpenGLXmRotationCallbacks.cc

Version: [ ReleaseNotes ] [ 1.0 ] [ 1.1 ] [ 2.0 ] [ 3.0 ] [ 3.1 ] [ 3.2 ] [ 4.0 ] [ 4.0.p1 ] [ 4.0.p2 ] [ 4.1 ] [ 4.1.p1 ] [ 5.0 ] [ 5.0.p1 ] [ 5.1 ] [ 5.1.p1 ] [ 5.2 ] [ 5.2.p1 ] [ 5.2.p2 ] [ 6.0 ] [ 6.0.p1 ] [ 6.1 ] [ 6.2 ] [ 6.2.p1 ] [ 6.2.p2 ] [ 7.0 ] [ 7.0.p1 ] [ 7.1 ] [ 7.1.p1 ] [ 8.0 ] [ 8.0.p1 ] [ 8.1 ] [ 8.1.p1 ] [ 8.1.p2 ] [ 8.2 ] [ 8.2.p1 ] [ 8.3 ] [ 8.3.p1 ] [ 8.3.p2 ] [ 9.0 ] [ 9.0.p1 ] [ 9.0.p2 ] [ 9.1 ] [ 9.1.p1 ] [ 9.1.p2 ] [ 9.1.p3 ] [ 9.2 ] [ 9.2.p1 ] [ 9.2.p2 ] [ 9.2.p3 ] [ 9.2.p4 ] [ 9.3 ] [ 9.3.p1 ] [ 9.3.p2 ] [ 9.4 ] [ 9.4.p1 ] [ 9.4.p2 ] [ 9.4.p3 ] [ 9.4.p4 ] [ 9.5 ] [ 9.5.p1 ] [ 9.5.p2 ] [ 9.6 ] [ 9.6.p1 ] [ 9.6.p2 ] [ 9.6.p3 ] [ 9.6.p4 ] [ 10.0 ] [ 10.0.p1 ] [ 10.0.p2 ] [ 10.0.p3 ] [ 10.0.p4 ] [ 10.1 ] [ 10.1.p1 ] [ 10.1.p2 ] [ 10.1.p3 ] [ 10.2 ] [ 10.2.p1 ] [ 10.2.p2 ] [ 10.2.p3 ] [ 10.3 ] [ 10.3.p1 ] [ 10.3.p2 ] [ 10.3.p3 ] [ 10.4 ] [ 10.4.p1 ] [ 10.4.p2 ] [ 10.4.p3 ] [ 10.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

Diff markup

Differences between /visualization/OpenGL/src/G4OpenGLXmRotationCallbacks.cc (Version 11.3.0) and /visualization/OpenGL/src/G4OpenGLXmRotationCallbacks.cc (Version 10.7.p3)


  1 //                                                  1 //
  2 // *******************************************      2 // ********************************************************************
  3 // * License and Disclaimer                         3 // * License and Disclaimer                                           *
  4 // *                                                4 // *                                                                  *
  5 // * The  Geant4 software  is  copyright of th      5 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
  6 // * the Geant4 Collaboration.  It is provided      6 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
  7 // * conditions of the Geant4 Software License      7 // * conditions of the Geant4 Software License,  included in the file *
  8 // * LICENSE and available at  http://cern.ch/      8 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
  9 // * include a list of copyright holders.           9 // * include a list of copyright holders.                             *
 10 // *                                               10 // *                                                                  *
 11 // * Neither the authors of this software syst     11 // * Neither the authors of this software system, nor their employing *
 12 // * institutes,nor the agencies providing fin     12 // * institutes,nor the agencies providing financial support for this *
 13 // * work  make  any representation or  warran     13 // * work  make  any representation or  warranty, express or implied, *
 14 // * regarding  this  software system or assum     14 // * regarding  this  software system or assume any liability for its *
 15 // * use.  Please see the license in the file      15 // * use.  Please see the license in the file  LICENSE  and URL above *
 16 // * for the full disclaimer and the limitatio     16 // * for the full disclaimer and the limitation of liability.         *
 17 // *                                               17 // *                                                                  *
 18 // * This  code  implementation is the result      18 // * This  code  implementation is the result of  the  scientific and *
 19 // * technical work of the GEANT4 collaboratio     19 // * technical work of the GEANT4 collaboration.                      *
 20 // * By using,  copying,  modifying or  distri     20 // * By using,  copying,  modifying or  distributing the software (or *
 21 // * any work based  on the software)  you  ag     21 // * any work based  on the software)  you  agree  to acknowledge its *
 22 // * use  in  resulting  scientific  publicati     22 // * use  in  resulting  scientific  publications,  and indicate your *
 23 // * acceptance of all terms of the Geant4 Sof     23 // * acceptance of all terms of the Geant4 Software license.          *
 24 // *******************************************     24 // ********************************************************************
 25 //                                                 25 //
 26 //                                                 26 //
 27 //                                                 27 //
 28 //                                                 28 // 
 29 // Andrew Walkden  16th April 1997                 29 // Andrew Walkden  16th April 1997
 30 // G4OpenGLXmRotationCallbacks :                   30 // G4OpenGLXmRotationCallbacks : 
 31 //                       Several callback func     31 //                       Several callback functions used by
 32 //                       elements of the contr     32 //                       elements of the control panel to
 33 //                       rotate the view.          33 //                       rotate the view.
 34                                                    34 
                                                   >>  35 #ifdef G4VIS_BUILD_OPENGLXM_DRIVER
                                                   >>  36 
 35 #include "G4OpenGLXmViewer.hh"                     37 #include "G4OpenGLXmViewer.hh"
 36                                                    38 
 37 #include "G4PhysicalConstants.hh"                  39 #include "G4PhysicalConstants.hh"
 38 #include "G4Scene.hh"                              40 #include "G4Scene.hh"
 39 #include "G4UImanager.hh"                          41 #include "G4UImanager.hh"
 40 #include "G4ios.hh"                                42 #include "G4ios.hh"
 41                                                    43 
 42 void G4OpenGLXmViewer::theta_rotation_callback     44 void G4OpenGLXmViewer::theta_rotation_callback (Widget w, 
 43                 XtPointer clientData,              45                 XtPointer clientData, 
 44                 XtPointer callData)                46                 XtPointer callData) 
 45 {                                                  47 {
 46   XmArrowButtonCallbackStruct *cbs = (XmArrowB     48   XmArrowButtonCallbackStruct *cbs = (XmArrowButtonCallbackStruct*) callData;
 47   G4OpenGLXmViewer* pView = (G4OpenGLXmViewer*     49   G4OpenGLXmViewer* pView = (G4OpenGLXmViewer*) clientData;
 48                                                    50 
 49   pView->rotate_right = get_boolean_userData (     51   pView->rotate_right = get_boolean_userData (w);
 50                                                    52 
 51   if (cbs->reason == XmCR_ARM) {                   53   if (cbs->reason == XmCR_ARM) {
 52     rotate_in_theta (pView, NULL);                 54     rotate_in_theta (pView, NULL);
 53   } else if (cbs->reason == XmCR_DISARM) {         55   } else if (cbs->reason == XmCR_DISARM) {
 54     XtRemoveTimeOut (pView->rotation_timer);       56     XtRemoveTimeOut (pView->rotation_timer);
 55   }                                                57   }
 56 }                                                  58 }
 57                                                    59 
 58 void G4OpenGLXmViewer::rotate_in_theta (XtPoin     60 void G4OpenGLXmViewer::rotate_in_theta (XtPointer clientData,
 59               XtIntervalId* timer_id)              61               XtIntervalId* timer_id) 
 60 {                                                  62 {
 61   //theta spin stuff here                          63   //theta spin stuff here
 62   G4OpenGLXmViewer* pView = (G4OpenGLXmViewer*     64   G4OpenGLXmViewer* pView = (G4OpenGLXmViewer*) clientData;
 63                                                    65 
 64   if (pView->rotate_right) {                       66   if (pView->rotate_right) {
 65     pView->rotateScene(1,0);                       67     pView->rotateScene(1,0);
 66   } else {                                         68   } else {
 67     pView->rotateScene(-1,0);                      69     pView->rotateScene(-1,0);
 68   }                                                70   }
 69   /*                                               71   /*
 70   G4double delta_theta;                            72   G4double delta_theta;
 71                                                    73 
 72   if (pView->fVP.GetLightsMoveWithCamera()) {      74   if (pView->fVP.GetLightsMoveWithCamera()) {
 73     if (pView->rotate_right) {                     75     if (pView->rotate_right) {
 74       delta_theta = -(pView->fRot_sens);           76       delta_theta = -(pView->fRot_sens);
 75     } else {                                       77     } else {
 76       delta_theta = pView->fRot_sens;              78       delta_theta = pView->fRot_sens;
 77     }                                              79     }
 78   } else {                                         80   } else {
 79     if (pView->rotate_right) {                     81     if (pView->rotate_right) {
 80       delta_theta = pView->fRot_sens;              82       delta_theta = pView->fRot_sens;
 81     } else {                                       83     } else {
 82       delta_theta = -(pView->fRot_sens);           84       delta_theta = -(pView->fRot_sens);
 83     }                                              85     }
 84   }                                                86   }    
 85   delta_theta *= deg;                              87   delta_theta *= deg;
 86   // Rotates by fixed azimuthal angle delta_th     88   // Rotates by fixed azimuthal angle delta_theta.
 87                                                    89 
 88   const G4Vector3D& vp = pView->fVP.GetViewpoi     90   const G4Vector3D& vp = pView->fVP.GetViewpointDirection ().unit ();
 89   const G4Vector3D& up = pView->fVP.GetUpVecto     91   const G4Vector3D& up = pView->fVP.GetUpVector ().unit ();
 90   const G4Vector3D& zprime = up;                   92   const G4Vector3D& zprime = up;
 91   G4double cosalpha = up.dot (vp);                 93   G4double cosalpha = up.dot (vp);
 92   G4double sinalpha = std::sqrt (1. - std::pow     94   G4double sinalpha = std::sqrt (1. - std::pow (cosalpha, 2));
 93   G4Vector3D yprime = (zprime.cross (vp)).unit     95   G4Vector3D yprime = (zprime.cross (vp)).unit ();
 94   G4Vector3D xprime = yprime.cross (zprime);       96   G4Vector3D xprime = yprime.cross (zprime);
 95   // Projection of vp on plane perpendicular t     97   // Projection of vp on plane perpendicular to up...
 96   G4Vector3D a1 = sinalpha * xprime;               98   G4Vector3D a1 = sinalpha * xprime;
 97   // Required new projection...                    99   // Required new projection...
 98   G4Vector3D a2 =                                 100   G4Vector3D a2 =
 99     sinalpha * (std::cos (delta_theta) * xprim    101     sinalpha * (std::cos (delta_theta) * xprime + std::sin (delta_theta) * yprime);
100   // Required Increment vector...                 102   // Required Increment vector...
101   G4Vector3D delta = a2 - a1;                     103   G4Vector3D delta = a2 - a1;
102   // So new viewpoint is...                       104   // So new viewpoint is...
103   G4Vector3D viewPoint = vp + delta;              105   G4Vector3D viewPoint = vp + delta;
104                                                   106 
105   pView->fVP.SetViewAndLights (viewPoint);        107   pView->fVP.SetViewAndLights (viewPoint);  
106   */                                              108   */
107                                                   109 
108   pView->SetView ();                              110   pView->SetView ();
109   pView->ClearView ();                            111   pView->ClearView ();
110   pView->DrawView ();                             112   pView->DrawView ();
111                                                   113 
112   pView->rotation_timer = XtAppAddTimeOut         114   pView->rotation_timer = XtAppAddTimeOut 
113     (pView->app,                                  115     (pView->app,
114      timer_id == NULL ? 500 : 1,                  116      timer_id == NULL ? 500 : 1,
115      rotate_in_theta,                             117      rotate_in_theta,
116      pView);                                      118      pView);
117 }                                                 119 }  
118                                                   120 
119 void G4OpenGLXmViewer::phi_rotation_callback (    121 void G4OpenGLXmViewer::phi_rotation_callback (Widget w, 
120               XtPointer clientData,               122               XtPointer clientData, 
121               XtPointer callData)                 123               XtPointer callData) 
122 {                                                 124 {
123   XmArrowButtonCallbackStruct *cbs = (XmArrowB    125   XmArrowButtonCallbackStruct *cbs = (XmArrowButtonCallbackStruct*) callData;
124   G4OpenGLXmViewer* pView = (G4OpenGLXmViewer*    126   G4OpenGLXmViewer* pView = (G4OpenGLXmViewer*) clientData;
125                                                   127 
126   pView->rotate_up = get_boolean_userData (w);    128   pView->rotate_up = get_boolean_userData (w);
127                                                   129 
128   if (cbs->reason == XmCR_ARM) {                  130   if (cbs->reason == XmCR_ARM) {
129     rotate_in_phi (pView, NULL);                  131     rotate_in_phi (pView, NULL);
130   } else if (cbs->reason == XmCR_DISARM) {        132   } else if (cbs->reason == XmCR_DISARM) {
131     XtRemoveTimeOut (pView->rotation_timer);      133     XtRemoveTimeOut (pView->rotation_timer);
132   }                                               134   }
133 }                                                 135 }
134                                                   136 
135 void G4OpenGLXmViewer::rotate_in_phi (XtPointe    137 void G4OpenGLXmViewer::rotate_in_phi (XtPointer clientData,
136             XtIntervalId* timer_id)               138             XtIntervalId* timer_id)
137 {                                                 139 {
138   //phi spin stuff here                           140   //phi spin stuff here
139   //  G4double delta_alpha;                       141   //  G4double delta_alpha;
140   G4OpenGLXmViewer* pView = (G4OpenGLXmViewer*    142   G4OpenGLXmViewer* pView = (G4OpenGLXmViewer*) clientData;
141                                                   143 
142   if (pView -> rotate_up) {                       144   if (pView -> rotate_up) {
143     pView->rotateScene(0,-1);                     145     pView->rotateScene(0,-1);
144   } else {                                        146   } else {
145     pView->rotateScene(0,1);                      147     pView->rotateScene(0,1);
146   }                                               148   }
147   /*                                              149   /*
148   if (pView->fVP.GetLightsMoveWithCamera()) {     150   if (pView->fVP.GetLightsMoveWithCamera()) {
149     if (pView -> rotate_up) {                     151     if (pView -> rotate_up) {
150       delta_alpha = -(pView->fRot_sens);          152       delta_alpha = -(pView->fRot_sens);
151     } else {                                      153     } else {
152       delta_alpha = pView->fRot_sens;             154       delta_alpha = pView->fRot_sens;
153     }                                             155     }
154   } else {                                        156   } else {
155     if (pView -> rotate_up) {                     157     if (pView -> rotate_up) {
156       delta_alpha = pView->fRot_sens;             158       delta_alpha = pView->fRot_sens;
157     } else {                                      159     } else {
158       delta_alpha = -(pView->fRot_sens);          160       delta_alpha = -(pView->fRot_sens);
159     }                                             161     }
160   }                                               162   }    
161                                                   163 
162   delta_alpha *= deg;                             164   delta_alpha *= deg;
163                                                   165 
164   const G4Vector3D& vp = pView->fVP.GetViewpoi    166   const G4Vector3D& vp = pView->fVP.GetViewpointDirection ().unit ();
165   const G4Vector3D& up = pView->fVP.GetUpVecto    167   const G4Vector3D& up = pView->fVP.GetUpVector ().unit ();
166                                                   168 
167   const G4Vector3D& xprime = vp;                  169   const G4Vector3D& xprime = vp;
168   G4Vector3D yprime = (up.cross(xprime)).unit(    170   G4Vector3D yprime = (up.cross(xprime)).unit();
169   G4Vector3D zprime = (xprime.cross(yprime)).u    171   G4Vector3D zprime = (xprime.cross(yprime)).unit();
170                                                   172 
171   G4Vector3D new_vp = std::cos(delta_alpha) *     173   G4Vector3D new_vp = std::cos(delta_alpha) * xprime + std::sin(delta_alpha) * zprime;
172                                                   174 
173   pView->fVP.SetViewAndLights (new_vp.unit());    175   pView->fVP.SetViewAndLights (new_vp.unit());
174                                                   176 
175   if (pView->fVP.GetLightsMoveWithCamera()) {     177   if (pView->fVP.GetLightsMoveWithCamera()) {
176     G4Vector3D new_up = (new_vp.cross(yprime))    178     G4Vector3D new_up = (new_vp.cross(yprime)).unit();
177     pView->fVP.SetUpVector(new_up);               179     pView->fVP.SetUpVector(new_up);
178   }                                               180   }
179                                                   181 
180   */                                              182   */
181   pView->SetView ();                              183   pView->SetView ();
182   pView->ClearView ();                            184   pView->ClearView ();
183   pView->DrawView ();                             185   pView->DrawView ();
184                                                   186   
185   pView->rotation_timer = XtAppAddTimeOut         187   pView->rotation_timer = XtAppAddTimeOut 
186     (pView->app,                                  188     (pView->app,
187      timer_id == NULL ? 500 : 1,                  189      timer_id == NULL ? 500 : 1,
188      rotate_in_phi,                               190      rotate_in_phi,
189      pView);                                      191      pView);
190 }                                                 192 }
191                                                   193 
192 void G4OpenGLXmViewer::set_rot_sens_callback (    194 void G4OpenGLXmViewer::set_rot_sens_callback (Widget w, 
193               XtPointer clientData,               195               XtPointer clientData, 
194               XtPointer callData)                 196               XtPointer callData) 
195 {                                                 197 {
196   XmScaleCallbackStruct *cbs = (XmScaleCallbac    198   XmScaleCallbackStruct *cbs = (XmScaleCallbackStruct*) callData;
197   G4OpenGLXmViewer* pView = (G4OpenGLXmViewer*    199   G4OpenGLXmViewer* pView = (G4OpenGLXmViewer*) clientData;
198   short dp = -1;                                  200   short dp = -1;
199   G4float ten_to_the_dp = 10.;                    201   G4float ten_to_the_dp = 10.;
200                                                   202 
201   XtVaGetValues (w,                               203   XtVaGetValues (w, 
202      XmNdecimalPoints, &dp,                       204      XmNdecimalPoints, &dp,
203      NULL);                                       205      NULL);
204                                                   206 
205   if (dp == 0) {                                  207   if (dp == 0) {
206     ten_to_the_dp = 1.;                           208     ten_to_the_dp = 1.;
207   } else if ( dp > 0) {                           209   } else if ( dp > 0) {
208     for (G4int i = 1; i < (G4int)dp; i++) {       210     for (G4int i = 1; i < (G4int)dp; i++) {
209       ten_to_the_dp *= 10.;                       211       ten_to_the_dp *= 10.;
210     }                                             212     }
211   } else {                                        213   } else {
212     G4Exception                                   214     G4Exception
213       ("G4OpenGLXmViewer::set_rot_sens_callbac    215       ("G4OpenGLXmViewer::set_rot_sens_callback",
214        "opengl2004", FatalException,              216        "opengl2004", FatalException,
215        "Bad value returned for dp in set_rot_s    217        "Bad value returned for dp in set_rot_sens_callback");
216   }                                               218   }
217                                                   219 
218   pView->fRot_sens = (G4float)(cbs->value) / t    220   pView->fRot_sens = (G4float)(cbs->value) / ten_to_the_dp;
219 }                                                 221 }  
220                                                   222 
221 void G4OpenGLXmViewer::set_rot_subject_callbac    223 void G4OpenGLXmViewer::set_rot_subject_callback (Widget w, 
222                  XtPointer clientData,            224                  XtPointer clientData, 
223                  XtPointer)                       225                  XtPointer) 
224 {                                                 226 {
225   G4OpenGLXmViewer* pView = (G4OpenGLXmViewer*    227   G4OpenGLXmViewer* pView = (G4OpenGLXmViewer*)clientData;
226                                                   228   
227   G4int choice = get_int_userData (w);            229   G4int choice = get_int_userData (w);
228                                                   230   
229   switch (choice) {                               231   switch (choice) {
230   case 0:                                         232   case 0: 
231     {                                             233     {
232       pView->fVP.SetLightsMoveWithCamera (true    234       pView->fVP.SetLightsMoveWithCamera (true);
233       break;                                      235       break;
234     }                                             236     }
235   case 1:                                         237   case 1:
236     {                                             238     {
237       pView->fVP.SetLightsMoveWithCamera (fals    239       pView->fVP.SetLightsMoveWithCamera (false);
238       break;                                      240       break;
239     }                                             241     }
240   default:                                        242   default:
241     {                                             243     {
242       G4Exception                                 244       G4Exception
243   ("G4OpenGLXmViewer::set_rot_subject_callback    245   ("G4OpenGLXmViewer::set_rot_subject_callback",
244    "opengl2005", FatalException,                  246    "opengl2005", FatalException,
245    "Unrecognised choice made in set_rot_subjec    247    "Unrecognised choice made in set_rot_subject_callback"); 
246     }                                             248     }
247   }                                               249   }
248 }                                                 250 }  
249                                                   251 
250 void G4OpenGLXmViewer::wobble_callback (Widget    252 void G4OpenGLXmViewer::wobble_callback (Widget w, 
251               XtPointer,                          253               XtPointer, 
252               XtPointer)                          254               XtPointer) 
253 {                                                 255 {
254   G4OpenGLXmViewer* pView;                        256   G4OpenGLXmViewer* pView;
255                                                   257   
256   XtVaGetValues (w,                               258   XtVaGetValues (w,
257      XmNuserData, &pView,                         259      XmNuserData, &pView,
258      NULL);                                       260      NULL);
259                                                   261   
260   pView->original_vp = pView->fVP.GetViewpoint    262   pView->original_vp = pView->fVP.GetViewpointDirection();
261   pView->wobble_timer = XtAppAddTimeOut           263   pView->wobble_timer = XtAppAddTimeOut
262     (pView->app,                                  264     (pView->app,
263      (long unsigned int) (1000. * (1. / pView-    265      (long unsigned int) (1000. * (1. / pView->wob_sens)),
264      wobble_timer_callback,                       266      wobble_timer_callback,
265      pView);                                      267      pView);
266 }                                                 268 }  
267                                                   269 
268 void G4OpenGLXmViewer::wobble_timer_callback (    270 void G4OpenGLXmViewer::wobble_timer_callback (XtPointer clientData,
269               XtIntervalId*)                      271               XtIntervalId*) 
270 {                                                 272 {
271   G4OpenGLXmViewer* pView = (G4OpenGLXmViewer*    273   G4OpenGLXmViewer* pView = (G4OpenGLXmViewer*)clientData;
272   const G4Vector3D& up = pView->fVP.GetUpVecto    274   const G4Vector3D& up = pView->fVP.GetUpVector();
273   G4Vector3D third_axis = up.cross(pView->orig    275   G4Vector3D third_axis = up.cross(pView->original_vp);
274   G4double pi_div_by_ten = pi / 10.0;             276   G4double pi_div_by_ten = pi / 10.0;
275   G4Vector3D d_up = 0.1 * (std::sin ((G4double    277   G4Vector3D d_up = 0.1 * (std::sin ((G4double)pView->frameNo * pi_div_by_ten * 2.)) * up;
276   G4Vector3D d_third_axis = 0.1 * (std::sin ((    278   G4Vector3D d_third_axis = 0.1 * (std::sin ((G4double)pView->frameNo * (pi_div_by_ten))) * third_axis;
277                                                   279 
278   pView->fVP.SetViewAndLights (pView->original    280   pView->fVP.SetViewAndLights (pView->original_vp + d_up + d_third_axis);
279                                                   281 
280   pView->SetView ();                              282   pView->SetView ();
281   pView->ClearView ();                            283   pView->ClearView ();
282   pView->DrawView ();                             284   pView->DrawView ();
283                                                   285   
284   if (pView->frameNo++ == 20) {                   286   if (pView->frameNo++ == 20) {
285     if (pView->wobble_timer) {                    287     if (pView->wobble_timer) {
286       XtRemoveTimeOut (pView->wobble_timer);      288       XtRemoveTimeOut (pView->wobble_timer);
287       pView->frameNo = 0;                         289       pView->frameNo = 0;
288       pView->fVP.SetViewAndLights (pView->orig    290       pView->fVP.SetViewAndLights (pView->original_vp);
289       pView->SetView ();                          291       pView->SetView ();
290       pView->ClearView ();                        292       pView->ClearView ();
291       pView->DrawView ();                         293       pView->DrawView ();
292    }                                              294    }
293   } else {                                        295   } else {
294     pView->wobble_timer = XtAppAddTimeOut         296     pView->wobble_timer = XtAppAddTimeOut
295       (pView->app,                                297       (pView->app,
296        (long unsigned int) (1000. * (1. / pVie    298        (long unsigned int) (1000. * (1. / pView->wob_sens)),
297        wobble_timer_callback,                     299        wobble_timer_callback,
298        pView);                                    300        pView);
299   }                                               301   }
300 }                                                 302 }
301                                                   303 
302 void G4OpenGLXmViewer::reset_callback (Widget     304 void G4OpenGLXmViewer::reset_callback (Widget w, 
303              XtPointer,                           305              XtPointer, 
304              XtPointer)                           306              XtPointer) 
305 {                                                 307 {
306                                                   308   
307   G4OpenGLXmViewer* pView;                        309   G4OpenGLXmViewer* pView;
308                                                   310   
309   XtVaGetValues (w,                               311   XtVaGetValues (w,
310      XmNuserData, &pView,                         312      XmNuserData, &pView,
311      NULL);                                       313      NULL);
312                                                   314   
313   pView->fVP.SetCurrentTargetPoint(G4Point3D()    315   pView->fVP.SetCurrentTargetPoint(G4Point3D());
314   pView->fVP.SetZoomFactor(1.0);                  316   pView->fVP.SetZoomFactor(1.0);
315   pView->fVP.SetDolly(0.0);                       317   pView->fVP.SetDolly(0.0);
316   pView->SetView ();                              318   pView->SetView ();
317   pView->ClearView ();                            319   pView->ClearView ();
318   pView->DrawView ();                             320   pView->DrawView ();
319   pView->zoom_low = 0.1;                          321   pView->zoom_low = 0.1;
320   pView->zoom_high = 10.0;                        322   pView->zoom_high = 10.0;
321                                                   323   
322 }                                                 324 }
                                                   >> 325 #endif
323                                                   326