Import Geant4 10.3.1 source tree
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4OpenInventorViewer.cc 88190 2015-02-02 17:24:54Z gcosmo $
|
||||
// $Id: G4OpenInventorViewer.cc 102573 2017-02-09 08:50:23Z gcosmo $
|
||||
|
||||
#ifdef G4VIS_BUILD_OI_DRIVER
|
||||
|
||||
@@ -184,6 +184,9 @@ G4bool G4OpenInventorViewer::CompareForKernelVisit(G4ViewParameters& vp) {
|
||||
// needs a kernel visit. (In this respect, it differs from the
|
||||
// OpenGL drivers, where it's done in SetView.)
|
||||
(vp.GetScaleFactor () != fVP.GetScaleFactor ()) ||
|
||||
// If G4OpenInventor ever introduces VAMs, the following might need
|
||||
// changing to a complete comparison, i.e., remove ".size()". See
|
||||
// G4OpenGLStoredViewer::CompareForKernelVisit.
|
||||
(vp.GetVisAttributesModifiers().size() !=
|
||||
fVP.GetVisAttributesModifiers().size())
|
||||
)
|
||||
|
||||
@@ -83,6 +83,7 @@
|
||||
#include "saveViewPt.h"
|
||||
#include "pickext.h"
|
||||
#include "pickref.h"
|
||||
#include "wireframe.h"
|
||||
//#include "console.h"
|
||||
//#include "favorites.h"
|
||||
|
||||
@@ -689,6 +690,7 @@ void G4OpenInventorXtExaminerViewer::createViewerButtons(Widget parent,
|
||||
int n;
|
||||
Arg args[6];
|
||||
Widget saveViewPtButton, abbrOutputButton, pickRefPathButton;
|
||||
Widget switchWireFrameButton;
|
||||
|
||||
// Create original buttons
|
||||
SoXtExaminerViewer::createViewerButtons(parent, buttonlist);
|
||||
@@ -779,16 +781,23 @@ void G4OpenInventorXtExaminerViewer::createViewerButtons(Widget parent,
|
||||
XtVaSetValues(pickRefPathButton, XmNlabelType, XmPIXMAP, XmNlabelPixmap,
|
||||
pickrefxpm, XmNselectPixmap, pickrefxpm, XmNlabelInsensitivePixmap,
|
||||
pickrefxpm_ins, XmNselectInsensitivePixmap, pickrefxpm_ins, NULL);
|
||||
// Pixmap favoritesxpm, favoritesxpm_ins;
|
||||
// favoritesxpm = SoXtInternal::createPixmapFromXpm(pickRefPathButton,
|
||||
// favorites_xpm);
|
||||
// favoritesxpm_ins = SoXtInternal::createPixmapFromXpm(pickRefPathButton,
|
||||
// favorites_xpm, TRUE);
|
||||
// XtVaSetValues(pickRefPathButton, XmNlabelType, XmPIXMAP, XmNlabelPixmap,
|
||||
// favoritesxpm, XmNselectPixmap, favoritesxpm, XmNlabelInsensitivePixmap,
|
||||
// favoritesxpm_ins, XmNselectInsensitivePixmap, favoritesxpm_ins, NULL);
|
||||
|
||||
buttonlist->append(pickRefPathButton);
|
||||
|
||||
// Toggle button for switching in and out of wireframe mode
|
||||
switchWireFrameButton = XtVaCreateManagedWidget("Wireframe",
|
||||
xmToggleButtonWidgetClass, parent, XmNindicatorOn, False, NULL);
|
||||
XtAddCallback(switchWireFrameButton, XmNvalueChangedCallback,
|
||||
G4OpenInventorXtExaminerViewer::switchWireFrameCB, this);
|
||||
Pixmap wireframe, wireframe_ins;
|
||||
wireframe = SoXtInternal::createPixmapFromXpm(switchWireFrameButton,
|
||||
wireframe_xpm);
|
||||
wireframe_ins = SoXtInternal::createPixmapFromXpm(switchWireFrameButton,
|
||||
wireframe_xpm, TRUE);
|
||||
XtVaSetValues(switchWireFrameButton, XmNlabelType, XmPIXMAP, XmNlabelPixmap,
|
||||
wireframe, XmNselectPixmap, wireframe, XmNlabelInsensitivePixmap,
|
||||
wireframe_ins, XmNselectInsensitivePixmap, wireframe_ins, NULL);
|
||||
buttonlist->append(switchWireFrameButton);
|
||||
}
|
||||
|
||||
|
||||
@@ -3036,11 +3045,11 @@ void G4OpenInventorXtExaminerViewer::saveViewPtCB(Widget w,
|
||||
XmString label = XmStringCreateLocalized((char *) "Name the viewpoint:");
|
||||
|
||||
XtSetArg(args[n], XmNselectionLabelString, label); n++;
|
||||
XtSetArg(args[n], XmNautoUnmanage, False); n++; //prevent the dialog from closing
|
||||
//automatically, in case the name
|
||||
//is wrong
|
||||
|
||||
nameViewPtDialog = XmCreatePromptDialog(parent, (char *) "Save Viewpoint",
|
||||
// Prevent the dialog from closing automatically, in case the name is wrong
|
||||
XtSetArg(args[n], XmNautoUnmanage, False); n++;
|
||||
// FWJ
|
||||
XtSetArg(args[n], XmNtitle, "Save Bookmark"); n++;
|
||||
nameViewPtDialog = XmCreatePromptDialog(parent, String("Save Bookmark"),
|
||||
args, n);
|
||||
|
||||
XmStringFree(label);
|
||||
@@ -3109,8 +3118,9 @@ void G4OpenInventorXtExaminerViewer::abbrOutputCB(Widget,
|
||||
XtPointer client_data,
|
||||
XtPointer)
|
||||
{
|
||||
G4OpenInventorXtExaminerViewer * This =
|
||||
G4OpenInventorXtExaminerViewer * This =
|
||||
(G4OpenInventorXtExaminerViewer *) client_data;
|
||||
// G4cout << "DISARMCALLBACK abbrOutputFlag=" << This->abbrOutputFlag << G4endl;
|
||||
This->abbrOutputFlag = !(This->abbrOutputFlag);
|
||||
}
|
||||
|
||||
@@ -3130,6 +3140,24 @@ void G4OpenInventorXtExaminerViewer::pickRefPathCB(Widget,
|
||||
}
|
||||
|
||||
|
||||
void G4OpenInventorXtExaminerViewer::switchWireFrameCB(Widget w,
|
||||
XtPointer client_data,
|
||||
XtPointer)
|
||||
{
|
||||
G4OpenInventorXtExaminerViewer* This =
|
||||
(G4OpenInventorXtExaminerViewer*)client_data;
|
||||
// xmToggleButton theToggleButton = (xmToggleButton)w;
|
||||
if (XmToggleButtonGetState(w)) {
|
||||
This->setDrawStyle(SoXtViewer::STILL, SoXtViewer::VIEW_LINE);
|
||||
This->setDrawStyle(SoXtViewer::INTERACTIVE, SoXtViewer::VIEW_LINE);
|
||||
} else {
|
||||
This->setDrawStyle(SoXtViewer::STILL, SoXtViewer::VIEW_AS_IS);
|
||||
This->setDrawStyle(SoXtViewer::INTERACTIVE,
|
||||
SoXtViewer::VIEW_SAME_AS_STILL);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Examines new viewpoint name and if OK calls saveViewPt.
|
||||
|
||||
void G4OpenInventorXtExaminerViewer::getViewPtNameCB(Widget w,
|
||||
|
||||
@@ -324,12 +324,28 @@ void G4OpenInventorXtExtendedViewer::EscapeFromKeyboardCbk(void* o) {
|
||||
void G4OpenInventorXtExtendedViewer::PostScriptCbk(
|
||||
Widget,XtPointer aData,XtPointer) {
|
||||
G4OpenInventorXtExtendedViewer* This = (G4OpenInventorXtExtendedViewer*)aData;
|
||||
// FWJ Workaround: avoids empty 2nd page in file
|
||||
SbBool superimpState =
|
||||
This->fViewer->getSuperimpositionEnabled(This->fViewer->superimposition);
|
||||
This->fViewer->setSuperimpositionEnabled(This->fViewer->superimposition,
|
||||
FALSE);
|
||||
This->WritePostScript();
|
||||
if (superimpState)
|
||||
This->fViewer->setSuperimpositionEnabled(This->fViewer->superimposition,
|
||||
TRUE);
|
||||
}
|
||||
void G4OpenInventorXtExtendedViewer::PDFCbk(
|
||||
Widget,XtPointer aData,XtPointer) {
|
||||
G4OpenInventorXtExtendedViewer* This = (G4OpenInventorXtExtendedViewer*)aData;
|
||||
// FWJ Workaround: avoids empty 2nd page in file
|
||||
SbBool superimpState =
|
||||
This->fViewer->getSuperimpositionEnabled(This->fViewer->superimposition);
|
||||
This->fViewer->setSuperimpositionEnabled(This->fViewer->superimposition,
|
||||
FALSE);
|
||||
This->WritePDF();
|
||||
if (superimpState)
|
||||
This->fViewer->setSuperimpositionEnabled(This->fViewer->superimposition,
|
||||
TRUE);
|
||||
}
|
||||
|
||||
void G4OpenInventorXtExtendedViewer::PixmapPostScriptCbk(
|
||||
|
||||
Reference in New Issue
Block a user