Import Geant4 11.2.0.beta source tree

This commit is contained in:
Gabriele Cosmo
2023-06-30 09:09:57 +02:00
parent aef78ca386
commit dd1f179cda
3780 changed files with 212808 additions and 142780 deletions
@@ -0,0 +1,224 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
//
//
// class description:
//
// This header file defines some static constant variables and error classes
// used internally by G4JpegMaker and related classes
//
#ifndef G4RTJpeg_H
#define G4RTJpeg_H 1
typedef unsigned char u_char;
typedef unsigned int u_int;
const char JFIF[] = "JFIF";
const char JFXX[] = "JFXX";
const double Sqrt2 = 1.41421356;
const double DisSqrt2 = 1.0 / Sqrt2;
const double PaiDiv16 = 3.14159265 / 16;
//Zigzag
static const int Zigzag[64] = {
0, 1, 8, 16, 9, 2, 3, 10,
17, 24, 32, 25, 18, 11, 4, 5,
12, 19, 26, 33, 40, 48, 41, 34,
27, 20, 13, 6, 7, 14, 21, 28,
35, 42, 49, 56, 57, 50, 43, 36,
29, 22, 15, 23, 30, 37, 44, 51,
58, 59, 52, 45, 38, 31, 39, 46,
53, 60, 61, 54, 47, 55, 62, 63
};
//ProcessResult
enum
jProcessResult{
M_NoError = 0,
M_RuntimeError = -1,
M_DataError = -2
};
// JpegMarkerCode
enum
jMarker{
M_SOF0 = 0xc0,
M_SOF1 = 0xc1,
M_SOF2 = 0xc2,
M_SOF3 = 0xc3,
M_SOF5 = 0xc5,
M_SOF6 = 0xc6,
M_SOF7 = 0xc7,
M_JPG = 0xc8,
M_SOF9 = 0xc9,
M_SOF10 = 0xca,
M_SOF11 = 0xcb,
M_SOF13 = 0xcd,
M_SOF14 = 0xce,
M_SOF15 = 0xcf,
M_DHT = 0xc4,
M_DAC = 0xcc,
M_RST0 = 0xd0, M_RST1 = 0xd1,
M_RST2 = 0xd2, M_RST3 = 0xd3,
M_RST4 = 0xd4, M_RST5 = 0xd5,
M_RST6 = 0xd6, M_RST7 = 0xd7,
M_SOI = 0xd8,
M_EOI = 0xd9,
M_SOS = 0xda,
M_DQT = 0xdb,
M_DNL = 0xdc,
M_DRI = 0xdd,
M_DHP = 0xde,
M_EXP = 0xdf,
M_COM = 0xfe,
M_APP0 = 0xe0, M_APP1 = 0xe1,
M_APP2 = 0xe2, M_APP3 = 0xe3,
M_APP4 = 0xe4, M_APP5 = 0xe5,
M_APP6 = 0xe6, M_APP7 = 0xe7,
M_APP8 = 0xe8, M_APP9 = 0xe9,
M_APP10 = 0xea, M_APP11 = 0xeb,
M_APP12 = 0xec, M_APP13 = 0xed,
M_APP14 = 0xee, M_APP15 = 0xef,
M_JPG0 = 0xf0, M_JPG1 = 0xf1,
M_JPG2 = 0xf2, M_JPG3 = 0xf3,
M_JPG4 = 0xf4, M_JPG5 = 0xf5,
M_JPG6 = 0xf6, M_JPG7 = 0xf7,
M_JPG8 = 0xf8, M_JPG9 = 0xf9,
M_JPG10 = 0xfa, M_JPG11 = 0xfb,
M_JPG12 = 0xfc, M_JPG13 = 0xfd,
M_TEM = 0x01,
M_RESst = 0x02,
M_RESend = 0xbf,
M_Error = 0xff,
M_Marker = 0xff
};
//JpegProperty
struct
G4JpegProperty{
G4JpegProperty()
:nRow(0)
,nColumn(0)
,Dimension(0)
,SamplePrecision(0)
,Comment(0)
,Format(0)
,MajorRevisions(0)
,MinorRevisions(0)
,Units(0)
,HDensity(0)
,VDensity(0)
,HThumbnail(0)
,VThumbnail(0)
,ExtensionCode(0)
{}
int nRow;
int nColumn;
int Dimension;
int SamplePrecision;
const char * Comment;
int Format;
u_char MajorRevisions;
u_char MinorRevisions;
int Units;
int HDensity;
int VDensity;
int HThumbnail;
int VThumbnail;
int ExtensionCode;
};
//MemoryError
class G4MemoryError
{
public:
G4MemoryError(int size, const char* message)
{mSize = size; mMessage = message;};
int mSize;
const char* mMessage;
};
//IndexError
class G4IndexError
{
public:
G4IndexError(int maxIndex, int errorIndex, const char* mes)
{mMaxIndex = maxIndex; mErrorIndex = errorIndex; mMessage = mes;};
int mMaxIndex;
int mErrorIndex;
const char* mMessage;
};
//BufferError
class G4BufferError
{
public:
G4BufferError(const char* mes)
{mMessage = mes;};
const char* mMessage;
};
//DataFormatError
class G4DataFormatError
{
public:
G4DataFormatError(void* address, const char* message)
{mAddress = address; mMessage = message;};
void* mAddress;
const char* mMessage;
};
//NotSupported
class G4NotSupported
{
public:
G4NotSupported(jMarker aMark, void* address)
{mMark = aMark; mAddress = address;};
jMarker mMark;
void* mAddress;
};
#endif
@@ -0,0 +1,97 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
//
//
// class description:
//
// This class converts 8 bit unsighned ints array to JPEG code.
//
#ifndef G4RTJpegCoder_H
#define G4RTJpegCoder_H 1
#include "G4RTJpeg.hh"
//HuffmanTable
struct
G4HuffmanCodeTable
{
int numOfElement;
int* SizeT;
int* CodeT;
};
class G4OutBitStream;
class G4JpegCoder
{
public:
G4JpegCoder(u_char* colorR,u_char* colorG,u_char* colorB);
~G4JpegCoder(void);
void GetJpegData(char** aJpegData,int& size);
void SetJpegProperty(const G4JpegProperty& aProperty);
int DoCoding(void);
protected:
u_char* mRgb[3];
int mYBlock[4][64];
int mCbBlock[64];
int mCrBlock[64];
double mCosT[8][8];
int mDCTData[64];
int mPreDC[3];
G4JpegProperty mProperty;
int mNumVUnits;
int mNumHUnits;
G4OutBitStream *mOBSP;
void CodeMCU();
void makeYCC(int ux,int uy);
void CodeHuffman(int cs);
void ForwardDCT(int* picData);
void Quantization(int cs);
void WriteHeader(void);
void WriteEOI(void);
};
const u_int JFIFLength = 16;
const u_int JFIFVersion = 0x0102; //JFIF Ver 1.02
const u_char YSampleF = 0x22;
const u_char CSampleF = 0x11;
#endif
@@ -0,0 +1,333 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
//
// class description:
//
// This header file defines some hard coded numbers used by G4RTJpegCoder
// to convert 8 bits RGB to JPEG.
//
#ifndef G4RTJpegCoderTable_H
#define G4RTJpegCoderTable_H 1
#include "G4RTJpeg.hh"
//QuantumTable
static const int YQuantumT[] = {
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
};
static const int CQuantumT[] = {
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
};
//HuffmanCode
static const int YDcSizeT[] = {
0x0002, 0x0003, 0x0003, 0x0003,
0x0003, 0x0003, 0x0004, 0x0005,
0x0006, 0x0007, 0x0008, 0x0009 };
static const int YDcCodeT[] = {
0x0000, 0x0002, 0x0003, 0x0004,
0x0005, 0x0006, 0x000e, 0x001e,
0x003e, 0x007e, 0x00fe, 0x01fe };
static const G4HuffmanCodeTable YDcHuffmanT = {
12,
(int*)YDcSizeT,
(int*)YDcCodeT
};
static const int CDcSizeT[] = {
0x0002, 0x0002, 0x0002, 0x0003,
0x0004, 0x0005, 0x0006, 0x0007,
0x0008, 0x0009, 0x000a, 0x000b };
static const int CDcCodeT[] = {
0x0000, 0x0001, 0x0002, 0x0006,
0x000e, 0x001e, 0x003e, 0x007e,
0x00fe, 0x01fe, 0x03fe, 0x07fe };
static const G4HuffmanCodeTable CDcHuffmanT = {
12,
(int*)CDcSizeT,
(int*)CDcCodeT
};
static const int YAcSizeT[] = {
4, 2, 2, 3, 4, 5, 7, 8,
10, 16, 16, 4, 5, 7, 9, 11,
16, 16, 16, 16, 16, 5, 8, 10,
12, 16, 16, 16, 16, 16, 16, 6,
9, 12, 16, 16, 16, 16, 16, 16,
16, 6, 10, 16, 16, 16, 16, 16,
16, 16, 16, 7, 11, 16, 16, 16,
16, 16, 16, 16, 16, 7, 12, 16,
16, 16, 16, 16, 16, 16, 16, 8,
12, 16, 16, 16, 16, 16, 16, 16,
16, 9, 15, 16, 16, 16, 16, 16,
16, 16, 16, 9, 16, 16, 16, 16,
16, 16, 16, 16, 16, 9, 16, 16,
16, 16, 16, 16, 16, 16, 16, 10,
16, 16, 16, 16, 16, 16, 16, 16,
16, 10, 16, 16, 16, 16, 16, 16,
16, 16, 16, 11, 16, 16, 16, 16,
16, 16, 16, 16, 16, 16, 16, 16,
16, 16, 16, 16, 16, 16, 16, 11,
16, 16, 16, 16, 16, 16, 16, 16,
16, 16 };
static const int YAcCodeT[] = {
0x000a, 0x0000, 0x0001, 0x0004,
0x000b, 0x001a, 0x0078, 0x00f8,
0x03f6, 0xff82, 0xff83, 0x000c,
0x001b, 0x0079, 0x01f6, 0x07f6,
0xff84, 0xff85, 0xff86, 0xff87,
0xff88, 0x001c, 0x00f9, 0x03f7,
0x0ff4, 0xff89, 0xff8a, 0xff8b,
0xff8c, 0xff8d, 0xff8e, 0x003a,
0x01f7, 0x0ff5, 0xff8f, 0xff90,
0xff91, 0xff92, 0xff93, 0xff94,
0xff95, 0x003b, 0x03f8, 0xff96,
0xff97, 0xff98, 0xff99, 0xff9a,
0xff9b, 0xff9c, 0xff9d, 0x007a,
0x07f7, 0xff9e, 0xff9f, 0xffa0,
0xffa1, 0xffa2, 0xffa3, 0xffa4,
0xffa5, 0x007b, 0x0ff6, 0xffa6,
0xffa7, 0xffa8, 0xffa9, 0xffaa,
0xffab, 0xffac, 0xffad, 0x00fa,
0x0ff7, 0xffae, 0xffaf, 0xffb0,
0xffb1, 0xffb2, 0xffb3, 0xffb4,
0xffb5, 0x01f8, 0x7fc0, 0xffb6,
0xffb7, 0xffb8, 0xffb9, 0xffba,
0xffbb, 0xffbc, 0xffbd, 0x01f9,
0xffbe, 0xffbf, 0xffc0, 0xffc1,
0xffc2, 0xffc3, 0xffc4, 0xffc5,
0xffc6, 0x01fa, 0xffc7, 0xffc8,
0xffc9, 0xffca, 0xffcb, 0xffcc,
0xffcd, 0xffce, 0xffcf, 0x03f9,
0xffd0, 0xffd1, 0xffd2, 0xffd3,
0xffd4, 0xffd5, 0xffd6, 0xffd7,
0xffd8, 0x03fa, 0xffd9, 0xffda,
0xffdb, 0xffdc, 0xffdd, 0xffde,
0xffdf, 0xffe0, 0xffe1, 0x07f8,
0xffe2, 0xffe3, 0xffe4, 0xffe5,
0xffe6, 0xffe7, 0xffe8, 0xffe9,
0xffea, 0xffeb, 0xffec, 0xffed,
0xffee, 0xffef, 0xfff0, 0xfff1,
0xfff2, 0xfff3, 0xfff4, 0x07f9,
0xfff5, 0xfff6, 0xfff7, 0xfff8,
0xfff9, 0xfffa, 0xfffb, 0xfffc,
0xfffd, 0xfffe };
static const G4HuffmanCodeTable YAcHuffmanT = {
162,
(int*)YAcSizeT,
(int*)YAcCodeT
};
static const int YEOBidx = 0;
static const int YZRLidx = 151;
static const int CAcSizeT[] = {
2, 2, 3, 4, 5, 5, 6, 7,
9, 10, 12, 4, 6, 8, 9, 11,
12, 16, 16, 16, 16, 5, 8, 10,
12, 15, 16, 16, 16, 16, 16, 5,
8, 10, 12, 16, 16, 16, 16, 16,
16, 6, 9, 16, 16, 16, 16, 16,
16, 16, 16, 6, 10, 16, 16, 16,
16, 16, 16, 16, 16, 7, 11, 16,
16, 16, 16, 16, 16, 16, 16, 7,
11, 16, 16, 16, 16, 16, 16, 16,
16, 8, 16, 16, 16, 16, 16, 16,
16, 16, 16, 9, 16, 16, 16, 16,
16, 16, 16, 16, 16, 9, 16, 16,
16, 16, 16, 16, 16, 16, 16, 9,
16, 16, 16, 16, 16, 16, 16, 16,
16, 9, 16, 16, 16, 16, 16, 16,
16, 16, 16, 11, 16, 16, 16, 16,
16, 16, 16, 16, 16, 14, 16, 16,
16, 16, 16, 16, 16, 16, 16, 10,
15, 16, 16, 16, 16, 16, 16, 16,
16, 16 };
static const int CAcCodeT[] = {
0x0000, 0x0001, 0x0004, 0x000a,
0x0018, 0x0019, 0x0038, 0x0078,
0x01f4, 0x03f6, 0x0ff4, 0x000b,
0x0039, 0x00f6, 0x01f5, 0x07f6,
0x0ff5, 0xff88, 0xff89, 0xff8a,
0xff8b, 0x001a, 0x00f7, 0x03f7,
0x0ff6, 0x7fc2, 0xff8c, 0xff8d,
0xff8e, 0xff8f, 0xff90, 0x001b,
0x00f8, 0x03f8, 0x0ff7, 0xff91,
0xff92, 0xff93, 0xff94, 0xff95,
0xff96, 0x003a, 0x01f6, 0xff97,
0xff98, 0xff99, 0xff9a, 0xff9b,
0xff9c, 0xff9d, 0xff9e, 0x003b,
0x03f9, 0xff9f, 0xffa0, 0xffa1,
0xffa2, 0xffa3, 0xffa4, 0xffa5,
0xffa6, 0x0079, 0x07f7, 0xffa7,
0xffa8, 0xffa9, 0xffaa, 0xffab,
0xffac, 0xffad, 0xffae, 0x007a,
0x07f8, 0xffaf, 0xffb0, 0xffb1,
0xffb2, 0xffb3, 0xffb4, 0xffb5,
0xffb6, 0x00f9, 0xffb7, 0xffb8,
0xffb9, 0xffba, 0xffbb, 0xffbc,
0xffbd, 0xffbe, 0xffbf, 0x01f7,
0xffc0, 0xffc1, 0xffc2, 0xffc3,
0xffc4, 0xffc5, 0xffc6, 0xffc7,
0xffc8, 0x01f8, 0xffc9, 0xffca,
0xffcb, 0xffcc, 0xffcd, 0xffce,
0xffcf, 0xffd0, 0xffd1, 0x01f9,
0xffd2, 0xffd3, 0xffd4, 0xffd5,
0xffd6, 0xffd7, 0xffd8, 0xffd9,
0xffda, 0x01fa, 0xffdb, 0xffdc,
0xffdd, 0xffde, 0xffdf, 0xffe0,
0xffe1, 0xffe2, 0xffe3, 0x07f9,
0xffe4, 0xffe5, 0xffe6, 0xffe7,
0xffe8, 0xffe9, 0xffea, 0xffeb,
0xffec, 0x3fe0, 0xffed, 0xffee,
0xffef, 0xfff0, 0xfff1, 0xfff2,
0xfff3, 0xfff4, 0xfff5, 0x03fa,
0x7fc3, 0xfff6, 0xfff7, 0xfff8,
0xfff9, 0xfffa, 0xfffb, 0xfffc,
0xfffd, 0xfffe };
static const G4HuffmanCodeTable CAcHuffmanT = {
162,
(int*)CAcSizeT,
(int*)CAcCodeT
};
static const int CEOBidx = 0;
static const int CZRLidx = 151;
//HuffmanCode
static const int DcDhtLength = 0x21;
static const int AcDhtLength = 0xb7;
static const u_char YDcDht[] = {
0xff, 0xc4,
0x00, 0x1f,
0x00,
0x00, 0x01, 0x05, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b
};
static const u_char CDcDht[] = {
0xff, 0xc4,
0x00, 0x1f,
0x01,
0x00, 0x03, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b
};
static const u_char YAcDht[] = {
0xff, 0xc4,
0x00, 0xb5,
0x10,
0x00, 0x02, 0x01, 0x03, 0x03, 0x02, 0x04, 0x03,
0x05, 0x05, 0x04, 0x04, 0x00, 0x00, 0x01, 0x7d,
0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12,
0x21, 0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07,
0x22, 0x71, 0x14, 0x32, 0x81, 0x91, 0xa1, 0x08,
0x23, 0x42, 0xb1, 0xc1, 0x15, 0x52, 0xd1, 0xf0,
0x24, 0x33, 0x62, 0x72, 0x82, 0x09, 0x0a, 0x16,
0x17, 0x18, 0x19, 0x1a, 0x25, 0x26, 0x27, 0x28,
0x29, 0x2a, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39,
0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49,
0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59,
0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69,
0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79,
0x7a, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89,
0x8a, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98,
0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6,
0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, 0xc4, 0xc5,
0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2, 0xd3, 0xd4,
0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xe1, 0xe2,
0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea,
0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,
0xf9, 0xfa
};
static const u_char CAcDht[] = {
0xff, 0xc4,
0x00, 0xb5,
0x11,
0x00, 0x02, 0x01, 0x02, 0x04, 0x04, 0x03, 0x04,
0x07, 0x05, 0x04, 0x04, 0x00, 0x01, 0x02, 0x77,
0x00, 0x01, 0x02, 0x03, 0x11, 0x04, 0x05, 0x21,
0x31, 0x06, 0x12, 0x41, 0x51, 0x07, 0x61, 0x71,
0x13, 0x22, 0x32, 0x81, 0x08, 0x14, 0x42, 0x91,
0xa1, 0xb1, 0xc1, 0x09, 0x23, 0x33, 0x52, 0xf0,
0x15, 0x62, 0x72, 0xd1, 0x0a, 0x16, 0x24, 0x34,
0xe1, 0x25, 0xf1, 0x17, 0x18, 0x19, 0x1a, 0x26,
0x27, 0x28, 0x29, 0x2a, 0x35, 0x36, 0x37, 0x38,
0x39, 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48,
0x49, 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58,
0x59, 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68,
0x69, 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78,
0x79, 0x7a, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
0x88, 0x89, 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96,
0x97, 0x98, 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5,
0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4,
0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3,
0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2,
0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda,
0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9,
0xea, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,
0xf9, 0xfa
};
#endif
@@ -0,0 +1,58 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
//
//
// class description:
//
// This is a concrete class of G4VFigureFileMaker.
// This class converts 8 bits unsighned integer arrays which represent RGB of
// each pixel to JPEG code and stores it to a file. The only one public method
// of this class will be invoked by G4RayTracer.
//
#ifndef G4RTJpegMaker_H
#define G4RTJpegMaker_H 1
#include "G4VFigureFileMaker.hh"
#include "G4RTJpeg.hh"
class G4RTJpegMaker : public G4VFigureFileMaker
{
public:
G4RTJpegMaker();
virtual ~G4RTJpegMaker();
public:
virtual void CreateFigureFile(const G4String& fileName,
int nColumn,int nRow,
u_char* colorR, u_char* colorG,
u_char* colorB);
};
#endif
@@ -0,0 +1,84 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
//
//
// class description:
//
// This is a concrete class of G4UImessenger. This class defines various
// UI commands which are unique to G4RayTracer.
//
#ifndef G4RTMessenger_HH
#define G4RTMessenger_HH 1
#include "G4UImessenger.hh"
class G4UIdirectory;
class G4UIcmdWithABool;
class G4UIcmdWith3Vector;
class G4UIcmdWith3VectorAndUnit;
class G4UIcmdWithADoubleAndUnit;
class G4UIcmdWithAnInteger;
class G4UIcmdWithAString;
class G4TheRayTracer;
class G4RTMessenger : public G4UImessenger
{
public:
static G4RTMessenger* GetInstance(G4TheRayTracer* p1); // Singleton constructor.
virtual ~G4RTMessenger();
virtual G4String GetCurrentValue(G4UIcommand * command);
virtual void SetNewValue(G4UIcommand * command,G4String newValue);
private:
G4RTMessenger(G4TheRayTracer* p1);
static G4RTMessenger* fpInstance;
G4TheRayTracer* theDefaultTracer; // The first tracer to
// instantiate this messenger.
G4TheRayTracer* theTracer; // The current tracer.
G4UIdirectory* rayDirectory;
G4UIcmdWithAnInteger* columnCmd;
G4UIcmdWithAnInteger* rowCmd;
G4UIcmdWith3VectorAndUnit* targetCmd;
G4UIcmdWith3VectorAndUnit* eyePosCmd;
G4UIcmdWith3Vector* lightCmd;
G4UIcmdWithADoubleAndUnit* spanXCmd;
G4UIcmdWithADoubleAndUnit* headCmd;
G4UIcmdWithADoubleAndUnit* attCmd;
G4UIcmdWithABool* distCmd;
G4UIcmdWithABool* transCmd;
G4UIcmdWithAString* fileCmd;
G4UIcmdWith3Vector* bkgColCmd;
};
#endif
@@ -0,0 +1,71 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
//
//
// class description:
//
// This class represents a line of JPEG code. This class must be used exclusively
// by G4RTJpegCoder.
//
#ifndef G4RTOutBitStream_H
#define G4RTOutBitStream_H 1
#include "G4RTJpeg.hh"
static const u_char BitFullMaskT[8] = {0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f
, 0xff};
class G4OutBitStream
{
public:
G4OutBitStream(int size);
~G4OutBitStream();
void SetBits(int v, int numBits);
void SetByte(u_char dat);
void SetWord(u_int dat);
void CopyByte(const char* src, int n);
u_char* GetStreamAddress(void){return mHeadOfBuf;};
int GetStreamSize(void){return int(mBuf - mHeadOfBuf);};
protected:
u_char* mHeadOfBuf;
u_char* mBuf;
u_char* mEndOfBuf;
int mBitPos;
int mWriteFlag;
void IncBuf(void);
void FullBit(void);
void Set8Bits(u_char v, int numBits);
void SetFewBits(u_char v, int numBits);
void SetBits2Byte(u_char v, int numBits);
};
#endif
@@ -0,0 +1,76 @@
//
// ********************************************************************
// * 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 G4RTPrimaryGeneratorAction_h
#define G4RTPrimaryGeneratorAction_h 1
#include "G4VUserPrimaryGeneratorAction.hh"
class G4Event;
class G4ParticleDefinition;
class G4VPhysicalVolume;
#include "globals.hh"
#include "geomdefs.hh"
#include "G4ThreeVector.hh"
class G4RTPrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
{
public:
G4RTPrimaryGeneratorAction();
virtual ~G4RTPrimaryGeneratorAction();
public:
virtual void GeneratePrimaries(G4Event* anEvent);
void SetUp();
private:
G4ParticleDefinition* particle_definition;
G4double particle_energy;
G4double particle_time;
G4ThreeVector particle_polarization;
G4VPhysicalVolume* pWorld;
EInside whereisit;
G4int nColumn;
G4int nRow;
G4ThreeVector eyePosition;
G4ThreeVector eyeDirection;
G4ThreeVector up;
G4double headAngle;
G4double viewSpan;
G4double stepAngle;
G4double viewSpanX;
G4double viewSpanY;
G4bool distortionOn;
};
#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. *
// ********************************************************************
//
//
//
//
// class description:
//
//////////////////////
//G4RTRun
/////////////////////
#ifndef G4RTRun_h
#define G4RTRun_h 1
#include "globals.hh"
#include "G4Run.hh"
#include "G4THitsMap.hh"
#include "G4Colour.hh"
class G4Event;
class G4TheMTRayTracer;
class G4VisAttributes;
class G4RayTrajectoryPoint;
class G4RTRun : public G4Run
{
public:
G4RTRun();
virtual ~G4RTRun();
virtual void RecordEvent(const G4Event*);
virtual void Merge(const G4Run*);
private:
G4THitsMap<G4Colour>* colorMap;
public:
G4THitsMap<G4Colour>* GetMap() const { return colorMap; }
private:
G4Colour backgroundColour;
G4ThreeVector lightDirection;
G4double attenuationLength;
private:
G4Colour GetSurfaceColour(G4RayTrajectoryPoint*);
G4Colour GetMixedColour(G4Colour,G4Colour,G4double);
G4Colour Attenuate(G4RayTrajectoryPoint*,G4Colour);
G4bool ValidColour(const G4VisAttributes*);
};
#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. *
// ********************************************************************
//
//
//
//
// class description:
//
//////////////////////
//G4RTRunAction
/////////////////////
#ifndef G4RTRunAction_h
#define G4RTRunAction_h 1
#include "G4UserRunAction.hh"
#include "globals.hh"
class G4RTRunAction : public G4UserRunAction
{
public:
G4RTRunAction();
virtual ~G4RTRunAction();
virtual G4Run* GenerateRun();
virtual void BeginOfRunAction(const G4Run*);
virtual void EndOfRunAction(const G4Run*);
};
#endif
@@ -0,0 +1,70 @@
//
// ********************************************************************
// * 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 G4RTSimpleScanner_H
#define G4RTSimpleScanner_H 1
// class description:
//
// G4RTSimpleScanner
// Provides a simple raster of window coordinates.
#include "G4VRTScanner.hh"
class G4RTSimpleScanner: public G4VRTScanner {
public: // with description
G4RTSimpleScanner();
virtual ~G4RTSimpleScanner();
// Compiler defaults for copy constructor and assignmemt.
virtual const G4String& GetGSName() const;
// Get name that acts as graphics system name.
virtual const G4String& GetGSNickname() const;
// Get name that acts as graphics system nickname. It is this that
// the user specifies on the /vis/open and /vis/sceneHandler/create
// commands.
virtual void Initialize(G4int nRow, G4int nColumn);
// Intialises scanner for window with nRow rows and nColumn columns.
virtual G4bool Coords(G4int& iRow, G4int& iColumn);
// Supplies coordinate (iRow,iColumn) and returns false when the
// sequence has finished, i.e., on the call *after* suplying the
// last valid coordinate.
protected:
G4String theGSName, theGSNickname;
G4int theNRow, theNColumn, theIRow, theIColumn;
};
#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. *
// ********************************************************************
//
//
//
//
// class description:
//
// This is a concrete class of G4UserSteppingAction. This class is used
// by G4RayTracer for managing a ray tracked through volumes. An object
// of this class is constructed by G4RayTracer and set to G4SteppingManager
// with replacement of user defined stepping action during the period of
// ray tracing.
//
//////////////////////
//G4RTSteppingAction
/////////////////////
#ifndef G4RTSteppingAction_h
#define G4RTSteppingAction_h 1
#include "G4UserSteppingAction.hh"
#include "globals.hh"
class G4RTSteppingAction : public G4UserSteppingAction
{
public:
G4RTSteppingAction();
virtual ~G4RTSteppingAction(){;}
virtual void UserSteppingAction(const G4Step*);
private:
static G4bool ignoreTransparency;
public:
static void SetIgnoreTransparency(G4bool val);
static G4bool GetIgnoreTransparency();
};
#endif
@@ -0,0 +1,73 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
//
//
// class description:
//
// This is a concrete class of G4UserTrackingAction. This class is used
// by G4RayTracer for managing a ray tracked through volumes. An object
// of this class is constructed by G4RayTracer and set to G4TrackingManager
// with replacement of user defined tracking action during the period of
// ray tracing.
//
///////////////////////
//G4RTTrackingAction.hh
///////////////////////
#ifndef G4RTTrackingAction_h
#define G4RTTrackingAction_h 1
#include "G4UserTrackingAction.hh"
class G4Track;
///////////////////////////
class G4RTTrackingAction : public G4UserTrackingAction
///////////////////////////
{
//--------
public:
//--------
// Constructor & Destructor
G4RTTrackingAction(){;}
virtual ~G4RTTrackingAction(){;}
// Member functions
virtual void PreUserTrackingAction(const G4Track* aTrack);
virtual void PostUserTrackingAction(const G4Track*){;}
};
#endif
@@ -0,0 +1,76 @@
//
// ********************************************************************
// * 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 G4RTWorkerInitialization_hh
#define G4RTWorkerInitialization_hh
class G4UserRunAction;
class G4VUserPrimaryGeneratorAction;
class G4UserEventAction;
class G4UserStackingAction;
class G4UserTrackingAction;
class G4UserSteppingAction;
class G4RTRunAction;
class G4RTPrimaryGeneratorAction;
class G4RTTrackingAction;
class G4RTSteppingAction;
#include "G4Threading.hh"
#include "G4UserWorkerInitialization.hh"
class G4RTWorkerInitialization : public G4UserWorkerInitialization
{
public: // with description
G4RTWorkerInitialization();
virtual ~G4RTWorkerInitialization();
virtual void WorkerRunStart() const;
// This method is called before an event loop. Geometry and physics have
// already been set up for the thread. All threads are synchronized and
// ready to start the local event loop. This situation is identical to
// "Idle" state in the sequential mode.
virtual void WorkerRunEnd() const;
// This method is called for each thread, when the local event loop has
// finished but before the synchronization over threads.
private:
static G4ThreadLocal const G4UserRunAction * theUserRunAction;
static G4ThreadLocal const G4VUserPrimaryGeneratorAction * theUserPrimaryGeneratorAction;
static G4ThreadLocal const G4UserEventAction * theUserEventAction;
static G4ThreadLocal const G4UserStackingAction * theUserStackingAction;
static G4ThreadLocal const G4UserTrackingAction * theUserTrackingAction;
static G4ThreadLocal const G4UserSteppingAction * theUserSteppingAction;
static G4ThreadLocal G4RTRunAction * theRTRunAction;
static G4ThreadLocal G4RTPrimaryGeneratorAction * theRTPrimaryGeneratorAction;
static G4ThreadLocal G4RTTrackingAction * theRTTrackingAction;
static G4ThreadLocal G4RTSteppingAction * theRTSteppingAction;
};
#endif //G4RTWorkerInitialization_hh
@@ -0,0 +1,87 @@
//
// ********************************************************************
// * 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 G4RTXScanner_H
#define G4RTXScanner_H 1
// class description:
//
// G4RTXScanner
// Provides a sequence of window coordinates suitable for a visible
// window of ever increasing resolution.
#include "G4VRTScanner.hh"
#include <X11/Xlib.h>
#include <X11/Xutil.h>
class G4ViewParameters;
class G4RTXScanner: public G4VRTScanner {
public: // with description
G4RTXScanner();
virtual ~G4RTXScanner();
// Compiler defaults for copy constructor and assignmemt.
virtual const G4String& GetGSName() const;
// Get name that acts as graphics system name.
virtual const G4String& GetGSNickname() const;
// Get name that acts as graphics system nickname. It is this that
// the user specifies on the /vis/open and /vis/sceneHandler/create
// commands.
virtual void Initialize(G4int nRow, G4int nColumn);
// Intialises scanner for window with nRow rows and nColumn columns.
virtual G4bool Coords(G4int& iRow, G4int& iColumn);
// Supplies coordinate (iRow,iColumn) and returns false when the
// sequence has finished, i.e., on the call *after* suplying the
// last valid coordinate.
virtual void Draw
(unsigned char red, unsigned char green, unsigned char blue);
// Draw coloured square at current position.
G4bool GetXWindow(const G4String& name, G4ViewParameters&);
protected:
G4String theGSName, theGSNickname;
G4int theNRow, theNColumn, theStep, theIRow, theIColumn;
// X Window variables...
Display* display;
Window win;
GC gc;
XStandardColormap *scmap;
};
#endif
@@ -0,0 +1,45 @@
//
// ********************************************************************
// * 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 G4RayTracerFeatures_HH
#define G4RayTracerFeatures_HH 1
// To make John Allison happy...........
const char RAYTRACER_FEATURES[] =
"Low quality high speed visualization using Geant4 kernel tracking mechanism.\
\n Features: Generate JPEG file(s) as default \
\n Visualize all kinds of solids including boolean solids \
\n Disadvantages : Conceptually trajectories and hits cannot be drawn \
\n No direct visualization";
#endif
@@ -0,0 +1,83 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// John Allison 17th March 2000
#ifndef G4RAYTRACERSCENEHANDLER_HH
#define G4RAYTRACERSCENEHANDLER_HH
#include "G4VSceneHandler.hh"
#include "G4ModelingParameters.hh"
#include <map>
class G4RayTracerSceneHandler: public G4VSceneHandler
{
public:
G4RayTracerSceneHandler(G4VGraphicsSystem& system,
const G4String& name = "");
virtual ~G4RayTracerSceneHandler();
void BuildVisAttsMap (const G4VSolid& solid);
// BuildVisAttsMap is the appropriate name for what it does in this class
// but it is actually an override of G4VSceneHandler::RequestPrimitives.
void RequestPrimitives (const G4VSolid& solid)
{BuildVisAttsMap(solid);}
// Required pure virtual functions, not used in Ray Tracer.
using G4VSceneHandler::AddPrimitive;
void AddPrimitive(const G4Polyline&){}
void AddPrimitive(const G4Text&){}
void AddPrimitive(const G4Circle&){}
void AddPrimitive(const G4Square&){}
void AddPrimitive(const G4Polyhedron&){}
void AddPrimitive(const G4Polymarker&){}
void ClearStore ();
struct PathLessThan
{G4bool operator()
(const G4ModelingParameters::PVPointerCopyNoPath&,
const G4ModelingParameters::PVPointerCopyNoPath&) const;
};
const std::map
<G4ModelingParameters::PVPointerCopyNoPath,G4VisAttributes,PathLessThan>&
GetSceneVisAttsMap() const
{return fSceneVisAttsMap;}
private:
static G4int fSceneIdCount; // Counter for RayTracer scene handlers.
std::map
<G4ModelingParameters::PVPointerCopyNoPath,G4VisAttributes,PathLessThan>
fSceneVisAttsMap;
};
#endif
@@ -0,0 +1,53 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// John Allison 17th March 2000
#ifndef G4RAYTRACERVIEWER_HH
#define G4RAYTRACERVIEWER_HH
#include "G4VViewer.hh"
class G4TheRayTracer;
class G4RayTracerViewer: public G4VViewer {
public:
G4RayTracerViewer(G4VSceneHandler&,
const G4String& name,
G4TheRayTracer* = 0);
virtual ~G4RayTracerViewer();
void Initialise();
void SetView();
void ClearView();
void DrawView();
G4TheRayTracer* GetTracer() {return theTracer;}
protected:
G4int fFileCount;
G4TheRayTracer* theTracer;
};
#endif
@@ -0,0 +1,42 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// John Allison 17th March 2000
#ifndef G4RAYTRACERXVIEWER_HH
#define G4RAYTRACERXVIEWER_HH
#include "G4RayTracerViewer.hh"
class G4RayTracerXViewer: public G4RayTracerViewer {
public:
G4RayTracerXViewer(G4VSceneHandler&,const G4String& name);
virtual ~G4RayTracerXViewer();
void Initialise();
};
#endif
@@ -0,0 +1,117 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
//
//
// class description:
//
// This is a concrete class of G4VTrajectory which represents a trajectory of a ray.
// This class is used by G4RayTracer. Objects of this class are created by G4RTTrackingAction.
// This class does not have concrete implementations of draw and print methods but
// information stored in this class is used by determining a colour of a pixel of the picture.
//
///////////////////
//G4RayTrajectory.hh
///////////////////
#ifndef G4RayTrajectory_h
#define G4RayTrajectory_h 1
class G4Step;
#include "G4VTrajectory.hh"
#include "G4Allocator.hh"
#include <stdlib.h>
#include <vector>
#include "globals.hh"
#include "G4Track.hh"
#include "G4RayTrajectoryPoint.hh"
class G4RayTrajectory : public G4VTrajectory
{
public:
G4RayTrajectory();
G4RayTrajectory(G4RayTrajectory & right);
virtual ~G4RayTrajectory();
private:
G4RayTrajectory& operator= (const G4RayTrajectory&);
public:
inline void* operator new(std::size_t);
inline void operator delete(void*);
// inline int operator == (const G4RayTrajectory& right){return (this==&right);}
virtual void AppendStep(const G4Step*);
virtual void ShowTrajectory(std::ostream&) const;
virtual void DrawTrajectory() const {;}
virtual G4int GetPointEntries() const {return (G4int)positionRecord->size();}
virtual G4VTrajectoryPoint* GetPoint(G4int i) const
{ return (*positionRecord)[i]; }
G4RayTrajectoryPoint* GetPointC(G4int i) const
{ return (*positionRecord)[i]; }
virtual void MergeTrajectory(G4VTrajectory* secondTrajectory);
// Get/Set functions to satisfy pure virtual functions of base class.
inline G4int GetTrackID() const { return 0; }
inline G4int GetParentID() const { return 0; }
inline G4String GetParticleName() const { return ""; }
inline G4double GetCharge() const { return 0.; }
inline G4int GetPDGEncoding() const { return 0; }
inline G4ThreeVector GetInitialMomentum() const { return G4ThreeVector(); }
private:
std::vector<G4RayTrajectoryPoint*>* positionRecord;
};
#if defined G4RAYTRACER_ALLOC_EXPORT
extern G4DLLEXPORT G4Allocator<G4RayTrajectory>*& rayTrajectoryAllocator();
#else
extern G4DLLIMPORT G4Allocator<G4RayTrajectory>*& rayTrajectoryAllocator();
#endif
inline void* G4RayTrajectory::operator new(std::size_t)
{
if(!rayTrajectoryAllocator())
{ rayTrajectoryAllocator() = new G4Allocator<G4RayTrajectory>; }
return (void*)rayTrajectoryAllocator()->MallocSingle();
}
inline void G4RayTrajectory::operator delete(void* aTrajectory)
{
rayTrajectoryAllocator()->FreeSingle((G4RayTrajectory*)aTrajectory);
}
#endif
@@ -0,0 +1,100 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
//
//
// class description:
//
// This is a concrete class of G4VTrajectoryPoint which represents a point where
// a ray crosses upon a surface of a volume regardless of its visibility. Objects
// of this class are created by G4RayTrajectory class object.
//
/////////////////////////
//G4RayTrajectoryPoint.hh
/////////////////////////
#ifndef G4RayTrajectoryPoint_h
#define G4RayTrajectoryPoint_h 1
class G4VisAttributes;
#include "globals.hh"
#include "G4VTrajectoryPoint.hh"
#include "G4Allocator.hh"
#include "G4ThreeVector.hh"
class G4RayTrajectoryPoint :public G4VTrajectoryPoint
{
public:
G4RayTrajectoryPoint();
virtual ~G4RayTrajectoryPoint();
inline void *operator new(size_t);
inline void operator delete(void *aTrajectoryPoint);
// inline G4bool operator==(const G4RayTrajectoryPoint& right) const
// { return (this==&right); };
private:
const G4VisAttributes* preStepAtt;
const G4VisAttributes* postStepAtt;
G4ThreeVector surfaceNormal;
G4double stepLength;
public:
inline void SetPreStepAtt(const G4VisAttributes* val) { preStepAtt = val; }
inline const G4VisAttributes* GetPreStepAtt() const { return preStepAtt; }
inline void SetPostStepAtt(const G4VisAttributes* val) { postStepAtt = val; }
inline const G4VisAttributes* GetPostStepAtt() const { return postStepAtt; }
inline void SetSurfaceNormal(const G4ThreeVector& val) { surfaceNormal = val; }
inline G4ThreeVector GetSurfaceNormal() const { return surfaceNormal; }
inline void SetStepLength(G4double val) { stepLength = val; }
inline G4double GetStepLength() const { return stepLength; }
inline const G4ThreeVector GetPosition() const { return G4ThreeVector();}
// Dummy function (not used) to satisfy base class pure virtual function.
};
#if defined G4RAYTRACER_ALLOC_EXPORT
extern G4DLLEXPORT G4Allocator<G4RayTrajectoryPoint>*& rayTrajectoryPointAllocator();
#else
extern G4DLLIMPORT G4Allocator<G4RayTrajectoryPoint>*& rayTrajectoryPointAllocator();
#endif
inline void* G4RayTrajectoryPoint::operator new(size_t)
{
if(!rayTrajectoryPointAllocator())
{ rayTrajectoryPointAllocator() = new G4Allocator<G4RayTrajectoryPoint>; }
return (void *) rayTrajectoryPointAllocator()->MallocSingle();
}
inline void G4RayTrajectoryPoint::operator delete(void *aTrajectoryPoint)
{
rayTrajectoryPointAllocator()->FreeSingle((G4RayTrajectoryPoint *) aTrajectoryPoint);
}
#endif
@@ -0,0 +1,120 @@
//
// ********************************************************************
// * 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 G4TheMTRayTracer_H
#define G4TheMTRayTracer_H 1
// class description:
//
// G4TheMTRayTracer
// This is a graphics driver of Geant4 which generates a figure file by
// ray tracing technique. The format of output figure file can be selected
// by assigning a pointer of G4VFigureFileMaker concrete class object.
// The main entry of ray tracing is Trace() method, which is available
// only at Idle state. G4TheMTRayTracer shoots rays and controls its own event
// loop. It generates G4Event objects used for its own purpose. When ray
// tracing is working, all sensitive detectors are inactivated and all
// user action classes are swapped out. Still, verbosities set to Geant4
// manager classes are concerned. Thus, it is recommended to set verbosities
// to minimum (usually zero).
// G4TheMTRayTracer can visualise absolutely all kinds of geometrical shapes
// which G4Navigator can deal with. Instead, it can NOT visualise hits
// nor trajectories generated by usual simulation.
#include "globals.hh"
#include "G4ThreeVector.hh"
#include "G4Colour.hh"
class G4RTMessenger;
class G4RayShooter;
class G4VFigureFileMaker;
class G4VisAttributes;
class G4VRTScanner;
class G4UserWorkerInitialization;
class G4RTWorkerInitialization;
class G4UserRunAction;
class G4RTRunAction;
class G4RTPrimaryGeneratorAction;
class G4RTRun;
class G4RayTracerViewer;
#include "G4TheRayTracer.hh"
class G4TheMTRayTracer : public G4TheRayTracer
{
friend class G4RTPrimaryGeneratorAction;
friend class G4RTRun;
friend class G4RayTracerViewer;
private:
static G4TheMTRayTracer* theInstance;
public: // with description
G4TheMTRayTracer(G4VFigureFileMaker* figMaker = 0,
G4VRTScanner* scanner = 0);
// Constructor. The argument is the pointer to G4VFigureFileMaker
// concrete class object. If it is not set and
// SetFigureFileMaker() method is not invoked before Trace()
// command is invoked, then G4RTJpegMaker will be used and JPEG
// file will be generated. The second argument is a scanner that
// produces a sequence of window coordinates. If it is not set
// here or if SetScanner is not invoked before Trace(), a default
// G4RTSimpleScanner will be used.
static G4TheMTRayTracer* Instance();
static G4TheMTRayTracer* Instance
(G4VFigureFileMaker* figMaker,G4VRTScanner* scanner);
public:
virtual ~G4TheMTRayTracer();
public: // with description
virtual void Trace(const G4String& fileName);
// The main entry point which triggers ray tracing. "fileName" is output
// file name, and it must contain extention (e.g. myFigure.jpg). This
// method is available only if Geant4 is at Idle state.
protected:
virtual G4bool CreateBitMap();
// Event loop
protected:
virtual void StoreUserActions();
virtual void RestoreUserActions();
protected:
const G4UserWorkerInitialization * theUserWorkerInitialization;
G4RTWorkerInitialization * theRTWorkerInitialization;
const G4UserRunAction * theUserRunAction;
G4RTRunAction * theRTRunAction;
};
#endif
@@ -0,0 +1,188 @@
//
// ********************************************************************
// * 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 G4TheRayTracer_H
#define G4TheRayTracer_H 1
// class description:
//
// G4TheRayTracer
// This is a graphics driver of Geant4 which generates a figure file by
// ray tracing technique. The format of output figure file can be selected
// by assigning a pointer of G4VFigureFileMaker concrete class object.
// The main entry of ray tracing is Trace() method, which is available
// only at Idle state. G4TheRayTracer shoots rays and controls its own event
// loop. It generates G4Event objects used for its own purpose. When ray
// tracing is working, all sensitive detectors are inactivated and all
// user action classes are swapped out. Still, verbosities set to Geant4
// manager classes are concerned. Thus, it is recommended to set verbosities
// to minimum (usually zero).
// G4TheRayTracer can visualise absolutely all kinds of geometrical shapes
// which G4Navigator can deal with. Instead, it can NOT visualise hits
// nor trajectories generated by usual simulation.
#include "globals.hh"
#include "G4ThreeVector.hh"
#include "G4Colour.hh"
class G4Event;
class G4EventManager;
class G4UserEventAction;
class G4UserStackingAction;
class G4UserTrackingAction;
class G4UserSteppingAction;
class G4RTTrackingAction;
class G4RTSteppingAction;
class G4RTMessenger;
class G4RayShooter;
class G4VFigureFileMaker;
class G4RayTrajectoryPoint;
class G4VisAttributes;
class G4VRTScanner;
class G4TheRayTracer
{
public: // with description
G4TheRayTracer(G4VFigureFileMaker* figMaker = 0,
G4VRTScanner* scanner = 0);
// Constructor. The argument is the pointer to G4VFigureFileMaker
// concrete class object. If it is not set and
// SetFigureFileMaker() method is not invoked before Trace()
// command is invoked, then G4RTJpegMaker will be used and JPEG
// file will be generated. The second argument is a scanner that
// produces a sequence of window coordinates. If it is not set
// here or if SetScanner is not invoked before Trace(), a default
// G4RTSimpleScanner will be used.
public:
virtual ~G4TheRayTracer();
public: // with description
virtual void Trace(const G4String& fileName);
// The main entry point which triggers ray tracing. "fileName" is output
// file name, and it must contain extention (e.g. myFigure.jpg). This
// method is available only if Geant4 is at Idle state.
protected:
virtual G4bool CreateBitMap();
// Event loop
void CreateFigureFile(const G4String& fileName);
// Create figure file after an event loop
G4bool GenerateColour(G4Event* anEvent);
// Calcurate RGB for one trajectory
virtual void StoreUserActions();
virtual void RestoreUserActions();
// Store and restore user action classes if defined
G4Colour GetSurfaceColour(G4RayTrajectoryPoint* point);
G4Colour GetMixedColour
(const G4Colour& surfCol,const G4Colour& transCol,G4double weight=0.5);
G4Colour Attenuate(G4RayTrajectoryPoint* point,const G4Colour& sourceCol);
G4bool ValidColour(const G4VisAttributes* visAtt);
public: // with description
inline void SetFigureFileMaker(G4VFigureFileMaker* figMaker)
// Set a concrete class of G4VFigureFileMaker for assigning the format of
// output figure file.
{ theFigMaker = figMaker; }
inline G4VFigureFileMaker* GetFigureFileMaker() {return theFigMaker;}
inline void SetScanner(G4VRTScanner* scanner)
// Set a concrete class of G4VRTScanner for producing a sequence
// of window coordinates.
{ theScanner = scanner; }
inline G4VRTScanner* GetScanner() {return theScanner;}
protected:
G4RayShooter * theRayShooter;
static G4VFigureFileMaker * theFigMaker;
G4RTMessenger * theMessenger;
static G4VRTScanner * theScanner;
G4EventManager * theEventManager;
G4UserEventAction * theUserEventAction;
G4UserStackingAction * theUserStackingAction;
G4UserTrackingAction * theUserTrackingAction;
G4UserSteppingAction * theUserSteppingAction;
G4UserEventAction * theRayTracerEventAction;
G4UserStackingAction * theRayTracerStackingAction;
G4RTTrackingAction * theRayTracerTrackingAction;
G4RTSteppingAction * theRayTracerSteppingAction;
unsigned char* colorR;
unsigned char* colorG;
unsigned char* colorB;
G4int nColumn;
G4int nRow;
G4ThreeVector eyePosition;
G4ThreeVector targetPosition;
G4ThreeVector eyeDirection;
G4ThreeVector lightDirection;
G4ThreeVector up;
G4double headAngle;
G4double viewSpan; // Angle per 100 pixels
G4double attenuationLength;
G4bool distortionOn;
G4bool antialiasingOn;
G4Colour rayColour;
G4Colour backgroundColour;
public:
inline void SetNColumn(G4int val) { nColumn = val; }
inline G4int GetNColumn() const { return nColumn; }
inline void SetNRow(G4int val) { nRow = val; }
inline G4int GetNRow() const { return nRow; }
inline void SetEyePosition(const G4ThreeVector& val) { eyePosition = val; }
inline G4ThreeVector GetEyePosition() const { return eyePosition; }
inline void SetTargetPosition(const G4ThreeVector& val) { targetPosition = val; }
inline G4ThreeVector GetTargetPosition() const { return targetPosition; }
inline void SetLightDirection(const G4ThreeVector& val) { lightDirection = val.unit(); }
inline G4ThreeVector GetLightDirection() const { return lightDirection; }
inline void SetUpVector(const G4ThreeVector& val) { up = val; }
inline G4ThreeVector GetUpVector() const { return up; }
inline void SetHeadAngle(G4double val) { headAngle = val; }
inline G4double GetHeadAngle() const { return headAngle; }
inline void SetViewSpan(G4double val) { viewSpan = val; }
inline G4double GetViewSpan() const { return viewSpan; }
inline void SetAttenuationLength(G4double val) { attenuationLength = val; }
inline G4double GetAttenuationLength() const { return attenuationLength; }
inline void SetDistortion(G4bool val) { distortionOn = val; }
inline G4bool GetDistortion() const { return distortionOn; }
inline void SetBackgroundColour(const G4Colour& val) { backgroundColour = val; }
inline G4Colour GetBackgroundColour() const { return backgroundColour; }
};
#endif
@@ -0,0 +1,55 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
//
//
// class description:
//
// This is an abstract class represents a class which generates a figure file
// converting from RGB 8 bits unsigned integers to a kind of picture format.
//
#ifndef G4VFigureFileMaker_H
#define G4VFigureFileMaker_H 1
#include "globals.hh"
class G4VFigureFileMaker
{
public:
G4VFigureFileMaker() {;}
virtual ~G4VFigureFileMaker() {;}
public:
virtual void CreateFigureFile(const G4String& fileName,
int nColumn,int nRow,
unsigned char* colorR, unsigned char* colorG,
unsigned char* colorB) = 0;
};
#endif
@@ -0,0 +1,72 @@
//
// ********************************************************************
// * 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 G4VRTScanner_H
#define G4VRTScanner_H 1
// class description:
//
// G4VRTScanner
// Interface class for provider of a sequence of window coordinates.
#include "globals.hh"
class G4VRTScanner {
public: // with description
G4VRTScanner();
virtual ~G4VRTScanner();
virtual const G4String& GetGSName() const = 0;
// Get name that acts as graphics system name.
virtual const G4String& GetGSNickname() const = 0;
// Get name that acts as graphics system nickname. It is this that
// the user specifies on the /vis/open and /vis/sceneHandler/create
// commands.
virtual void Initialize(G4int nRow, G4int nColumn) = 0;
// Intialises scanner for window with nRow rows and nColumn columns.
virtual G4bool Coords(G4int& iRow, G4int& iColumn) = 0;
// Supplies coordinate (iRow,iColumn) and returns false when the
// sequence has finished, i.e., on the call *after* suplying the
// last valid coordinate.
virtual void Draw
(unsigned char red, unsigned char green, unsigned char blue);
// Draw coloured square at current position.
};
inline
void G4VRTScanner::Draw(unsigned char, unsigned char, unsigned char) {}
#endif