Import Geant4 10.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-10 11:51:14 +02:00
parent e2d2f9810a
commit 286caacf06
12421 changed files with 730077 additions and 502383 deletions
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4OpenInventor.cc 66373 2012-12-18 09:41:34Z gcosmo $
//
#ifdef G4VIS_BUILD_OI_DRIVER
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4OpenInventorSceneHandler.cc 66373 2012-12-18 09:41:34Z gcosmo $
//
//
// Jeff Kallenbach 01 Aug 1996
@@ -50,7 +50,6 @@
#include <Inventor/nodes/SoNormal.h>
#include <Inventor/nodes/SoNormalBinding.h>
#include <Inventor/nodes/SoComplexity.h>
#include <Inventor/nodes/SoNurbsSurface.h>
#include <Inventor/nodes/SoTranslation.h>
#include <Inventor/nodes/SoTransform.h>
#include <Inventor/nodes/SoResetTransform.h>
@@ -75,7 +74,6 @@ typedef HEPVis_SoMarkerSet SoMarkerSet;
#include "SoG4MarkerSet.h"
#include "G4Scene.hh"
#include "G4NURBS.hh"
#include "G4OpenInventor.hh"
#include "G4OpenInventorTransform3D.hh"
#include "G4ThreeVector.hh"
@@ -585,87 +583,6 @@ void G4OpenInventorSceneHandler::AddPrimitive (const G4Polyhedron& polyhedron)
fCurrentSeparator->addChild(soPolyhedron);
}
//
// Method for handling G4NURBS objects for drawing solids.
// Knots and Ctrl Pnts MUST be arrays of GLfloats.
//
void G4OpenInventorSceneHandler::AddPrimitive (const G4NURBS& nurb) {
if (fProcessing2D) {
static G4bool warned = false;
if (!warned) {
warned = true;
G4Exception
("G4OpenInventorSceneHandler::AddPrimitive (const G4NURBS&)",
"OpenInventor-0006", JustWarning,
"2D NURBS not implemented. Ignored.");
}
return;
}
// Get vis attributes - pick up defaults if none.
const G4VisAttributes* pVA =
fpViewer -> GetApplicableVisAttributes (nurb.GetVisAttributes ());
AddProperties(pVA); // Colour, etc.
AddTransform(); // Transformation
G4float *u_knot_array, *u_knot_array_ptr;
u_knot_array = u_knot_array_ptr = new G4float [nurb.GetnbrKnots(G4NURBS::U)];
G4NURBS::KnotsIterator u_iterator (nurb, G4NURBS::U);
while (u_iterator.pick (u_knot_array_ptr++)){}
G4float *v_knot_array, *v_knot_array_ptr;
v_knot_array = v_knot_array_ptr = new G4float [nurb.GetnbrKnots(G4NURBS::V)];
G4NURBS::KnotsIterator v_iterator (nurb, G4NURBS::V);
while (v_iterator.pick (v_knot_array_ptr++)){}
G4float *ctrl_pnt_array, *ctrl_pnt_array_ptr;
ctrl_pnt_array = ctrl_pnt_array_ptr =
new G4float [nurb.GettotalnbrCtrlPts () * G4NURBS::NofC*sizeof(G4float)];
G4NURBS::CtrlPtsCoordsIterator c_p_iterator (nurb);
while (c_p_iterator.pick (ctrl_pnt_array_ptr++)){}
SoSeparator *surfSep = new SoSeparator();
//
// Set up NURBS
//
SoComplexity *complexity = new SoComplexity;
SoCoordinate4 *ctlPts = new SoCoordinate4;
SoNurbsSurface *oi_nurb = new SoNurbsSurface;
complexity->value = (float)0.6;
G4int nPoints = nurb.GettotalnbrCtrlPts ();
SbVec4f* points = new SbVec4f[nPoints];
for (G4int iPoint = 0; iPoint < nPoints ; iPoint++) {
points[iPoint].setValue(
ctrl_pnt_array[iPoint*4 + 0],
ctrl_pnt_array[iPoint*4 + 1],
ctrl_pnt_array[iPoint*4 + 2],
ctrl_pnt_array[iPoint*4 + 3]);
}
ctlPts->point.setValues (0,nPoints,points);
oi_nurb->numUControlPoints = nurb.GetnbrCtrlPts(G4NURBS::U);
oi_nurb->numVControlPoints = nurb.GetnbrCtrlPts(G4NURBS::V);
oi_nurb->uKnotVector.setValues(0,nurb.GetnbrKnots(G4NURBS::U),u_knot_array);
oi_nurb->vKnotVector.setValues(0,nurb.GetnbrKnots(G4NURBS::V),v_knot_array);
surfSep->addChild(complexity);
surfSep->addChild(ctlPts);
surfSep->addChild(oi_nurb);
fCurrentSeparator->addChild(surfSep);
//
// Clean-up
//
delete [] u_knot_array;
delete [] v_knot_array;
delete [] ctrl_pnt_array;
delete [] points;
}
void G4OpenInventorSceneHandler::GeneratePrerequisites()
{
// Utility for PreAddSolid and BeginPrimitives.
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4OpenInventorTransform3D.cc 66373 2012-12-18 09:41:34Z gcosmo $
//
//
// jck 17 Dec 1996
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id$
// $Id: G4OpenInventorViewer.cc 66373 2012-12-18 09:41:34Z gcosmo $
#ifdef G4VIS_BUILD_OI_DRIVER
@@ -160,7 +160,6 @@ G4bool G4OpenInventorViewer::CompareForKernelVisit(G4ViewParameters& vp) {
if (
(vp.GetDrawingStyle () != fVP.GetDrawingStyle ()) ||
(vp.IsAuxEdgeVisible () != fVP.IsAuxEdgeVisible ()) ||
(vp.GetRepStyle () != fVP.GetRepStyle ()) ||
(vp.IsCulling () != fVP.IsCulling ()) ||
(vp.IsCullingInvisible () != fVP.IsCullingInvisible ()) ||
(vp.IsDensityCulling () != fVP.IsDensityCulling ()) ||
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4OpenInventorWin.cc 66373 2012-12-18 09:41:34Z gcosmo $
//
// OpenInventor graphics system factory.
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4OpenInventorWinViewer.cc 66373 2012-12-18 09:41:34Z gcosmo $
//
/*
* jck : 05 Feb 1997 : Initial Implementation
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4OpenInventorXt.cc 66373 2012-12-18 09:41:34Z gcosmo $
//
//
// Jeff Kallenbach 01 Aug 1996
@@ -34,6 +34,7 @@
#include <cmath>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <algorithm> // For using sort on a vector
#include <X11/keysym.h>
@@ -564,10 +565,8 @@ void G4OpenInventorXtExaminerViewer::superimpositionEvent(SoAction * action)
if (refParticleIdx < (int) refParticleTrajectory.size() - 1) {
this->curInfoFont->size.setValue(16);
this->curInfoFont->name.setValue("defaultFont:Bold");
char zPos[20];
sprintf(zPos, "%7.2f [m]", refZPositions[refParticleIdx] / 1000);
this->curInfoText->string.setValue(SbString(zPos));
}
}
@@ -2386,8 +2385,9 @@ void G4OpenInventorXtExaminerViewer::constructListsDialog(Widget w,
// Shell Dialog
std::string dialogNameStr = This->fileName.substr(This->fileName.rfind('/') + 1);
char *dialogName = new char[dialogNameStr.size() + 1];
strcpy(dialogName, dialogNameStr.c_str());
const int nDialog = dialogNameStr.size() + 1;
char *dialogName = new char[nDialog];
strncpy(dialogName, dialogNameStr.c_str(), nDialog);
n = 0;
XtSetArg(args[n], XmNx, 610); n++;
@@ -3031,8 +3031,9 @@ void G4OpenInventorXtExaminerViewer::getViewPtNameCB(Widget w,
}
if (!nameExists) {
name = new char[This->MAX_VP_NAME + 1];
strcpy(name, strName.c_str());
const int nVPName = This->MAX_VP_NAME + 1;
name = new char[nVPName];
strncpy(name, strName.c_str(), nVPName);
if (This->viewPtIdx == -1)
This->viewPtIdx = 0;
This->saveViewPt(name);
@@ -4195,8 +4196,9 @@ void G4OpenInventorXtExaminerViewer::renameBookmarkCB(Widget,
int beg = vpNameStr.find_first_not_of(' '); // Remove leading/trailing spaces
int end = vpNameStr.find_last_not_of(' ');
vpNameStr = vpNameStr.substr(beg, end - beg + 1);
vpName = new char[vpNameStr.size() + 1];
strcpy(vpName, vpNameStr.c_str());
const int nVPName = vpNameStr.size() + 1;
vpName = new char[nVPName];
strncpy(vpName, vpNameStr.c_str(), nVPName);
int size = This->viewPtList.size();
for (int i = 0; i < size; i++) {
@@ -4258,8 +4260,9 @@ void G4OpenInventorXtExaminerViewer::sortBookmarksCB(Widget,
// viewPtIdx has to be changed to account for a different order in viewPtList
if (!strcmp(charList[i].c_str(), This->curViewPtName))
This->viewPtIdx = i;
char *vpName2 = new char[charList[i].size() + 1];
strcpy(vpName2, charList[i].c_str());
const int nVPName = charList[i].size() + 1;
char *vpName2 = new char[nVPName];
strncpy(vpName2, charList[i].c_str(), nVPName);
newStrList[i] = XmStringCreateLocalized(vpName2);
delete vpName2;
}
@@ -25,7 +25,6 @@
//
//
// $Id: G4OpenInventorXt.cc,v 1.5 2010-05-26 14:30:46 allison Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
//
// Jeff Kallenbach 01 Aug 1996
@@ -59,6 +59,8 @@
#include <Xm/RowColumn.h>
#include <Xm/Text.h>
#include <cstdio>
#include "HEPVis/actions/SoGL2PSAction.h"
#include "G4OpenInventor.hh"
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id$
// $Id: G4OpenInventorXtViewer.cc 66373 2012-12-18 09:41:34Z gcosmo $
//
/*
* jck 05 Feb 1997 - Initial Implementation
@@ -57,7 +57,6 @@ SbPainterPS::SbPainterPS(
:fDeviceWidth((8.5-1.) * 72. * METAFILE_SCALE) /* 540. * METAFILE_SCALE */
,fDeviceHeight(11. * 72. * METAFILE_SCALE) /* 792. * METAFILE_SCALE */
,fPageNumber(0)
,fPagePos(0)
,fMarkerSize(2.)
,fFile(NULL)
,fFileName(NULL)
@@ -72,6 +71,7 @@ SbPainterPS::SbPainterPS(
fParams.nbit = 2;
fParams.doBack = 1;
fParams.lineWidth = -1.;
fBufferPointer[0] = '\0';
#ifdef WIN32
::setlocale(LC_NUMERIC,"USA");
#endif
@@ -25,7 +25,7 @@
//
//
//
// $Id$
// $Id: SoBox.cc 66373 2012-12-18 09:41:34Z gcosmo $
//
/*----------------------------HEPVis----------------------------------------*/
/* */
@@ -25,7 +25,7 @@
//
//
//
// $Id$
// $Id: SoCons.cc 66373 2012-12-18 09:41:34Z gcosmo $
//
/*-----------------------------HEPVis---------------------------------------*/
/* */
@@ -51,7 +51,7 @@ void SoCounterAction::initClass(void){
SO_ACTION_ADD_METHOD(SoNode,SoCounterAction::actionMethod);
}
SoCounterAction::SoCounterAction()
:fCount(0),fLookFor(NODE),fCheckDerived(TRUE){
:fCount(0),fLookFor(NODE),fType(),fCheckDerived(TRUE) {
SO_ACTION_CONSTRUCTOR(SoCounterAction);
}
SoCounterAction::~SoCounterAction(){}
@@ -25,7 +25,7 @@
//
//
//
// $Id$
// $Id: SoDetectorTreeKit.cc 66373 2012-12-18 09:41:34Z gcosmo $
//
/*-----------------------------HEPVis----------------------------------------*/
/* */
@@ -25,7 +25,7 @@
//
//
//
// $Id$
// $Id: SoTrap.cc 66373 2012-12-18 09:41:34Z gcosmo $
//
/*-----------------------------HEPVis----------------------------------------*/
/* */
@@ -25,7 +25,7 @@
//
//
//
// $Id$
// $Id: SoTrd.cc 66373 2012-12-18 09:41:34Z gcosmo $
//
/*-----------------------------HEPVis---------------------------------------*/
/* */
@@ -25,7 +25,7 @@
//
//
//
// $Id$
// $Id: SoTubs.cc 66373 2012-12-18 09:41:34Z gcosmo $
//
/*-----------------------------HEPVis---------------------------------------*/
/* */