G4tgrVolumeAssembly Class Reference

#include <G4tgrVolumeAssembly.hh>

Inheritance diagram for G4tgrVolumeAssembly:

G4tgrVolume

Public Member Functions

 G4tgrVolumeAssembly ()
 G4tgrVolumeAssembly (const std::vector< G4String > &wl)
 ~G4tgrVolumeAssembly ()
virtual G4tgrPlaceAddPlace (const std::vector< G4String > &wl)
const G4StringGetComponentName (G4int ii) const
const G4StringGetComponentRM (G4int ii) const
G4ThreeVector GetComponentPos (G4int ii) const
G4int GetNoComponents () const

Protected Attributes

std::vector< G4StringtheComponentNames
std::vector< G4StringtheComponentRMs
std::vector< G4ThreeVectortheComponentPos

Friends

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

Detailed Description

Definition at line 47 of file G4tgrVolumeAssembly.hh.


Constructor & Destructor Documentation

G4tgrVolumeAssembly::G4tgrVolumeAssembly (  ) 

Definition at line 46 of file G4tgrVolumeAssembly.cc.

00047 {
00048 }

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

Definition at line 58 of file G4tgrVolumeAssembly.cc.

References G4tgrUtils::CheckWLsize(), G4cout, G4endl, G4tgrUtils::GetDouble(), G4tgrUtils::GetInt(), G4tgrUtils::GetString(), G4tgrMessenger::GetVerboseLevel(), theComponentNames, theComponentPos, theComponentRMs, G4tgrVolume::theName, G4tgrVolume::theRGBColour, G4tgrVolume::theSolid, G4tgrVolume::theType, G4tgrVolume::theVisibility, and WLSIZE_GE.

00059 {
00060   theType = "VOLAssembly";
00061 
00062   //---------- set name 
00063   theName = G4tgrUtils::GetString( wl[1] ); 
00064 
00065   G4int nVol = G4tgrUtils::GetInt( wl[2] ); 
00066 
00067   G4tgrUtils::CheckWLsize( wl, 3+nVol*5, WLSIZE_GE,
00068                            "G4tgrVolumeAssembly::G4tgrVolumeAssembly" );
00069 
00070 
00071   for(G4int ii=0; ii<nVol*5; ii+=5)
00072   {
00073 #ifdef G4VERBOSE
00074     if( G4tgrMessenger::GetVerboseLevel() >= 2 )
00075     {
00076          G4cout << " G4tgrVolumeAssembly::G4tgrVolumeAssembly() -"
00077                 << " Adding component: " << ii << " - " << wl[ii+3] << G4endl;
00078     }
00079 #endif
00080     theComponentNames.push_back(G4tgrUtils::GetString( wl[3+ii+0]));
00081     theComponentRMs.push_back(G4tgrUtils::GetString( wl[3+ii+1]));
00082     theComponentPos.push_back(G4ThreeVector(G4tgrUtils::GetDouble(wl[3+ii+2]),
00083                                             G4tgrUtils::GetDouble(wl[3+ii+3]),
00084                                             G4tgrUtils::GetDouble(wl[3+ii+4])));
00085   }
00086   theVisibility = 1;
00087   theRGBColour = new G4double[4];
00088   for (size_t ii=0; ii<4; ii++)  { theRGBColour[ii] = -1.; }
00089 
00090   theSolid = 0;
00091 
00092 #ifdef G4VERBOSE
00093   if( G4tgrMessenger::GetVerboseLevel() >= 1 )
00094   {
00095      G4cout << " Created " << *this << G4endl;
00096   }
00097 #endif
00098 
00099 }

G4tgrVolumeAssembly::~G4tgrVolumeAssembly (  ) 

Definition at line 52 of file G4tgrVolumeAssembly.cc.

00053 {
00054 }


Member Function Documentation

G4tgrPlace * G4tgrVolumeAssembly::AddPlace ( const std::vector< G4String > &  wl  )  [virtual]

Reimplemented from G4tgrVolume.

Definition at line 103 of file G4tgrVolumeAssembly.cc.

