92 if(sgeometry.empty()) {
93 G4cout <<
"ERROR: Geometry string \""
95 <<
"\" is empty. Using \"600x600\"."
99 snprintf(str,
sizeof str,
"%dx%d",width,height);
108 shellName +=
"_shell";
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,
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);
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);
131 {Widget menu =
AddMenu(menuBar,
"File",
"File");
137 {Widget menu =
AddMenu(menuBar,
"Etc",
"Etc");
150 {Widget menu =
AddMenu(menuBar,
"Help",
"Help");
153 fViewer =
new SoXtExaminerViewer(form,wName.c_str(),
TRUE);
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);
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);
181 if(str!=0) wName = str;
182 fViewer =
new SoXtExaminerViewer(parent,wName.c_str(),
TRUE);
185 fViewer->setSize(SbVec2s(width,height));
188 const SbViewportRegion& vpRegion =
fViewer->getViewportRegion();
203 fViewer->setTransparencyType(SoGLRenderAction::SORTED_OBJECT_ADD);
250 Widget menu = XmCreatePulldownMenu(aMenuBar,(
char*)aName.c_str(),NULL,0);
254 XmStringLtoRCreate((
char*)aLabel.c_str(),(
char*)XmSTRING_DEFAULT_CHARSET);
255 XtSetArg (args[0],XmNlabelString,cps);
256 XtSetArg (args[1],XmNsubMenuId,menu);
257 Widget widget = XmCreateCascadeButton(aMenuBar,(
char*)aName.c_str(),args,2);
259 XtManageChild(widget);