Import Geant4 3.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 15:55:53 +02:00
parent e7d7193284
commit cfcb558cfe
3050 changed files with 91703 additions and 48310 deletions
+47 -16
View File
@@ -1,5 +1,5 @@
$Id: History,v 1.12 2000/06/26 16:16:06 gcosmo Exp $
$Id: History,v 1.16 2000/11/22 16:10:43 gcosmo Exp $
-------------------------------------------------------------------
=========================================================
@@ -20,21 +20,52 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
June 26 2000 Vladimir Grichine geom-solid-bool-V01-01-03
Nov 22 2000 Vladimir Grichine geom-solid-bool-V02-00-03
- Added new set methods for matrix/vectors to G4DisplacedSolid:
SetTransform(G4AffineTransform&),
SetDirectTransform(G4AffineTransform&),
SetFrameRotation(const G4RotationMatrix&),
SetFrameTranslation(const G4ThreeVector&),
SetObjectRotation(const G4RotationMatrix&),
SetObjectTranslation(const G4ThreeVector&).
Nov 20 2000 Gabriele Cosmo geom-solid-bool-V02-00-02
- Fixes to remove warnings from "-Wall -ansi -pedantic" g++ compiler options:
o commented out variables declared and not used.
o fixed declaration of variables used before being initialised.
o fixed order of initialisation of member data in constructors.
o fixed usage of unsigned-int (size_t) for array indeces.
Nov 2 2000 Gabriele Cosmo geom-solid-bool-V02-00-01
- QA code revision and cleanup (+fixes from CodeWizard filtering):
o Added (private) declarations of copy constructor and assignment
operator where needed.
o Changed virtual functions to non-inline wherever's the case.
Sep 13 2000 Vladimir Grichine geom-solid-bool-V02-00-00
- G4SubtractionSolid.cc: relaxed behavior in SurfaceNormal(p), where
it is allowed for a point to be inside the solid. A message is thrown
to cerr instead of a G4Exception.
Jun 26 2000 Vladimir Grichine geom-solid-bool-V01-01-03
- Fixed bug in G4SubtractionSolid::DistanceToOut(p,v,...). validNorm
flag was uncorrectly set to true. Fixes report #102.
June 6 2000 John Apostolakis geom-solid-bool-V01-01-02
Jun 6 2000 John Apostolakis geom-solid-bool-V01-01-02
- Protecting the use of pointers validNorm and n, if calcNorm is false
June 6 2000 John Allison geom-solid-bool-V01-01-01
Jun 6 2000 John Allison geom-solid-bool-V01-01-01
- Re-enabled CreatePolyhedron() method from G4UnionSolid, G4IntersectionSolid
and G4SubtractionSolid. Coworks with greps-V01-01-04.
May 26 2000 John Allison geom-solid-bool-V01-01-00
May 26 2000 John Allison geom-solid-bool-V01-01-00
- Disabled CreatePolyhedron() method from G4UnionSolid, G4IntersectionSolid
and G4SubtractionSolid. It now temporarly returns a NULL pointer.
@@ -43,48 +74,48 @@ committal in the CVS repository !
Files G4UnionSolid.cc, G4SubtractionSolid.cc and G4IntersectionSolid.cc
are included in the branch-tag "boolean_nopoly_branch".
Apr 27 2000 Gabriele Cosmo
Apr 27 2000 Gabriele Cosmo
- Reorganised comments for the Software Reference Manual.
- Added CVS headers and standard G4 header where missing.
Apr 11 2000 John Allison
Apr 11 2000 John Allison
- CreatePolyhedron implemented for BooleanSolids.
- G4DisplacedSolid: reversed implementation of GetFrameRotation and
GetObjectRotation, removing inappropriate invertion.
- G4DisplacedSolid::GetConstituentMovedSolid() made const.
Jan 19 2000 Gabriele Cosmo geom-solid-bool-V01-00-00
Jan 19 2000 Gabriele Cosmo geom-solid-bool-V01-00-00
- Syncronized file versions with HEAD (essentially CVS headers changes)
- Fixed cases of G4std::min which were not migrated on the HEAD in files:
G4UnionSolid.cc and G4IntersectionSolid.cc
Nov 24 1999 geom-solid-bool-V00-01-05
Nov 24 1999 geom-solid-bool-V00-01-05
- Small fix in src/G4DisplacedSolid.cc to the return type
(const G4AffineTransform --> G4AffineTransform)
to conform with the specification of the class.
Nov 19 1999 geom-solid-bool-V00-01-04
Nov 19 1999 geom-solid-bool-V00-01-04
- Fixes from Vladimir, and additional tests
Nov 10 1999 geom-solid-bool-V00-01-03b
Nov 10 1999 geom-solid-bool-V00-01-03b
- Renamed GetConstituentSolid to GetConstituentMovedSolid in G4DisplacedSolid
to avoid clashing with method that gets the contituents of a G4BooleanSolid.
Nov 10 1999 geom-solid-bool-V00-01-03a
Nov 10 1999 geom-solid-bool-V00-01-03a
- Tag with additional methods for Persistency
Nov 10 1999 geom-solid-bool-V00-01-03-cand
Nov 10 1999 geom-solid-bool-V00-01-03-cand
New method: Get Object Rotation/Translation methods in Displaced Solid
Nov 9 1999 geom-solid-bool-V00-01-02-cand
Nov 9 1999 geom-solid-bool-V00-01-02-cand
- Tag with additional methods for Visualisation
@@ -97,10 +128,10 @@ committal in the CVS repository !
Dec 1 1998 John Apostolakis geom-boolean-4-ja
Dec 1 1998 John Apostolakis geom-boolean-4-ja
Code portability changes.
Nov 27 1998 John Apostolakis & Vladimir Grichine geom-boolean-3-vg
Nov 27 1998 J.Apostolakis & V.Grichine geom-boolean-3-vg
Fixes agreed in code review were implemented.
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4BooleanSolid.hh,v 1.3 2000/04/27 09:59:36 gcosmo Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4BooleanSolid.hh,v 1.4 2000/11/02 12:25:45 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
// class G4BooleanSolid
@@ -64,6 +64,12 @@ class G4BooleanSolid : public G4VSolid
G4VSolid* fPtrSolidA ;
G4VSolid* fPtrSolidB ;
private:
G4BooleanSolid(const G4BooleanSolid&);
G4BooleanSolid& operator=(const G4BooleanSolid&);
// Private copy constructor and assignment operator.
private:
G4bool createdDisplacedSolid;
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4DisplacedSolid.hh,v 1.7 2000/04/27 09:59:36 gcosmo Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4DisplacedSolid.hh,v 1.10 2000/11/22 16:09:51 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
// class G4DisplacedSolid
@@ -20,6 +20,7 @@
// History:
//
// 28.10.98 V.Grichine, creation according J. Apostolakis's recommendations
// 22.11.00 V.Grichine, new set methods for matrix/vectors
#ifndef G4DisplacedSolid_HH
#define G4DisplacedSolid_HH
@@ -91,17 +92,27 @@ class G4DisplacedSolid : public G4VSolid
// return a self pointer else return 0.
G4VSolid* GetConstituentMovedSolid() const;
G4AffineTransform GetTransform() const;
void SetTransform(G4AffineTransform& );
G4AffineTransform GetDirectTransform() const;
// Access methods.
void SetDirectTransform(G4AffineTransform&);
// Access/Set methods.
G4RotationMatrix GetFrameRotation() const;
void SetFrameRotation(const G4RotationMatrix&);
G4ThreeVector GetFrameTranslation() const;
// Get the rotation/translation, as applied to the frame of reference.
void SetFrameTranslation(const G4ThreeVector&);
// Get/Set the rotation/translation, as applied to the frame of reference.
G4RotationMatrix GetObjectRotation() const;
void SetObjectRotation(const G4RotationMatrix&);
G4ThreeVector GetObjectTranslation() const;
// Get the rotation/translation, as applied to the object.
void SetObjectTranslation(const G4ThreeVector&);
// Get/Set the rotation/translation, as applied to the object.
public: // without description
@@ -115,12 +126,16 @@ class G4DisplacedSolid : public G4VSolid
G4VSolid* fPtrSolid ;
G4AffineTransform* fPtrTransform ;
G4AffineTransform* fDirectTransform ;
private:
G4DisplacedSolid(const G4DisplacedSolid&);
G4DisplacedSolid& operator=(const G4DisplacedSolid&);
// Private copy constructor and assignment operator.
} ;
inline G4GeometryType G4DisplacedSolid::GetEntityType() const
{
return G4String("G4DisplacedSolid");
}
#endif
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4IntersectionSolid.hh,v 1.3 2000/04/27 09:59:36 gcosmo Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4IntersectionSolid.hh,v 1.4 2000/11/02 12:25:45 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
// class G4IntersectionSolid
@@ -90,10 +90,5 @@ class G4IntersectionSolid : public G4BooleanSolid
} ;
inline G4GeometryType G4IntersectionSolid::GetEntityType() const
{
return G4String("G4IntersectionSolid");
}
#endif
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4SubtractionSolid.hh,v 1.3 2000/04/27 09:59:37 gcosmo Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4SubtractionSolid.hh,v 1.4 2000/11/02 12:25:46 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
// class G4SubtractionSolid
@@ -90,10 +90,5 @@ class G4SubtractionSolid : public G4BooleanSolid
};
inline G4GeometryType G4SubtractionSolid::GetEntityType() const
{
return G4String("G4SubtractionSolid");
}
#endif
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4UnionSolid.hh,v 1.4 2000/04/27 09:59:37 gcosmo Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4UnionSolid.hh,v 1.5 2000/11/02 12:25:46 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
// class G4UnionSolid
@@ -88,10 +88,5 @@ class G4UnionSolid : public G4BooleanSolid
};
inline G4GeometryType G4UnionSolid::GetEntityType() const
{
return G4String("G4UnionSolid");
}
#endif
@@ -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,