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::G4PlacedSolid (  ) 

Definition at line 39 of file G4PlacedSolid.cc.

00040 {
00041   solid =0;
00042   solidRotation =0;
00043   solidTranslation =0;
00044 }

G4PlacedSolid::G4PlacedSolid ( G4BREPSolid ,
G4Axis2Placement3D = 0 
)

Definition at line 47 of file G4PlacedSolid.cc.

References G4Axis2Placement3D::GetAxis(), G4GeometryTolerance::GetInstance(), G4Axis2Placement3D::GetLocation(), G4Axis2Placement3D::GetRefDirection(), and G4GeometryTolerance::GetSurfaceTolerance().

00048 {
00049   solid = sol;
00050   if(p)
00051   {
00052     G4double x,y,z;
00053     G4Point3D srfpoint = p->GetLocation();
00054     
00055     x = srfpoint.x();
00056     y = srfpoint.y();
00057     z = srfpoint.z();
00058     solidTranslation = new G4ThreeVector(x,y,z);
00059     
00060     G4Vector3D tmpvec = p->GetAxis();
00061     x = tmpvec.x();
00062     y = tmpvec.y();
00063     z = tmpvec.z();
00064     G4ThreeVector x_axis(x,y,z);
00065 
00066     G4double kCarTolerance = G4GeometryTolerance::GetInstance()
00067                              ->GetSurfaceTolerance();
00068     if( (x<kCarTolerance)&&
00069         (y<kCarTolerance)&&
00070         (z<kCarTolerance)   )
00071       solidRotation=0;
00072     else
00073     {
00074       tmpvec = p->GetRefDirection();
00075       x = tmpvec.x();
00076       y = tmpvec.y();
00077       z = tmpvec.z();
00078 
00079       G4ThreeVector y_axis(x,y,z);
00080       solidRotation = new G4RotationMatrix();
00081       solidRotation->rotateAxes(x_axis, y_axis, x_axis.cross(y_axis));
00082     }
00083   }
00084   else
00085   {
00086     solidTranslation=0;
00087     solidRotation=0;
00088   }
00089 }

G4PlacedSolid::~G4PlacedSolid (  ) 

Definition at line 92 of file G4PlacedSolid.cc.

00093 {
00094   //delete solid;
00095   if(solidRotation)
00096     delete solidRotation;
00097   
00098   if(solidTranslation)
00099     delete solidTranslation;
00100 }


Member Function Documentation

G4RotationMatrix * G4PlacedSolid::GetRotation (  )  const [inline]

Definition at line 50 of file G4PlacedSolid.icc.

00051 {
00052   return solidRotation;
00053 }

G4VSolid * G4PlacedSolid::GetSolid (  )  const [inline]

Definition at line 44 of file G4PlacedSolid.icc.

00045 {
00046   return solid;
00047 }

G4ThreeVector * G4PlacedSolid::GetTranslation (  )  const [inline]

Definition at line 56 of file G4PlacedSolid.icc.

00057 {
00058   return solidTranslation;
00059 } 

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

Definition at line 38 of file G4PlacedSolid.icc.

00039 {
00040   return (this==&ps) ? true : false; 
00041 }

std::ostream & G4PlacedSolid::StreamInfo ( std::ostream &  os  )  const [inline]

Definition at line 62 of file G4PlacedSolid.icc.

References G4BREPSolid::StreamInfo().

00063 {
00064   return solid->StreamInfo( os );
00065 }


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