#include <G4tgrSolidBoolean.hh>
Inheritance diagram for G4tgrSolidBoolean:
Public Member Functions | |
G4tgrSolidBoolean (const std::vector< G4String > &wl) | |
~G4tgrSolidBoolean () | |
const G4tgrSolid * | GetSolid (G4int ii) const |
const G4String & | GetRelativeRotMatName () const |
G4ThreeVector | GetRelativePlace () const |
Friends | |
std::ostream & | operator<< (std::ostream &, const G4tgrSolidBoolean &) |
Definition at line 51 of file G4tgrSolidBoolean.hh.
G4tgrSolidBoolean::G4tgrSolidBoolean | ( | const std::vector< G4String > & | wl | ) |
Definition at line 44 of file G4tgrSolidBoolean.cc.
References G4tgrUtils::DumpVS(), FatalException, G4tgrVolumeMgr::FindSolid(), G4tgrVolumeMgr::FindVolume(), G4cout, G4endl, G4Exception(), G4tgrUtils::GetDouble(), G4tgrVolumeMgr::GetInstance(), G4tgrVolume::GetSolid(), G4tgrUtils::GetString(), G4tgrMessenger::GetVerboseLevel(), G4tgrVolumeMgr::RegisterMe(), G4tgrSolid::theName, and G4tgrSolid::theType.
00045 { 00046 // :SOLID/:VOLU VOLU UNION/SUBS/INTERS VOLU1 VOLU2 ROTM POSX POSY POSZ 00047 00048 if( wl.size() != 9 ) 00049 { 00050 G4tgrUtils::DumpVS(wl, "G4tgrSolidBoolean::G4tgrSolidBoolean()"); 00051 G4Exception("G4tgrSolidBoolean::G4tgrSolidBoolean()", "InvalidInput", 00052 FatalException, "Line read with less or more than 9 words."); 00053 } 00054 00055 //---------- Set name 00056 theName = G4tgrUtils::GetString( wl[1] ); 00057 00058 G4tgrVolumeMgr* volmgr = G4tgrVolumeMgr::GetInstance(); 00059 const G4tgrSolid* sol1 = volmgr->FindSolid( G4tgrUtils::GetString( wl[3] )); 00060 if( !sol1 ) 00061 { 00062 sol1 = volmgr->FindVolume( G4tgrUtils::GetString( wl[3] ), 1)->GetSolid(); 00063 } 00064 const G4tgrSolid* sol2 = volmgr->FindSolid( G4tgrUtils::GetString( wl[4] )); 00065 if( !sol2 ) 00066 { 00067 sol2 = volmgr->FindVolume( G4tgrUtils::GetString( wl[4] ), 1)->GetSolid(); 00068 } 00069 theSolids.push_back( sol1 ); 00070 theSolids.push_back( sol2 ); 00071 00072 //---------- Set relative placement and rotation matrix 00073 theRelativeRotMatName = G4tgrUtils::GetString( wl[5] ); 00074 theRelativePlace = G4ThreeVector( G4tgrUtils::GetDouble(wl[6]), 00075 G4tgrUtils::GetDouble(wl[7]), 00076 G4tgrUtils::GetDouble(wl[8]) ); 00077 //---------- Set solid type 00078 G4String wl2 = wl[2]; 00079 for( size_t ii = 0; ii < wl2.length(); ii++ ) 00080 { 00081 wl2[ii] = toupper( wl2[ii] ); 00082 } 00083 theType = "Boolean_" + wl2; 00084 00085 #ifdef G4VERBOSE 00086 if( G4tgrMessenger::GetVerboseLevel() >= 1 ) 00087 { 00088 G4cout << " Created " << *this << G4endl; 00089 } 00090 #endif 00091 00092 G4tgrVolumeMgr::GetInstance()->RegisterMe( this ); 00093 }
G4tgrSolidBoolean::~G4tgrSolidBoolean | ( | ) |
G4ThreeVector G4tgrSolidBoolean::GetRelativePlace | ( | ) | const [virtual] |
const G4String & G4tgrSolidBoolean::GetRelativeRotMatName | ( | ) | const [virtual] |
const G4tgrSolid * G4tgrSolidBoolean::GetSolid | ( | G4int | ii | ) | const [inline] |
Definition at line 82 of file G4tgrSolidBoolean.hh.
References FatalException, and G4Exception().
00083 { 00084 if((ii != 0) && (ii != 1)) 00085 { 00086 std::ostringstream message; 00087 message << "Only two G4tgrSolids (0,1) possible ! Asking for... " 00088 << ii; 00089 G4Exception("G4tgrSolidBoolean::GetSolid()", "InvalidInput", 00090 FatalException, message); 00091 } 00092 return theSolids[ii]; 00093 }
std::ostream& operator<< | ( | std::ostream & | os, | |
const G4tgrSolidBoolean & | sol | |||
) | [friend] |
Definition at line 117 of file G4tgrSolidBoolean.cc.
00118 { 00119 os << "G4tgrSolidBoolean= " << sol.theName << " of type " << sol.theType 00120 << " PARAMS: "; 00121 if( sol.theSolidParams.size() != 0 ) 00122 { 00123 std::vector<G4double> solpar = *(sol.theSolidParams[0]); 00124 for( size_t ii = 0; ii < solpar.size(); ii++) 00125 { 00126 os << solpar[ii] << " " ; 00127 } 00128 } 00129 os << G4endl; 00130 00131 return os; 00132 }