Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4PlacedSolid Class Reference

#include <G4PlacedSolid.hh>

Public Member Functions

 G4PlacedSolid ()
 
 G4PlacedSolid (G4BREPSolid *, G4Axis2Placement3D *=0)
 
 ~G4PlacedSolid ()
 
G4bool operator== (const G4PlacedSolid &ps) const
 
G4VSolidGetSolid () const
 
G4RotationMatrixGetRotation () const
 
G4ThreeVectorGetTranslation () const
 
std::ostream & StreamInfo (std::ostream &os) const
 

Detailed Description

Definition at line 47 of file G4PlacedSolid.hh.

Constructor & Destructor Documentation

◆ G4PlacedSolid() [1/2]

G4PlacedSolid::G4PlacedSolid ( )

Definition at line 39 of file G4PlacedSolid.cc.

40{
41 solid =0;
42 solidRotation =0;
43 solidTranslation =0;
44}

◆ G4PlacedSolid() [2/2]

G4PlacedSolid::G4PlacedSolid ( G4BREPSolid sol,
G4Axis2Placement3D p = 0 
)

Definition at line 47 of file G4PlacedSolid.cc.

48{
49 solid = sol;
50 if(p)
51 {
52 G4double x,y,z;
53 G4Point3D srfpoint = p->GetLocation();
54
55 x = srfpoint.x();
56 y = srfpoint.y();
57 z = srfpoint.z();
58 solidTranslation = new G4ThreeVector(x,y,z);
59
60 G4Vector3D tmpvec = p->GetAxis();
61 x = tmpvec.x();
62 y = tmpvec.y();
63 z = tmpvec.z();
64 G4ThreeVector x_axis(x,y,z);
65
68 if( (x<kCarTolerance)&&
69 (y<kCarTolerance)&&
70 (z<kCarTolerance) )
71 solidRotation=0;
72 else
73 {
74 tmpvec = p->GetRefDirection();
75 x = tmpvec.x();
76 y = tmpvec.y();
77 z = tmpvec.z();
78
79 G4ThreeVector y_axis(x,y,z);
80 solidRotation = new G4RotationMatrix();
81 solidRotation->rotateAxes(x_axis, y_axis, x_axis.cross(y_axis));
82 }
83 }
84 else
85 {
86 solidTranslation=0;
87 solidRotation=0;
88 }
89}
CLHEP::HepRotation G4RotationMatrix
CLHEP::Hep3Vector G4ThreeVector
double G4double
Definition: G4Types.hh:64
HepRotation & rotateAxes(const Hep3Vector &newX, const Hep3Vector &newY, const Hep3Vector &newZ)
Definition: Rotation.cc:105
G4Point3D GetLocation() const
G4Vector3D GetAxis() const
G4Vector3D GetRefDirection() const
G4double GetSurfaceTolerance() const
static G4GeometryTolerance * GetInstance()

◆ ~G4PlacedSolid()

G4PlacedSolid::~G4PlacedSolid ( )

Definition at line 92 of file G4PlacedSolid.cc.

93{
94 //delete solid;
95 if(solidRotation)
96 delete solidRotation;
97
98 if(solidTranslation)
99 delete solidTranslation;
100}

Member Function Documentation

◆ GetRotation()

G4RotationMatrix * G4PlacedSolid::GetRotation ( ) const
inline

◆ GetSolid()

G4VSolid * G4PlacedSolid::GetSolid ( ) const
inline

◆ GetTranslation()

G4ThreeVector * G4PlacedSolid::GetTranslation ( ) const
inline

◆ operator==()

G4bool G4PlacedSolid::operator== ( const G4PlacedSolid ps) const
inline

◆ StreamInfo()

std::ostream & G4PlacedSolid::StreamInfo ( std::ostream &  os) const

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