Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4tgrVolumeDivision Class Reference

#include <G4tgrVolumeDivision.hh>

Inheritance diagram for G4tgrVolumeDivision:
Collaboration diagram for G4tgrVolumeDivision:

Public Member Functions

 G4tgrVolumeDivision (const std::vector< G4String > &wl)
 
 ~G4tgrVolumeDivision ()
 
G4tgrPlaceDivRepGetPlaceDivision ()
 
- Public Member Functions inherited from G4tgrVolume
 G4tgrVolume ()
 
 G4tgrVolume (const std::vector< G4String > &wl)
 
 G4tgrVolume (const G4tgrVolume &vol)
 
virtual ~G4tgrVolume ()
 
virtual G4tgrPlaceAddPlace (const std::vector< G4String > &wl)
 
G4tgrPlaceDivRepAddPlaceReplica (const std::vector< G4String > &wl)
 
G4tgrPlaceParameterisationAddPlaceParam (const std::vector< G4String > &wl)
 
void AddVisibility (const std::vector< G4String > &wl)
 
void AddRGBColour (const std::vector< G4String > &wl)
 
void AddCheckOverlaps (const std::vector< G4String > &wl)
 
const G4StringGetName () const
 
void SetName (const G4String &name)
 
const G4StringGetType () const
 
G4tgrSolidGetSolid () const
 
const G4StringGetMaterialName () const
 
const std::vector< G4tgrPlace * > GetPlacements () const
 
G4bool GetVisibility () const
 
G4doubleGetColour () const
 
G4doubleGetRGBColour () const
 
G4bool GetCheckOverlaps () const
 
virtual G4tgrVolumeGetVolume (G4int ii) const
 

Friends

std::ostream & operator<< (std::ostream &os, const G4tgrVolumeDivision &obj)
 

Additional Inherited Members

- Protected Attributes inherited from G4tgrVolume
G4String theName
 
G4String theType
 
G4String theMaterialName
 
G4tgrSolidtheSolid
 
std::vector< G4tgrPlace * > thePlacements
 
G4bool theVisibility
 
G4doubletheRGBColour
 
G4bool theCheckOverlaps
 

Detailed Description

Definition at line 59 of file G4tgrVolumeDivision.hh.

Constructor & Destructor Documentation

G4tgrVolumeDivision::G4tgrVolumeDivision ( const std::vector< G4String > &  wl)

Definition at line 53 of file G4tgrVolumeDivision.cc.

