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

#include <G4tgrSolidBoolean.hh>

Inheritance diagram for G4tgrSolidBoolean:
Collaboration diagram for G4tgrSolidBoolean:

Public Member Functions

 G4tgrSolidBoolean (const std::vector< G4String > &wl)
 
 ~G4tgrSolidBoolean ()
 
const G4tgrSolidGetSolid (G4int ii) const
 
const G4StringGetRelativeRotMatName () const
 
G4ThreeVector GetRelativePlace () const
 
- Public Member Functions inherited from G4tgrSolid
 G4tgrSolid ()
 
 G4tgrSolid (const std::vector< G4String > &wl)
 
virtual ~G4tgrSolid ()
 
const G4StringGetName () const
 
const G4StringGetType () const
 
const std::vector< std::vector
< G4double > * > 
GetSolidParams () const
 

Friends

std::ostream & operator<< (std::ostream &, const G4tgrSolidBoolean &)
 

Additional Inherited Members

- Protected Attributes inherited from G4tgrSolid
G4String theName
 
G4String theType
 
std::vector< std::vector
< G4double > * > 
theSolidParams
 

Detailed Description

Definition at line 51 of file G4tgrSolidBoolean.hh.

Constructor & Destructor Documentation

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

Definition at line 44 of file G4tgrSolidBoolean.cc.

45 {
46  // :SOLID/:VOLU VOLU UNION/SUBS/INTERS VOLU1 VOLU2 ROTM POSX POSY POSZ
47 
48  if( wl.size() != 9 )
49  {
50  G4tgrUtils::DumpVS(wl, "G4tgrSolidBoolean::G4tgrSolidBoolean()");
51  G4Exception("G4tgrSolidBoolean::G4tgrSolidBoolean()", "InvalidInput",
52  FatalException, "Line read with less or more than 9 words.");
53  }
54 
55  //---------- Set name
56  theName = G4tgrUtils::GetString( wl[1] );
57 
59  const G4tgrSolid* sol1 = volmgr->FindSolid( G4tgrUtils::GetString( wl[3] ));
60  if( !sol1 )
61  {
62  sol1 = volmgr->FindVolume( G4tgrUtils::GetString( wl[3] ), 1)->GetSolid();
63  }
64  const G4tgrSolid* sol2 = volmgr->FindSolid( G4tgrUtils::GetString( wl[4] ));
65  if( !sol2 )
66  {
67  sol2 = volmgr->FindVolume( G4tgrUtils::GetString( wl[4] ), 1)->GetSolid();
68  }
69  theSolids.push_back( sol1 );
70  theSolids.push_back( sol2 );
71 
72  //---------- Set relative placement and rotation matrix
73  theRelativeRotMatName = G4tgrUtils::GetString( wl[5] );
74  theRelativePlace = G4ThreeVector( G4tgrUtils::GetDouble(wl[6]),
75  G4tgrUtils::GetDouble(wl[7]),
76  G4tgrUtils::GetDouble(wl[8]) );
77  //---------- Set solid type
78  G4String wl2 = wl[2];
79  for( size_t ii = 0; ii < wl2.length(); ii++ )
80  {
81  wl2[ii] = toupper( wl2[ii] );
82  }
83  theType = "Boolean_" + wl2;
84 
85 #ifdef G4VERBOSE
87  {
88  G4cout << " Created " << *this << G4endl;
89  }
90 #endif
91 
93 }
G4tgrSolid * FindSolid(const G4String &name, G4bool exists=false)
CLHEP::Hep3Vector G4ThreeVector
G4String theType
Definition: G4tgrSolid.hh:75
G4tgrSolid * GetSolid() const
Definition: G4tgrVolume.hh:92
G4GLOB_DLL std::ostream G4cout
static G4int GetVerboseLevel()
static G4tgrVolumeMgr * GetInstance()
G4tgrVolume * FindVolume(const G4String &volname, G4bool exists=false)
void RegisterMe(G4tgrSolid *vol)
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
static void DumpVS(const std::vector< G4String > &wl, const char *msg)
Definition: G4tgrUtils.cc:158
static G4String GetString(const G4String &str)
Definition: G4tgrUtils.cc:180
G4String theName
Definition: G4tgrSolid.hh:73
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

G4tgrSolidBoolean::~G4tgrSolidBoolean ( )

Definition at line 97 of file G4tgrSolidBoolean.cc.

98 {
99 }

Member Function Documentation

G4ThreeVector G4tgrSolidBoolean::GetRelativePlace ( ) const
virtual

Reimplemented from G4tgrSolid.

Definition at line 110 of file G4tgrSolidBoolean.cc.

111 {
112  return theRelativePlace;
113 }

Here is the caller graph for this function:

const G4String & G4tgrSolidBoolean::GetRelativeRotMatName ( ) const
virtual

Reimplemented from G4tgrSolid.

Definition at line 103 of file G4tgrSolidBoolean.cc.

104 {
105  return theRelativeRotMatName;
106 }
const G4tgrSolid * G4tgrSolidBoolean::GetSolid ( G4int  ii) const
inline

Definition at line 82 of file G4tgrSolidBoolean.hh.

83 {
84  if((ii != 0) && (ii != 1))
85  {
86  std::ostringstream message;
87  message << "Only two G4tgrSolids (0,1) possible ! Asking for... "
88  << ii;
89  G4Exception("G4tgrSolidBoolean::GetSolid()", "InvalidInput",
90  FatalException, message);
91  }
92  return theSolids[ii];
93 }
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:

Here is the caller graph for this function:

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const G4tgrSolidBoolean sol 
)
friend

Definition at line 117 of file G4tgrSolidBoolean.cc.

118 {
119  os << "G4tgrSolidBoolean= " << sol.theName << " of type " << sol.theType
120  << " PARAMS: ";
121  if( sol.theSolidParams.size() != 0 )
122  {
123  std::vector<G4double> solpar = *(sol.theSolidParams[0]);
124  for( size_t ii = 0; ii < solpar.size(); ii++)
125  {
126  os << solpar[ii] << " " ;
127  }
128  }
129  os << G4endl;
130 
131  return os;
132 }
G4String theType
Definition: G4tgrSolid.hh:75
G4String theName
Definition: G4tgrSolid.hh:73
#define G4endl
Definition: G4ios.hh:61

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