Import Geant4 0.0.0 source tree
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4Circle.hh,v 2.0 1998/07/02 17:30:39 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
// John Allison 17/11/96.
|
||||
|
||||
#ifndef G4CIRCLE_HH
|
||||
#define G4CIRCLE_HH
|
||||
|
||||
#include "G4VMarker.hh"
|
||||
|
||||
class G4Circle: public G4VMarker {
|
||||
public:
|
||||
G4Circle ();
|
||||
G4Circle (const G4Point3D& pos);
|
||||
G4Circle (const G4VMarker& marker);
|
||||
};
|
||||
|
||||
#include "G4Circle.icc"
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,20 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4Circle.icc,v 2.0 1998/07/02 17:29:43 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
// John Allison 17/11/96.
|
||||
|
||||
inline G4Circle::G4Circle () {}
|
||||
|
||||
inline G4Circle::G4Circle (const G4Point3D& pos):
|
||||
G4VMarker (pos) {}
|
||||
|
||||
inline G4Circle::G4Circle (const G4VMarker& marker):
|
||||
G4VMarker (marker) {}
|
||||
@@ -0,0 +1,21 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4Color.hh,v 2.0 1998/07/02 17:29:50 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
// John Allison 20th October 1996
|
||||
|
||||
#ifndef G4COLOR_HH
|
||||
#define G4COLOR_HH
|
||||
|
||||
#include "G4Colour.hh"
|
||||
|
||||
typedef G4Colour G4Color;
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,48 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4Colour.hh,v 2.0 1998/07/02 17:29:51 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
// John Allison 20th October 1996
|
||||
|
||||
#ifndef G4COLOUR_HH
|
||||
#define G4COLOUR_HH
|
||||
|
||||
#include "globals.hh"
|
||||
class ostream;
|
||||
|
||||
class G4Colour {
|
||||
friend ostream& operator << (ostream& os, const G4Colour& c);
|
||||
friend G4bool operator != (const G4Colour& c1, const G4Colour& c2);
|
||||
public:
|
||||
G4Colour (G4double r = 1., G4double g = 1., G4double b = 1.,
|
||||
G4double a = 1.);
|
||||
G4double GetRed () const;
|
||||
G4double GetGreen () const;
|
||||
G4double GetBlue () const;
|
||||
G4double GetAlpha () const; // alpha = opacity = 1. - transparency.
|
||||
private:
|
||||
G4double red, green, blue, alpha;
|
||||
};
|
||||
|
||||
inline G4Colour::G4Colour (G4double r, G4double g, G4double b, G4double a):
|
||||
red (r), green (g), blue (b), alpha (a)
|
||||
{
|
||||
if( red > 1.0 ){red = 1.0;} if( red < 0.0 ){red = 0.0;}
|
||||
if( green > 1.0 ){green = 1.0;} if( green < 0.0 ){green = 0.0;}
|
||||
if( blue > 1.0 ){blue = 1.0;} if( blue < 0.0 ){blue = 0.0;}
|
||||
if( alpha > 1.0 ){alpha = 1.0;} if( alpha < 0.0 ){alpha = 0.0;}
|
||||
}
|
||||
|
||||
inline G4double G4Colour::GetRed () const {return red;}
|
||||
inline G4double G4Colour::GetGreen () const {return green;}
|
||||
inline G4double G4Colour::GetBlue () const {return blue;}
|
||||
inline G4double G4Colour::GetAlpha () const {return alpha;}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,504 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4NURBS.hh,v 2.3 1998/12/01 13:37:14 evc Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
// Olivier Crumeyrolle 12 September 1996
|
||||
|
||||
// G4NURBS.hh
|
||||
// prototype for class G4NURBS - see documentation in graphics_reps/doc.
|
||||
// OC 280896
|
||||
|
||||
#ifndef __C_G4NURBS__
|
||||
#define __C_G4NURBS__ 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4VVisPrim.hh"
|
||||
|
||||
// HP's CC compiler :
|
||||
// it's recommended that you include G4NURBS.hh BEFORE any other includes,
|
||||
// at least before iostream.h
|
||||
|
||||
// checked for CC, xlC, g++, cxx
|
||||
// * a friendness problem with DEC's cxx, fixed by __C_G4NURBS_FFIX__ *
|
||||
//#if defined(__DECCXX) || defined(WIN32) i.e., always defined.
|
||||
#define __C_G4NURBS_FFIX__ 1
|
||||
//#endif
|
||||
|
||||
// The internal floating point type is G4Float, defined line 162
|
||||
|
||||
#include "G4ios.hh"
|
||||
|
||||
#include "G4Point3D.hh"
|
||||
#include "G4Vector3D.hh"
|
||||
|
||||
class G4NURBS : public G4VVisPrim {
|
||||
public:
|
||||
// NO public constructor. A G4NURBS must be builded with a child class.
|
||||
// Pure virtual function Whoami so one can't instanciate G4NURBS at all.
|
||||
|
||||
// Whoami return a string describing the NURBS (e.g "Box")
|
||||
// * this string must not contain any \n *
|
||||
// this string is *not* yours (const char)
|
||||
virtual const char* Whoami() const = 0;
|
||||
|
||||
// the copy constructor is private.
|
||||
|
||||
// destructor.
|
||||
virtual ~G4NURBS();
|
||||
|
||||
// direction selector defined as a type because the user will use it
|
||||
// and we want the user to be well-manered.
|
||||
// However internally this typed enum is not as easy to use as it
|
||||
// could be (we can't ++). "t_" means it's a kind of local type.
|
||||
enum t_direction {
|
||||
U = 0,
|
||||
V = 1,
|
||||
DMask = 1, // NofD : Number of Directions
|
||||
NofD = 2 // DMask : direction mask for fast range control,
|
||||
}; // e.g. : m[a_dir & DMask]
|
||||
|
||||
// external representation for t_direction (just U -> 'U' V -> 'V')
|
||||
static char Tochar(t_direction in_dir);
|
||||
|
||||
// mother index type (I'd like to be able to use unsigned G4int
|
||||
// but it's impossible)
|
||||
typedef unsigned int t_index;
|
||||
|
||||
// type for knot index, derivate from t_index
|
||||
typedef t_index t_indKnot;
|
||||
|
||||
// type for ctrlpt coord and ctrlpt index
|
||||
typedef unsigned int t_indCoord;
|
||||
typedef unsigned int t_indCtrlPt; // mono index
|
||||
typedef t_index t_inddCtrlPt; // bi dim index, derivate from t_index
|
||||
|
||||
// why only t_inddCtrlPt and t_indKnot (and t_order further)
|
||||
// "derive" of t_index ? Because only these ones need
|
||||
// to be compatible (order + nbrctrlpts = nbrknots in a given direction)
|
||||
// Ok, typedefs are not true type derivation,
|
||||
// but this is the "spirit" of declarations with t_index.
|
||||
// To do true derivation we need true classes
|
||||
// but classes for int are wastefull with today's compilers.
|
||||
|
||||
// Note that these index types are defined
|
||||
// without knowledge of the indexed items types and that's perfect.
|
||||
|
||||
// interface data type for the rationnal control points
|
||||
enum { X, Y, Z, W, NofC }; // NofC : number of coordinates
|
||||
|
||||
// not typed as t_indCoord so loops are easy
|
||||
// to write, but the user is less restricted
|
||||
typedef G4double t_doubleCtrlPt [NofC]; // with doubles
|
||||
typedef G4float t_floatCtrlPt [NofC]; // with floats
|
||||
|
||||
// access functions for others (e.g. GraphicsModel)
|
||||
G4int GetUorder() const;
|
||||
G4int GetVorder() const;
|
||||
G4int GetUnbrKnots() const;
|
||||
G4int GetVnbrKnots() const;
|
||||
G4int GetUnbrCtrlPts() const;
|
||||
G4int GetVnbrCtrlPts() const;
|
||||
G4int GettotalnbrCtrlPts() const;
|
||||
|
||||
G4double GetUmin() const;
|
||||
G4double GetUmax() const;
|
||||
G4double GetVmin() const;
|
||||
G4double GetVmax() const;
|
||||
void CalcPoint(G4double u, G4double v,
|
||||
G4Point3D &p, G4Vector3D &utan, G4Vector3D &vtan) const;
|
||||
|
||||
// alternate access functions with G4NURBS::t_direction
|
||||
// e.g. mynurb.Getorder(G4NURBS::U)
|
||||
// these functions never fail because in_dir is masked
|
||||
G4int Getorder(t_direction in_dir) const;
|
||||
G4int GetnbrKnots(t_direction in_dir) const;
|
||||
G4int GetnbrCtrlPts(t_direction in_dir) const;
|
||||
|
||||
// crude access to knots vector and control points.
|
||||
// float and double versions.
|
||||
// * one should rather use the iterators below *
|
||||
|
||||
// get a *copy* of the value; this copy is the user's
|
||||
// one, so the user is intended to manage it (including delete).
|
||||
// in_dir is masked, in_index checked and rounded.
|
||||
// errors on G4cerr
|
||||
G4float GetfloatKnot(t_direction in_dir, t_indKnot in_index) const;
|
||||
G4double GetdoubleKnot(t_direction in_dir, t_indKnot in_index) const;
|
||||
t_floatCtrlPt* GetfloatCtrlPt(t_indCtrlPt in_onedimindex) const;
|
||||
t_floatCtrlPt* GetfloatCtrlPt(t_inddCtrlPt in_Uindex, t_inddCtrlPt in_Vindex) const;
|
||||
t_doubleCtrlPt* GetdoubleCtrlPt(t_indCtrlPt in_onedimindex) const;
|
||||
t_doubleCtrlPt* GetdoubleCtrlPt(t_inddCtrlPt in_Uindex, t_inddCtrlPt in_Vindex) const;
|
||||
|
||||
// complete copy functions
|
||||
// the user don't control the allocation and the copy process
|
||||
// but he/she own the result and will have to delete it
|
||||
// when he/she does not need it any more.
|
||||
G4float* GetfloatAllKnots(t_direction in_dir) const;
|
||||
G4double* GetdoubleAllKnots(t_direction in_dir) const;
|
||||
G4float* GetfloatAllCtrlPts() const;
|
||||
G4double* GetdoubleAllCtrlPts() const;
|
||||
|
||||
// the iterators need that, the user does not
|
||||
protected:
|
||||
// internal type for reel numbers
|
||||
// ( Float is defined in templates.hh and is
|
||||
// under the control of HIGH_PRECISION )
|
||||
typedef Float G4Float;
|
||||
|
||||
// internal type for order, derivate from t_index
|
||||
typedef t_index t_order;
|
||||
|
||||
// internal type for knot
|
||||
typedef G4Float t_Knot;
|
||||
|
||||
// internal types for the control points
|
||||
typedef G4Float t_Coord;
|
||||
typedef t_Coord t_CtrlPt [NofC];
|
||||
|
||||
// (nb: templates.hh included in globals.hh)
|
||||
// type for ref counting
|
||||
//typedef unsigned int t_refcount;
|
||||
|
||||
public:
|
||||
// iterators for an .... iterative access to knots and control points
|
||||
|
||||
// errors are reported on G4cerr
|
||||
// they are friends, they use the protected members.
|
||||
// one can have as many iterators as he/she wants working in the same time.
|
||||
|
||||
// declarations of iterators
|
||||
class KnotsIterator;
|
||||
class CtrlPtsCoordsIterator;
|
||||
class CtrlPtsIterator;
|
||||
|
||||
// friendness declarations for iterators
|
||||
friend class KnotsIterator;
|
||||
friend class CtrlPtsCoordsIterator;
|
||||
friend class CtrlPtsIterator;
|
||||
|
||||
// Example for the KnotsIterator
|
||||
// G4float * my_array, * my_float_p;
|
||||
// my_float_p = my_array = new float [my_nurb.GetnbrKnots(G4NURBS::U)];
|
||||
// G4NURBS::KnotsIterator my_iterator(my_nurb, G4NURBS::U);
|
||||
// while (my_iterator.pick(my_float_p++));
|
||||
// that's all! my_array contain all the U knots.
|
||||
|
||||
class KnotsIterator {
|
||||
public:
|
||||
KnotsIterator(const G4NURBS & in_rNurb, t_direction in_dir, t_indKnot in_startIndex = 0);
|
||||
G4bool pick(G4double * inout_pDbl);
|
||||
G4bool pick(G4float * inout_pFlt);
|
||||
//~KnotsIterator();
|
||||
|
||||
protected:
|
||||
const t_direction kmdir;
|
||||
const t_Knot * const kmpMax;
|
||||
const t_Knot * mp;
|
||||
};
|
||||
|
||||
// the CtrlPtsCoordsIterator. Works like the knots' one :
|
||||
// G4float * my_array, * my_float_p;
|
||||
// my_float_p = my_array = new float [my_nurb.GettotalnbrCtrlPts()*G4NURBS::NofC*sizeof(float)];
|
||||
// G4NURBS::CtrlPtsCoordsIterator my_iterator(my_nurb);
|
||||
// while (my_iterator.pick(my_float_p++));
|
||||
// after the while statement; my_float_p point just after the array
|
||||
// Remember ctrlpts are given U index increasing first
|
||||
|
||||
class CtrlPtsCoordsIterator {
|
||||
public:
|
||||
CtrlPtsCoordsIterator(const G4NURBS & in_rNurb, t_indCtrlPt in_startCtrlPtIndex = 0);
|
||||
G4bool pick(G4double * inout_pDbl);
|
||||
G4bool pick(G4float * inout_pFlt);
|
||||
//~CtrlPtsCoordsIterator();
|
||||
|
||||
protected:
|
||||
const t_Coord * const kmpMax;
|
||||
const t_Coord * mp;
|
||||
};
|
||||
|
||||
// this iterator work CtrlPt by CtrlPt
|
||||
// see the << overload for an example
|
||||
class CtrlPtsIterator {
|
||||
public:
|
||||
CtrlPtsIterator(const G4NURBS & in_rNurb, t_indCtrlPt in_startIndex = 0);
|
||||
G4bool pick(t_doubleCtrlPt * inout_pDblCtrlPt);
|
||||
G4bool pick(t_floatCtrlPt * inout_pFltCtrlPt);
|
||||
//~CtrlPtsIterator();
|
||||
|
||||
protected:
|
||||
const t_CtrlPt * const kmpMax;
|
||||
const t_CtrlPt * mp;
|
||||
};
|
||||
|
||||
// Q: a directional Iterator to extract one col/row of CtrlPts ?
|
||||
|
||||
protected:
|
||||
|
||||
// little structure containing data for each direction
|
||||
class t_Dir;
|
||||
friend class t_Dir;
|
||||
class t_Dir {
|
||||
public:
|
||||
t_order order;
|
||||
t_inddCtrlPt nbrCtrlPts;
|
||||
t_indKnot nbrKnots;
|
||||
t_Knot * pKnots;
|
||||
//t_refcount nbralias;
|
||||
};
|
||||
|
||||
// check flag for the constructor
|
||||
typedef enum { NOcheck, check } t_CheckFlag;
|
||||
|
||||
// first constructor (see G4NURBScylinder.cc for an example)
|
||||
// compulsory arguments :
|
||||
// order of the surface in U and V direction
|
||||
// number of control points in U and V direction
|
||||
// control points array (usualy empty here, *but* allocated)
|
||||
// optional arguments :
|
||||
// U and V knots vector (can be automaticaly generated)
|
||||
// check flag (default is to check!)
|
||||
//
|
||||
G4NURBS (t_order in_Uorder, t_order in_Vorder,
|
||||
t_inddCtrlPt in_UnbrCtrlPts, t_inddCtrlPt in_VnbrCtrlPts,
|
||||
t_CtrlPt * in_pCtrlPts,
|
||||
t_Knot * in_pUKnots = NULL, t_Knot * in_pVKnots = NULL,
|
||||
t_CheckFlag in_CheckFlag = check );
|
||||
|
||||
// NB: the minimal NURBS is order 1, 2 knots, => 1 control points
|
||||
// one can actually define some curves with G4NURBS, set U as you want
|
||||
// set the V dir as order 1, 1 ctrlpt, 2 knots { 0 1 }
|
||||
// OpenGL work with this kind of data
|
||||
|
||||
// second constructor (easier to use) (see G4NURBStube.cc for an example)
|
||||
// compulsory arguments :
|
||||
// order of the surface in U and V direction
|
||||
// number of control points in U and V direction
|
||||
// optional arguments :
|
||||
// U and V knots vector generation flag (automaticaly or not)
|
||||
// check flag (default is to check!)
|
||||
// Allocations are Done for the user
|
||||
// but he/she still have to fill some arrays
|
||||
// For the moment I don't see yet how to ensure
|
||||
// that the user correctly fill the arrays
|
||||
// (in particular how avoid out of range access)
|
||||
// without class types for arrays.
|
||||
|
||||
#ifdef __C_G4NURBS_FFIX__
|
||||
public:
|
||||
#endif
|
||||
|
||||
// knots vector generation flag
|
||||
enum t_KnotVectorGenFlag {
|
||||
UserDefined, // The user will fill the array (in the child constructor for instance).
|
||||
|
||||
Regular, // First and last knot repeated order time
|
||||
// other knots regularly spaced, unrepeated.
|
||||
// Typically used for "linear" knots vector
|
||||
|
||||
RegularRep // First and last knot repeated order time
|
||||
// other knots regularly spaced but repeated one time.
|
||||
// Typically used for "circular" knots vector and alikes.
|
||||
}; //t_KnotVectorGenFlag
|
||||
|
||||
#ifdef __C_G4NURBS_FFIX__
|
||||
protected:
|
||||
#endif
|
||||
|
||||
// external representation for t_KnotVectorGenFlag
|
||||
// as a << overload.
|
||||
// (used in errors report)
|
||||
friend ostream & operator << (ostream & inout_OutStream,
|
||||
t_KnotVectorGenFlag in_KVGFlag);
|
||||
|
||||
G4NURBS (t_order in_Uorder, t_order in_Vorder,
|
||||
t_inddCtrlPt in_UnbrCtrlPts, t_inddCtrlPt in_VnbrCtrlPts,
|
||||
t_KnotVectorGenFlag in_UKVGFlag = Regular,
|
||||
t_KnotVectorGenFlag in_VKVGFlag = Regular,
|
||||
t_CheckFlag in_CheckFlag = check );
|
||||
|
||||
// nurbs data
|
||||
t_Dir m[NofD]; // t_Dir : order nbrCtrlPts nbrKnots pKnots
|
||||
t_indCtrlPt mtotnbrCtrlPts; // Total number of control points
|
||||
t_CtrlPt * mpCtrlPts; // U increasing first, V after
|
||||
//t_refcount mnbralias; // ref count for mpCtrlPts
|
||||
|
||||
// 2dim index to 1 dim conversion
|
||||
t_indCtrlPt To1d(t_inddCtrlPt in_Uindex, t_inddCtrlPt in_Vindex) const;
|
||||
|
||||
// internal functions for converting the internal
|
||||
// data points to the interface type required
|
||||
// one can do some better things with class conversion
|
||||
// but for the moment control point data types are not class.
|
||||
// static functions.
|
||||
// if changed to member functions, one must add the const
|
||||
// status and rewrite calls with an instance in
|
||||
// some of the get functions.
|
||||
|
||||
// return a float copy
|
||||
static t_floatCtrlPt* TofloatCtrlPt(const t_CtrlPt &);
|
||||
|
||||
// return a double copy
|
||||
static t_doubleCtrlPt* TodoubleCtrlPt(const t_CtrlPt &);
|
||||
|
||||
|
||||
// Building functions
|
||||
|
||||
// KnotsVector builder
|
||||
// static function that work on a t_Dir and its
|
||||
// knot vector. So we can define
|
||||
// some knots vector outside a nurbs
|
||||
// object. (This avoid the existence
|
||||
// of some incompletly defined nurbs object,
|
||||
// used just as knots vector container)
|
||||
// Return true if succesfull.
|
||||
// ALWAYS allocate the knots array.
|
||||
// (return false and do nothing if it already exists (ie != NULL))
|
||||
// Always fail if order + nbrCtrlPt != nbrKnots
|
||||
static G4bool MakeKnotVector(t_Dir & inout_dirdat, t_KnotVectorGenFlag in_KVGFlag);
|
||||
static G4bool MakeKnotVector(t_Dir * p_inoutdirdat, t_KnotVectorGenFlag in_KVGFlag);
|
||||
// the second is just an alias, cf further
|
||||
|
||||
// others building functions ?
|
||||
// revolve ?
|
||||
// partial revolve ?
|
||||
|
||||
static void CP(G4NURBS::t_CtrlPt & rcp, t_Coord x, t_Coord y, t_Coord z, t_Coord w);
|
||||
static void CP(G4NURBS::t_CtrlPt & rcp, t_Coord x, t_Coord y, t_Coord z, t_Coord w, G4Float factor);
|
||||
|
||||
private:
|
||||
// check function used internally by constructors.
|
||||
// no returned value because all errors reported are fatals.
|
||||
// (assume order + nbrCtrlPts == nbrKnots
|
||||
// cf constructors to understand why)
|
||||
void Conscheck() const;
|
||||
|
||||
// copy constructor.
|
||||
// Not really necessary for geant. A warning is issued when used.
|
||||
G4NURBS(const G4NURBS &);
|
||||
|
||||
};
|
||||
|
||||
// external representation for t_KnotVectorGenFlag
|
||||
ostream & operator << (ostream & inout_OutStream, G4NURBS::t_KnotVectorGenFlag in_KVGFlag);
|
||||
|
||||
|
||||
// << overload to dump a nurbs
|
||||
// writted with public access functions
|
||||
// do not depends on protected part
|
||||
|
||||
ostream & operator << (ostream & inout_outStream, const G4NURBS & in_kNurb);
|
||||
|
||||
/***********************************************************************
|
||||
* *
|
||||
* Inline code for public access functions. *
|
||||
* depends on the protected part *
|
||||
* *
|
||||
***********************************************************************/
|
||||
|
||||
inline G4int G4NURBS::GetUorder() const { return m[U].order; }
|
||||
inline G4int G4NURBS::GetVorder() const { return m[V].order; }
|
||||
inline G4int G4NURBS::GetUnbrKnots() const { return m[U].nbrKnots; }
|
||||
inline G4int G4NURBS::GetVnbrKnots() const { return m[V].nbrKnots; }
|
||||
inline G4int G4NURBS::GetUnbrCtrlPts() const { return m[U].nbrCtrlPts; }
|
||||
inline G4int G4NURBS::GetVnbrCtrlPts() const { return m[V].nbrCtrlPts; }
|
||||
inline G4int G4NURBS::GettotalnbrCtrlPts() const { return mtotnbrCtrlPts; }
|
||||
|
||||
inline G4double G4NURBS::GetUmin() const {
|
||||
return (G4double) m[U].pKnots[GetUorder()-1];
|
||||
}
|
||||
|
||||
inline G4double G4NURBS::GetUmax() const {
|
||||
return (G4double) m[U].pKnots[GetUnbrCtrlPts()];
|
||||
}
|
||||
|
||||
inline G4double G4NURBS::GetVmin() const {
|
||||
return (G4double) m[V].pKnots[GetVorder()-1];
|
||||
}
|
||||
|
||||
inline G4double G4NURBS::GetVmax() const {
|
||||
return (G4double) m[V].pKnots[GetVnbrCtrlPts()];
|
||||
}
|
||||
|
||||
inline G4int G4NURBS::Getorder(G4NURBS::t_direction in_dir) const {
|
||||
return m[in_dir & DMask].order;
|
||||
}
|
||||
|
||||
inline G4int G4NURBS::GetnbrKnots(G4NURBS::t_direction in_dir) const {
|
||||
return m[in_dir & DMask].nbrKnots;
|
||||
}
|
||||
|
||||
inline G4int G4NURBS::GetnbrCtrlPts(G4NURBS::t_direction in_dir) const {
|
||||
return m[in_dir & DMask].nbrCtrlPts;
|
||||
}
|
||||
|
||||
inline char G4NURBS::Tochar(G4NURBS::t_direction in_dir) {
|
||||
return (in_dir?'V':'U');
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* *
|
||||
* inline code for protected functions *
|
||||
* *
|
||||
***********************************************************************/
|
||||
|
||||
// convert two dim. index to one dim.
|
||||
//( Ctrl Pts are stored U increasing first )
|
||||
// no check.
|
||||
inline G4NURBS::t_indCtrlPt
|
||||
G4NURBS::To1d(t_inddCtrlPt in_Uindex, t_inddCtrlPt in_Vindex) const {
|
||||
return in_Uindex + in_Vindex*m[U].nbrCtrlPts;
|
||||
}
|
||||
|
||||
// return a float copy
|
||||
inline G4NURBS::t_floatCtrlPt*
|
||||
G4NURBS::TofloatCtrlPt(const t_CtrlPt & in_krcp) {
|
||||
G4NURBS::t_floatCtrlPt * pcopy = new G4NURBS::t_floatCtrlPt [1];
|
||||
for (G4int indCoord = X; indCoord < NofC; indCoord++)
|
||||
(*pcopy)[indCoord] = (G4float)in_krcp[indCoord];
|
||||
return pcopy;
|
||||
}
|
||||
|
||||
// return a double copy
|
||||
inline G4NURBS::t_doubleCtrlPt*
|
||||
G4NURBS::TodoubleCtrlPt(const t_CtrlPt & in_krcp) {
|
||||
G4NURBS::t_doubleCtrlPt * pcopy = new G4NURBS::t_doubleCtrlPt [1];
|
||||
for (G4int indCoord = X; indCoord < NofC; indCoord++)
|
||||
(*pcopy)[indCoord] = (G4double)in_krcp[indCoord];
|
||||
return pcopy;
|
||||
}
|
||||
|
||||
// MakeKnotVector alias
|
||||
inline G4bool G4NURBS::MakeKnotVector(G4NURBS::t_Dir * p_inoutdirdat, G4NURBS::t_KnotVectorGenFlag in_KVGFlag) {
|
||||
return MakeKnotVector(*p_inoutdirdat, in_KVGFlag);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* *
|
||||
* inlines functions to simplify control points definition *
|
||||
* see GG4NURBSbox.cc for instance *
|
||||
* *
|
||||
***********************************************************************/
|
||||
|
||||
inline void G4NURBS::CP(G4NURBS::t_CtrlPt & rcp,
|
||||
t_Coord x, t_Coord y, t_Coord z, t_Coord w) {
|
||||
rcp[G4NURBS::X]=x;
|
||||
rcp[G4NURBS::Y]=y;
|
||||
rcp[G4NURBS::Z]=z;
|
||||
rcp[G4NURBS::W]=w;
|
||||
}
|
||||
|
||||
// with a common factor
|
||||
inline void G4NURBS::CP(G4NURBS::t_CtrlPt & rcp, t_Coord x, t_Coord y, t_Coord z, t_Coord w, G4Float factor) {
|
||||
rcp[G4NURBS::X]=factor*x;
|
||||
rcp[G4NURBS::Y]=factor*y;
|
||||
rcp[G4NURBS::Z]=factor*z;
|
||||
rcp[G4NURBS::W]=factor*w;
|
||||
}
|
||||
|
||||
#endif /* end of __C_G4NURBS__ */
|
||||
@@ -0,0 +1,34 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4NURBSbox.hh,v 2.1 1998/07/12 02:59:11 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
// Olivier Crumeyrolle 12 September 1996
|
||||
|
||||
// Box builder prototype
|
||||
// OC 060996
|
||||
|
||||
#include "G4NURBS.hh"
|
||||
|
||||
#ifndef __C_G4NURBSbox__
|
||||
|
||||
#define __C_G4NURBSbox__ 1
|
||||
|
||||
class G4NURBSbox : public G4NURBS
|
||||
{
|
||||
public: G4NURBSbox(G4double DX, G4double DY, G4double DZ);
|
||||
virtual const char* Whoami() const;
|
||||
};
|
||||
|
||||
#endif
|
||||
// end of __C_G4NURBSbox__
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4NURBScylinder.hh,v 2.1 1998/07/12 02:59:11 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
// Olivier Crumeyrolle 12 September 1996
|
||||
|
||||
// Cylinder builder prototype
|
||||
// OC 090796
|
||||
|
||||
#include "G4NURBS.hh"
|
||||
|
||||
#ifndef __C_G4NURBScylinder__
|
||||
|
||||
#define __C_G4NURBScylinder__ 1
|
||||
|
||||
class G4NURBScylinder : public G4NURBS
|
||||
{
|
||||
public: G4NURBScylinder(G4double R, G4double DZ);
|
||||
virtual const char* Whoami() const;
|
||||
};
|
||||
|
||||
#endif
|
||||
// end of __C_G4NURBScylinder__
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4NURBShexahedron.hh,v 2.1 1998/07/12 02:59:12 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
// Hexa hedron builder prototype
|
||||
// OC 17 9 96
|
||||
|
||||
#include "G4NURBS.hh"
|
||||
|
||||
#include "G4ThreeVector.hh"
|
||||
|
||||
|
||||
#ifndef __C_G4NURBShexahedron__
|
||||
|
||||
#define __C_G4NURBShexahedron__ 1
|
||||
|
||||
class G4NURBShexahedron : public G4NURBS
|
||||
{
|
||||
|
||||
// imagine the hexahedron is just a box, then
|
||||
// the eight corners must be given in the following order :
|
||||
// DX DY -DZ
|
||||
// -DX DY -DZ
|
||||
// -DX -DY -DZ
|
||||
// DX -DY -DZ
|
||||
// DX DY DZ
|
||||
// -DX DY DZ
|
||||
// -DX -DY DZ
|
||||
// DX -DY DZ
|
||||
// (ie, with Oz pointing to you, Ox on the right, Oy on the top:
|
||||
// from the rear, from the upper right corner to the lower one
|
||||
// in anticlockwise sens, then the same for front side)
|
||||
|
||||
public: G4NURBShexahedron(const G4ThreeVector Corners [8]);
|
||||
virtual const char* Whoami() const;
|
||||
};
|
||||
|
||||
#endif
|
||||
// end of __C_G4NURBShexahedron__
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4NURBStube.hh,v 2.1 1998/07/12 02:59:13 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
// Olivier Crumeyrolle 12 September 1996
|
||||
|
||||
// Tube builder prototype
|
||||
// OC 090796
|
||||
|
||||
#include "G4NURBS.hh"
|
||||
|
||||
#ifndef __C_G4NURBStube__
|
||||
|
||||
#define __C_G4NURBStube__ 1
|
||||
|
||||
class G4NURBStube : public G4NURBS
|
||||
{
|
||||
public: G4NURBStube(G4double RMIN, G4double RMAX, G4double DZ);
|
||||
virtual const char* Whoami() const;
|
||||
};
|
||||
|
||||
#endif
|
||||
// end of __C_G4NURBStube__
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4NURBStubesector.hh,v 2.1 1998/07/12 02:59:14 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
// Olivier Crumeyrolle 12 September 1996
|
||||
|
||||
// Tubesector builder prototype
|
||||
// OC 290896
|
||||
|
||||
#include "G4NURBS.hh"
|
||||
|
||||
#ifndef __C_G4NURBStubesector__
|
||||
|
||||
#define __C_G4NURBStubesector__ 1
|
||||
|
||||
class G4NURBStubesector : public G4NURBS
|
||||
{
|
||||
public:
|
||||
// angle in radians
|
||||
|
||||
// If PHI2 smaller (or equal) than PHI1 , it is incremented
|
||||
// by 2pi as necessary to become strictly greater.
|
||||
|
||||
// Except that, you can use any value for the arguments,
|
||||
// it's the renderer or you that will have troubles.
|
||||
|
||||
G4NURBStubesector(G4double RMIN, G4double RMAX, G4double DZ, G4double PHI1, G4double PHI2);
|
||||
virtual const char* Whoami() const;
|
||||
virtual ~G4NURBStubesector();
|
||||
|
||||
protected:
|
||||
char * mpwhoami;
|
||||
|
||||
private:
|
||||
static t_inddCtrlPt DecideNbrCtrlPts(G4double PHI1, G4double PHI2);
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
// end of __C_G4NURBStubesector__
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4Point3DList.hh,v 2.0 1998/07/02 17:30:02 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
// John Allison July 1995
|
||||
|
||||
#ifndef G4POINT3DLIST_HH
|
||||
#define G4POINT3DLIST_HH
|
||||
|
||||
#include <rw/tvordvec.h>
|
||||
#include "G4Point3D.hh"
|
||||
|
||||
class ostream;
|
||||
|
||||
class G4Point3DList: public RWTValOrderedVector<G4Point3D> {
|
||||
|
||||
friend ostream& operator << (ostream& os, const G4Point3DList& points);
|
||||
|
||||
public:
|
||||
|
||||
virtual ~G4Point3DList();
|
||||
// Destructor.
|
||||
|
||||
};
|
||||
|
||||
#include "G4Point3DList.icc"
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,14 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4Point3DList.icc,v 2.0 1998/07/02 17:30:04 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
// John Allison July 1995
|
||||
|
||||
inline G4Point3DList::~G4Point3DList () {}
|
||||
@@ -0,0 +1,342 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4Polyhedron.hh,v 2.2 1998/07/13 16:56:10 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
//
|
||||
// G4Polyhedron is an intermediate class between G4 and visualization
|
||||
// systems. It is intended to provide some service like:
|
||||
// - polygonization of the G4 shapes with triangulization
|
||||
// (quadrilaterization) of complex polygons;
|
||||
// - calculation of normals for faces and vertices;
|
||||
//
|
||||
// Public constructors:
|
||||
// G4PolyhedronBox(dx,dy,dz) - create G4Polyhedron for G4 Box;
|
||||
// G4PolyhedronTrd1(dx1,dx2,dy,dz) - create G4Polyhedron for G4 Trd1;
|
||||
// G4PolyhedronTrd2(dx1,dx2,dy1,dy2,dz) - create G4Polyhedron for G4 Trd2;
|
||||
// G4PolyhedronTrap(dz,theta,phi,
|
||||
// h1,bl1,tl1,alp1,
|
||||
// h2,bl2,tl2,alp2) - create G4Polyhedron for G4 Trap;
|
||||
// G4PolyhedronPara(dx,dy,dz,
|
||||
// alpha,theta,phi) - create G4Polyhedron for G4 Para;
|
||||
//
|
||||
// G4PolyhedronTube(rmin,rmax,dz) - create G4Polyhedron for G4 Tube;
|
||||
// G4PolyhedronTubs(rmin,rmax,dz,
|
||||
// phi1,dphi) - create G4Polyhedron for G4 Tubs;
|
||||
// G4PolyhedronCone(rmin1,rmax1,
|
||||
// rmin2,rmax2,dz) - create G4Polyhedron for G4 Cone;
|
||||
// G4PolyhedronCons(rmin1,rmax1,
|
||||
// rmin2,rmax2,dz,
|
||||
// phi1,dphi) - create G4Polyhedron for G4 Cons;
|
||||
//
|
||||
// G4PolyhedronPgon(phi,dphi,npdv,nz,
|
||||
// z(*),rmin(*),rmax(*)) - create G4Polyhedron for G4 Pgon;
|
||||
// G4PolyhedronPcon(phi,dphi,nz,
|
||||
// z(*),rmin(*),rmax(*)) - create G4Polyhedron for G4 Pcon;
|
||||
//
|
||||
// G4PolyhedronSphere(rmin,rmax,
|
||||
// phi,dphi,the,dthe) - create G4Polyhedron for Sphere;
|
||||
// G4PolyhedronTorus(rmin,rmax,rtor,
|
||||
// phi,dphi) - create G4Polyhedron for Torus;
|
||||
//
|
||||
// Public functions:
|
||||
// GetNoVertices() - returns number of vertices
|
||||
// GetNoFacets() - returns number of faces
|
||||
// GetNextVertexIndex(index, edgeFlag) - get vertex indeces of the
|
||||
// quadrilaterals in order; returns false when
|
||||
// finished each face;
|
||||
// GetVertex(index) - returns vertex by index;
|
||||
// GetNextVertex(vertex, edgeFlag) - get vertices with edge visibility
|
||||
// of the quadrilaterals in order;
|
||||
// returns false when finished each face;
|
||||
// GetNextVertex(vertex, edgeFlag, normal) - get vertices with edge
|
||||
// visibility and normal of the quadrilaterals
|
||||
// in order; returns false when finished each face;
|
||||
// GetNextNormal(normal) - get normals of each face in order;
|
||||
// returns false when finished all faces;
|
||||
// GetNextUnitNormal(normal) - get normals of unit length of each face
|
||||
// in order; returns false when finished all faces;
|
||||
// GetNextEdgeIndeces(i1, i2, edgeFlag) - get indeces of the next edge;
|
||||
// returns false for the last edge;
|
||||
// GetNextEdge(p1, p2, edgeFlag) - get next edge;
|
||||
// returns false for the last edge;
|
||||
// SetNumberOfRotationSteps(G4int n) - Set number of steps for whole circle;
|
||||
// History:
|
||||
// 20.06.96 Evgeni Chernyaev <Evgueni.Tcherniaev@cern.ch> - initial version
|
||||
//
|
||||
// 23.07.96 John Allison
|
||||
// - added GetNoVertices, GetNoFacets, GetNextVertex, GetNextNormal
|
||||
//
|
||||
// 30.09.96 E.Chernyaev
|
||||
// - added GetNextVertexIndex, GetVertex by Yasuhide Sawada
|
||||
// - added GetNextUnitNormal, GetNextEdgeIndeces, GetNextEdge
|
||||
// - improvements: angles now expected in radians
|
||||
// int -> G4int, double -> G4double
|
||||
// - G4ThreeVector replaced by either G4Point3D or G4Normal3D
|
||||
//
|
||||
// 15.12.96 E.Chernyaev
|
||||
// - private functions G4PolyhedronAlloc, G4PolyhedronPrism renamed
|
||||
// to AllocateMemory and CreatePrism
|
||||
// - added private functions GetNumberOfRotationSteps, RotateEdge,
|
||||
// RotateAroundZ, SetReferences
|
||||
// - rewritten G4PolyhedronCons;
|
||||
// - added G4PolyhedronPara, ...Trap, ...Pgon, ...Pcon, ...Sphere, ...Torus,
|
||||
// so full List of implemented shapes now looks like:
|
||||
// BOX, TRD1, TRD2, TRAP, TUBE, TUBS, CONE, CONS, PARA, PGON, PCON,
|
||||
// SPHERE, TORUS
|
||||
//
|
||||
// 01.06.97 E.Chernyaev
|
||||
// - RotateAroundZ modified and SetSideFacets added to allow Rmin=Rmax
|
||||
// in bodies of revolution
|
||||
//
|
||||
// 24.06.97 J.Allison
|
||||
// - added static private member fNumberOfRotationSteps and static public
|
||||
// functions void SetNumberOfRotationSteps (G4int n) and
|
||||
// void ResetNumberOfRotationSteps (). Modified
|
||||
// GetNumberOfRotationSteps() appropriately. Made all three functions
|
||||
// inline (at end of this .hh file).
|
||||
// Usage:
|
||||
// G4Polyhedron::SetNumberOfRotationSteps
|
||||
// (fpView -> GetViewParameters ().GetNoOfSides ());
|
||||
// pPolyhedron = solid.CreatePolyhedron ();
|
||||
// G4Polyhedron::ResetNumberOfRotationSteps ();
|
||||
|
||||
|
||||
#ifndef G4POLYHEDRON_HH
|
||||
#define G4POLYHEDRON_HH
|
||||
|
||||
#include "G4ios.hh"
|
||||
#include "G4VVisPrim.hh"
|
||||
#include "G4Point3D.hh"
|
||||
#include "G4Normal3D.hh"
|
||||
|
||||
class G4Facet {
|
||||
friend class G4Polyhedron;
|
||||
friend ostream& operator<<(ostream&, const G4Facet &facet);
|
||||
|
||||
private:
|
||||
struct G4Edge { G4int v,f; };
|
||||
G4Edge edge[4];
|
||||
|
||||
public:
|
||||
G4Facet(G4int v1=0, G4int f1=0, G4int v2=0, G4int f2=0,
|
||||
G4int v3=0, G4int f3=0, G4int v4=0, G4int f4=0)
|
||||
{ edge[0].v=v1; edge[0].f=f1; edge[1].v=v2; edge[1].f=f2;
|
||||
edge[2].v=v3; edge[2].f=f3; edge[3].v=v4; edge[3].f=f4; }
|
||||
};
|
||||
|
||||
class G4Polyhedron: public G4VVisPrim {
|
||||
friend ostream& operator<<(ostream&, const G4Polyhedron &ph);
|
||||
|
||||
private:
|
||||
static G4int fNumberOfRotationSteps;
|
||||
|
||||
protected:
|
||||
G4int nvert, nface;
|
||||
G4Point3D *pV;
|
||||
G4Facet *pF;
|
||||
|
||||
// Allocate memory for G4Polyhedron
|
||||
void AllocateMemory(G4int Nvert, G4int Nface);
|
||||
|
||||
// Create G4Polyhedron for prism with quadrilateral base
|
||||
void CreatePrism();
|
||||
|
||||
// Get number of steps for whole circle
|
||||
G4int GetNumberOfRotationSteps();
|
||||
|
||||
// Generate facets by revolving an edge around Z-axis
|
||||
void RotateEdge(G4int k1, G4int k2, G4double r1, G4double r2,
|
||||
G4int v1, G4int v2, G4int vEdge,
|
||||
G4bool ifWholeCircle, G4int ns, G4int &kface);
|
||||
|
||||
// Set side facets for the case of incomplete rotation
|
||||
void SetSideFacets(G4int ii[4], G4int vv[4],
|
||||
G4int *kk, G4double *r,
|
||||
G4double dphi, G4int ns, G4int &kface);
|
||||
|
||||
// Create G4Polyhedron for body of revolution around Z-axis
|
||||
void RotateAroundZ(G4int nstep, G4double phi, G4double dphi,
|
||||
G4int np1, G4int np2,
|
||||
const G4double *z, G4double *r,
|
||||
G4int nodeVis, G4int edgeVis);
|
||||
|
||||
// For each edge set reference to neighbouring facet
|
||||
void SetReferences();
|
||||
|
||||
public:
|
||||
// Constructor
|
||||
G4Polyhedron(G4int Nvert=0, G4int Nface=0)
|
||||
: nvert(Nvert), nface(Nface),
|
||||
pV(Nvert ? new G4Point3D[Nvert+1] : 0),
|
||||
pF(Nface ? new G4Facet[Nface+1] : 0) {}
|
||||
|
||||
// Copy constructor
|
||||
G4Polyhedron(const G4Polyhedron &from);
|
||||
|
||||
// Destructor
|
||||
~G4Polyhedron() { delete [] pV; delete [] pF; }
|
||||
|
||||
// Assignment
|
||||
G4Polyhedron& operator=(const G4Polyhedron &from);
|
||||
|
||||
// Get number of vertices
|
||||
G4int GetNoVertices() const { return nvert; }
|
||||
|
||||
// Get number of facets
|
||||
G4int GetNoFacets() const { return nface; }
|
||||
|
||||
// Get next vertex index of the quadrilateral
|
||||
G4bool GetNextVertexIndex(G4int &index, G4int &edgeFlag) const;
|
||||
|
||||
// Get vertex by index
|
||||
G4Point3D GetVertex(G4int index) const;
|
||||
|
||||
// Get next vertex + edge visibility of the quadrilateral
|
||||
G4bool GetNextVertex(G4Point3D &vertex, G4int &edgeFlag) const;
|
||||
|
||||
// Get next vertex + edge visibility + normal of the quadrilateral
|
||||
//G4bool GetNextVertex
|
||||
//(G4Point3D &vertex, G4int &edgeFlag, G4Normal3D &normal) const;
|
||||
|
||||
// Get normal of the next face
|
||||
G4bool GetNextNormal(G4Normal3D &normal) const;
|
||||
|
||||
// Get normal of unit length of the next face
|
||||
G4bool GetNextUnitNormal(G4Normal3D &normal) const;
|
||||
|
||||
// Get indeces of the next edge
|
||||
G4bool GetNextEdgeIndeces(G4int &i1, G4int &i2, G4int &edgeFlag) const;
|
||||
|
||||
// Get next edge
|
||||
G4bool GetNextEdge(G4Point3D &p1, G4Point3D &p2, G4int &edgeFlag) const;
|
||||
|
||||
// Set number of steps for whole circle
|
||||
static void SetNumberOfRotationSteps(G4int n);
|
||||
|
||||
// Reset number of steps for whole circle to default value
|
||||
static void ResetNumberOfRotationSteps();
|
||||
};
|
||||
|
||||
class G4PolyhedronTrd2 : public G4Polyhedron {
|
||||
public:
|
||||
G4PolyhedronTrd2(G4double Dx1, G4double Dx2,
|
||||
G4double Dy1, G4double Dy2, G4double Dz);
|
||||
};
|
||||
|
||||
class G4PolyhedronTrd1 : public G4PolyhedronTrd2 {
|
||||
public:
|
||||
G4PolyhedronTrd1(G4double Dx1, G4double Dx2, G4double Dy, G4double Dz) :
|
||||
G4PolyhedronTrd2(Dx1, Dx2, Dy, Dy, Dz) {}
|
||||
};
|
||||
|
||||
class G4PolyhedronBox : public G4PolyhedronTrd2 {
|
||||
public:
|
||||
G4PolyhedronBox(G4double Dx, G4double Dy, G4double Dz) :
|
||||
G4PolyhedronTrd2(Dx, Dx, Dy, Dy, Dz) {}
|
||||
};
|
||||
|
||||
class G4PolyhedronTrap : public G4Polyhedron {
|
||||
public:
|
||||
G4PolyhedronTrap(G4double Dz, G4double Theta, G4double Phi,
|
||||
G4double Dy1, G4double Dx1, G4double Dx2, G4double Alp1,
|
||||
G4double Dy2, G4double Dx3, G4double Dx4, G4double Alp2);
|
||||
};
|
||||
|
||||
class G4PolyhedronPara : public G4PolyhedronTrap {
|
||||
public:
|
||||
G4PolyhedronPara(G4double Dx, G4double Dy, G4double Dz,
|
||||
G4double Alpha, G4double Theta, G4double Phi) :
|
||||
G4PolyhedronTrap(Dz, Theta, Phi, Dy, Dx, Dx, Alpha, Dy, Dx, Dx, Alpha) {}
|
||||
};
|
||||
|
||||
class G4PolyhedronCons : public G4Polyhedron {
|
||||
public:
|
||||
G4PolyhedronCons(G4double Rmn1, G4double Rmx1,
|
||||
G4double Rmn2, G4double Rmx2, G4double Dz,
|
||||
G4double Phi1, G4double Dphi);
|
||||
};
|
||||
|
||||
class G4PolyhedronCone : public G4PolyhedronCons {
|
||||
public:
|
||||
G4PolyhedronCone(G4double Rmn1, G4double Rmx1,
|
||||
G4double Rmn2, G4double Rmx2, G4double Dz)
|
||||
: G4PolyhedronCons(Rmn1, Rmx1, Rmn2, Rmx2, Dz, 0*deg, 360*deg) {}
|
||||
};
|
||||
|
||||
class G4PolyhedronTubs : public G4PolyhedronCons {
|
||||
public:
|
||||
G4PolyhedronTubs(G4double Rmin, G4double Rmax, G4double Dz,
|
||||
G4double Phi1, G4double Dphi)
|
||||
: G4PolyhedronCons(Rmin, Rmax, Rmin, Rmax, Dz, Phi1, Dphi) {}
|
||||
};
|
||||
|
||||
class G4PolyhedronTube : public G4PolyhedronCons {
|
||||
public:
|
||||
G4PolyhedronTube (G4double Rmin, G4double Rmax, G4double Dz)
|
||||
: G4PolyhedronCons(Rmin, Rmax, Rmin, Rmax, Dz, 0*deg, 360*deg) {}
|
||||
};
|
||||
|
||||
class G4PolyhedronPgon : public G4Polyhedron {
|
||||
public:
|
||||
G4PolyhedronPgon(G4double phi, G4double dphi, G4int npdv, G4int nz,
|
||||
const G4double *z,
|
||||
const G4double *rmin,
|
||||
const G4double *rmax);
|
||||
};
|
||||
|
||||
class G4PolyhedronPcon : public G4PolyhedronPgon {
|
||||
public:
|
||||
G4PolyhedronPcon(G4double phi, G4double dphi, G4int nz,
|
||||
const G4double *z,
|
||||
const G4double *rmin,
|
||||
const G4double *rmax)
|
||||
: G4PolyhedronPgon(phi, dphi, 0, nz, z, rmin, rmax) {}
|
||||
};
|
||||
|
||||
class G4PolyhedronSphere : public G4Polyhedron {
|
||||
public:
|
||||
G4PolyhedronSphere(G4double rmin, G4double rmax,
|
||||
G4double phi, G4double dphi,
|
||||
G4double the, G4double dthe);
|
||||
};
|
||||
|
||||
class G4PolyhedronTorus : public G4Polyhedron {
|
||||
public:
|
||||
G4PolyhedronTorus(G4double rmin, G4double rmax, G4double rtor,
|
||||
G4double phi, G4double dphi);
|
||||
};
|
||||
|
||||
inline G4int G4Polyhedron::GetNumberOfRotationSteps()
|
||||
/***********************************************************************
|
||||
* *
|
||||
* Name: G4Polyhedron::GetNumberOfRotationSteps Date: 11.12.96 *
|
||||
* Author: E.Chernyaev (IHEP/Protvino) Revised: 24.06.97 *
|
||||
* *
|
||||
* Function: Get number of steps for whole circle *
|
||||
* *
|
||||
***********************************************************************/
|
||||
{
|
||||
return fNumberOfRotationSteps;
|
||||
}
|
||||
|
||||
inline void G4Polyhedron::ResetNumberOfRotationSteps()
|
||||
/***********************************************************************
|
||||
* *
|
||||
* Name: G4Polyhedron::ResetNumberOfRotationSteps Date: 24.06.97 *
|
||||
* Author: J.Allison (Manchester University) Revised: *
|
||||
* *
|
||||
* Function: Reset number of steps for whole circle to default value *
|
||||
* *
|
||||
***********************************************************************/
|
||||
{
|
||||
fNumberOfRotationSteps = 24;
|
||||
}
|
||||
|
||||
#endif /* G4POLYHEDRON_HH */
|
||||
@@ -0,0 +1,29 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4Polyline.hh,v 2.0 1998/07/02 17:30:06 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
// John Allison July 1995
|
||||
|
||||
#ifndef G4POLYLINE_HH
|
||||
#define G4POLYLINE_HH
|
||||
|
||||
#include "G4VVisPrim.hh"
|
||||
#include "G4Point3DList.hh"
|
||||
|
||||
class G4Polyline: public G4VVisPrim, public G4Point3DList {
|
||||
friend ostream& operator << (ostream& os, const G4Polyline& line);
|
||||
public:
|
||||
G4Polyline ();
|
||||
G4Polyline (const G4VVisPrim& prim);
|
||||
};
|
||||
|
||||
inline G4Polyline::G4Polyline () {}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,33 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4Polymarker.hh,v 2.0 1998/07/02 17:30:08 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
// John Allison November 1996
|
||||
|
||||
#ifndef G4POLYMARKER_HH
|
||||
#define G4POLYMARKER_HH
|
||||
|
||||
#include "G4VMarker.hh"
|
||||
#include "G4Point3DList.hh"
|
||||
|
||||
class G4Polymarker: public G4VMarker, public G4Point3DList {
|
||||
public:
|
||||
friend ostream& operator << (ostream& os, const G4Polymarker& marker);
|
||||
enum MarkerType {line, dots, circles, squares};
|
||||
G4Polymarker ();
|
||||
MarkerType GetMarkerType () const;
|
||||
void SetMarkerType (MarkerType type);
|
||||
private:
|
||||
MarkerType fMarkerType;
|
||||
};
|
||||
|
||||
#include "G4Polymarker.icc"
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,20 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4Polymarker.icc,v 2.0 1998/07/02 17:30:09 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
// John Allison November 1996
|
||||
|
||||
inline G4Polymarker::MarkerType G4Polymarker::GetMarkerType () const {
|
||||
return fMarkerType;
|
||||
}
|
||||
|
||||
inline void G4Polymarker::SetMarkerType (MarkerType type) {
|
||||
fMarkerType = type;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4Square.hh,v 2.0 1998/07/02 17:29:48 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
// John Allison 17/11/96.
|
||||
|
||||
#ifndef G4SQUARE_HH
|
||||
#define G4SQUARE_HH
|
||||
|
||||
#include "G4VMarker.hh"
|
||||
|
||||
class G4Square: public G4VMarker {
|
||||
public:
|
||||
G4Square ();
|
||||
G4Square (const G4Point3D& pos);
|
||||
G4Square (const G4VMarker& marker);
|
||||
};
|
||||
|
||||
#include "G4Square.icc"
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,20 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4Square.icc,v 2.0 1998/07/02 17:30:10 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
// John Allison 17/11/96.
|
||||
|
||||
inline G4Square::G4Square () {}
|
||||
|
||||
inline G4Square::G4Square (const G4Point3D& pos):
|
||||
G4VMarker (pos) {}
|
||||
|
||||
inline G4Square::G4Square (const G4VMarker& marker):
|
||||
G4VMarker (marker) {}
|
||||
@@ -0,0 +1,45 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4Text.hh,v 2.0 1998/07/02 17:30:12 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
// John Allison 17/11/96.
|
||||
|
||||
#ifndef G4TEXT_HH
|
||||
#define G4TEXT_HH
|
||||
|
||||
#include "G4VMarker.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class G4Text: public G4VMarker {
|
||||
public:
|
||||
enum Layout {left, centre, right};
|
||||
G4Text (const G4String& text);
|
||||
G4Text (const G4String& text, const G4Point3D& pos);
|
||||
G4Text (const G4VMarker& marker);
|
||||
G4String GetText () const;
|
||||
Layout GetLayout () const;
|
||||
|
||||
G4double GetXOffset () const ;
|
||||
G4double GetYOffset () const ;
|
||||
|
||||
void SetText (const G4String& text);
|
||||
void SetLayout (Layout layout);
|
||||
|
||||
void SetOffset ( double dx, double dy ) ;
|
||||
|
||||
private:
|
||||
G4String fText;
|
||||
Layout fLayout;
|
||||
G4double fXOffset, fYOffset ;
|
||||
};
|
||||
|
||||
#include "G4Text.icc"
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,44 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4Text.icc,v 2.0 1998/07/02 17:30:13 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
// John Allison 17/11/96.
|
||||
|
||||
inline G4String G4Text::GetText () const {
|
||||
return fText;
|
||||
}
|
||||
|
||||
inline G4Text::Layout G4Text::GetLayout () const {
|
||||
return fLayout;
|
||||
}
|
||||
|
||||
inline void G4Text::SetText (const G4String& text) {
|
||||
fText = text;
|
||||
}
|
||||
|
||||
inline void G4Text::SetLayout (G4Text::Layout layout) {
|
||||
fLayout = layout;
|
||||
}
|
||||
|
||||
inline G4double G4Text::GetXOffset () const
|
||||
{
|
||||
return fXOffset ;
|
||||
}
|
||||
|
||||
inline G4double G4Text::GetYOffset () const
|
||||
{
|
||||
return fYOffset ;
|
||||
}
|
||||
|
||||
inline void G4Text::SetOffset ( double x_offset, double y_offset )
|
||||
{
|
||||
fXOffset = x_offset ;
|
||||
fYOffset = y_offset ;
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4VGraphicsScene.hh,v 2.0 1998/07/02 17:30:16 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
// John Allison 19th July 1996
|
||||
// Abstract interface class for the concept of a graphics scene.
|
||||
// It is a minimal scene for the GEANT4 kernel.
|
||||
// See G4VScene for a fuller description. G4VScene is the full abstract
|
||||
// interface to graphics systems.
|
||||
|
||||
#ifndef G4VGRAPHICSSCENE_HH
|
||||
#define G4VGRAPHICSSCENE_HH
|
||||
|
||||
class G4VisAttributes;
|
||||
class G4VSolid;
|
||||
class G4Box;
|
||||
class G4Cons;
|
||||
class G4Tubs;
|
||||
class G4Trd;
|
||||
class G4Trap;
|
||||
class G4Sphere;
|
||||
class G4Para;
|
||||
class G4Torus;
|
||||
class G4PhysicalVolumeModel;
|
||||
|
||||
#include "G4Transform3D.hh"
|
||||
|
||||
// Scene Interface - begin snippet.
|
||||
class G4VGraphicsScene {
|
||||
|
||||
public:
|
||||
|
||||
///////////////////////////////////////////////////////////////////
|
||||
// Functions for adding raw GEANT4 objects. The concrete graphics
|
||||
// scene has the option of implementing its own model or asking the
|
||||
// solid to provide a G4Polyhedron or similar primitive - see, for
|
||||
// example, G4VScene in the Visualization Category.
|
||||
|
||||
virtual void AddThis (const G4Box& box) = 0;
|
||||
virtual void AddThis (const G4Cons& cons) = 0;
|
||||
virtual void AddThis (const G4Tubs& tubs) = 0;
|
||||
virtual void AddThis (const G4Trd& trd) = 0;
|
||||
virtual void AddThis (const G4Trap& trap) = 0;
|
||||
virtual void AddThis (const G4Sphere& sphere) = 0;
|
||||
virtual void AddThis (const G4Para& para ) = 0;
|
||||
virtual void AddThis (const G4Torus& torus ) = 0;
|
||||
virtual void AddThis (const G4VSolid& solid) = 0; // For solids not above.
|
||||
|
||||
///////////////////////////////////////////////////////////////////
|
||||
// Other functions.
|
||||
|
||||
virtual void EstablishSpecials (G4PhysicalVolumeModel&) {}
|
||||
// Used to establish any special relationships between scene and
|
||||
// this particular type of model - non-pure, i.e., no requirement to
|
||||
// implement. See G4PhysicalVolumeModel.hh for details.
|
||||
|
||||
virtual void DecommissionSpecials (G4PhysicalVolumeModel&) {}
|
||||
// Used to reverse the effect of EstablishSpecials, if required.
|
||||
|
||||
virtual void PreAddThis (const G4Transform3D& objectTransformation,
|
||||
const G4VisAttributes& visAttribs) = 0;
|
||||
// objectTransformation is the transformation in the world
|
||||
// coordinate system of the object about to be added, and
|
||||
// visAttribs is its visualization attributes.
|
||||
|
||||
virtual void PostAddThis () = 0;
|
||||
|
||||
};
|
||||
// Scene Interface - end snippet.
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,123 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4VMarker.hh,v 2.3 1998/11/09 02:37:42 stanaka Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
// G4VMarker - base class for markers - circles, squares, etc.
|
||||
// John Allison 17/11/96.
|
||||
|
||||
// G4VMarkers are 2-dimensional G4VVisPrims with the special
|
||||
// properties (a) of always facing the camera and (b) of having the
|
||||
// possibility of a size defined in screen units. The convention is
|
||||
// that if a world size is not specified, then the marker will be
|
||||
// drawn to the given screen size or paper size regardless of the
|
||||
// viewing transformation in effect.
|
||||
//
|
||||
// "Size" means "overall size", e.g., diameter of circle, side of
|
||||
// Square, height of text (but Diameter and Radius access functions
|
||||
// are defined to avoid ambiguity).
|
||||
//
|
||||
// So the user who constructs the marker decides whether it should be
|
||||
// drawn to a given size in world coordinates by setting the world
|
||||
// size. Alternatively, the user can set the screen size (internally,
|
||||
// the world size is set to zero) and the marker is drawn to its
|
||||
// screen size. Finally, the user may decide not to set any size; in
|
||||
// that case, it is drawn according to the sizes specified in the
|
||||
// default marker specified in G4ViewParameters.
|
||||
//
|
||||
// Also in G4ViewParameters is a "global marker scale" which is a
|
||||
// factor by which all marker sizes are multiplied before drawing.
|
||||
//
|
||||
// Thus the graphics system driver scene code might look like:
|
||||
//
|
||||
// void G4XXXGraphicsScene::AddPrimitive (const G4Circle& circle) {
|
||||
// G4bool hidden = !(fpView -> GetViewParameters().IsMarkerNotHidden());
|
||||
// const G4Colour& colour = GetColour (circle); // Base class GetColour.
|
||||
// G4VMarker::FillStyle style = circle.GetFillStyle();
|
||||
// const G4Point3D& centre = circle.GetPosition();
|
||||
// MarkerSizeType sizeType;
|
||||
// G4double size = GetMarkerSize (circle, sizeType);
|
||||
// switch (sizeType) {
|
||||
// default:
|
||||
// case screen:
|
||||
// // Draw in screen coordinates.
|
||||
// // ...
|
||||
// break;
|
||||
// case world:
|
||||
// // Draw in world coordinates.
|
||||
// // ...
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
|
||||
#ifndef G4VMARKER_HH
|
||||
#define G4VMARKER_HH
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4VVisPrim.hh"
|
||||
#include "G4Point3D.hh"
|
||||
#include "G4Colour.hh"
|
||||
#include "G4Color.hh"
|
||||
|
||||
class G4VMarker: public G4VVisPrim {
|
||||
|
||||
friend ostream& operator << (ostream& os, const G4VMarker& marker);
|
||||
friend G4bool operator != (const G4VMarker& m1,
|
||||
const G4VMarker& m2);
|
||||
public:
|
||||
|
||||
enum FillStyle {noFill, hashed, filled};
|
||||
|
||||
//////////////////////////////////////////////////////
|
||||
// Constructors...
|
||||
G4VMarker ();
|
||||
G4VMarker (const G4VMarker& marker);
|
||||
G4VMarker& operator = (const G4VMarker& right);
|
||||
G4VMarker (const G4Point3D& pos);
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
// Get functions...
|
||||
G4Point3D GetPosition () const;
|
||||
G4double GetWorldSize () const;
|
||||
G4double GetWorldDiameter () const;
|
||||
G4double GetWorldRadius () const;
|
||||
G4double GetScreenSize () const;
|
||||
G4double GetScreenDiameter () const;
|
||||
G4double GetScreenRadius () const;
|
||||
FillStyle GetFillStyle () const;
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
// Set functions...
|
||||
void SetPosition (const G4Point3D&);
|
||||
void SetWorldSize (G4double);
|
||||
void SetWorldDiameter (G4double);
|
||||
void SetWorldRadius (G4double);
|
||||
void SetScreenSize (G4double);
|
||||
void SetScreenDiameter (G4double);
|
||||
void SetScreenRadius (G4double);
|
||||
void SetFillStyle (FillStyle);
|
||||
|
||||
// Access functions to the string for user custimizable information
|
||||
virtual const G4String& GetInfo() const { return fInfo ;}
|
||||
virtual void SetInfo( const G4String& info ){ fInfo = info ;}
|
||||
|
||||
private:
|
||||
G4Point3D fPosition;
|
||||
G4double fWorldSize; // Default 0. means use screen size.
|
||||
G4double fScreenSize; // Default 0. means use global default.
|
||||
FillStyle fFillStyle;
|
||||
|
||||
// String for user customizable information
|
||||
G4String fInfo ;
|
||||
|
||||
};
|
||||
|
||||
#include "G4VMarker.icc"
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,117 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4VMarker.icc,v 2.2 1998/11/09 02:37:43 stanaka Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
|
||||
inline G4VMarker::G4VMarker ():
|
||||
fPosition (G4Point3D ()),
|
||||
fWorldSize (0.),
|
||||
fScreenSize (0.),
|
||||
fFillStyle (noFill),
|
||||
fInfo()
|
||||
{}
|
||||
|
||||
inline G4VMarker::G4VMarker (const G4VMarker& marker):
|
||||
G4VVisPrim (marker),
|
||||
fPosition (marker.fPosition),
|
||||
fWorldSize (marker.fWorldSize),
|
||||
fScreenSize (marker.fScreenSize),
|
||||
fFillStyle (marker.fFillStyle),
|
||||
fInfo (marker.fInfo)
|
||||
{}
|
||||
|
||||
|
||||
inline G4VMarker& G4VMarker::operator = (const G4VMarker& right) {
|
||||
((G4VVisPrim*) this) -> operator = (right);
|
||||
fPosition = right.fPosition;
|
||||
fWorldSize = right.fWorldSize;
|
||||
fScreenSize = right.fScreenSize;
|
||||
fFillStyle = right.fFillStyle;
|
||||
fInfo = right.fInfo;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline G4VMarker::G4VMarker (const G4Point3D& pos):
|
||||
fPosition (pos),
|
||||
fWorldSize (0.),
|
||||
fScreenSize (0.),
|
||||
fFillStyle (noFill),
|
||||
fInfo ()
|
||||
{}
|
||||
|
||||
inline G4Point3D G4VMarker::GetPosition () const {
|
||||
return fPosition;
|
||||
}
|
||||
|
||||
inline G4double G4VMarker::GetWorldSize () const {
|
||||
return fWorldSize;
|
||||
}
|
||||
|
||||
inline G4double G4VMarker::GetWorldDiameter () const {
|
||||
return fWorldSize;
|
||||
}
|
||||
|
||||
inline G4double G4VMarker::GetWorldRadius () const {
|
||||
return fWorldSize / 2.;
|
||||
}
|
||||
|
||||
inline G4double G4VMarker::GetScreenSize () const {
|
||||
return fScreenSize;
|
||||
}
|
||||
|
||||
inline G4double G4VMarker::GetScreenDiameter () const {
|
||||
return fScreenSize;
|
||||
}
|
||||
|
||||
inline G4double G4VMarker::GetScreenRadius () const {
|
||||
return fScreenSize / 2.;
|
||||
}
|
||||
|
||||
inline G4VMarker::FillStyle G4VMarker::GetFillStyle () const {
|
||||
return fFillStyle;
|
||||
}
|
||||
|
||||
inline void G4VMarker::SetPosition (const G4Point3D& pos) {
|
||||
fPosition = pos;
|
||||
}
|
||||
|
||||
inline void G4VMarker::SetWorldSize (G4double ws) {
|
||||
fWorldSize = ws;
|
||||
}
|
||||
|
||||
inline void G4VMarker::SetWorldDiameter (G4double wd) {
|
||||
fWorldSize = wd;
|
||||
}
|
||||
|
||||
inline void G4VMarker::SetWorldRadius (G4double wr) {
|
||||
fWorldSize = 2. * wr;
|
||||
}
|
||||
|
||||
inline void G4VMarker::SetScreenSize (G4double ss) {
|
||||
fWorldSize = 0.;
|
||||
fScreenSize = ss;
|
||||
}
|
||||
|
||||
inline void G4VMarker::SetScreenDiameter (G4double sd) {
|
||||
fWorldSize = 0.;
|
||||
fScreenSize = sd;
|
||||
}
|
||||
|
||||
inline void G4VMarker::SetScreenRadius (G4double sr) {
|
||||
fWorldSize = 0.;
|
||||
fScreenSize = 2. * sr;
|
||||
}
|
||||
|
||||
inline void G4VMarker::SetFillStyle (G4VMarker::FillStyle style) {
|
||||
fFillStyle = style;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,117 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4VVisManager.hh,v 2.4 1998/09/25 11:54:18 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
// Abstract interface for GEANT4 Visualization Manager.
|
||||
// John Allison 19/Oct/1996.
|
||||
|
||||
// This is a "Singleton", i.e., only one instance of it may exist.
|
||||
// This is ensured by making the constructor private.
|
||||
|
||||
// It has only one public access function which is used to obtain a pointer
|
||||
// to the concrete G4VisManager, should it exist.
|
||||
// G4VVisManager* pVVMan = G4VVisManager::GetConcreteInstance ();
|
||||
// points to the real (concrete) G4VisManager, if a view is available for
|
||||
// drawing, otherwise is zero. Thus all code must be protected,
|
||||
// for example, by:
|
||||
// if (pVVMan) pVVMan -> Draw (polyline);
|
||||
|
||||
#ifndef G4VVISMANAGER_HH
|
||||
#define G4VVISMANAGER_HH
|
||||
|
||||
#include "G4Transform3D.hh"
|
||||
#include "G4ThreeVector.hh" // Just a typedef Hep3Vector.
|
||||
#include "G4RotationMatrix.hh" // Just a typedef HepRotation.
|
||||
|
||||
class G4Polyline;
|
||||
class G4Text;
|
||||
class G4Circle;
|
||||
class G4Square;
|
||||
class G4Polymarker;
|
||||
class G4Polyhedron;
|
||||
class G4NURBS;
|
||||
class G4VSolid;
|
||||
class G4LogicalVolume;
|
||||
class G4VPhysicalVolume;
|
||||
class G4VisAttributes;
|
||||
|
||||
class G4VVisManager {
|
||||
|
||||
public:
|
||||
|
||||
static G4VVisManager* GetConcreteInstance ();
|
||||
// Returns pointer to actual visualization manager if a view is
|
||||
// available for drawing, else returns null. Always check value.
|
||||
|
||||
virtual ~G4VVisManager () {}
|
||||
|
||||
///////////////////////////////////////////////////////////////////
|
||||
// Functions to Draw "transient" objects, useful for hits, digis, etc.
|
||||
|
||||
//1 Note that the {\tt G4Transform3D} objects refer to the
|
||||
//1 transformation of the {\em object} being drawn. However, for
|
||||
//1 some functions, there is a version which takes a {\tt
|
||||
//1 G4Translation} and a {\tt G4RotationMatrix}, the latter being a
|
||||
//1 {\em system} rotation, as in {\tt G4PVPlacement}.
|
||||
//1
|
||||
//1 Note also that where a {\tt G4VisAttributes} argument is
|
||||
//1 specified, it overrides any attributes belonging to the object
|
||||
//1 itself. Otherwise, the visualization attributes are assumed to
|
||||
//1 be those belonging to the object being drawn (you can set its
|
||||
//1 attributes --- see Section \ref{ap:setting_attribs}).
|
||||
|
||||
// VVisManager Interface - begin snippet.
|
||||
virtual void Draw (const G4Polyline&,
|
||||
const G4Transform3D& objectTransformation = G4Transform3D::Identity) = 0;
|
||||
|
||||
virtual void Draw (const G4Text&,
|
||||
const G4Transform3D& objectTransformation = G4Transform3D::Identity) = 0;
|
||||
|
||||
virtual void Draw (const G4Circle&,
|
||||
const G4Transform3D& objectTransformation = G4Transform3D::Identity) = 0;
|
||||
|
||||
virtual void Draw (const G4Square&,
|
||||
const G4Transform3D& objectTransformation = G4Transform3D::Identity) = 0;
|
||||
|
||||
virtual void Draw (const G4Polymarker&,
|
||||
const G4Transform3D& objectTransformation = G4Transform3D::Identity) = 0;
|
||||
|
||||
virtual void Draw (const G4Polyhedron&,
|
||||
const G4Transform3D& objectTransformation = G4Transform3D::Identity) = 0;
|
||||
|
||||
virtual void Draw (const G4NURBS&,
|
||||
const G4Transform3D& objectTransformation = G4Transform3D::Identity) = 0;
|
||||
|
||||
virtual void Draw (const G4VSolid&, const G4VisAttributes&,
|
||||
const G4Transform3D& objectTransformation = G4Transform3D::Identity) = 0;
|
||||
|
||||
virtual void Draw (const G4LogicalVolume&, const G4VisAttributes&,
|
||||
const G4Transform3D& objectTransformation = G4Transform3D::Identity) = 0;
|
||||
|
||||
virtual void Draw (const G4VPhysicalVolume&, const G4VisAttributes&,
|
||||
const G4Transform3D& objectTransformation = G4Transform3D::Identity) = 0;
|
||||
// VVisManager Interface - end snippet.
|
||||
|
||||
// Other management functions...
|
||||
|
||||
virtual void GeometryHasChanged () = 0;
|
||||
// This is used by the run manager to notify a change of geometry.
|
||||
|
||||
protected:
|
||||
|
||||
static G4VVisManager* fpConcreteInstance; // Pointer to real G4VisManager.
|
||||
|
||||
};
|
||||
|
||||
inline G4VVisManager* G4VVisManager::GetConcreteInstance () {
|
||||
return fpConcreteInstance;
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,42 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4VVisPrim.hh,v 2.0 1998/07/02 17:30:23 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
// John Allison August 1995
|
||||
// Virtual base class for Visualization Primitives
|
||||
// (or Visualization Representations, as they are sometimes called).
|
||||
|
||||
#ifndef G4VVISPRIM_HH
|
||||
#define G4VVISPRIM_HH
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4Visible.hh"
|
||||
|
||||
class ostream;
|
||||
class G4VisAttributes;
|
||||
|
||||
class G4VVisPrim: public G4Visible {
|
||||
|
||||
friend ostream& operator << (ostream& os, const G4VVisPrim& prim);
|
||||
|
||||
public:
|
||||
|
||||
G4VVisPrim ();
|
||||
G4VVisPrim (const G4VVisPrim& prim);
|
||||
G4VVisPrim& operator = (const G4VVisPrim& right);
|
||||
G4VVisPrim (const G4VisAttributes* pVA);
|
||||
|
||||
virtual G4bool operator == (const G4VVisPrim& prim) const;
|
||||
|
||||
};
|
||||
|
||||
#include "G4VVisPrim.icc"
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,32 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4VVisPrim.icc,v 2.0 1998/07/02 17:30:24 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
// John Allison August 1995
|
||||
|
||||
inline G4VVisPrim::G4VVisPrim () {}
|
||||
|
||||
inline G4VVisPrim::G4VVisPrim (const G4VVisPrim& prim):
|
||||
G4Visible (prim)
|
||||
{}
|
||||
|
||||
inline G4VVisPrim& G4VVisPrim::operator = (const G4VVisPrim& right) {
|
||||
((G4Visible*) this) -> operator = (right);
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline G4VVisPrim::G4VVisPrim (const G4VisAttributes* pVA):
|
||||
G4Visible (pVA)
|
||||
{}
|
||||
|
||||
inline G4bool G4VVisPrim::operator == (const G4VVisPrim& prim) const{
|
||||
return this == &prim;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4VisAttributes.hh,v 2.2 1998/11/25 16:01:15 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
// John Allison 23rd October 1996
|
||||
|
||||
#ifndef __G4VISATTRIBUTES_HH__
|
||||
#define __G4VISATTRIBUTES_HH__
|
||||
|
||||
#include "G4ios.hh"
|
||||
#include "globals.hh"
|
||||
#include "G4Colour.hh"
|
||||
#include "G4Color.hh"
|
||||
|
||||
class G4VisAttributes {
|
||||
|
||||
friend ostream& operator << (ostream& os, const G4VisAttributes& a);
|
||||
friend G4bool operator != (const G4VisAttributes& a1,
|
||||
const G4VisAttributes& a2);
|
||||
|
||||
public:
|
||||
|
||||
// Constructors, etc. - begin snippet.
|
||||
enum LineStyle {unbroken, dashed, dotted};
|
||||
enum ForcedDrawingStyle {wireframe, solid};
|
||||
|
||||
G4VisAttributes ();
|
||||
G4VisAttributes (G4bool visibility);
|
||||
G4VisAttributes (const G4Colour& colour);
|
||||
G4VisAttributes (G4bool visibility, const G4Colour& colour);
|
||||
|
||||
static const G4VisAttributes Invisible;
|
||||
// Constructors - end snippet.
|
||||
|
||||
G4bool IsVisible () const;
|
||||
G4bool IsDaughtersInvisible () const;
|
||||
const G4Colour& GetColour () const;
|
||||
const G4Color& GetColor () const;
|
||||
LineStyle GetLineStyle () const;
|
||||
G4double GetLineWidth () const;
|
||||
G4bool IsForceDrawingStyle () const;
|
||||
ForcedDrawingStyle GetForcedDrawingStyle () const;
|
||||
|
||||
// Set methods - begin snippet.
|
||||
void SetVisibility (G4bool);
|
||||
void SetDaughtersInvisible (G4bool);
|
||||
void SetColour (const G4Colour&);
|
||||
void SetColor (const G4Color&);
|
||||
void SetColour (G4double red, G4double green, G4double blue,
|
||||
G4double alpha = 1.);
|
||||
void SetColor (G4double red, G4double green, G4double blue,
|
||||
G4double alpha = 1.);
|
||||
void SetLineStyle (LineStyle);
|
||||
void SetLineWidth (G4double);
|
||||
void SetForceWireframe (G4bool);
|
||||
void SetForceSolid (G4bool);
|
||||
// Set methods - end snippet.
|
||||
|
||||
private:
|
||||
|
||||
// Available attributes - begin snippet.
|
||||
G4bool fVisible; // Visibility flag
|
||||
G4bool fDaughtersInvisible; // Make daughters invsibile.
|
||||
G4Colour fColour;
|
||||
LineStyle fLineStyle;
|
||||
G4double fLineWidth; // Units of "normal" device linewidth, e.g.,
|
||||
// pixels for screen, 0.1 mm for paper.
|
||||
G4bool fForceDrawingStyle; // To override view parameters.
|
||||
ForcedDrawingStyle fForcedStyle;
|
||||
// Available attributes - end snippet.
|
||||
};
|
||||
|
||||
#include "G4VisAttributes.icc"
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,80 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4VisAttributes.icc,v 2.1 1998/11/25 16:01:18 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
// John Allison 18th November 1996
|
||||
|
||||
inline G4bool G4VisAttributes::IsVisible () const {return fVisible;}
|
||||
|
||||
inline G4bool G4VisAttributes::IsDaughtersInvisible () const {
|
||||
return fDaughtersInvisible;
|
||||
}
|
||||
|
||||
inline const G4Colour& G4VisAttributes::GetColour () const {return fColour;}
|
||||
|
||||
inline const G4Color& G4VisAttributes::GetColor () const {return fColour;}
|
||||
|
||||
inline G4VisAttributes::LineStyle G4VisAttributes::GetLineStyle () const {
|
||||
return fLineStyle;
|
||||
}
|
||||
|
||||
inline G4double G4VisAttributes::GetLineWidth () const {
|
||||
return fLineWidth;
|
||||
}
|
||||
|
||||
inline G4bool G4VisAttributes::IsForceDrawingStyle () const {
|
||||
return fForceDrawingStyle;
|
||||
}
|
||||
inline G4VisAttributes::ForcedDrawingStyle
|
||||
G4VisAttributes::GetForcedDrawingStyle () const {
|
||||
return fForcedStyle;
|
||||
}
|
||||
|
||||
inline void G4VisAttributes::SetVisibility (G4bool v) {fVisible = v;}
|
||||
|
||||
inline void G4VisAttributes::SetDaughtersInvisible (G4bool v) {
|
||||
fDaughtersInvisible = v;
|
||||
}
|
||||
|
||||
inline void G4VisAttributes::SetColour (const G4Colour& colour) {
|
||||
fColour = colour;
|
||||
}
|
||||
|
||||
inline void G4VisAttributes::SetColor (const G4Color& color) {
|
||||
fColour = color;
|
||||
}
|
||||
|
||||
inline void G4VisAttributes::SetColour
|
||||
(G4double red, G4double green, G4double blue, G4double alpha) {
|
||||
fColour = G4Colour (red, green, blue, alpha);
|
||||
}
|
||||
|
||||
inline void G4VisAttributes::SetColor
|
||||
(G4double red, G4double green, G4double blue, G4double alpha) {
|
||||
fColour = G4Color (red, green, blue, alpha);
|
||||
}
|
||||
|
||||
inline void G4VisAttributes::SetLineStyle (G4VisAttributes::LineStyle style) {
|
||||
fLineStyle = style;
|
||||
}
|
||||
|
||||
inline void G4VisAttributes::SetLineWidth (G4double w) {
|
||||
fLineWidth = w;
|
||||
}
|
||||
|
||||
inline void G4VisAttributes::SetForceWireframe (G4bool force) {
|
||||
fForceDrawingStyle = force;
|
||||
fForcedStyle = G4VisAttributes::wireframe;
|
||||
}
|
||||
|
||||
inline void G4VisAttributes::SetForceSolid (G4bool force) {
|
||||
fForceDrawingStyle = force;
|
||||
fForcedStyle = G4VisAttributes::solid;
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4VisExtent.hh,v 2.0 1998/07/02 17:30:29 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
// A.Walkden 28/11/95
|
||||
// VisExtent.hh, header file to prototype Extent functions for use in
|
||||
// instantiating Visualisation windows with an appropriate field of
|
||||
// view for the object(s) being drawn.
|
||||
|
||||
#ifndef G4VISEXTENT_HH
|
||||
#define G4VISEXTENT_HH
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4Point3D.hh"
|
||||
|
||||
class G4VisExtent
|
||||
{
|
||||
public:
|
||||
G4VisExtent (G4double xmin = 0., G4double xmax = 0.,
|
||||
G4double ymin = 0., G4double ymax = 0.,
|
||||
G4double zmin = 0., G4double zmax = 0.);
|
||||
G4VisExtent (const G4Point3D& centre, G4double radius);
|
||||
~G4VisExtent ();
|
||||
G4double GetXmin () const;
|
||||
G4double GetXmax () const;
|
||||
G4double GetYmin () const;
|
||||
G4double GetYmax () const;
|
||||
G4double GetZmin () const;
|
||||
G4double GetZmax () const;
|
||||
G4Point3D GetExtentCentre () const;
|
||||
G4Point3D GetExtentCenter () const;
|
||||
G4double GetExtentRadius () const;
|
||||
void SetXmin (G4double xmin);
|
||||
void SetXmax (G4double xmax);
|
||||
void SetYmin (G4double ymin);
|
||||
void SetYmax (G4double ymax);
|
||||
void SetZmin (G4double zmin);
|
||||
void SetZmax (G4double zmax);
|
||||
friend ostream& operator << (ostream& os, const G4VisExtent& e);
|
||||
friend G4bool operator != (const G4VisExtent& e1, const G4VisExtent& e2);
|
||||
|
||||
private:
|
||||
G4double fXmin, fXmax, fYmin, fYmax, fZmin, fZmax;
|
||||
};
|
||||
|
||||
inline G4double G4VisExtent::GetXmin () const { return fXmin; }
|
||||
inline G4double G4VisExtent::GetXmax () const { return fXmax; }
|
||||
inline G4double G4VisExtent::GetYmin () const { return fYmin; }
|
||||
inline G4double G4VisExtent::GetYmax () const { return fYmax; }
|
||||
inline G4double G4VisExtent::GetZmin () const { return fZmin; }
|
||||
inline G4double G4VisExtent::GetZmax () const { return fZmax; }
|
||||
|
||||
inline G4Point3D G4VisExtent::GetExtentCenter () const {
|
||||
return GetExtentCentre ();
|
||||
}
|
||||
|
||||
inline void G4VisExtent::SetXmin (G4double xmin) {fXmin = xmin;}
|
||||
inline void G4VisExtent::SetXmax (G4double xmax) {fXmax = xmax;}
|
||||
inline void G4VisExtent::SetYmin (G4double ymin) {fYmin = ymin;}
|
||||
inline void G4VisExtent::SetYmax (G4double ymax) {fYmax = ymax;}
|
||||
inline void G4VisExtent::SetZmin (G4double zmin) {fZmin = zmin;}
|
||||
inline void G4VisExtent::SetZmax (G4double zmax) {fZmax = zmax;}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,48 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4Visible.hh,v 2.0 1998/07/02 17:30:32 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
// John Allison 30th October 1996
|
||||
// Base class for all things visible, i.e., which have Vis Attributes.
|
||||
|
||||
// Note: a null pointer implies no attributes. Under those circumstances
|
||||
// the visualization system is free to choose some.
|
||||
|
||||
#ifndef G4VISIBLE_HH
|
||||
#define G4VISIBLE_HH
|
||||
|
||||
class G4VisAttributes;
|
||||
class ostream;
|
||||
|
||||
class G4Visible {
|
||||
|
||||
friend ostream& operator << (ostream& os, const G4Visible& v);
|
||||
|
||||
public:
|
||||
|
||||
G4Visible ();
|
||||
G4Visible (const G4Visible& visible);
|
||||
G4Visible& operator = (const G4Visible& right);
|
||||
G4Visible (const G4VisAttributes* pVA);
|
||||
|
||||
const G4VisAttributes* GetVisAttributes () const;
|
||||
|
||||
void SetVisAttributes (const G4VisAttributes* pVA);
|
||||
void SetVisAttributes (const G4VisAttributes& VA);
|
||||
|
||||
protected:
|
||||
|
||||
const G4VisAttributes* fpVisAttributes;
|
||||
|
||||
};
|
||||
|
||||
#include "G4Visible.icc"
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,39 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4Visible.icc,v 2.0 1998/07/02 17:30:38 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
// John Allison 30th October 1996
|
||||
|
||||
inline G4Visible::G4Visible (): fpVisAttributes (0) {}
|
||||
|
||||
inline G4Visible::G4Visible (const G4Visible& visible):
|
||||
fpVisAttributes (visible.fpVisAttributes)
|
||||
{}
|
||||
|
||||
inline G4Visible& G4Visible::operator = (const G4Visible& right) {
|
||||
fpVisAttributes = right.fpVisAttributes;
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline G4Visible::G4Visible (const G4VisAttributes* pVA):
|
||||
fpVisAttributes (pVA)
|
||||
{}
|
||||
|
||||
inline const G4VisAttributes* G4Visible::GetVisAttributes () const {
|
||||
return fpVisAttributes;
|
||||
}
|
||||
|
||||
inline void G4Visible::SetVisAttributes (const G4VisAttributes* pVA) {
|
||||
fpVisAttributes = pVA;
|
||||
}
|
||||
|
||||
inline void G4Visible::SetVisAttributes (const G4VisAttributes& VA) {
|
||||
fpVisAttributes = &VA;
|
||||
}
|
||||
Reference in New Issue
Block a user