79 {
80
82
84 int width = 600;
85 int height = 600;
86
87 if(!parent) {
88
89 char str[32];
90
92 if(sgeometry.empty()) {
93 G4cout <<
"ERROR: Geometry string \""
94 << sgeometry
95 << "\" is empty. Using \"600x600\"."
97 width = 600;
98 height = 600;
99 snprintf(str,sizeof str,"%dx%d",width,height);
100 sgeometry = str;
101 } else {
104 }
105
106
108 shellName += "_shell";
109 Arg args[10];
110 XtSetArg(args[0],XtNgeometry,XtNewString(sgeometry.c_str()));
111 XtSetArg(args[1],XtNborderWidth,0);
112 XtSetArg(args[2],XtNtitle,XtNewString(wName.c_str()));
113 fShell = XtAppCreateShell(shellName.c_str(),
"Inventor",
114 topLevelShellWidgetClass,
115 SoXt::getDisplay(),
116 args,3);
117
118 XtSetArg(args[0],XmNtopAttachment ,XmATTACH_FORM);
119 XtSetArg(args[1],XmNleftAttachment ,XmATTACH_FORM);
120 XtSetArg(args[2],XmNrightAttachment ,XmATTACH_FORM);
121 XtSetArg(args[3],XmNbottomAttachment,XmATTACH_FORM);
122 Widget form = XmCreateForm (
fShell,(
char*)
"form",args,4);
123 XtManageChild (form);
124
125 XtSetArg(args[0],XmNtopAttachment ,XmATTACH_FORM);
126 XtSetArg(args[1],XmNleftAttachment ,XmATTACH_FORM);
127 XtSetArg(args[2],XmNrightAttachment ,XmATTACH_FORM);
128 Widget menuBar = XmCreateMenuBar (form,(char*)"menuBar",args,3);
129 XtManageChild(menuBar);
130
131 {Widget menu =
AddMenu(menuBar,
"File",
"File");
136
137 {Widget menu =
AddMenu(menuBar,
"Etc",
"Etc");
141
148 }
149
150 {Widget menu =
AddMenu(menuBar,
"Help",
"Help");
152
153 fViewer =
new SoXtExaminerViewer(form,wName.c_str(),
TRUE);
154
155 XtSetArg(args[0],XmNtopAttachment ,XmATTACH_WIDGET);
156 XtSetArg(args[1],XmNtopWidget ,menuBar);
157 XtSetArg(args[2],XmNleftAttachment ,XmATTACH_FORM);
158 XtSetArg(args[3],XmNrightAttachment ,XmATTACH_FORM);
159 XtSetArg(args[4],XmNbottomAttachment,XmATTACH_FORM);
160 XtSetValues(
fViewer->getWidget(),args,5);
161
163 XtSetArg(args[0],XmNleftAttachment ,XmATTACH_FORM);
164 XtSetArg(args[1],XmNrightAttachment ,XmATTACH_FORM);
165 XtSetArg(args[2],XmNbottomAttachment,XmATTACH_FORM);
166 Widget cancel = XmCreatePushButton(
fHelpForm,(
char*)
"helpCancel",args,3);
167 XtAddCallback(cancel,XmNactivateCallback,
HelpCancelCbk,(XtPointer)
this);
168 XtManageChild(cancel);
169 XtSetArg(args[0],XmNtopAttachment ,XmATTACH_FORM);
170 XtSetArg(args[1],XmNleftAttachment ,XmATTACH_FORM);
171 XtSetArg(args[2],XmNrightAttachment ,XmATTACH_FORM);
172 XtSetArg(args[3],XmNbottomAttachment,XmATTACH_WIDGET);
173 XtSetArg(args[4],XmNbottomWidget ,cancel);
176
178
179 } else {
181 if(str!=0) wName = str;
182 fViewer =
new SoXtExaminerViewer(parent,wName.c_str(),
TRUE);
183 }
184
185 fViewer->setSize(SbVec2s(width,height));
186
187
188 const SbViewportRegion& vpRegion =
fViewer->getViewportRegion();
191
192
201 }
203 fViewer->setTransparencyType(SoGLRenderAction::SORTED_OBJECT_ADD);
204}
SoSelection * fSoSelection
Geant4_SoGL2PSAction * fGL2PSAction
static void SetPreviewCbk(Widget, XtPointer, XtPointer)
static void SetReducedWireFrameCbk(Widget, XtPointer, XtPointer)
static void SceneGraphStatisticsCbk(Widget, XtPointer, XtPointer)
static void SetPreviewAndFullCbk(Widget, XtPointer, XtPointer)
static void EraseDetectorCbk(Widget, XtPointer, XtPointer)
static void PixmapPostScriptCbk(Widget, XtPointer, XtPointer)
static void SetFullWireFrameCbk(Widget, XtPointer, XtPointer)
static void PostScriptCbk(Widget, XtPointer, XtPointer)
static void WriteInventorCbk(Widget, XtPointer, XtPointer)
void AddButton(Widget, const G4String &, XtCallbackProc)
static void HelpCancelCbk(Widget, XtPointer, XtPointer)
static void EraseEventCbk(Widget, XtPointer, XtPointer)
static void UpdateSceneCbk(Widget, XtPointer, XtPointer)
static void EscapeCbk(Widget, XtPointer, XtPointer)
static void SetSolidCbk(Widget, XtPointer, XtPointer)
static void HelpCbk(Widget, XtPointer, XtPointer)
Widget AddMenu(Widget, const G4String &, const G4String &)
void SetCreatedInteractor(G4Interactor)
virtual void FlushAndWaitExecution()=0
G4Interactor GetParentInteractor()
char * GetCreationString()
void AddShell(G4Interactor)
const G4String & GetXGeometryString() const
unsigned int GetWindowSizeHintX() const