References G4tgrUtils::CheckWLsize(), G4cout, G4endl, G4tgrVolumeMgr::GetInstance(), G4tgrPlace::GetParentName(), G4tgrPlace::GetType(), G4tgrMessenger::GetVerboseLevel(), G4tgrVolumeMgr::RegisterParentChild(), G4tgrPlace::SetVolume(), G4tgrVolume::theName, G4tgrVolume::thePlacements, and WLSIZE_EQ.

00104 {
00105   //---------- Check for exact number of words read 
00106   G4tgrUtils::CheckWLsize( wl, 7, WLSIZE_EQ, " G4tgrVolumeAssembly::AddPlace");
00107 
00108   //---------- set G4tgrPlace 
00109   G4tgrPlaceSimple* pl = new G4tgrPlaceSimple( wl );
00110 
00111   pl->SetVolume( this );
00112   thePlacements.push_back( pl ); 
00113 
00114 #ifdef G4VERBOSE
00115   if( G4tgrMessenger::GetVerboseLevel() >= 2 )
00116   {
00117     G4cout << "   New placement: " << thePlacements.size()
00118            << " added for Volume " << theName
00119            << " inside " << pl->GetParentName()
00120            << " type " << pl->GetType() << G4endl;
00121   }
00122 #endif
00123   //---------- register parent - child 
00124   G4tgrVolumeMgr::GetInstance()->RegisterParentChild( pl->GetParentName(), pl );
00125 
00126   return pl;
00127 }

const G4String& G4tgrVolumeAssembly::GetComponentName ( G4int  ii  )  const [inline]

Definition at line 58 of file G4tgrVolumeAssembly.hh.

References theComponentNames.

00059       { return theComponentNames[ii]; }

G4ThreeVector G4tgrVolumeAssembly::GetComponentPos ( G4int  ii  )  const [inline]

Definition at line 62 of file G4tgrVolumeAssembly.hh.

References theComponentPos.

00063       { return theComponentPos[ii]; }

const G4String& G4tgrVolumeAssembly::GetComponentRM ( G4int  ii  )  const [inline]

Definition at line 60 of file G4tgrVolumeAssembly.hh.

References theComponentRMs.

00061       { return theComponentRMs[ii]; }

G4int G4tgrVolumeAssembly::GetNoComponents (  )  const [inline]

Definition at line 64 of file G4tgrVolumeAssembly.hh.

References theComponentNames.

00065       { return theComponentNames.size(); }


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const G4tgrVolumeAssembly obj 
) [friend]

Definition at line 131 of file G4tgrVolumeAssembly.cc.

00132 {
00133   os << "G4tgrVolumeAssembly= " << obj.theName;
00134 
00135   for( size_t ii = 0; ii < obj.theComponentNames.size(); ii++ )
00136   {
00137     os << obj.theComponentNames[ii] << " RotMatName= "
00138        << obj.theComponentRMs[ii] << " Position= "
00139        << obj.theComponentPos[ii].x() << " "
00140        << obj.theComponentPos[ii].y() << " "
00141        << obj.theComponentPos[ii].z();
00142   }
00143   os << G4endl;
00144 
00145   return os;
00146 }


Field Documentation

std::vector<G4String> G4tgrVolumeAssembly::theComponentNames [protected]

Definition at line 71 of file G4tgrVolumeAssembly.hh.

Referenced by G4tgrVolumeAssembly(), GetComponentName(), GetNoComponents(), and operator<<().

std::vector<G4ThreeVector> G4tgrVolumeAssembly::theComponentPos [protected]

Definition at line 73 of file G4tgrVolumeAssembly.hh.

Referenced by G4tgrVolumeAssembly(), GetComponentPos(), and operator<<().

std::vector<G4String> G4tgrVolumeAssembly::theComponentRMs [protected]

Definition at line 72 of file G4tgrVolumeAssembly.hh.

Referenced by G4tgrVolumeAssembly(), GetComponentRM(), and operator<<().


The documentation for this class was generated from the following files:
Generated on Mon May 27 17:53:31 2013 for Geant4 by  doxygen 1.4.7