Import Geant4 11.3.0.beta source tree
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#ifndef HEPVis_SbGL_h
|
||||
#define HEPVis_SbGL_h
|
||||
|
||||
#ifdef WIN32
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
// Needs setting based on choice of driver
|
||||
// Apple system for SoQt on Apple
|
||||
// Native otherwise (Apple Framework)
|
||||
// NOTE: This header is private to the OI category, and the OI lib can only be built in one mode
|
||||
// so rhis can be simplified....
|
||||
#if defined(__APPLE__) && (!defined(G4VIS_BUILD_OIX_DRIVER) || !defined(G4VIS_USE_OIX_DRIVER))
|
||||
#include <OpenGL/gl.h>
|
||||
#include <OpenGL/glu.h>
|
||||
#else
|
||||
#include <GL/gl.h>
|
||||
#include <GL/glu.h>
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,54 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
//
|
||||
#ifndef HEPVis_SbMath_h
|
||||
#define HEPVis_SbMath_h
|
||||
|
||||
#include <cmath>
|
||||
#ifndef M_PI
|
||||
#define M_PI 3.1415926535897931160E0
|
||||
#define M_PI_2 1.5707963267948965580E0
|
||||
#endif
|
||||
|
||||
#define SbMinimum(a,b) ((a)<(b)?a:b)
|
||||
#define SbMaximum(a,b) ((a)>(b)?a:b)
|
||||
|
||||
#define FCOS(x) ((float)cos((double)(x)))
|
||||
#define FSIN(x) ((float)sin((double)(x)))
|
||||
#define FACOS(x) ((float)acos((double)(x)))
|
||||
#define FASIN(x) ((float)asin((double)(x)))
|
||||
#define FTAN(x) ((float)tan((double)(x)))
|
||||
#define FATAN(x) ((float)atan((double)(x)))
|
||||
#define FSQRT(x) ((float)sqrt((double)(x)))
|
||||
#define FPOW(x,y) ((float)pow((double)(x),(double)(y)))
|
||||
#define FLOG(x) ((float)log((double)(x)))
|
||||
#define FLOG10(x) ((float)log10((double)(x)))
|
||||
#define FFLOOR(x) ((float)floor((double)(x)))
|
||||
#define FFABS(x) ((float)fabs((double)(x)))
|
||||
#define FCEIL(x) ((float)ceil((double)(x)))
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,77 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// History :
|
||||
// - 09/12/98, G.Barrand : creation.
|
||||
|
||||
#ifndef HEPVis_SbPainter_h
|
||||
#define HEPVis_SbPainter_h
|
||||
|
||||
#include <Inventor/SbBasic.h>
|
||||
|
||||
/*
|
||||
#include <HEPVis/SbStyle.h>
|
||||
|
||||
typedef enum {
|
||||
SbPrimitivePoints,
|
||||
SbPrimitiveLineStrip,
|
||||
SbPrimitiveLineLoop,
|
||||
SbPrimitiveLines,
|
||||
SbPrimitivePolygon
|
||||
} SbPrimitiveType;
|
||||
|
||||
class SbPainterContext {
|
||||
public:
|
||||
float fRed,fGreen,fBlue;
|
||||
int fLineWidth;
|
||||
SbLineStyle fLineStyle;
|
||||
int fMarkerSize;
|
||||
SbMarkerStyle fMarkerStyle;
|
||||
SbAreaStyle fAreaStyle;
|
||||
int fPolygonMode;
|
||||
};
|
||||
*/
|
||||
|
||||
#define SbPainter Geant4_SbPainter
|
||||
|
||||
class SbPainter {
|
||||
public:
|
||||
SbPainter();
|
||||
virtual ~SbPainter();
|
||||
void setWindowSize(int,int);
|
||||
void enableEdges(SbBool);
|
||||
virtual void beginTraversal() = 0;
|
||||
virtual void clearColorBuffer(float,float,float) = 0;
|
||||
//virtual void drawPrimitive(SbPrimitiveType,
|
||||
// int,float*,float*,float*,
|
||||
// const SbPainterContext&) = 0;
|
||||
virtual void endTraversal() = 0;
|
||||
protected:
|
||||
int fWindowWidth,fWindowHeight;
|
||||
float fRed,fGreen,fBlue;
|
||||
SbBool fEdges;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,129 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// History :
|
||||
// - 25/09/98, G.Barrand : creation.
|
||||
|
||||
#ifndef HEPVis_SbPainterPS_h
|
||||
#define HEPVis_SbPainterPS_h
|
||||
|
||||
// Inheritance :
|
||||
#include <HEPVis/SbPainter.h>
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
#include <Inventor/SbViewportRegion.h>
|
||||
|
||||
#define SbPainterPS Geant4_SbPainterPS
|
||||
|
||||
class SbPainterPS : public SbPainter {
|
||||
public:
|
||||
SbPainterPS();
|
||||
~SbPainterPS();
|
||||
void beginTraversal();
|
||||
void clearColorBuffer(float,float,float);
|
||||
//void drawPrimitive(SbPrimitiveType,
|
||||
// int,float*,float*,float*,
|
||||
// const SbPainterContext&);
|
||||
void endTraversal();
|
||||
public:
|
||||
void setColorScheme(int);
|
||||
void setOrientation(int);
|
||||
void setBackgroundDrawn(int);
|
||||
void setBitsPerPixel(int);
|
||||
void setLineWidth(int);
|
||||
void* getStream();
|
||||
void setFileName(const char*);
|
||||
const char* getFileName() const;
|
||||
void openFileForWriting(const char*);
|
||||
void closeStream();
|
||||
void putPageScaleInStream(float,float);
|
||||
void putSaveStateInStream();
|
||||
void putRestoreStateInStream();
|
||||
void putTranslationInStream(float,float);
|
||||
void putScaleInStream(float,float);
|
||||
void putBeginPageInStream();
|
||||
void putEndPageInStream();
|
||||
void putRGB_InStream(float,float,float);
|
||||
void putMarkerSizeInStream(float);
|
||||
//void putMarkerStyleInStream(SbMarkerStyle);
|
||||
void putBackgroundInStream(float,float,float,float,float);
|
||||
void putFrameInStream(float,float,float,float,float);
|
||||
void putRotateInStream(float);
|
||||
void putNewPathInStream();
|
||||
void putStrokeInStream();
|
||||
void putFillInStream();
|
||||
void putClosePathInStream();
|
||||
void putCapInStream(int);
|
||||
void putLineToInStream(float,float);
|
||||
void putMoveInStream(float,float);
|
||||
void putCircleInStream(float,float,float);
|
||||
void putLineWidthInStream(int);
|
||||
//void putLineStyleInStream(SbLineStyle);
|
||||
typedef int(*GetRGB_Function)(unsigned int,unsigned int,
|
||||
double&,double&,double&);
|
||||
void putImageInStream(unsigned int,unsigned int,GetRGB_Function);
|
||||
private:
|
||||
//void drawPolygon(int,float*,float*,float,float,float,const SbAreaStyle&);
|
||||
//void drawLines(int,float*,float*,float,float,float,const SbLineStyle&,int);
|
||||
//void drawMarkers(int,float*,float*,
|
||||
// float,float,float,const SbMarkerStyle&,int);
|
||||
enum ColorScheme {
|
||||
Color = 0,
|
||||
Grey = 1,
|
||||
BlackWhite = 2
|
||||
};
|
||||
struct {
|
||||
int shade;
|
||||
int portrait;
|
||||
int nbit;
|
||||
int doBack;
|
||||
float lineWidth;
|
||||
} fParams;
|
||||
float fDeviceWidth;
|
||||
float fDeviceHeight;
|
||||
int fPageNumber;
|
||||
float fMarkerSize;
|
||||
FILE* fFile;
|
||||
char* fFileName;
|
||||
int fGSave;
|
||||
int fBufferCount;
|
||||
char* fBufferString;
|
||||
#define METAFILE_RECORD_LENGTH 80
|
||||
unsigned char fBufferPointer[METAFILE_RECORD_LENGTH+1];
|
||||
private:
|
||||
void putInStreamF(const char*,...);
|
||||
void printFLN(const char*,...);
|
||||
void printV(const char*,va_list);
|
||||
float convertRGB_ToGrey(float,float,float);
|
||||
void writeByte(unsigned char);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+69
@@ -0,0 +1,69 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#ifndef HEPVis_SoAlternateRepAction_h
|
||||
#define HEPVis_SoAlternateRepAction_h
|
||||
|
||||
// Inheritance :
|
||||
#include <Inventor/actions/SoAction.h>
|
||||
|
||||
#include <Inventor/actions/SoSubAction.h>
|
||||
|
||||
#define SoAlternateRepAction Geant4_SoAlternateRepAction
|
||||
|
||||
class SoAlternateRepAction : public SoAction {
|
||||
SO_ACTION_HEADER(SoAlternateRepAction);
|
||||
public:
|
||||
SoAlternateRepAction();
|
||||
virtual ~SoAlternateRepAction();
|
||||
static void initClass(void);
|
||||
void setGenerate(SbBool);
|
||||
SbBool getGenerate() const;
|
||||
private:
|
||||
static void nodeAction(SoAction*,SoNode*);
|
||||
private:
|
||||
SbBool fGenerate;
|
||||
};
|
||||
|
||||
#define SO_ALTERNATEREP_DO_ACTION(aAction) \
|
||||
if(aAction->isOfType(SoAlternateRepAction::getClassTypeId())) {\
|
||||
if(((SoAlternateRepAction*)aAction)->getGenerate()==TRUE) {\
|
||||
if(alternateRep.getValue()==NULL) {\
|
||||
generateAlternateRep();\
|
||||
SoNode* altRep = alternateRep.getValue();\
|
||||
if((altRep!=NULL) && altRep->isOfType(SoGroup::getClassTypeId()))\
|
||||
altRep->doAction(aAction);\
|
||||
}\
|
||||
} else {\
|
||||
SoNode* altRep = alternateRep.getValue();\
|
||||
if((altRep!=NULL) && altRep->isOfType(SoGroup::getClassTypeId()))\
|
||||
altRep->doAction(aAction);\
|
||||
clearAlternateRep();\
|
||||
}\
|
||||
return;\
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,60 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#ifndef HEPVis_SoCounterAction_h
|
||||
#define HEPVis_SoCounterAction_h
|
||||
|
||||
// Inheritance :
|
||||
#include <Inventor/actions/SoAction.h>
|
||||
|
||||
#include <Inventor/actions/SoSubAction.h>
|
||||
|
||||
#define SoCounterAction Geant4_SoCounterAction
|
||||
|
||||
class SoCounterAction : public SoAction {
|
||||
SO_ACTION_HEADER(SoCounterAction);
|
||||
public:
|
||||
SoCounterAction();
|
||||
virtual ~SoCounterAction();
|
||||
static void initClass(void);
|
||||
enum LookFor { NODE = 1,TYPE = 2, NAME = 3 };
|
||||
void setLookFor(LookFor);
|
||||
void setType(const SoType,SbBool = TRUE);
|
||||
// void setName(const SbName);
|
||||
public:
|
||||
int getCount() const;
|
||||
protected:
|
||||
virtual void beginTraversal(SoNode*);
|
||||
private:
|
||||
static void actionMethod(SoAction*,SoNode*);
|
||||
private:
|
||||
int fCount;
|
||||
int fLookFor;
|
||||
SbName fName;
|
||||
SoType fType;
|
||||
SbBool fCheckDerived;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,77 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#ifndef HEPVis_SoGL2PSAction_h
|
||||
#define HEPVis_SoGL2PSAction_h
|
||||
|
||||
#include <Inventor/actions/SoGLRenderAction.h>
|
||||
|
||||
#include <tools/gl2ps_def.h>
|
||||
|
||||
#include <string>
|
||||
|
||||
/**
|
||||
* SoGL2PSAction inherits Inventor/SoGLRenderAction.
|
||||
* It uses the gl2ps software to produce vector PostScript of a scene graph.
|
||||
*/
|
||||
|
||||
#define SoGL2PSAction Geant4_SoGL2PSAction
|
||||
|
||||
class SoGL2PSAction : public SoGLRenderAction {
|
||||
SO_ACTION_HEADER(SoGL2PSAction);
|
||||
public:
|
||||
SoGL2PSAction(const SbViewportRegion&);
|
||||
virtual ~SoGL2PSAction();
|
||||
public: /*SoINTERNAL*/
|
||||
static void initClass();
|
||||
public:
|
||||
void setFileName(const std::string&);
|
||||
void setTitleAndProducer(const std::string&,const std::string&);
|
||||
void setExportImageFormat_PS();
|
||||
void setExportImageFormat_EPS();
|
||||
void setExportImageFormat_TEX();
|
||||
void setExportImageFormat_PDF();
|
||||
void setExportImageFormat_SVG();
|
||||
void setExportImageFormat_PGF();
|
||||
bool enableFileWriting();
|
||||
void disableFileWriting();
|
||||
bool addBitmap(int,int,float=0,float=0,float=0,float=0);
|
||||
protected:
|
||||
virtual void beginTraversal(SoNode*);
|
||||
private:
|
||||
bool openFile();
|
||||
void closeFile();
|
||||
bool beginPage(int,int,int,int);
|
||||
bool endPage();
|
||||
tools_GL2PScontextPointer fContext;
|
||||
FILE* fFile;
|
||||
std::string fFileName;
|
||||
std::string fTitle;
|
||||
std::string fProducer;
|
||||
unsigned int fFormat;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// 27/03/2004 : G.Barrand : creation.
|
||||
|
||||
#ifndef HEPVis_SoStyleCache_h
|
||||
#define HEPVis_SoStyleCache_h
|
||||
|
||||
#include <Inventor/nodes/SoGroup.h>
|
||||
|
||||
//#include <HEPVis/SbStyle.h>
|
||||
|
||||
class SoMaterial;
|
||||
class SoDrawStyle;
|
||||
class SoLightModel;
|
||||
class SoResetTransform;
|
||||
class SbColor;
|
||||
|
||||
#define SoStyleCache Geant4_SoStyleCache
|
||||
|
||||
class SoStyleCache : public SoGroup {
|
||||
public:
|
||||
SoStyleCache();
|
||||
protected:
|
||||
~SoStyleCache();
|
||||
public:
|
||||
SoMaterial* getMaterial(const SbColor&,float = 0);
|
||||
SoMaterial* getMaterial(float,float,float,float = 0);
|
||||
//SoDrawStyle* getLineStyle(SbLineStyle,float = 0);
|
||||
SoDrawStyle* getLineStyle(unsigned short = 0xFFFF,float = 0);
|
||||
SoLightModel* getLightModelPhong();
|
||||
SoLightModel* getLightModelBaseColor();
|
||||
SoResetTransform* getResetTransform();
|
||||
private:
|
||||
SoGroup* fMaterials;
|
||||
SoGroup* fLineStyles;
|
||||
SoGroup* fLightModels;
|
||||
SoResetTransform* fResetTransform;
|
||||
};
|
||||
|
||||
#endif
|
||||
+121
@@ -0,0 +1,121 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
//
|
||||
/*-----------------------------HEPVis----------------------------------------*/
|
||||
/* */
|
||||
/* Node: SoDetectorTreeKit */
|
||||
/* Description: Easy way of browsing through a tree of detectors */
|
||||
/* Author: Joe Boudreau Nov 11 1996 */
|
||||
/* */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#ifndef HEPVis_SoDetectorTreeKit_h
|
||||
#define HEPVis_SoDetectorTreeKit_h
|
||||
|
||||
// Inheritance :
|
||||
#include <Inventor/nodekits/SoBaseKit.h>
|
||||
|
||||
class SoEventCallback;
|
||||
class SoSeparator;
|
||||
|
||||
#define SoDetectorTreeKit Geant4_SoDetectorTreeKit
|
||||
|
||||
|
||||
class SoDetectorTreeKit:public SoBaseKit {
|
||||
|
||||
// The following is required:
|
||||
SO_KIT_HEADER(SoDetectorTreeKit);
|
||||
////////////////////////////////////////////
|
||||
public:
|
||||
SoSFNode alternateRep; //public in order to query if alternateRep done.
|
||||
private:
|
||||
////////////////////////////////////////////
|
||||
SO_KIT_CATALOG_ENTRY_HEADER(callbackList);
|
||||
SO_KIT_CATALOG_ENTRY_HEADER(topSeparator);
|
||||
SO_KIT_CATALOG_ENTRY_HEADER(pickStyle);
|
||||
SO_KIT_CATALOG_ENTRY_HEADER(appearance);
|
||||
SO_KIT_CATALOG_ENTRY_HEADER(units);
|
||||
SO_KIT_CATALOG_ENTRY_HEADER(transform);
|
||||
SO_KIT_CATALOG_ENTRY_HEADER(texture2Transform);
|
||||
SO_KIT_CATALOG_ENTRY_HEADER(childList);
|
||||
SO_KIT_CATALOG_ENTRY_HEADER(previewSeparator);
|
||||
SO_KIT_CATALOG_ENTRY_HEADER(fullSeparator);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
// Constructor, required
|
||||
SoDetectorTreeKit();
|
||||
|
||||
// This is required
|
||||
virtual SbBool affectsState() const;
|
||||
|
||||
// Class Initializer, required
|
||||
static void initClass();
|
||||
|
||||
// Turn the preview on or off
|
||||
virtual void setPreview(SbBool Flag);
|
||||
|
||||
// Return the preview state
|
||||
virtual SbBool getPreview() const;
|
||||
|
||||
// Set SoSwitch::whichChild = SO_SWITCH_ALL
|
||||
void setPreviewAndFull();
|
||||
|
||||
// Return the preview Separator
|
||||
virtual SoSeparator *getPreviewSeparator() const;
|
||||
|
||||
// Return the full Separator
|
||||
virtual SoSeparator *getFullSeparator() const;
|
||||
|
||||
// Generate AlternateRep, required. Generating an alternate representation
|
||||
// must be done upon users request. It allows an Inventor program to read
|
||||
// back the file without requiring *this* code to be dynamically linked.
|
||||
// If the users expects that *this* code will be dynamically linked, he
|
||||
// need not invoke this method.
|
||||
virtual void generateAlternateRep();
|
||||
|
||||
// We better be able to clear it, too!
|
||||
virtual void clearAlternateRep();
|
||||
|
||||
protected:
|
||||
|
||||
// Destructor.
|
||||
virtual ~SoDetectorTreeKit();
|
||||
|
||||
virtual void doAction(SoAction*);
|
||||
private:
|
||||
|
||||
// This is needed as well
|
||||
void createInitialTree();
|
||||
|
||||
// This is the callback function that will be
|
||||
// added to the callback list
|
||||
static void expand (void *userData, SoEventCallback *eventCB);
|
||||
static void contract (void *userData, SoEventCallback *eventCB);
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,156 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
//
|
||||
/*-----------------------------Hepvis----------------------------------------*/
|
||||
/* */
|
||||
/* Node: SoBox */
|
||||
/* Description: Represents the G4Box Geant Geometry entity */
|
||||
/* Author: Joe Boudreau Nov 11 1996 */
|
||||
/* */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#ifndef HEPVis_SoBox_h
|
||||
#define HEPVis_SoBox_h
|
||||
|
||||
#include <Inventor/fields/SoSFFloat.h>
|
||||
#include <Inventor/fields/SoSFNode.h>
|
||||
#include <Inventor/nodes/SoShape.h>
|
||||
|
||||
class SoSFNode;
|
||||
|
||||
//! SoBox - Inventor version of the G4Box Geant Geometry entity
|
||||
/*!
|
||||
* Node: SoBox
|
||||
*
|
||||
* Description: The Inventor version of the G4Box Geant Geometry entity
|
||||
*
|
||||
* Author: Joe Boudreau Nov 11 1996
|
||||
*
|
||||
* class G4Box
|
||||
*
|
||||
* A Box is a cuboid of given half lengths dx,dy,dz. The Box is
|
||||
* centred on the origin with sides parallel to the x/y/z axes.
|
||||
*
|
||||
* Always use Inventor Fields. This allows Inventor to detect a change to
|
||||
* the data field and take the appropriate action; e.g., redraw the scene.
|
||||
*/
|
||||
|
||||
#define SoBox Geant4_SoBox
|
||||
|
||||
class SoBox:public SoShape {
|
||||
|
||||
// The following is required:
|
||||
SO_NODE_HEADER(SoBox);
|
||||
|
||||
public:
|
||||
|
||||
//
|
||||
//! Half-length along X
|
||||
//
|
||||
SoSFFloat fDx;
|
||||
//
|
||||
//! Half-length along Y
|
||||
//
|
||||
SoSFFloat fDy;
|
||||
//
|
||||
//! Half-length along Z
|
||||
//
|
||||
SoSFFloat fDz;
|
||||
//
|
||||
//! Alternate rep - for use by users without HEPVis shared objects
|
||||
//
|
||||
SoSFNode alternateRep;
|
||||
|
||||
//
|
||||
//! Constructor, required
|
||||
//
|
||||
SoBox();
|
||||
|
||||
//
|
||||
//! Class Initializer, required
|
||||
//
|
||||
static void initClass();
|
||||
|
||||
//
|
||||
//! Generate AlternateRep, required. Generating an alternate representation
|
||||
//! must be done upon users request. It allows an Inventor program to read
|
||||
//! back the file without requiring *this* code to be dynamically linked.
|
||||
//! If the users expects that *this* code will be dynamically linked, he
|
||||
//! need not invoke this method.
|
||||
//
|
||||
virtual void generateAlternateRep();
|
||||
|
||||
//
|
||||
//! We better be able to clear it, too!
|
||||
//
|
||||
virtual void clearAlternateRep();
|
||||
|
||||
protected:
|
||||
|
||||
//
|
||||
//! compute bounding Box, required
|
||||
//
|
||||
virtual void computeBBox(SoAction *action, SbBox3f &box, SbVec3f ¢er );
|
||||
|
||||
//
|
||||
//! Generate Primitives, required
|
||||
//
|
||||
virtual void generatePrimitives(SoAction *action);
|
||||
|
||||
//
|
||||
//! GetChildList, required whenever the class has hidden children
|
||||
//
|
||||
virtual SoChildList *getChildren() const;
|
||||
|
||||
|
||||
protected:
|
||||
//
|
||||
//! Destructor, required
|
||||
//
|
||||
virtual ~SoBox();
|
||||
|
||||
private:
|
||||
|
||||
//
|
||||
//! Generate Children. Used to create the hidden children. Required whenever
|
||||
//! the node has hidden children.
|
||||
//
|
||||
void generateChildren();
|
||||
|
||||
//
|
||||
//! Used to modify hidden children when a data field is changed. Required
|
||||
//! whenever the class has hidden children.
|
||||
//
|
||||
void updateChildren();
|
||||
|
||||
//
|
||||
//! ChildList. Required whenever the class has hidden children.
|
||||
//
|
||||
SoChildList *children;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,192 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
//
|
||||
/*-----------------------------Hepvis----------------------------------------*/
|
||||
/* */
|
||||
/* Node: SoCons */
|
||||
/* Description: Represents the G4Cons Geant Geometry entity */
|
||||
/* Author: Joe Boudreau Nov 11 1996 */
|
||||
/* */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#ifndef HEPVis_SoCons_h
|
||||
#define HEPVis_SoCons_h
|
||||
|
||||
#include <Inventor/fields/SoSFFloat.h>
|
||||
#include <Inventor/fields/SoSFNode.h>
|
||||
#include <Inventor/fields/SoSFBool.h>
|
||||
#include <Inventor/nodes/SoShape.h>
|
||||
|
||||
class SoSFNode;
|
||||
//! SoCons - Inventor version of the G4Cons Geant Geometry entity
|
||||
/*!
|
||||
* Node: SoCons
|
||||
*
|
||||
* Description: The Inventor version of the G4Cons Geant Geometry entity
|
||||
*
|
||||
* Author: Joe Boudreau Nov 11 1996
|
||||
*
|
||||
* A G4Cons is, in the general case, a Phi segment of a cone, with half-length
|
||||
* fDz, inner and outer radii specified at -fDz and +fDz. The Phi segment is
|
||||
* described by a starting fSPhi angle, and the +fDPhi delta angle for the shape.
|
||||
* If the delta angle is >=2*M_PI, the shape is treated as continuous in Phi
|
||||
*
|
||||
* Member Data:
|
||||
*
|
||||
* fRmin1 inside radius at -fDz
|
||||
* fRmin2 inside radius at +fDz
|
||||
* fRmax1 outside radius at -fDz
|
||||
* fRmax2 outside radius at +fDz
|
||||
* fDz half length in z
|
||||
*
|
||||
* fSPhi starting angle of the segment in radians
|
||||
* fDPhi delta angle of the segment in radians
|
||||
*/
|
||||
|
||||
#define SoCons Geant4_SoCons
|
||||
|
||||
class SoCons:public SoShape {
|
||||
|
||||
// The following is required:
|
||||
SO_NODE_HEADER(SoCons);
|
||||
|
||||
public:
|
||||
|
||||
//
|
||||
//! Inside radius at -fDz
|
||||
//
|
||||
SoSFFloat fRmin1;
|
||||
//
|
||||
//! Inside radius at +fDz
|
||||
//
|
||||
SoSFFloat fRmin2;
|
||||
//
|
||||
//! Outside radius at -fDz
|
||||
//
|
||||
SoSFFloat fRmax1;
|
||||
//
|
||||
//! Outside radius at +fDz
|
||||
//
|
||||
SoSFFloat fRmax2;
|
||||
//
|
||||
//! Half-length along Z
|
||||
//
|
||||
SoSFFloat fDz;
|
||||
//
|
||||
//! Starting angle, in radians
|
||||
//
|
||||
SoSFFloat fSPhi;
|
||||
//
|
||||
//! Delta-angle, in radians
|
||||
//
|
||||
SoSFFloat fDPhi;
|
||||
//
|
||||
//! An Inventor option - slightly better render, worse performance
|
||||
//
|
||||
SoSFBool smoothDraw;
|
||||
//
|
||||
//! Alternate rep required - for use by users without HEPVis shared objects
|
||||
//
|
||||
SoSFNode alternateRep;
|
||||
|
||||
//
|
||||
//! Constructor, required
|
||||
//
|
||||
SoCons();
|
||||
|
||||
//
|
||||
//! Class Initializer, required
|
||||
//
|
||||
static void initClass();
|
||||
|
||||
//
|
||||
//! Generate AlternateRep, required. Generating an alternate representation
|
||||
//! must be done upon users request. It allows an Inventor program to read
|
||||
//! back the file without requiring *this* code to be dynamically linked.
|
||||
//! If the users expects that *this* code will be dynamically linked, he
|
||||
//! need not invoke this method.
|
||||
//
|
||||
virtual void generateAlternateRep();
|
||||
|
||||
//
|
||||
//! We better be able to clear it, too!
|
||||
//
|
||||
virtual void clearAlternateRep();
|
||||
|
||||
protected:
|
||||
|
||||
//
|
||||
//! compute bounding Box, required
|
||||
//
|
||||
virtual void computeBBox(SoAction *action, SbBox3f &box, SbVec3f ¢er );
|
||||
|
||||
//
|
||||
//! Generate Primitives, required
|
||||
//
|
||||
virtual void generatePrimitives(SoAction *action);
|
||||
|
||||
//
|
||||
//! GetChildList, required whenever the class has hidden children
|
||||
//
|
||||
virtual SoChildList *getChildren() const;
|
||||
|
||||
|
||||
protected:
|
||||
//
|
||||
//! Destructor, required
|
||||
//
|
||||
virtual ~SoCons();
|
||||
|
||||
private:
|
||||
|
||||
//
|
||||
//! Generate Children. Used to create the hidden children. Required whenever
|
||||
//! the node has hidden children.
|
||||
//
|
||||
void generateChildren();
|
||||
|
||||
//
|
||||
//! Used to modify hidden children when a data field is changed. Required
|
||||
//! whenever the class has hidden children.
|
||||
//
|
||||
void updateChildren();
|
||||
|
||||
//
|
||||
//! ChildList. Required whenever the class has hidden children.
|
||||
//
|
||||
SoChildList *children;
|
||||
|
||||
//
|
||||
//! help with trigonometry. increments sines an cosines by an angle.
|
||||
//
|
||||
void inc(double & sinPhi, double & cosPhi, double sinDeltaPhi, double cosDeltaPhi) const {
|
||||
double oldSin=sinPhi,oldCos=cosPhi;
|
||||
sinPhi = oldSin*cosDeltaPhi+oldCos*sinDeltaPhi;
|
||||
cosPhi = oldCos*cosDeltaPhi-oldSin*sinDeltaPhi;
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,67 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// This node is able to produce PostScript, GIF files.
|
||||
//
|
||||
////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
#ifndef HEPVis_SoImageWriter_h
|
||||
#define HEPVis_SoImageWriter_h
|
||||
|
||||
#include <Inventor/nodes/SoSubNode.h>
|
||||
#include <Inventor/fields/SoSFEnum.h>
|
||||
#include <Inventor/fields/SoSFString.h>
|
||||
|
||||
#define SoImageWriter Geant4_SoImageWriter
|
||||
|
||||
class SoImageWriter : public SoNode {
|
||||
SO_NODE_HEADER(SoImageWriter);
|
||||
public:
|
||||
/* enum Format {
|
||||
POST_SCRIPT,
|
||||
GIF
|
||||
};
|
||||
SoSFEnum format;*/
|
||||
SoSFString fileName;
|
||||
SoImageWriter();
|
||||
void enable();
|
||||
void disable();
|
||||
SbBool getStatus() const;
|
||||
protected:
|
||||
virtual ~SoImageWriter();
|
||||
public: /*SoEXTENDER*/
|
||||
virtual void GLRender(SoGLRenderAction*);
|
||||
public: /*SoINTERNAL*/
|
||||
static void initClass();
|
||||
private:
|
||||
SbBool fEnabled;
|
||||
SbBool fStatus;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,111 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#ifndef HEPVis_SoMarkerSet_h
|
||||
#define HEPVis_SoMarkerSet_h
|
||||
|
||||
#include <Inventor/nodes/SoPointSet.h>
|
||||
|
||||
#include <Inventor/fields/SoMFInt32.h>
|
||||
|
||||
#define HEPVis_SoMarkerSet Geant4_HEPVis_SoMarkerSet
|
||||
|
||||
class HEPVis_SoMarkerSet : public SoPointSet {
|
||||
SO_NODE_HEADER(HEPVis_SoMarkerSet);
|
||||
public:
|
||||
SoMFInt32 markerIndex ;
|
||||
HEPVis_SoMarkerSet();
|
||||
|
||||
enum MarkerType {
|
||||
//************ 5x5 markers
|
||||
PLUS_5_5 = 0,
|
||||
ASTERISK_5_5,
|
||||
CROSS_5_5,
|
||||
STAR_5_5,
|
||||
CIRCLE_LINE_5_5,
|
||||
CIRCLE_FILLED_5_5,
|
||||
TRIANGLE_UP_LINE_5_5,
|
||||
TRIANGLE_UP_FILLED_5_5,
|
||||
TRIANGLE_DOWN_LINE_5_5,
|
||||
TRIANGLE_DOWN_FILLED_5_5,
|
||||
DAVID_STAR_LINE_5_5 = 10,
|
||||
DAVID_STAR_FILLED_5_5,
|
||||
SWISS_CROSS_LINE_5_5,
|
||||
SWISS_CROSS_FILLED_5_5,
|
||||
DIAMOND_LINE_5_5,
|
||||
DIAMOND_FILLED_5_5,
|
||||
SQUARE_LINE_5_5,
|
||||
SQUARE_FILLED_5_5 = 17,
|
||||
|
||||
//************ 7x7 markers
|
||||
PLUS_7_7 = 18,
|
||||
ASTERISK_7_7,
|
||||
CROSS_7_7,
|
||||
STAR_7_7,
|
||||
CIRCLE_LINE_7_7,
|
||||
CIRCLE_FILLED_7_7,
|
||||
TRIANGLE_UP_LINE_7_7,
|
||||
TRIANGLE_UP_FILLED_7_7,
|
||||
TRIANGLE_DOWN_LINE_7_7,
|
||||
TRIANGLE_DOWN_FILLED_7_7,
|
||||
DAVID_STAR_LINE_7_7,
|
||||
DAVID_STAR_FILLED_7_7,
|
||||
SWISS_CROSS_LINE_7_7 = 30,
|
||||
SWISS_CROSS_FILLED_7_7,
|
||||
DIAMOND_LINE_7_7,
|
||||
DIAMOND_FILLED_7_7,
|
||||
SQUARE_LINE_7_7,
|
||||
SQUARE_FILLED_7_7 = 35,
|
||||
|
||||
//************ 9x9 markers
|
||||
PLUS_9_9 = 36,
|
||||
ASTERISK_9_9,
|
||||
CROSS_9_9,
|
||||
STAR_9_9,
|
||||
CIRCLE_LINE_9_9,
|
||||
CIRCLE_FILLED_9_9,
|
||||
TRIANGLE_UP_LINE_9_9,
|
||||
TRIANGLE_UP_FILLED_9_9,
|
||||
TRIANGLE_DOWN_LINE_9_9,
|
||||
TRIANGLE_DOWN_FILLED_9_9,
|
||||
DAVID_STAR_LINE_9_9,
|
||||
DAVID_STAR_FILLED_9_9,
|
||||
SWISS_CROSS_LINE_9_9 = 30,
|
||||
SWISS_CROSS_FILLED_9_9,
|
||||
DIAMOND_LINE_9_9,
|
||||
DIAMOND_FILLED_9_9,
|
||||
SQUARE_LINE_9_9,
|
||||
SQUARE_FILLED_9_9 = 53
|
||||
} ;
|
||||
|
||||
public: /*SoEXTENDER*/
|
||||
virtual void GLRender(SoGLRenderAction*);
|
||||
public: /*SoINTERNAL*/
|
||||
static void initClass();
|
||||
protected:
|
||||
virtual ~HEPVis_SoMarkerSet();
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,218 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
//
|
||||
/*-----------------------------Hepvis----------------------------------------*/
|
||||
/* */
|
||||
/* Node: SoTrap */
|
||||
/* Description: Represents the G4Trap Geant Geometry entity */
|
||||
/* Author: Joe Boudreau Nov 11 1996 */
|
||||
/* */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#ifndef HEPVis_SoTrap_h
|
||||
#define HEPVis_SoTrap_h
|
||||
|
||||
// Inheritance :
|
||||
#include <Inventor/nodes/SoShape.h>
|
||||
|
||||
#include <Inventor/fields/SoSFNode.h>
|
||||
#include <Inventor/fields/SoSFBool.h>
|
||||
#include <Inventor/fields/SoSFFloat.h>
|
||||
|
||||
//adding fields
|
||||
#ifdef WIN32
|
||||
#include <SoWinEnterScope.h>
|
||||
#endif
|
||||
|
||||
|
||||
// Defining Class
|
||||
#ifdef WIN32
|
||||
#include <SoWinLeaveScope.h>
|
||||
#endif
|
||||
|
||||
class SoSFNode;
|
||||
|
||||
//! SoTrap - Inventor version of the G4Trap Geant Geometry entity
|
||||
/*! Node: SoTrap
|
||||
*
|
||||
* Description: Inventor version of the G4Trap Geant Geometry entity
|
||||
*
|
||||
* Author: Joe Boudreau Nov 11 1996
|
||||
*
|
||||
* A G4Trap is a general trapezoid: The faces perpendicular to the z planes
|
||||
* are tapezia, and their centres are not necessarily on a line parallel to
|
||||
* the z axis.
|
||||
*
|
||||
* Note that of the 11 parameters desribed below, only 9 are really
|
||||
* independent - a check for planarity is made in the calculation of the
|
||||
* equation for each plane. If the planes are not parallel, a call to
|
||||
* G4Exception is made.
|
||||
*
|
||||
* Always use Inventor Fields. This allows Inventor to detect a change to
|
||||
* the data field and take the appropriate action; e.g., redraw the scene.
|
||||
*
|
||||
*/
|
||||
|
||||
#define SoTrap Geant4_SoTrap
|
||||
|
||||
class SoTrap:public SoShape {
|
||||
|
||||
// The following is required:
|
||||
SO_NODE_HEADER(SoTrap);
|
||||
|
||||
public:
|
||||
#if defined(WIN32) && defined(BUILDING_DLL)
|
||||
// When building the node as a DLL under Win32 we must explicitly
|
||||
// declare this entry point as visible outside the DLL. The macro
|
||||
// BUILDING_DLL is defined in the node's source file.
|
||||
_declspec(dllexport)
|
||||
#endif
|
||||
|
||||
//
|
||||
//! half-length along Z
|
||||
//
|
||||
SoSFFloat pDz;
|
||||
//
|
||||
//! Polar angle of the line joining the centres of the faces at -/+pDz
|
||||
//
|
||||
SoSFFloat pTheta;
|
||||
//
|
||||
//! Azimuthal angle of the line joing the centre of the face at -pDz
|
||||
//! to the centre of the face at +pDz
|
||||
//
|
||||
SoSFFloat pPhi;
|
||||
//
|
||||
//! Half-length along y of the face at -pDz
|
||||
//
|
||||
SoSFFloat pDy1;
|
||||
//
|
||||
//! Half-length along x of the side at y=-pDy1 of the face at -pDz
|
||||
//
|
||||
SoSFFloat pDx1;
|
||||
//
|
||||
//! Half-length along x of the side at y=+pDy1 of the face at -pDz
|
||||
//
|
||||
SoSFFloat pDx2;
|
||||
//
|
||||
//! Half-length along y of the face at +pDz
|
||||
//
|
||||
SoSFFloat pDy2;
|
||||
//
|
||||
//! Half-length along x of the side at y=-pDy2 of the face at +pDz
|
||||
//
|
||||
SoSFFloat pDx3;
|
||||
//
|
||||
//! Half-length along x of the side at y=+pDy2 of the face at +pDz
|
||||
//
|
||||
SoSFFloat pDx4;
|
||||
//
|
||||
//! Angle with respect to the y axis from the centre of the side at
|
||||
//! y=-pDy1 to the centre at y=+pDy1 of the face at -pDz
|
||||
//
|
||||
SoSFFloat pAlp1;
|
||||
//
|
||||
//! Angle with respect to the y axis from the centre of the side at
|
||||
//! y=-pDy2 to the centre at y=+pDy2 of the face at +pDz
|
||||
//
|
||||
SoSFFloat pAlp2;
|
||||
|
||||
//
|
||||
//! Alternate rep - required
|
||||
//
|
||||
SoSFNode alternateRep;
|
||||
|
||||
//
|
||||
//! Constructor, required
|
||||
//
|
||||
SoTrap();
|
||||
|
||||
//
|
||||
//! Class Initializer, required
|
||||
//
|
||||
static void initClass();
|
||||
|
||||
//
|
||||
//! Generate AlternateRep, required. Generating an alternate representation
|
||||
//! must be done upon users request. It allows an Inventor program to read
|
||||
//! back the file without requiring *this* code to be dynamically linked.
|
||||
//! If the users expects that *this* code will be dynamically linked, he
|
||||
//! need not invoke this method.
|
||||
//
|
||||
virtual void generateAlternateRep();
|
||||
|
||||
//
|
||||
//! We better be able to clear it, too!
|
||||
//
|
||||
virtual void clearAlternateRep();
|
||||
|
||||
protected:
|
||||
|
||||
//
|
||||
//! compute bounding Box, required
|
||||
//
|
||||
virtual void computeBBox(SoAction *action, SbBox3f &box, SbVec3f ¢er );
|
||||
|
||||
//
|
||||
//! Generate Primitives, required
|
||||
//
|
||||
virtual void generatePrimitives(SoAction *action);
|
||||
|
||||
//
|
||||
//! GetChildList, required whenever the class has hidden children
|
||||
//
|
||||
virtual SoChildList *getChildren() const;
|
||||
|
||||
//
|
||||
//! Destructor, required
|
||||
//
|
||||
virtual ~SoTrap();
|
||||
|
||||
private:
|
||||
|
||||
//
|
||||
//! Generate Children. Used to create the hidden children. Required whenever
|
||||
//! the node has hidden children.
|
||||
//
|
||||
void generateChildren();
|
||||
|
||||
//
|
||||
//! Used to modify hidden children when a data field is changed. Required
|
||||
//! whenever the class has hidden children.
|
||||
//
|
||||
void updateChildren();
|
||||
|
||||
//
|
||||
//! ChildList. Required whenever the class has hidden children.
|
||||
//
|
||||
SoChildList *children;
|
||||
|
||||
};
|
||||
|
||||
#ifdef WIN32
|
||||
#include <SoWinEnterScope.h>
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,170 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
//
|
||||
/*-----------------------------Hepvis----------------------------------------*/
|
||||
/* */
|
||||
/* Node: SoTrd */
|
||||
/* Description: Represents the G4Trd Geant Geometry entity */
|
||||
/* Author: Joe Boudreau Nov 11 1996 */
|
||||
/* */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#ifndef HEPVis_SoTrd_h
|
||||
#define HEPVis_SoTrd_h
|
||||
|
||||
#include <Inventor/fields/SoSFFloat.h>
|
||||
#include <Inventor/fields/SoSFNode.h>
|
||||
#include <Inventor/fields/SoSFBool.h>
|
||||
#include <Inventor/nodes/SoShape.h>
|
||||
|
||||
class SoSFNode;
|
||||
|
||||
//! SoTrd - Inventor version of the G4Trd Geant Geometry entity
|
||||
/*!
|
||||
* Node: SoTrd
|
||||
*
|
||||
* Description: Inventor version of the G4Trd Geant Geometry entity
|
||||
*
|
||||
* Author: Joe Boudreau Nov 11 1996
|
||||
*
|
||||
* A Trd is a trapezoid with the x and y dimensions varying along z
|
||||
*
|
||||
* Always use Inventor Fields. This allows Inventor to detect a change to
|
||||
* the data field and take the appropriate action; e.g., redraw the scene.
|
||||
*
|
||||
*/
|
||||
|
||||
#define SoTrd Geant4_SoTrd
|
||||
|
||||
class SoTrd:public SoShape {
|
||||
|
||||
//
|
||||
//! This is required
|
||||
//
|
||||
SO_NODE_HEADER(SoTrd);
|
||||
|
||||
public:
|
||||
|
||||
//
|
||||
//! half-length of x, at -fDz
|
||||
//
|
||||
SoSFFloat fDx1;
|
||||
|
||||
//
|
||||
//! half-length of x, at +fDz
|
||||
//
|
||||
SoSFFloat fDx2;
|
||||
|
||||
//
|
||||
//! half-length of y, at -fDz
|
||||
//
|
||||
SoSFFloat fDy1;
|
||||
|
||||
//
|
||||
//! half-length of y, at +fDz
|
||||
//
|
||||
SoSFFloat fDy2;
|
||||
|
||||
//
|
||||
//! half-length along Z
|
||||
//
|
||||
SoSFFloat fDz;
|
||||
|
||||
//
|
||||
//! Alternate rep - required
|
||||
//
|
||||
SoSFNode alternateRep;
|
||||
|
||||
//
|
||||
//! Constructor, required
|
||||
//
|
||||
SoTrd();
|
||||
|
||||
//
|
||||
//! Class Initializer, required
|
||||
//
|
||||
static void initClass();
|
||||
|
||||
//
|
||||
//! Generate AlternateRep, required. Generating an alternate representation
|
||||
//! must be done upon users request. It allows an Inventor program to read
|
||||
//! back the file without requiring *this* code to be dynamically linked.
|
||||
//! If the users expects that *this* code will be dynamically linked, he
|
||||
//! need not invoke this method.
|
||||
//
|
||||
virtual void generateAlternateRep();
|
||||
|
||||
//
|
||||
//! We better be able to clear it, too!
|
||||
//
|
||||
virtual void clearAlternateRep();
|
||||
|
||||
protected:
|
||||
|
||||
//
|
||||
//! compute bounding Box, required
|
||||
//
|
||||
virtual void computeBBox(SoAction *action, SbBox3f &box, SbVec3f ¢er );
|
||||
|
||||
//
|
||||
//! Generate Primitives, required
|
||||
//
|
||||
virtual void generatePrimitives(SoAction *action);
|
||||
|
||||
//
|
||||
//! GetChildList, required whenever the class has hidden children
|
||||
//
|
||||
virtual SoChildList *getChildren() const;
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
//
|
||||
//! Destructor, required
|
||||
//
|
||||
virtual ~SoTrd();
|
||||
|
||||
private:
|
||||
|
||||
//
|
||||
//! Generate Children. Used to create the hidden children. Required whenever
|
||||
//! the node has hidden children.
|
||||
//
|
||||
void generateChildren();
|
||||
|
||||
//
|
||||
//! Used to modify hidden children when a data field is changed. Required
|
||||
//! whenever the class has hidden children.
|
||||
//
|
||||
void updateChildren();
|
||||
|
||||
//
|
||||
//! ChildList. Required whenever the class has hidden children.
|
||||
//
|
||||
SoChildList *children;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,181 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
//
|
||||
/*-----------------------------Hepvis----------------------------------------*/
|
||||
/* */
|
||||
/* Node: SoTubs */
|
||||
/* Description: Represents the G4Tubs Geant Geometry entity */
|
||||
/* Author: Joe Boudreau Nov 11 1996 */
|
||||
/* */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#ifndef HEPVis_SoTubs_h
|
||||
#define HEPVis_SoTubs_h
|
||||
|
||||
#include <Inventor/fields/SoSFFloat.h>
|
||||
#include <Inventor/fields/SoSFNode.h>
|
||||
#include <Inventor/fields/SoSFBool.h>
|
||||
#include <Inventor/nodes/SoShape.h>
|
||||
|
||||
class SoSFNode;
|
||||
|
||||
//! SoTubs - Inventor version of the G4Tubs Geant Geometry entity
|
||||
/*!
|
||||
* Node: SoTubs
|
||||
*
|
||||
* Description: The Inventor version of the G4Tubs Geant Geometry entity
|
||||
*
|
||||
* Author: Joe Boudreau Nov 11 1996
|
||||
*
|
||||
* class G4Tubs
|
||||
*
|
||||
* A tube or tube segment with curved sides parallel to
|
||||
* the z-axis. The tube has a specified half-length along
|
||||
* the z axis, about which it is centred, and a given
|
||||
* minimum and maximum radius. A minimum radius of 0
|
||||
* signifies a filled tube /cylinder. The tube segment is
|
||||
* specified by starting and delta
|
||||
* angles for phi, with 0 being the +x axis, PI/2
|
||||
* the +y axis. A delta angle of 2PI signifies a
|
||||
* complete, unsegmented tube/cylinder
|
||||
*
|
||||
* Always use Inventor Fields. This allows Inventor to detect a change to
|
||||
* the data field and take the appropriate action; e.g., redraw the scene.
|
||||
*/
|
||||
|
||||
#define SoTubs Geant4_SoTubs
|
||||
|
||||
class SoTubs:public SoShape {
|
||||
|
||||
// The following is required:
|
||||
SO_NODE_HEADER(SoTubs);
|
||||
|
||||
public:
|
||||
|
||||
//
|
||||
//! Inside radius of the tube
|
||||
//
|
||||
SoSFFloat pRMin;
|
||||
//
|
||||
//! Outside radius of the tube
|
||||
//
|
||||
SoSFFloat pRMax;
|
||||
//
|
||||
//! Half-length in Z
|
||||
//
|
||||
SoSFFloat pDz;
|
||||
//
|
||||
//! Starting angle, in radians
|
||||
//
|
||||
SoSFFloat pSPhi;
|
||||
//
|
||||
//! Delta-angle, in radians
|
||||
//
|
||||
SoSFFloat pDPhi;
|
||||
//
|
||||
//! Alternate rep - required
|
||||
//
|
||||
SoSFNode alternateRep;
|
||||
|
||||
//
|
||||
//! Constructor, required
|
||||
//
|
||||
SoTubs();
|
||||
|
||||
//
|
||||
//! Class Initializer, required
|
||||
//
|
||||
static void initClass();
|
||||
|
||||
//
|
||||
//! Generate AlternateRep, required. Generating an alternate representation
|
||||
//! must be done upon users request. It allows an Inventor program to read
|
||||
//! back the file without requiring *this* code to be dynamically linked.
|
||||
//! If the users expects that *this* code will be dynamically linked, he
|
||||
//! need not invoke this method.
|
||||
//
|
||||
virtual void generateAlternateRep();
|
||||
|
||||
//
|
||||
//! We better be able to clear it, too!
|
||||
//
|
||||
virtual void clearAlternateRep();
|
||||
|
||||
protected:
|
||||
|
||||
//
|
||||
//! compute bounding Box, required
|
||||
//
|
||||
virtual void computeBBox(SoAction *action, SbBox3f &box, SbVec3f ¢er );
|
||||
|
||||
//
|
||||
//! Generate Primitives, required
|
||||
//
|
||||
virtual void generatePrimitives(SoAction *action);
|
||||
|
||||
//
|
||||
//! GetChildList, required whenever the class has hidden children
|
||||
//
|
||||
virtual SoChildList *getChildren() const;
|
||||
|
||||
|
||||
protected:
|
||||
//
|
||||
//! Destructor, required
|
||||
//
|
||||
virtual ~SoTubs();
|
||||
|
||||
private:
|
||||
|
||||
//
|
||||
//! Generate Children. Used to create the hidden children. Required whenever
|
||||
//! the node has hidden children.
|
||||
//
|
||||
void generateChildren();
|
||||
|
||||
//
|
||||
//! Used to modify hidden children when a data field is changed. Required
|
||||
//! whenever the class has hidden children.
|
||||
//
|
||||
void updateChildren();
|
||||
|
||||
//
|
||||
//! ChildList. Required whenever the class has hidden children.
|
||||
//
|
||||
SoChildList *children;
|
||||
|
||||
//
|
||||
//! help with trigonometry. increments sines an cosines by an angle.
|
||||
//
|
||||
void inc(double & sinPhi, double & cosPhi, double sinDeltaPhi, double cosDeltaPhi) const {
|
||||
double oldSin=sinPhi,oldCos=cosPhi;
|
||||
sinPhi = oldSin*cosDeltaPhi+oldCos*sinDeltaPhi;
|
||||
cosPhi = oldCos*cosDeltaPhi-oldSin*sinDeltaPhi;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user