Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer << 3 // * DISCLAIMER * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th << 5 // * The following disclaimer summarizes all the specific disclaimers * 6 // * the Geant4 Collaboration. It is provided << 6 // * of contributors to this software. The specific disclaimers,which * 7 // * conditions of the Geant4 Software License << 7 // * govern, are listed with their locations in: * 8 // * LICENSE and available at http://cern.ch/ << 8 // * http://cern.ch/geant4/license * 9 // * include a list of copyright holders. << 10 // * 9 // * * 11 // * Neither the authors of this software syst 10 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 11 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 12 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 13 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file << 14 // * use. * 16 // * for the full disclaimer and the limitatio << 17 // * 15 // * * 18 // * This code implementation is the result << 16 // * This code implementation is the intellectual property of the * 19 // * technical work of the GEANT4 collaboratio << 17 // * GEANT4 collaboration. * 20 // * By using, copying, modifying or distri << 18 // * By copying, distributing or modifying the Program (or any work * 21 // * any work based on the software) you ag << 19 // * based on the Program) you indicate your acceptance of this * 22 // * use in resulting scientific publicati << 20 // * statement, and all its terms. * 23 // * acceptance of all terms of the Geant4 Sof << 24 // ******************************************* 21 // ******************************************************************** 25 // 22 // 26 // 23 // >> 24 // $Id: G4OpenGLXmWindowHandlingCallbacks.cc,v 1.5 2001/07/11 10:08:59 gunter Exp $ >> 25 // GEANT4 tag $Name: geant4-05-02-patch-01 $ 27 // 26 // 28 // 27 // 29 // Andrew Walkden 16th June 1997 28 // Andrew Walkden 16th June 1997 30 // G4OpenGLXmWindowHandlingCallbacks : Callbac 29 // G4OpenGLXmWindowHandlingCallbacks : Callback functions for 31 // (Motif) 30 // (Motif) widgets to use. 32 // in hand 31 // in handling (Xm) windows 33 32 >> 33 #ifdef G4VIS_BUILD_OPENGLXM_DRIVER >> 34 34 #include "G4OpenGLXmViewer.hh" 35 #include "G4OpenGLXmViewer.hh" 35 36 36 void G4OpenGLXmViewer::resize_callback (Widget 37 void G4OpenGLXmViewer::resize_callback (Widget w, 37 XtPointer clientData, 38 XtPointer clientData, 38 XtPointer x) << 39 XtPointer) 39 { 40 { 40 expose_callback(w,clientData,x); << 41 Dimension width, height; >> 42 G4OpenGLXmViewer* pView = (G4OpenGLXmViewer*) clientData; >> 43 >> 44 XtVaGetValues (w, >> 45 XmNwidth, &width, >> 46 XmNheight, &height, >> 47 NULL); >> 48 >> 49 pView->WinSize_x = (G4int) width; >> 50 pView->WinSize_y = (G4int) height; 41 } 51 } 42 52 43 53 44 54 45 void G4OpenGLXmViewer::expose_callback (Widget 55 void G4OpenGLXmViewer::expose_callback (Widget w, 46 XtPointer clientData, 56 XtPointer clientData, 47 XtPointer) 57 XtPointer) 48 { 58 { 49 G4OpenGLXmViewer* pView = (G4OpenGLXmViewer* 59 G4OpenGLXmViewer* pView = (G4OpenGLXmViewer*) clientData; 50 Dimension width, height; 60 Dimension width, height; 51 61 52 XtVaGetValues (w, 62 XtVaGetValues (w, 53 XmNwidth, &width, 63 XmNwidth, &width, 54 XmNheight, &height, 64 XmNheight, &height, 55 NULL); 65 NULL); 56 66 57 pView->ResizeWindow(width,height); << 67 pView->WinSize_x = (G4int) width; >> 68 pView->WinSize_y = (G4int) height; >> 69 >> 70 glXMakeCurrent (pView->dpy, XtWindow(pView->glxarea), pView->cx); >> 71 glViewport (0, 0, width, height); 58 72 59 //??????????????????????????? This might be a << 73 pView->ClearView (); 60 // glXMakeCurrent (pView->dpy, XtWindow(pView << 74 pView->DrawView (); 61 // pView->SetView (); << 62 // pView->ClearView (); << 63 // pView->DrawView (); << 64 //???????????????????????????? Commented out 1 << 65 } 75 } 66 76 67 void G4OpenGLXmViewer::print_callback (Widget, 77 void G4OpenGLXmViewer::print_callback (Widget, 68 XtPointer clientData, 78 XtPointer clientData, 69 XtPointer) 79 XtPointer) 70 { 80 { 71 G4OpenGLXViewer* pView = (G4OpenGLXmViewer*) 81 G4OpenGLXViewer* pView = (G4OpenGLXmViewer*) clientData; 72 pView->exportImage(); << 82 pView->print(); 73 } 83 } 74 84 75 void G4OpenGLXmViewer::set_print_colour_callba 85 void G4OpenGLXmViewer::set_print_colour_callback (Widget w, 76 XtPointer clientData, 86 XtPointer clientData, 77 XtPointer) 87 XtPointer) 78 { 88 { 79 G4OpenGLXmViewer* pView = (G4OpenGLXmViewer* 89 G4OpenGLXmViewer* pView = (G4OpenGLXmViewer*)clientData; 80 90 81 G4int choice = get_int_userData (w); 91 G4int choice = get_int_userData (w); 82 92 83 pView->fPrintColour=(G4bool)choice; << 93 pView->print_colour=(G4bool)choice; 84 G4cout << "Print colour set to " << pView->f << 94 G4cout << "Print colour set to " << pView->print_colour; 85 95 86 } 96 } 87 97 88 void G4OpenGLXmViewer::set_print_style_callbac 98 void G4OpenGLXmViewer::set_print_style_callback (Widget w, 89 XtPointer clientData, 99 XtPointer clientData, 90 XtPointer) 100 XtPointer) 91 { 101 { 92 G4OpenGLXmViewer* pView = (G4OpenGLXmViewer* 102 G4OpenGLXmViewer* pView = (G4OpenGLXmViewer*)clientData; 93 103 94 G4int choice = get_int_userData (w); 104 G4int choice = get_int_userData (w); 95 105 96 pView->fVectoredPs=(G4bool)choice; << 106 pView->vectored_ps=(G4bool)choice; 97 G4cout << "`Produce vectored PostScript ?' s << 107 G4cout << "`Produce vectored PostScript ?' set to : " << pView->print_colour; 98 108 99 } 109 } >> 110 >> 111 #endif 100 112