54 {
55  // wl: NAME PARENT MATERIAL AXIS STEP/NDIV OFFSET
56 
58  "G4tgrVolumeDivision::G4tgrVolumeDivision" );
60  "G4tgrVolumeDivision::G4tgrVolumeDivision" );
61 
62  theType = "VOLDivision";
63 
64  // :DIV NAME PARENT MATERIAL AXIS STEP/NDIV OFFSET
65 
66  //---------- set name
67  theName = G4tgrUtils::GetString( wl[1] );
68 
69  //---------- set the pointer to the parent DU
70  G4String parentName = G4tgrUtils::GetString(wl[2]);
71  G4tgrVolumeMgr::GetInstance()->FindVolume( parentName, 1); // check existance
72 
73  //---------- initialize G4tgrPlace
74  thePlaceDiv = new G4tgrPlaceDivRep();
75  thePlaceDiv->SetParentName( parentName );
76  thePlaceDiv->SetType("PlaceDivision");
77  thePlaceDiv->SetVolume( this );
78 
79  //---------- set material name
81 
82  //----- set axis of replica
83  thePlaceDiv->SetAxis( thePlaceDiv->BuildAxis(G4tgrUtils::GetString(wl[4])) );
84 
85  //------ register parent - child
86  G4tgrVolumeMgr::GetInstance()->RegisterParentChild( parentName, thePlaceDiv );
87 #ifdef G4VERBOSE
89  {
90  G4cout << " G4tgrVolumeDivision::G4tgrVolumeDivision() -"
91  << " Replica register parent - child " << G4endl;
92  }
93 #endif
94 
95  //---------- set if division is given by number of divisions of by width
96  G4String wl0 = wl[0];
97  for( size_t ii = 0; ii < wl0.length(); ii++ )
98  {
99  wl0[ii] = toupper( wl0[ii] );
100  }
101 
102  if( wl0 == ":DIV_NDIV" )
103  {
104  thePlaceDiv->SetDivType( DivByNdiv );
105  thePlaceDiv->SetNDiv( G4tgrUtils::GetInt( wl[5] ) );
106  if( wl.size() == 7 )
107  {
108  thePlaceDiv->SetOffset( G4tgrUtils::GetDouble( wl[6] )*mm );
109  }
110  }
111  else if( wl0 == ":DIV_WIDTH" )
112  {
113  thePlaceDiv->SetDivType( DivByWidth );
114  thePlaceDiv->SetWidth( G4tgrUtils::GetDouble( wl[5] )*mm );
115  if( wl.size() == 7 )
116  {
117  thePlaceDiv->SetOffset( G4tgrUtils::GetDouble( wl[6] )*mm );
118  }
119  }
120  else if( wl0 == ":DIV_NDIV_WIDTH" )
121  {
122  thePlaceDiv->SetDivType( DivByNdivAndWidth );
123  thePlaceDiv->SetNDiv( G4tgrUtils::GetInt( wl[5] ) );
124  thePlaceDiv->SetWidth( G4tgrUtils::GetDouble( wl[6] )*mm );
125  if( wl.size() == 8 )
126  {
127  thePlaceDiv->SetOffset( G4tgrUtils::GetDouble( wl[7] )*mm );
128  }
129  }
130  else
131  {
132  G4String ErrMessage = "Division type not supported, sorry... " + wl[0];
133  G4Exception("G4tgrVolumeDivision::G4tgrVolumeDivision()",
134  "NotImplemented", FatalException, ErrMessage);
135  }
136 
137  theVisibility = 1;
138  theRGBColour = new G4double[3];
139  for(size_t ii=0; ii<3; ii++) { theRGBColour[ii] = -1.; }
140 
141 #ifdef G4VERBOSE
143  {
144  G4cout << " Created " << *this << G4endl;
145  }
146 #endif
147 
148  theSolid = 0;
149 }
EAxis BuildAxis(const G4String &axisName)
static constexpr double mm
Definition: G4SIunits.hh:115
G4String theMaterialName
Definition: G4tgrVolume.hh:112
G4bool theVisibility
Definition: G4tgrVolume.hh:119
static void CheckWLsize(const std::vector< G4String > &wl, unsigned int nWCheck, WLSIZEtype st, const G4String &methodName)
Definition: G4tgrUtils.cc:475
void SetOffset(G4double offset)
void SetNDiv(G4int ndiv)
G4String theType
Definition: G4tgrVolume.hh:110
void SetType(const G4String &typ)
Definition: G4tgrPlace.hh:63
G4GLOB_DLL std::ostream G4cout
void SetVolume(G4tgrVolume *vol)
Definition: G4tgrPlace.hh:62
static G4int GetVerboseLevel()
void SetAxis(EAxis axis)
static G4tgrVolumeMgr * GetInstance()
G4tgrSolid * theSolid
Definition: G4tgrVolume.hh:114
G4String theName
Definition: G4tgrVolume.hh:108
void SetDivType(G4DivType typ)
G4tgrVolume * FindVolume(const G4String &volname, G4bool exists=false)
static G4int GetInt(const G4String &str)
Definition: G4tgrUtils.cc:430
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
static G4double GetDouble(const G4String &str, G4double unitval=1.)
Definition: G4tgrUtils.cc:205
void SetWidth(G4double width)
static G4String GetString(const G4String &str)
Definition: G4tgrUtils.cc:180
void RegisterParentChild(const G4String &parentName, const G4tgrPlace *pl)
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
G4double * theRGBColour
Definition: G4tgrVolume.hh:120
void SetParentName(const G4String &parentName)

Here is the call graph for this function:

G4tgrVolumeDivision::~G4tgrVolumeDivision ( )

Definition at line 48 of file G4tgrVolumeDivision.cc.

49 {
50 }

Member Function Documentation

G4tgrPlaceDivRep* G4tgrVolumeDivision::GetPlaceDivision ( )
inline

Definition at line 70 of file G4tgrVolumeDivision.hh.

70 { return thePlaceDiv; }

Here is the caller graph for this function:

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const G4tgrVolumeDivision obj 
)
friend

Definition at line 153 of file G4tgrVolumeDivision.cc.

154 {
155  os << "G4tgrVolumeDivision= " << obj.theName
156  << " Placement= " << *(obj.thePlaceDiv) << G4endl;
157 
158  return os;
159 }
G4String theName
Definition: G4tgrVolume.hh:108
#define G4endl
Definition: G4ios.hh:61

The documentation for this class was generated from the following files: