Geant4  10.03.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4tgrVolume Class Reference

#include <G4tgrVolume.hh>

Inheritance diagram for G4tgrVolume:
Collaboration diagram for G4tgrVolume:

Public Member Functions

 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
 

Protected Attributes

G4String theName
 
G4String theType
 
G4String theMaterialName
 
G4tgrSolidtheSolid
 
std::vector< G4tgrPlace * > thePlacements
 
G4bool theVisibility
 
G4doubletheRGBColour
 
G4bool theCheckOverlaps
 

Friends

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

Detailed Description

Definition at line 60 of file G4tgrVolume.hh.

Constructor & Destructor Documentation

G4tgrVolume::G4tgrVolume ( )

Definition at line 49 of file G4tgrVolume.cc.

50  : theName(""), theType(""),
51  theMaterialName(""), theSolid(0), theVisibility(false),
53 {
54 }
G4String theMaterialName
Definition: G4tgrVolume.hh:112
G4bool theVisibility
Definition: G4tgrVolume.hh:119
G4String theType
Definition: G4tgrVolume.hh:110
G4tgrSolid * theSolid
Definition: G4tgrVolume.hh:114
G4String theName
Definition: G4tgrVolume.hh:108
G4bool theCheckOverlaps
Definition: G4tgrVolume.hh:121
G4double * theRGBColour
Definition: G4tgrVolume.hh:120
G4tgrVolume::G4tgrVolume ( const std::vector< G4String > &  wl)

Definition at line 65 of file G4tgrVolume.cc.

66 {
67  theType = "VOLSimple";
68 
69  //---------- set name
70  theName = G4tgrUtils::GetString( wl[1] );
71 
72  theVisibility = 1;
73  theRGBColour = new G4double[4];
74  for(size_t ii=0; ii<4; ii++) { theRGBColour[ii] = -1.; }
75  theCheckOverlaps = 0;
76 
77  if( wl.size() != 4 )
78  {
79  //:VOLU tag to build a volume creating solid and material
80  //---------- set material name
81  theMaterialName = G4tgrUtils::GetString( wl[wl.size()-1] );
82 
83  //---------- create only vector<double> of theSolidParams
85 
86 #ifdef G4VERBOSE
88  {
89  G4cout << "Created from new solid: "
90  << *this << G4endl;
91  }
92 #endif
93  }
94  else
95  {
96  //:VOLU tag to build a volume assigning material to solid
97  //---------- set material name
99  theSolid = G4tgrVolumeMgr::GetInstance()->FindSolid( wl[2], true );
100 
101 #ifdef G4VERBOSE
103  {
104  G4cout << "Created from existing solid: "
105  << *this << G4endl;
106  }
107 #endif
108  }
109 }
G4tgrSolid * FindSolid(const G4String &name, G4bool exists=false)
G4String theMaterialName
Definition: G4tgrVolume.hh:112
G4bool theVisibility
Definition: G4tgrVolume.hh:119
G4String theType
Definition: G4tgrVolume.hh:110
G4GLOB_DLL std::ostream G4cout
static G4int GetVerboseLevel()
static G4tgrVolumeMgr * GetInstance()
G4tgrSolid * theSolid
Definition: G4tgrVolume.hh:114
G4String theName
Definition: G4tgrVolume.hh:108
static G4String GetString(const G4String &str)
Definition: G4tgrUtils.cc:180
G4tgrSolid * CreateSolid(const std::vector< G4String > &wl, G4bool bVOLUtag)
#define G4endl
Definition: G4ios.hh:61
G4bool theCheckOverlaps
Definition: G4tgrVolume.hh:121
double G4double
Definition: G4Types.hh:76
G4double * theRGBColour
Definition: G4tgrVolume.hh:120

Here is the call graph for this function:

G4tgrVolume::G4tgrVolume ( const G4tgrVolume vol)

Definition at line 113 of file G4tgrVolume.cc.

114 {
115  theName = vol.GetName();
116  theType = vol.GetType();
118  theSolid = vol.GetSolid();
121  theRGBColour = vol.GetRGBColour();
123 }
const std::vector< G4tgrPlace * > GetPlacements() const
Definition: G4tgrVolume.hh:95
G4bool GetCheckOverlaps() const
Definition: G4tgrVolume.hh:100
G4String theMaterialName
Definition: G4tgrVolume.hh:112
G4bool theVisibility
Definition: G4tgrVolume.hh:119
G4String theType
Definition: G4tgrVolume.hh:110
G4tgrSolid * GetSolid() const
Definition: G4tgrVolume.hh:92
std::vector< G4tgrPlace * > thePlacements
Definition: G4tgrVolume.hh:116
G4tgrSolid * theSolid
Definition: G4tgrVolume.hh:114
G4String theName
Definition: G4tgrVolume.hh:108
G4bool GetVisibility() const
Definition: G4tgrVolume.hh:96
const G4String & GetType() const
Definition: G4tgrVolume.hh:91
G4bool theCheckOverlaps
Definition: G4tgrVolume.hh:121
const G4String & GetName() const
Definition: G4tgrVolume.hh:89
G4double * theRGBColour
Definition: G4tgrVolume.hh:120
const G4String & GetMaterialName() const
Definition: G4tgrVolume.hh:93
G4double * GetRGBColour() const
Definition: G4tgrVolume.hh:98

Here is the call graph for this function:

G4tgrVolume::~G4tgrVolume ( )
virtual

Definition at line 58 of file G4tgrVolume.cc.

59 {
60  delete [] theRGBColour;
61 }
G4double * theRGBColour
Definition: G4tgrVolume.hh:120

Member Function Documentation

void G4tgrVolume::AddCheckOverlaps ( const std::vector< G4String > &  wl)

------— Set check overlaps

Definition at line 271 of file G4tgrVolume.cc.

272 {
273  //---------- Check for exact number of words read
274  G4tgrUtils::CheckWLsize( wl, 3, WLSIZE_GE, " G4tgrVolume::AddCheckOverlaps");
275 
278 
279 }
static void CheckWLsize(const std::vector< G4String > &wl, unsigned int nWCheck, WLSIZEtype st, const G4String &methodName)
Definition: G4tgrUtils.cc:475
G4bool theCheckOverlaps
Definition: G4tgrVolume.hh:121
static G4bool GetBool(const G4String &str)
Definition: G4tgrUtils.cc:448

Here is the call graph for this function:

G4tgrPlace * G4tgrVolume::AddPlace ( const std::vector< G4String > &  wl)
virtual

Reimplemented in G4tgrVolumeAssembly.

Definition at line 138 of file G4tgrVolume.cc.

139 {
140  //---------- Check for exact number of words read
141  G4tgrUtils::CheckWLsize( wl, 8, WLSIZE_EQ, " G4tgrVolume::AddPlace");
142  //---------- set G4tgrPlace
143  G4tgrPlaceSimple* pl = new G4tgrPlaceSimple( wl );
144  //---------- check that there is no previous placement in
145  // the same parent with the same copyNo
146  std::vector<G4tgrPlace*>::iterator ite;
147  for( ite = thePlacements.begin(); ite != thePlacements.end(); ite++)
148  {
149  if( ((*ite)->GetCopyNo() == pl->GetCopyNo())
150  && ((*ite)->GetParentName() == pl->GetParentName()) )
151  {
152  G4String ErrMessage = "Repeated placement. Volume "
153  + theName + " in " + pl->GetParentName();
154  G4Exception("G4tgrVolume::AddPlace()", "InvalidArgument",
155  FatalErrorInArgument, ErrMessage);
156  }
157  }
158 
159  pl->SetVolume( this );
160  thePlacements.push_back( pl );
161 
162 #ifdef G4VERBOSE
164  {
165  G4cout << " G4tgrVolume: New placement: " << thePlacements.size()
166  << " added for Volume " << theName
167  << " inside " << pl->GetParentName()
168  << " type " << pl->GetType() << G4endl;
169  }
170 #endif
171  //---------- register parent - child
173 
174  return pl;
175 }
const G4String & GetType() const
Definition: G4tgrPlace.hh:61
static void CheckWLsize(const std::vector< G4String > &wl, unsigned int nWCheck, WLSIZEtype st, const G4String &methodName)
Definition: G4tgrUtils.cc:475
tuple pl
Definition: readPY.py:5
G4GLOB_DLL std::ostream G4cout
void SetVolume(G4tgrVolume *vol)
Definition: G4tgrPlace.hh:62
static G4int GetVerboseLevel()
std::vector< G4tgrPlace * > thePlacements
Definition: G4tgrVolume.hh:116
static G4tgrVolumeMgr * GetInstance()
G4String theName
Definition: G4tgrVolume.hh:108
const G4String & GetParentName() const
Definition: G4tgrPlace.hh:58
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
unsigned int GetCopyNo() const
Definition: G4tgrPlace.hh:60
void RegisterParentChild(const G4String &parentName, const G4tgrPlace *pl)
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

Here is the caller graph for this function:

G4tgrPlaceParameterisation * G4tgrVolume::AddPlaceParam ( const std::vector< G4String > &  wl)

Definition at line 218 of file G4tgrVolume.cc.

219 {
220  //---------- set G4tgrPlaceParameterisation
222 
223  pl->SetVolume( this );
224  thePlacements.push_back( pl );
225 
226 #ifdef G4VERBOSE
228  {
229  G4cout << " G4tgrVolume: New placement Param: " << thePlacements.size()
230  << " added for Volume " << theName
231  << " inside " << pl->GetParentName() << G4endl;
232  }
233 #endif
234  //---------- register parent - child
236 
237  return pl;
238 }
tuple pl
Definition: readPY.py:5
G4GLOB_DLL std::ostream G4cout
void SetVolume(G4tgrVolume *vol)
Definition: G4tgrPlace.hh:62
static G4int GetVerboseLevel()
std::vector< G4tgrPlace * > thePlacements
Definition: G4tgrVolume.hh:116
static G4tgrVolumeMgr * GetInstance()
G4String theName
Definition: G4tgrVolume.hh:108
const G4String & GetParentName() const
Definition: G4tgrPlace.hh:58
void RegisterParentChild(const G4String &parentName, const G4tgrPlace *pl)
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

Here is the caller graph for this function:

G4tgrPlaceDivRep * G4tgrVolume::AddPlaceReplica ( const std::vector< G4String > &  wl)

Definition at line 180 of file G4tgrVolume.cc.

181 {
182  //---------- Check for exact number of words read
183  G4tgrUtils::CheckWLsize( wl, 6, WLSIZE_GE, " G4tgrVolume::AddPlaceReplica");
184  G4tgrUtils::CheckWLsize( wl, 7, WLSIZE_LE, " G4tgrVolume::AddPlaceReplica");
185 
186  if( (wl.size() == 7) && (G4tgrUtils::GetDouble(wl[6]) != 0.)
187  && (wl[3] != "PHI") )
188  {
189  G4Exception("G4tgrVolume::AddPlaceReplica",
190  "Offset set for replica not along PHI, it will not be used",
191  JustWarning,
192  G4String("Volume "+wl[1]+" in volume "+wl[2]).c_str());
193  }
194 
195  //---------- set G4tgrPlace
196  G4tgrPlaceDivRep* pl = new G4tgrPlaceDivRep( wl );
197  pl->SetType("PlaceReplica");
198  pl->SetVolume( this );
199  thePlacements.push_back( pl );
200 
201 #ifdef G4VERBOSE
203  {
204  G4cout << " G4tgrVolume: New placement replica: " << thePlacements.size()
205  << " added for Volume " << theName
206  << " inside " << pl->GetParentName() << G4endl;
207  }
208 #endif
209  //---------- register parent - child
211 
212  return pl;
213 }
static void CheckWLsize(const std::vector< G4String > &wl, unsigned int nWCheck, WLSIZEtype st, const G4String &methodName)
Definition: G4tgrUtils.cc:475
void SetType(const G4String &typ)
Definition: G4tgrPlace.hh:63
tuple pl
Definition: readPY.py:5
G4GLOB_DLL std::ostream G4cout
void SetVolume(G4tgrVolume *vol)
Definition: G4tgrPlace.hh:62
static G4int GetVerboseLevel()
std::vector< G4tgrPlace * > thePlacements
Definition: G4tgrVolume.hh:116
static G4tgrVolumeMgr * GetInstance()
G4String theName
Definition: G4tgrVolume.hh:108
const G4String & GetParentName() const
Definition: G4tgrPlace.hh:58
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 RegisterParentChild(const G4String &parentName, const G4tgrPlace *pl)
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

Here is the caller graph for this function:

void G4tgrVolume::AddRGBColour ( const std::vector< G4String > &  wl)

------— Set transparency

Definition at line 253 of file G4tgrVolume.cc.

254 {
255  //---------- Check for exact number of words read
256  G4tgrUtils::CheckWLsize( wl, 5, WLSIZE_GE, " G4tgrVolume::AddRGBColour");
257 
258  //---------- Set RGB colour
259  theRGBColour[0] = G4tgrUtils::GetDouble( wl[2] );
260  theRGBColour[1] = G4tgrUtils::GetDouble( wl[3] );
261  theRGBColour[2] = G4tgrUtils::GetDouble( wl[4] );
263  if( wl.size() == 6 )
264  {
265  theRGBColour[3] = G4tgrUtils::GetDouble( wl[5] );
266  }
267 }
static void CheckWLsize(const std::vector< G4String > &wl, unsigned int nWCheck, WLSIZEtype st, const G4String &methodName)
Definition: G4tgrUtils.cc:475
static G4double GetDouble(const G4String &str, G4double unitval=1.)
Definition: G4tgrUtils.cc:205
G4double * theRGBColour
Definition: G4tgrVolume.hh:120

Here is the call graph for this function:

void G4tgrVolume::AddVisibility ( const std::vector< G4String > &  wl)

Definition at line 242 of file G4tgrVolume.cc.

243 {
244  //---------- Check for exact number of words read
245  G4tgrUtils::CheckWLsize( wl, 3, WLSIZE_EQ, " G4tgrVolume::AddVisibility");
246 
247  //---------- Set visibility
249 }
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
static G4bool GetBool(const G4String &str)
Definition: G4tgrUtils.cc:448

Here is the call graph for this function:

G4bool G4tgrVolume::GetCheckOverlaps ( ) const
inline

Definition at line 100 of file G4tgrVolume.hh.

100 {return theCheckOverlaps;}
G4bool theCheckOverlaps
Definition: G4tgrVolume.hh:121

Here is the caller graph for this function:

G4double* G4tgrVolume::GetColour ( ) const
inline

Definition at line 97 of file G4tgrVolume.hh.

97 {return theRGBColour;}
G4double * theRGBColour
Definition: G4tgrVolume.hh:120

Here is the caller graph for this function:

const G4String& G4tgrVolume::GetMaterialName ( ) const
inline

Definition at line 93 of file G4tgrVolume.hh.

93 {return theMaterialName;}
G4String theMaterialName
Definition: G4tgrVolume.hh:112

Here is the caller graph for this function:

const G4String& G4tgrVolume::GetName ( void  ) const
inline

Definition at line 89 of file G4tgrVolume.hh.

89 {return theName;}
G4String theName
Definition: G4tgrVolume.hh:108

Here is the caller graph for this function:

const std::vector<G4tgrPlace*> G4tgrVolume::GetPlacements ( ) const
inline

Definition at line 95 of file G4tgrVolume.hh.

95 {return thePlacements;}
std::vector< G4tgrPlace * > thePlacements
Definition: G4tgrVolume.hh:116

Here is the caller graph for this function:

G4double* G4tgrVolume::GetRGBColour ( ) const
inline

