Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4OpenGLXmTopLevelShell.cc
Go to the documentation of this file.
1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
10// * *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
17// * *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
25//
26//
27//
28//Top level shell class
29
30#ifdef G4VIS_BUILD_OPENGLXM_DRIVER
31
32#include "G4OpenGLXmViewer.hh"
35
36#include <Xm/Frame.h>
37#include <Xm/RowColumn.h>
38
39G4OpenGLXmTopLevelShell::G4OpenGLXmTopLevelShell (G4OpenGLXmViewer* v,
40 char* n)
41{
42 pView = v;
43 ProcesspView ();
44 name = n;
45 toplevel = XtVaCreatePopupShell
46 (name,
47 topLevelShellWidgetClass,
48 top,
49
50 XtNiconName, name,
51 XtNtitle, name,
52 XmNdeleteResponse, XmDO_NOTHING,
53 XmNisHomogeneous, False,
54
55 XtNvisual, visual,
56 XtNdepth, depth,
57 XtNcolormap, cmap,
58 XtNborderColor, borcol,
59 XtNbackground, bgnd,
60 NULL);
61
62 frame = XtVaCreateManagedWidget (name,
63 xmFrameWidgetClass,
64 toplevel,
65
66 XtNvisual, visual,
67 XtNdepth, depth,
68 XtNcolormap, cmap,
69 XtNborderColor, borcol,
70 XtNbackground, bgnd,
71
72 NULL);
73
74
75
76 top_box = XtVaCreateManagedWidget (name,
77 xmRowColumnWidgetClass,
78 frame,
79
80 XmNadjustMargin, True,
81 XmNisHomogeneous, False,
82
83 XtNvisual, visual,
84 XtNdepth, depth,
85 XtNcolormap, cmap,
86 XtNborderColor, borcol,
87 XtNbackground, bgnd,
88
89 NULL);
90
91}
92
93G4OpenGLXmTopLevelShell::~G4OpenGLXmTopLevelShell ()
94{
95 XtDestroyWidget (toplevel);
96}
97
98void G4OpenGLXmTopLevelShell::AddChild (G4OpenGLXmVWidgetContainer* container)
99{
100 container->AddYourselfTo (this);
101}
102
103void G4OpenGLXmTopLevelShell::Realize ()
104{
105 Cardinal num_children;
106 XtVaGetValues (toplevel,
107 XmNnumChildren, &num_children,
108 NULL);
109// G4cout << name << " now parents " << num_children << " children." << G4endl;
110 XtManageChild (toplevel);
111 XtRealizeWidget (toplevel);
112 XtPopup (toplevel, XtGrabNonexclusive);
113}
114
115Widget* G4OpenGLXmTopLevelShell::GetPointerToWidget ()
116{
117 return &top_box;
118}
119
120char* G4OpenGLXmTopLevelShell::GetName ()
121{
122 return name;
123}
124
125#endif
const char * name(G4int ptype)