#include <G4tgrVolumeDivision.hh>
Inheritance diagram for G4tgrVolumeDivision:
Public Member Functions | |
G4tgrVolumeDivision (const std::vector< G4String > &wl) | |
~G4tgrVolumeDivision () | |
G4tgrPlaceDivRep * | GetPlaceDivision () |
Friends | |
std::ostream & | operator<< (std::ostream &os, const G4tgrVolumeDivision &obj) |
Definition at line 59 of file G4tgrVolumeDivision.hh.
G4tgrVolumeDivision::G4tgrVolumeDivision | ( | const std::vector< G4String > & | wl | ) |
Definition at line 53 of file G4tgrVolumeDivision.cc.
References G4tgrPlaceDivRep::BuildAxis(), G4tgrUtils::CheckWLsize(), DivByNdiv, DivByNdivAndWidth, DivByWidth, FatalException, G4tgrVolumeMgr::FindVolume(), G4cout, G4endl, G4Exception(), G4tgrUtils::GetDouble(), G4tgrVolumeMgr::GetInstance(), G4tgrUtils::GetInt(), G4tgrUtils::GetString(), G4tgrMessenger::GetVerboseLevel(), G4tgrVolumeMgr::RegisterParentChild(), G4tgrPlaceDivRep::SetAxis(), G4tgrPlaceDivRep::SetDivType(), G4tgrPlaceDivRep::SetNDiv(), G4tgrPlaceDivRep::SetOffset(), G4tgrPlaceDivRep::SetParentName(), G4tgrPlace::SetType(), G4tgrPlace::SetVolume(), G4tgrPlaceDivRep::SetWidth(), G4tgrVolume::theMaterialName, G4tgrVolume::theName, G4tgrVolume::theRGBColour, G4tgrVolume::theSolid, G4tgrVolume::theType, G4tgrVolume::theVisibility, WLSIZE_GE, and WLSIZE_LE.
00054 { 00055 // wl: NAME PARENT MATERIAL AXIS STEP/NDIV OFFSET 00056 00057 G4tgrUtils::CheckWLsize( wl, 6, WLSIZE_GE, 00058 "G4tgrVolumeDivision::G4tgrVolumeDivision" ); 00059 G4tgrUtils::CheckWLsize( wl, 8, WLSIZE_LE, 00060 "G4tgrVolumeDivision::G4tgrVolumeDivision" ); 00061 00062 theType = "VOLDivision"; 00063 00064 // :DIV NAME PARENT MATERIAL AXIS STEP/NDIV OFFSET 00065 00066 //---------- set name 00067 theName = G4tgrUtils::GetString( wl[1] ); 00068 00069 //---------- set the pointer to the parent DU 00070 G4String parentName = G4tgrUtils::GetString(wl[2]); 00071 G4tgrVolumeMgr::GetInstance()->FindVolume( parentName, 1); // check existance 00072 00073 //---------- initialize G4tgrPlace 00074 thePlaceDiv = new G4tgrPlaceDivRep(); 00075 thePlaceDiv->SetParentName( parentName ); 00076 thePlaceDiv->SetType("PlaceDivision"); 00077 thePlaceDiv->SetVolume( this ); 00078 00079 //---------- set material name 00080 theMaterialName = G4tgrUtils::GetString( wl[3] ); 00081 00082 //----- set axis of replica 00083 thePlaceDiv->SetAxis( thePlaceDiv->BuildAxis(G4tgrUtils::GetString(wl[4])) ); 00084 00085 //------ register parent - child 00086 G4tgrVolumeMgr::GetInstance()->RegisterParentChild( parentName, thePlaceDiv ); 00087 #ifdef G4VERBOSE 00088 if( G4tgrMessenger::GetVerboseLevel() >= 3 ) 00089 { 00090 G4cout << " G4tgrVolumeDivision::G4tgrVolumeDivision() -" 00091 << " Replica register parent - child " << G4endl; 00092 } 00093 #endif 00094 00095 //---------- set if division is given by number of divisions of by width 00096 G4String wl0 = wl[0]; 00097 for( size_t ii = 0; ii < wl0.length(); ii++ ) 00098 { 00099 wl0[ii] = toupper( wl0[ii] ); 00100 } 00101 00102 if( wl0 == ":DIV_NDIV" ) 00103 { 00104 thePlaceDiv->SetDivType( DivByNdiv ); 00105 thePlaceDiv->SetNDiv( G4tgrUtils::GetInt( wl[5] ) ); 00106 if( wl.size() == 7 ) 00107 { 00108 thePlaceDiv->SetOffset( G4tgrUtils::GetDouble( wl[6] )*mm ); 00109 } 00110 } 00111 else if( wl0 == ":DIV_WIDTH" ) 00112 { 00113 thePlaceDiv->SetDivType( DivByWidth ); 00114 thePlaceDiv->SetWidth( G4tgrUtils::GetDouble( wl[5] )*mm ); 00115 if( wl.size() == 7 ) 00116 { 00117 thePlaceDiv->SetOffset( G4tgrUtils::GetDouble( wl[6] )*mm ); 00118 } 00119 } 00120 else if( wl0 == ":DIV_NDIV_WIDTH" ) 00121 { 00122 thePlaceDiv->SetDivType( DivByNdivAndWidth ); 00123 thePlaceDiv->SetNDiv( G4tgrUtils::GetInt( wl[5] ) ); 00124 thePlaceDiv->SetWidth( G4tgrUtils::GetDouble( wl[6] )*mm ); 00125 if( wl.size() == 8 ) 00126 { 00127 thePlaceDiv->SetOffset( G4tgrUtils::GetDouble( wl[7] )*mm ); 00128 } 00129 } 00130 else 00131 { 00132 G4String ErrMessage = "Division type not supported, sorry... " + wl[0]; 00133 G4Exception("G4tgrVolumeDivision::G4tgrVolumeDivision()", 00134 "NotImplemented", FatalException, ErrMessage); 00135 } 00136 00137 theVisibility = 1; 00138 theRGBColour = new G4double[3]; 00139 for(size_t ii=0; ii<3; ii++) { theRGBColour[ii] = -1.; } 00140 00141 #ifdef G4VERBOSE 00142 if( G4tgrMessenger::GetVerboseLevel() >= 1 ) 00143 { 00144 G4cout << " Created " << *this << G4endl; 00145 } 00146 #endif 00147 00148 theSolid = 0; 00149 }
G4tgrVolumeDivision::~G4tgrVolumeDivision | ( | ) |
G4tgrPlaceDivRep* G4tgrVolumeDivision::GetPlaceDivision | ( | ) | [inline] |
std::ostream& operator<< | ( | std::ostream & | os, | |
const G4tgrVolumeDivision & | obj | |||
) | [friend] |
Definition at line 153 of file G4tgrVolumeDivision.cc.
00154 { 00155 os << "G4tgrVolumeDivision= " << obj.theName 00156 << " Placement= " << *(obj.thePlaceDiv) << G4endl; 00157 00158 return os; 00159 }