Definition at line 98 of file G4tgrVolume.hh.

98 {return theRGBColour;}
G4double * theRGBColour
Definition: G4tgrVolume.hh:120

Here is the caller graph for this function:

G4tgrSolid* G4tgrVolume::GetSolid ( ) const
inline

Definition at line 92 of file G4tgrVolume.hh.

92 {return theSolid;}
G4tgrSolid * theSolid
Definition: G4tgrVolume.hh:114

Here is the caller graph for this function:

const G4String& G4tgrVolume::GetType ( ) const
inline

Definition at line 91 of file G4tgrVolume.hh.

91 {return theType;}
G4String theType
Definition: G4tgrVolume.hh:110

Here is the caller graph for this function:

G4bool G4tgrVolume::GetVisibility ( ) const
inline

Definition at line 96 of file G4tgrVolume.hh.

96 {return theVisibility;}
G4bool theVisibility
Definition: G4tgrVolume.hh:119

Here is the caller graph for this function:

G4tgrVolume * G4tgrVolume::GetVolume ( G4int  ii) const
virtual

Definition at line 127 of file G4tgrVolume.cc.

128 {
129  G4String ErrMessage = "Should only be called for composite solids... "
131  G4Exception("G4tgrVolume::GetVolume()", "InvalidCall",
132  FatalException, ErrMessage);
133  return 0;
134 }
static G4String ConvertToString(G4bool boolVal)
Definition: G4UIcommand.cc:372
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41

Here is the call graph for this function:

void G4tgrVolume::SetName ( const G4String name)
inline

Definition at line 90 of file G4tgrVolume.hh.

90 {theName = name;}
const XML_Char * name
Definition: expat.h:151
G4String theName
Definition: G4tgrVolume.hh:108

Friends And Related Function Documentation

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

Definition at line 283 of file G4tgrVolume.cc.

284 {
285  os << "G4tgrVolume= " << obj.theName << " Type= " << obj.theType
286  << " Material= " << obj.theMaterialName
287  << " Visibility " << obj.theVisibility
288  << " Colour " << (obj.theRGBColour)[0] << " "
289  << (obj.theRGBColour)[1] << " "
290  << (obj.theRGBColour)[2] << " "
291  << (obj.theRGBColour)[3] << " "
292  << " CheckOverlaps " << obj.theCheckOverlaps
293  << " N placements " << obj.thePlacements.size() << G4endl;
294 
295  return os;
296 }
G4String theMaterialName
Definition: G4tgrVolume.hh:112
G4bool theVisibility
Definition: G4tgrVolume.hh:119
G4String theType
Definition: G4tgrVolume.hh:110
std::vector< G4tgrPlace * > thePlacements
Definition: G4tgrVolume.hh:116
G4String theName
Definition: G4tgrVolume.hh:108
#define G4endl
Definition: G4ios.hh:61
G4bool theCheckOverlaps
Definition: G4tgrVolume.hh:121
G4double * theRGBColour
Definition: G4tgrVolume.hh:120

Member Data Documentation

G4bool G4tgrVolume::theCheckOverlaps
protected

Definition at line 121 of file G4tgrVolume.hh.

G4String G4tgrVolume::theMaterialName
protected

Definition at line 112 of file G4tgrVolume.hh.

G4String G4tgrVolume::theName
protected

Definition at line 108 of file G4tgrVolume.hh.

std::vector<G4tgrPlace*> G4tgrVolume::thePlacements
protected

Definition at line 116 of file G4tgrVolume.hh.

G4double* G4tgrVolume::theRGBColour
protected

Definition at line 120 of file G4tgrVolume.hh.

G4tgrSolid* G4tgrVolume::theSolid
protected

Definition at line 114 of file G4tgrVolume.hh.

G4String G4tgrVolume::theType
protected

Definition at line 110 of file G4tgrVolume.hh.

G4bool G4tgrVolume::theVisibility
protected

Definition at line 119 of file G4tgrVolume.hh.


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