Import Geant4 10.3.1 source tree

This commit is contained in:
Gabriele Cosmo
2017-02-28 16:16:20 +01:00
parent a3452e42ac
commit 4597adb7c4
267 changed files with 14761 additions and 24650 deletions
+7 -1
View File
@@ -1,4 +1,4 @@
$Id: History 97317 2016-06-01 12:14:31Z gcosmo $
$Id: History 102573 2017-02-09 08:50:23Z gcosmo $
-------------------------------------------------------------------
=========================================================
@@ -20,6 +20,12 @@ committal in the CVS repository !
History file for visualization/OpenInventor
-------------------------------------------
10 January 2017 Fred Jones (openinventor-V10-02-04)
- G4OpenInventorXtExtendedViewer:
Added viewer button for Wireframe/Solid switching.
Added workaround to prevent empty second page in
PS and PDF output (due to superimposed scene).
01 June 2016 John Allison (openinventor-V10-02-03)
- G4OpenInventorXtExtendedViewer.hh:
Removed fPDFButton - not used. Fixes Coverity warning.
@@ -65,6 +65,8 @@ class SoPointSet;
class G4OpenInventorXtExaminerViewer : public SoXtExaminerViewer {
friend class G4OpenInventorXtExaminerViewerMessenger;
// FWJ
friend class G4OpenInventorXtExtendedViewer;
private:
Widget prevViewPtButton, nextViewPtButton;
@@ -108,6 +110,8 @@ public:
bool abbrOutputFlag;
bool pickRefPathFlag;
bool viewingBeforePickRef;
// FWJ
// SoNode * superimposition;
protected:
// Same constructor as the ExaminerViewer
@@ -204,6 +208,7 @@ private:
static void saveViewPtCB(Widget, XtPointer, XtPointer);
static void abbrOutputCB(Widget, XtPointer, XtPointer);
static void pickRefPathCB(Widget, XtPointer, XtPointer);
static void switchWireFrameCB(Widget, XtPointer, XtPointer);
static void constructListsDialog(Widget, XtPointer, XtPointer);
void saveViewPt(char *name);
@@ -0,0 +1,34 @@
#ifndef COIN_PIXMAP_WIREFRAME_XPM
#define COIN_PIXMAP_WIREFRAME_XPM
/* XPM */
static const char* wireframe_xpm[]={
"24 24 2 1",
". c None",
"# c #000000",
"........................",
"........................",
"......################..",
".....##.............##..",
"....#.#............#.#..",
"...#..#...........#..#..",
"..################...#..",
"..#...#..........#...#..",
"..#...#..........#...#..",
"..#...#..........#...#..",
"..#...#..........#...#..",
"..#...#..........#...#..",
"..#...#..........#...#..",
"..#...#..........#...#..",
"..#...#..........#...#..",
"..#...#..........#...#..",
"..#...#..........#...#..",
"..#...################..",
"..#..#...........#..#...",
"..#.#............#.#....",
"..##.............##.....",
"..################......",
"........................",
"........................"};
#endif /* !COIN_PIXMAP_WIREFRAME_XPM */
@@ -11,7 +11,7 @@
#
# Generated on : 24/9/2010
#
# $Id: sources.cmake 96179 2016-03-22 15:43:57Z gcosmo $
# $Id: sources.cmake 102573 2017-02-09 08:50:23Z gcosmo $
#
#------------------------------------------------------------------------------
@@ -109,6 +109,7 @@ if(UNIX)
saveViewPt.h
pickext.h
pickref.h
wireframe.h
)
list(APPEND G4VIS_MODULE_OPENINVENTOR_SOURCES
@@ -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(