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: G4OpenGLXmBox.cc,v 1.5 2001/07/11 10:08:56 gunter Exp $ >> 25 // GEANT4 tag $Name: geant4-04-00 $ 27 // 26 // 28 //Box container class 27 //Box container class 29 28 >> 29 #ifdef G4VIS_BUILD_OPENGLXM_DRIVER >> 30 30 #include "G4OpenGLXmFramedBox.hh" 31 #include "G4OpenGLXmFramedBox.hh" 31 #include "G4OpenGLXmBox.hh" 32 #include "G4OpenGLXmBox.hh" 32 #include "G4OpenGLXmVWidgetComponent.hh" 33 #include "G4OpenGLXmVWidgetComponent.hh" 33 #include "G4OpenGLXmVWidgetShell.hh" 34 #include "G4OpenGLXmVWidgetShell.hh" 34 #include <Xm/RowColumn.h> << 35 #include <Xm/Xm.h> << 36 35 37 G4OpenGLXmBox::G4OpenGLXmBox (const char* n, 36 G4OpenGLXmBox::G4OpenGLXmBox (const char* n, 38 G4bool r) 37 G4bool r) 39 { 38 { 40 name = n; 39 name = n; 41 radio = r; 40 radio = r; 42 parent = NULL; 41 parent = NULL; 43 box_row_col = NULL; 42 box_row_col = NULL; 44 } 43 } 45 44 46 G4OpenGLXmBox::~G4OpenGLXmBox () 45 G4OpenGLXmBox::~G4OpenGLXmBox () 47 {} 46 {} 48 47 49 void G4OpenGLXmBox::AddChild (G4OpenGLXmVWidge 48 void G4OpenGLXmBox::AddChild (G4OpenGLXmVWidgetComponent* component) 50 { 49 { 51 component->AddYourselfTo(this); 50 component->AddYourselfTo(this); 52 Cardinal num_children; 51 Cardinal num_children; 53 XtVaGetValues (box_row_col, 52 XtVaGetValues (box_row_col, 54 XmNnumChildren, &num_children, 53 XmNnumChildren, &num_children, 55 NULL); 54 NULL); 56 // G4cout << name << " now parents " << num_c 55 // G4cout << name << " now parents " << num_children << " children." << G4endl; 57 } 56 } 58 57 59 void G4OpenGLXmBox::AddYourselfTo (G4OpenGLXmV 58 void G4OpenGLXmBox::AddYourselfTo (G4OpenGLXmVWidgetShell* window) 60 { 59 { 61 60 62 pView = window->GetView (); 61 pView = window->GetView (); 63 ProcesspView (); 62 ProcesspView (); 64 parent = window->GetPointerToWidget (); 63 parent = window->GetPointerToWidget (); 65 64 66 box_row_col = XtVaCreateManagedWidget (name 65 box_row_col = XtVaCreateManagedWidget (name, 67 xmRowColumnWidgetClass, 66 xmRowColumnWidgetClass, 68 *parent, 67 *parent, 69 68 70 XmNadjustMargin, True, 69 XmNadjustMargin, True, 71 XmNisHomogeneous, False, 70 XmNisHomogeneous, False, 72 XmNlabelString, (XmString)name, 71 XmNlabelString, (XmString)name, 73 XmNradioAlwaysOne, radio, 72 XmNradioAlwaysOne, radio, 74 XmNradioBehavior, radio, 73 XmNradioBehavior, radio, 75 74 76 XtNvisual, visual, 75 XtNvisual, visual, 77 XtNdepth, depth, 76 XtNdepth, depth, 78 XtNcolormap, cmap, 77 XtNcolormap, cmap, 79 XtNborderColor, borcol, 78 XtNborderColor, borcol, 80 XtNbackground, bgnd, 79 XtNbackground, bgnd, 81 80 82 NULL); 81 NULL); 83 82 84 } 83 } 85 84 86 Widget* G4OpenGLXmBox::GetPointerToParent () 85 Widget* G4OpenGLXmBox::GetPointerToParent () 87 { 86 { 88 return parent; 87 return parent; 89 } 88 } 90 89 91 Widget* G4OpenGLXmBox::GetPointerToWidget () 90 Widget* G4OpenGLXmBox::GetPointerToWidget () 92 { 91 { 93 return &box_row_col; 92 return &box_row_col; 94 } 93 } 95 94 96 const char* G4OpenGLXmBox::GetName () 95 const char* G4OpenGLXmBox::GetName () 97 { 96 { 98 return name; 97 return name; 99 } 98 } 100 99 101 void G4OpenGLXmBox::SetName (const char* n) 100 void G4OpenGLXmBox::SetName (const char* n) 102 { 101 { 103 name = n; 102 name = n; 104 } 103 } >> 104 >> 105 #endif 105 106