Import Geant4 3.0.0 source tree
This commit is contained in:
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4BooleanSolid.cc,v 1.3 2000/04/27 09:59:39 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: G4BooleanSolid.cc,v 1.4 2000/11/20 17:56:01 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
// Implementation for the abstract base class for solids created by boolean
|
||||
// operations between other solids
|
||||
@@ -84,7 +84,7 @@ G4BooleanSolid::~G4BooleanSolid()
|
||||
// If the solid is not a "Boolean", return 0
|
||||
const G4VSolid* G4BooleanSolid::GetConstituentSolid(G4int no) const
|
||||
{
|
||||
const G4VSolid* subSolid;
|
||||
const G4VSolid* subSolid=0;
|
||||
if( no == 0 )
|
||||
subSolid = fPtrSolidA;
|
||||
else if( no == 1 )
|
||||
@@ -97,7 +97,7 @@ const G4VSolid* G4BooleanSolid::GetConstituentSolid(G4int no) const
|
||||
|
||||
G4VSolid* G4BooleanSolid::GetConstituentSolid(G4int no)
|
||||
{
|
||||
G4VSolid* subSolid;
|
||||
G4VSolid* subSolid=0;
|
||||
if( no == 0 )
|
||||
subSolid = fPtrSolidA;
|
||||
else if( no == 1 )
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4DisplacedSolid.cc,v 1.11 2000/04/27 09:59:39 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: G4DisplacedSolid.cc,v 1.13 2000/11/22 15:19:20 grichine Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
// Implementation for G4DisplacedSolid class for boolean
|
||||
// operations between other solids
|
||||
@@ -15,6 +15,7 @@
|
||||
//
|
||||
// 28.10.98 V.Grichine, creation according J. Apostolakis's recommendations
|
||||
// 14.11.99 V.Grichine, modifications in CalculateExtent(...) method
|
||||
// 22.11.00 V.Grichine, new set methods for matrix/vectors
|
||||
|
||||
#include "G4DisplacedSolid.hh"
|
||||
|
||||
@@ -90,6 +91,11 @@ G4DisplacedSolid::~G4DisplacedSolid()
|
||||
}
|
||||
}
|
||||
|
||||
G4GeometryType G4DisplacedSolid::GetEntityType() const
|
||||
{
|
||||
return G4String("G4DisplacedSolid");
|
||||
}
|
||||
|
||||
const G4DisplacedSolid* G4DisplacedSolid::GetDisplacedSolidPtr() const
|
||||
{ return this; }
|
||||
|
||||
@@ -97,42 +103,86 @@ const G4DisplacedSolid* G4DisplacedSolid::GetDisplacedSolidPtr() const
|
||||
{ return this; }
|
||||
|
||||
G4VSolid* G4DisplacedSolid::GetConstituentMovedSolid() const
|
||||
{ return fPtrSolid; }
|
||||
{
|
||||
return fPtrSolid;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
G4AffineTransform G4DisplacedSolid::GetTransform() const
|
||||
{
|
||||
G4AffineTransform aTransform= *fPtrTransform;
|
||||
G4AffineTransform aTransform = *fPtrTransform;
|
||||
return aTransform;
|
||||
}
|
||||
|
||||
void G4DisplacedSolid::SetTransform(G4AffineTransform& transform)
|
||||
{
|
||||
fPtrTransform = &transform ;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
G4AffineTransform G4DisplacedSolid::GetDirectTransform() const
|
||||
{
|
||||
G4AffineTransform aTransform= *fDirectTransform;
|
||||
return aTransform;
|
||||
}
|
||||
|
||||
void G4DisplacedSolid::SetDirectTransform(G4AffineTransform& transform)
|
||||
{
|
||||
fDirectTransform = &transform ;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
G4RotationMatrix G4DisplacedSolid::GetFrameRotation() const
|
||||
{
|
||||
G4RotationMatrix InvRotation= fDirectTransform->NetRotation();
|
||||
return InvRotation;
|
||||
}
|
||||
|
||||
void G4DisplacedSolid::SetFrameRotation(const G4RotationMatrix& matrix)
|
||||
{
|
||||
fDirectTransform->SetNetRotation(matrix);
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
G4ThreeVector G4DisplacedSolid::GetFrameTranslation() const
|
||||
{
|
||||
return fPtrTransform->NetTranslation();
|
||||
}
|
||||
|
||||
void G4DisplacedSolid::SetFrameTranslation(const G4ThreeVector& vector)
|
||||
{
|
||||
fPtrTransform->SetNetTranslation(vector);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////
|
||||
|
||||
G4RotationMatrix G4DisplacedSolid::GetObjectRotation() const
|
||||
{
|
||||
G4RotationMatrix Rotation= fPtrTransform->NetRotation();
|
||||
return Rotation;
|
||||
}
|
||||
|
||||
void G4DisplacedSolid::SetObjectRotation(const G4RotationMatrix& matrix)
|
||||
{
|
||||
fPtrTransform->SetNetRotation(matrix);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
|
||||
G4ThreeVector G4DisplacedSolid::GetObjectTranslation() const
|
||||
{
|
||||
return fDirectTransform->NetTranslation();
|
||||
}
|
||||
|
||||
void G4DisplacedSolid::SetObjectTranslation(const G4ThreeVector& vector)
|
||||
{
|
||||
fDirectTransform->SetNetTranslation(vector);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4IntersectionSolid.cc,v 1.8 2000/06/24 14:27:41 japost Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: G4IntersectionSolid.cc,v 1.9 2000/11/02 12:25:47 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
// Implementation of methods for the class G4IntersectionSolid
|
||||
//
|
||||
@@ -412,6 +412,15 @@ G4IntersectionSolid::ComputeDimensions( G4VPVParameterisation* p,
|
||||
//
|
||||
//
|
||||
|
||||
G4GeometryType G4IntersectionSolid::GetEntityType() const
|
||||
{
|
||||
return G4String("G4IntersectionSolid");
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
void
|
||||
G4IntersectionSolid::DescribeYourselfTo ( G4VGraphicsScene& scene ) const
|
||||
{
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4SubtractionSolid.cc,v 1.8 2000/06/26 16:16:06 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: G4SubtractionSolid.cc,v 1.11 2000/11/20 17:56:01 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
// Implementation of methods for the class G4IntersectionSolid
|
||||
//
|
||||
@@ -17,6 +17,8 @@
|
||||
// J.Apostolakis recommendations (while loops)
|
||||
// 02.08.99 V.Grichine, bugs fixed in DistanceToOut(p,v,...)
|
||||
// while -> do-while & surfaceA limitations
|
||||
// 13.09.00 V.Grichine, bug fixed in SurfaceNormal(p), p can be inside
|
||||
//
|
||||
//
|
||||
|
||||
#include "G4SubtractionSolid.hh"
|
||||
@@ -145,16 +147,24 @@ G4SubtractionSolid::SurfaceNormal( const G4ThreeVector& p ) const
|
||||
if( fPtrSolidA->Inside(p) == kSurface &&
|
||||
fPtrSolidB->Inside(p) != kInside )
|
||||
{
|
||||
normal= fPtrSolidA->SurfaceNormal(p) ;
|
||||
normal = fPtrSolidA->SurfaceNormal(p) ;
|
||||
}
|
||||
else if( fPtrSolidA->Inside(p) == kInside &&
|
||||
fPtrSolidB->Inside(p) != kOutside )
|
||||
{
|
||||
normal= -fPtrSolidB->SurfaceNormal(p) ;
|
||||
normal = -fPtrSolidB->SurfaceNormal(p) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
G4Exception("Invalid call in G4SubtractionSolid::SurfaceNormal(p), point p is inside rather than on surface") ;
|
||||
if ( fPtrSolidA->DistanceToOut(p) <= fPtrSolidB->DistanceToIn(p) )
|
||||
{
|
||||
normal = fPtrSolidA->SurfaceNormal(p) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
normal = -fPtrSolidB->SurfaceNormal(p) ;
|
||||
}
|
||||
G4cerr<<"G4SubtractionSolid::SurfaceNormal(p), point p is inside"<<G4endl ;
|
||||
}
|
||||
}
|
||||
return normal;
|
||||
@@ -314,7 +324,7 @@ G4SubtractionSolid::DistanceToOut( const G4ThreeVector& p,
|
||||
G4double
|
||||
G4SubtractionSolid::DistanceToOut( const G4ThreeVector& p ) const
|
||||
{
|
||||
G4double dist;
|
||||
G4double dist=kInfinity;
|
||||
|
||||
if( Inside(p) == kOutside )
|
||||
{
|
||||
@@ -323,7 +333,7 @@ G4SubtractionSolid::DistanceToOut( const G4ThreeVector& p ) const
|
||||
else
|
||||
{
|
||||
dist= G4std::min(fPtrSolidA->DistanceToOut(p),
|
||||
fPtrSolidB->DistanceToIn(p) ) ;
|
||||
fPtrSolidB->DistanceToIn(p) ) ;
|
||||
}
|
||||
return dist;
|
||||
}
|
||||
@@ -332,6 +342,15 @@ G4SubtractionSolid::DistanceToOut( const G4ThreeVector& p ) const
|
||||
//
|
||||
//
|
||||
|
||||
G4GeometryType G4SubtractionSolid::GetEntityType() const
|
||||
{
|
||||
return G4String("G4SubtractionSolid");
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
void
|
||||
G4SubtractionSolid::ComputeDimensions( G4VPVParameterisation* p,
|
||||
const G4int n,
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4UnionSolid.cc,v 1.9 2000/06/24 14:27:42 japost Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: G4UnionSolid.cc,v 1.11 2000/11/20 17:56:01 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
// Implementation of methods for the class G4IntersectionSolid
|
||||
//
|
||||
@@ -173,7 +173,6 @@ G4double
|
||||
G4UnionSolid::DistanceToIn( const G4ThreeVector& p,
|
||||
const G4ThreeVector& v ) const
|
||||
{
|
||||
G4double dist ;
|
||||
if( Inside(p) == kInside )
|
||||
{
|
||||
G4Exception("Invalid call in G4IntersectionSolid::DistanceToIn(p,v), point p is inside") ;
|
||||
@@ -230,7 +229,7 @@ G4UnionSolid::DistanceToOut( const G4ThreeVector& p,
|
||||
else
|
||||
{
|
||||
EInside positionA = fPtrSolidA->Inside(p) ;
|
||||
EInside positionB = fPtrSolidB->Inside(p) ;
|
||||
// EInside positionB = fPtrSolidB->Inside(p) ;
|
||||
|
||||
if( positionA != kOutside )
|
||||
{
|
||||
@@ -286,7 +285,7 @@ G4UnionSolid::DistanceToOut( const G4ThreeVector& p,
|
||||
G4double
|
||||
G4UnionSolid::DistanceToOut( const G4ThreeVector& p ) const
|
||||
{
|
||||
G4double distout;
|
||||
G4double distout = kInfinity;
|
||||
if( Inside(p) == kOutside )
|
||||
{
|
||||
G4Exception("Invalid call in G4IntersectionSolid::DistanceToOut(p), point p is outside") ;
|
||||
@@ -304,7 +303,7 @@ G4UnionSolid::DistanceToOut( const G4ThreeVector& p ) const
|
||||
(positionA == kSurface && positionB == kInside ) )
|
||||
{
|
||||
distout= G4std::max(fPtrSolidA->DistanceToOut(p),
|
||||
fPtrSolidB->DistanceToOut(p) ) ;
|
||||
fPtrSolidB->DistanceToOut(p) ) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -325,6 +324,15 @@ G4UnionSolid::DistanceToOut( const G4ThreeVector& p ) const
|
||||
//
|
||||
//
|
||||
|
||||
G4GeometryType G4UnionSolid::GetEntityType() const
|
||||
{
|
||||
return G4String("G4UnionSolid");
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
void
|
||||
G4UnionSolid::ComputeDimensions( G4VPVParameterisation* p,
|
||||
const G4int n,
|
||||
|
||||
Reference in New Issue
Block a user