Ignore:
Timestamp:
Feb 16, 2009, 10:14:30 AM (16 years ago)
Author:
garnier
Message:

en test de gl2ps. Problemes de libraries

Location:
trunk/source/geometry/solids/CSG/include
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/geometry/solids/CSG/include/G4Cons.hh

    r850 r921  
    2525//
    2626//
    27 // $Id: G4Cons.hh,v 1.18 2007/05/18 07:38:00 gcosmo Exp $
    28 // GEANT4 tag $Name: HEAD $
     27// $Id: G4Cons.hh,v 1.21 2008/11/06 11:04:00 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-02-cand-01 $
    2929//
    3030//
     
    5454//  fDPhi  delta angle of the segment in radians
    5555//
     56//  fPhiFullCone   Boolean variable used for indicate the Phi Section
     57//
    5658//   Note:
    5759//      Internally fSPhi & fDPhi are adjusted so that fDPhi<=2PI,
     
    7375  public:  // with description
    7476
    75         G4Cons(const G4String& pName,
    76                      G4double pRmin1, G4double pRmax1,
    77                      G4double pRmin2, G4double pRmax2,
    78                      G4double pDz,
    79                      G4double pSPhi, G4double pDPhi);
     77    G4Cons(const G4String& pName,
     78                 G4double pRmin1, G4double pRmax1,
     79                 G4double pRmin2, G4double pRmax2,
     80                 G4double pDz,
     81                 G4double pSPhi, G4double pDPhi);
    8082         
    81         virtual ~G4Cons() ;
    82 
    83   // Accessors
    84 
    85         inline G4double    GetInnerRadiusMinusZ() const;
    86         inline G4double    GetOuterRadiusMinusZ() const;
    87         inline G4double    GetInnerRadiusPlusZ()  const;
    88         inline G4double    GetOuterRadiusPlusZ()  const;
    89  
    90         inline G4double    GetZHalfLength()       const;
    91  
    92         inline G4double    GetStartPhiAngle () const;
    93         inline G4double    GetDeltaPhiAngle () const;
    94  
    95   // Modifiers
    96 
    97         inline void    SetInnerRadiusMinusZ( G4double Rmin1 );
    98         inline void    SetOuterRadiusMinusZ( G4double Rmax1 );
    99         inline void    SetInnerRadiusPlusZ ( G4double Rmin2 );
    100         inline void    SetOuterRadiusPlusZ ( G4double Rmax2 );
     83    virtual ~G4Cons() ;
     84
     85    // Accessors
     86
     87    inline G4double    GetInnerRadiusMinusZ() const;
     88    inline G4double    GetOuterRadiusMinusZ() const;
     89    inline G4double    GetInnerRadiusPlusZ()  const;
     90    inline G4double    GetOuterRadiusPlusZ()  const;
     91 
     92    inline G4double    GetZHalfLength()       const;
     93 
     94    inline G4double    GetStartPhiAngle () const;
     95    inline G4double    GetDeltaPhiAngle () const;
     96 
     97    // Modifiers
     98
     99    inline void    SetInnerRadiusMinusZ( G4double Rmin1 );
     100    inline void    SetOuterRadiusMinusZ( G4double Rmax1 );
     101    inline void    SetInnerRadiusPlusZ ( G4double Rmin2 );
     102    inline void    SetOuterRadiusPlusZ ( G4double Rmax2 );
    101103         
    102         inline void    SetZHalfLength      ( G4double newDz );
    103         inline void    SetStartPhiAngle    ( G4double newSPhi);
    104         inline void    SetDeltaPhiAngle    ( G4double newDPhi);
    105 
    106   // Other methods for solid
    107 
    108         inline G4double    GetCubicVolume();
    109         inline G4double    GetSurfaceArea();
    110 
    111         void ComputeDimensions(G4VPVParameterisation* p,
    112                                const G4int n,
    113                                const G4VPhysicalVolume* pRep);
    114 
    115         G4bool CalculateExtent(const EAxis pAxis,
    116                                const G4VoxelLimits& pVoxelLimit,
    117                                const G4AffineTransform& pTransform,
    118                                      G4double& pmin, G4double& pmax) const;         
    119 
    120         EInside Inside(const G4ThreeVector& p) const;
    121 
    122         G4ThreeVector SurfaceNormal(const G4ThreeVector& p) const;
    123 
    124         G4double DistanceToIn(const G4ThreeVector& p,
    125                                const G4ThreeVector& v) const;
    126         G4double DistanceToIn(const G4ThreeVector& p) const;
    127         G4double DistanceToOut(const G4ThreeVector& p,
    128                                const G4ThreeVector& v,
    129                                const G4bool calcNorm=G4bool(false),
    130                                      G4bool *validNorm=0,
    131                                      G4ThreeVector *n=0) const;             
    132         G4double DistanceToOut(const G4ThreeVector& p) const;
    133 
    134         G4GeometryType  GetEntityType() const;
     104    inline void    SetZHalfLength      ( G4double newDz );
     105    inline void    SetStartPhiAngle    ( G4double newSPhi);
     106    inline void    SetDeltaPhiAngle    ( G4double newDPhi);
     107
     108    // Other methods for solid
     109
     110    inline G4double    GetCubicVolume();
     111    inline G4double    GetSurfaceArea();
     112
     113    void ComputeDimensions(G4VPVParameterisation* p,
     114                           const G4int n,
     115                           const G4VPhysicalVolume* pRep);
     116
     117    G4bool CalculateExtent(const EAxis pAxis,
     118                           const G4VoxelLimits& pVoxelLimit,
     119                           const G4AffineTransform& pTransform,
     120                                 G4double& pmin, G4double& pmax) const;         
     121
     122    EInside Inside(const G4ThreeVector& p) const;
     123
     124    G4ThreeVector SurfaceNormal(const G4ThreeVector& p) const;
     125
     126    G4double DistanceToIn (const G4ThreeVector& p,
     127                           const G4ThreeVector& v) const;
     128    G4double DistanceToIn (const G4ThreeVector& p) const;
     129    G4double DistanceToOut(const G4ThreeVector& p,
     130                           const G4ThreeVector& v,
     131                           const G4bool calcNorm=G4bool(false),
     132                                 G4bool *validNorm=0,
     133                                 G4ThreeVector *n=0) const;             
     134    G4double DistanceToOut(const G4ThreeVector& p) const;
     135
     136    G4GeometryType  GetEntityType() const;
    135137       
    136         G4ThreeVector GetPointOnSurface() const;
     138    G4ThreeVector GetPointOnSurface() const;
    137139       
    138         std::ostream& StreamInfo(std::ostream& os) const;
    139 
    140   // Visualisation functions
    141 
    142         void          DescribeYourselfTo( G4VGraphicsScene& scene ) const;
    143         G4Polyhedron* CreatePolyhedron() const;
    144         G4NURBS*      CreateNURBS() const;
     140    std::ostream& StreamInfo(std::ostream& os) const;
     141
     142    // Visualisation functions
     143
     144    void          DescribeYourselfTo( G4VGraphicsScene& scene ) const;
     145    G4Polyhedron* CreatePolyhedron() const;
     146    G4NURBS*      CreateNURBS() const;
    145147
    146148  public:  // without description
    147149       
    148         G4Cons(__void__&);
    149           // Fake default constructor for usage restricted to direct object
    150           // persistency for clients requiring preallocation of memory for
    151           // persistifiable objects.
    152 
    153         //  Old access functions
    154 
    155         inline G4double    GetRmin1() const;
    156         inline G4double    GetRmax1() const;
    157         inline G4double    GetRmin2() const;
    158         inline G4double    GetRmax2() const;
    159  
    160         inline G4double    GetDz()    const;
    161  
    162         inline G4double    GetSPhi() const;
    163         inline G4double    GetDPhi() const;
     150    G4Cons(__void__&);
     151      //
     152      // Fake default constructor for usage restricted to direct object
     153      // persistency for clients requiring preallocation of memory for
     154      // persistifiable objects.
     155
     156    //  Old access functions
     157
     158    inline G4double    GetRmin1() const;
     159    inline G4double    GetRmax1() const;
     160    inline G4double    GetRmin2() const;
     161    inline G4double    GetRmax2() const;
     162 
     163    inline G4double    GetDz()    const;
     164 
     165    inline G4double    GetSPhi() const;
     166    inline G4double    GetDPhi() const;
    164167
    165168  protected:
    166169 
    167         G4ThreeVectorList*
    168         CreateRotatedVertices(const G4AffineTransform& pTransform) const;
    169  
    170         // Used by distanceToOut
    171  
    172         enum ESide {kNull,kRMin,kRMax,kSPhi,kEPhi,kPZ,kMZ};
    173  
    174         // used by normal
    175  
    176         enum ENorm {kNRMin,kNRMax,kNSPhi,kNEPhi,kNZ};
     170    G4ThreeVectorList*
     171    CreateRotatedVertices(const G4AffineTransform& pTransform) const;
     172 
     173    G4double fRmin1, fRmin2, fRmax1, fRmax2, fDz, fSPhi, fDPhi;
     174    G4bool fPhiFullCone;
     175
     176    // Used by distanceToOut
     177 
     178    enum ESide {kNull,kRMin,kRMax,kSPhi,kEPhi,kPZ,kMZ};
     179 
     180    // used by normal
     181 
     182    enum ENorm {kNRMin,kNRMax,kNSPhi,kNEPhi,kNZ};
    177183
    178184  private:
    179185
    180         G4ThreeVector ApproxSurfaceNormal(const G4ThreeVector& p) const;
    181           // Algorithm for SurfaceNormal() following the original
    182           // specification for points not on the surface
     186    inline void Initialise();
     187      // Reset relevant values to zero
     188
     189    inline void InitializeTrigonometry();
     190      //
     191      // Recompute relevant trigonometric values and cache them
     192
     193    G4ThreeVector ApproxSurfaceNormal(const G4ThreeVector& p) const;
     194      //
     195      // Algorithm for SurfaceNormal() following the original
     196      // specification for points not on the surface
    183197
    184198  private:
    185199
    186         G4double kRadTolerance, kAngTolerance;
    187 
    188         G4double fRmin1,fRmin2,
    189                  fRmax1,fRmax2,
    190                  fDz,
    191                  fSPhi,fDPhi;
     200    G4double kRadTolerance, kAngTolerance;
     201      //
     202      // Radial and angular tolerances
     203
     204    G4double sinCPhi, cosCPhi, cosHDPhiOT, cosHDPhiIT,
     205             sinSPhi, cosSPhi, sinEPhi, cosEPhi;
     206      //
     207      // Cached trigonometric values
    192208};
    193209
  • trunk/source/geometry/solids/CSG/include/G4Cons.icc

    r850 r921  
    2525//
    2626//
    27 // $Id: G4Cons.icc,v 1.6 2006/10/19 15:33:37 gcosmo Exp $
    28 // GEANT4 tag $Name: HEAD $
     27// $Id: G4Cons.icc,v 1.8 2008/11/06 10:55:40 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-02-cand-01 $
    2929//
    3030// --------------------------------------------------------------------
     
    3737
    3838inline
    39 G4double G4Cons::GetInnerRadiusMinusZ() const
    40 {
    41   return fRmin1 ;
    42 }
    43 
    44 inline
    45 G4double G4Cons::GetOuterRadiusMinusZ() const
    46 {
    47   return fRmax1 ;
    48 }
    49 
    50 inline
    51 G4double G4Cons::GetInnerRadiusPlusZ() const
    52 {
    53   return fRmin2 ;
    54 }
    55 
    56 inline
    57 G4double G4Cons::GetOuterRadiusPlusZ() const
    58 {
    59   return fRmax2 ;
    60 }
    61 
    62 inline
    63 G4double G4Cons::GetZHalfLength() const
    64 {
    65   return fDz ;
    66 }
    67 
    68 inline 
    69 G4double G4Cons::GetStartPhiAngle() const
    70 {
    71   return fSPhi ;
    72 }
    73 
    74 inline
    75 G4double G4Cons::GetDeltaPhiAngle() const
    76 {
    77   return fDPhi;
    78 }
    79 
    80 inline
    81 void G4Cons::SetInnerRadiusMinusZ( G4double Rmin1 )
    82 {
    83   fRmin1= Rmin1 ;
     39void G4Cons::Initialise()
     40{
    8441  fCubicVolume= 0.;
    8542  fSurfaceArea= 0.;
     
    8744}
    8845
     46inline
     47void G4Cons::InitializeTrigonometry()
     48{
     49  G4double hDPhi = 0.5*fDPhi;                       // half delta phi
     50  G4double cPhi  = fSPhi + hDPhi;
     51  G4double ePhi  = fSPhi + fDPhi;
     52
     53  sinCPhi    = std::sin(cPhi);
     54  cosCPhi    = std::cos(cPhi);
     55  cosHDPhiIT = std::cos(hDPhi - 0.5*kAngTolerance); // inner/outer tol half dphi
     56  cosHDPhiOT = std::cos(hDPhi + 0.5*kAngTolerance);
     57  sinSPhi = std::sin(fSPhi);
     58  cosSPhi = std::cos(fSPhi);
     59  sinEPhi = std::sin(ePhi);
     60  cosEPhi = std::cos(ePhi);
     61}
     62
     63inline
     64G4double G4Cons::GetInnerRadiusMinusZ() const
     65{
     66  return fRmin1 ;
     67}
     68
     69inline
     70G4double G4Cons::GetOuterRadiusMinusZ() const
     71{
     72  return fRmax1 ;
     73}
     74
     75inline
     76G4double G4Cons::GetInnerRadiusPlusZ() const
     77{
     78  return fRmin2 ;
     79}
     80
     81inline
     82G4double G4Cons::GetOuterRadiusPlusZ() const
     83{
     84  return fRmax2 ;
     85}
     86
     87inline
     88G4double G4Cons::GetZHalfLength() const
     89{
     90  return fDz ;
     91}
     92
     93inline 
     94G4double G4Cons::GetStartPhiAngle() const
     95{
     96  return fSPhi ;
     97}
     98
     99inline
     100G4double G4Cons::GetDeltaPhiAngle() const
     101{
     102  return fDPhi;
     103}
     104
     105inline
     106void G4Cons::SetInnerRadiusMinusZ( G4double Rmin1 )
     107{
     108  fRmin1= Rmin1 ;
     109  Initialise();
     110}
     111
    89112inline
    90113void G4Cons::SetOuterRadiusMinusZ( G4double Rmax1 )
    91114{
    92115  fRmax1= Rmax1 ;
    93   fCubicVolume= 0.;
    94   fSurfaceArea= 0.;
    95   fpPolyhedron = 0;
     116  Initialise();
    96117}
    97118
     
    100121{
    101122  fRmin2= Rmin2 ;
    102   fCubicVolume= 0.;
    103   fSurfaceArea= 0.;
    104   fpPolyhedron = 0;
     123  Initialise();
    105124}
    106125
     
    109128{
    110129  fRmax2= Rmax2 ;
    111   fCubicVolume= 0.;
    112   fSurfaceArea= 0.;
    113   fpPolyhedron = 0;
     130  Initialise();
    114131}
    115132
     
    118135{
    119136  fDz= newDz ;
    120   fCubicVolume= 0.;
    121   fSurfaceArea= 0.;
    122   fpPolyhedron = 0;
     137  Initialise();
    123138}
    124139
     
    127142{
    128143  fSPhi= newSPhi;
    129   fCubicVolume= 0.;
    130   fSurfaceArea= 0.;
    131   fpPolyhedron = 0;
     144  Initialise();
     145  InitializeTrigonometry();
    132146}
    133147
    134148void G4Cons::SetDeltaPhiAngle ( G4double newDPhi )
    135149{
     150  if ( newDPhi >= twopi-kAngTolerance*0.5 )
     151  {
     152    fPhiFullCone = true;
     153  }
     154  else if ( newDPhi > 0 )
     155  {
     156    fPhiFullCone = false;
     157  }
     158  else
     159  {
     160     G4cerr << "ERROR - G4Cons()::SetDeltaPhiAngle() : " << GetName() << G4endl
     161            << "        Negative delta-Phi ! - " << newDPhi << G4endl;
     162     G4Exception("G4Cons::SetDeltaPhiAngle()", "InvalidSetup",
     163                  FatalException, "Invalid dphi.");
     164  }
    136165  fDPhi=  newDPhi;
    137   fCubicVolume= 0.;
    138   fSurfaceArea= 0.;
    139   fpPolyhedron = 0;
     166  Initialise();
     167  InitializeTrigonometry();
    140168}
    141169
     
    220248                         + 0.5*(fRmax1*fRmax1-fRmin1*fRmin1
    221249                               +fRmax2*fRmax2-fRmin2*fRmin2 ));
    222     if(fDPhi < twopi )
     250    if(!fPhiFullCone)
    223251    {
    224252      fSurfaceArea = fSurfaceArea+4*fDz*(mmax-mmin);
  • trunk/source/geometry/solids/CSG/include/G4Sphere.hh

    r850 r921  
    2525//
    2626//
    27 // $Id: G4Sphere.hh,v 1.20 2007/05/18 07:38:00 gcosmo Exp $
    28 // GEANT4 tag $Name: HEAD $
     27// $Id: G4Sphere.hh,v 1.21 2008/11/21 09:50:05 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-02-cand-01 $
    2929//
    3030//
     
    8888    // Accessors
    8989       
    90     inline G4double GetInsideRadius   () const;
     90    inline G4double GetInnerRadius    () const;
    9191    inline G4double GetOuterRadius    () const;
    9292    inline G4double GetStartPhiAngle  () const;
     
    9797    // Modifiers
    9898
    99     inline void SetInsideRadius   (G4double newRmin);
     99    inline void SetInnerRadius    (G4double newRMin);
    100100    inline void SetOuterRadius    (G4double newRmax);
    101101    inline void SetStartPhiAngle  (G4double newSphi);
     
    162162    inline G4double  GetSTheta() const;
    163163    inline G4double  GetDTheta() const;
     164    inline G4double  GetInsideRadius() const;
     165    inline void SetInsideRadius(G4double newRmin);
    164166
    165167  protected:
  • trunk/source/geometry/solids/CSG/include/G4Sphere.icc

    r850 r921  
    2525//
    2626//
    27 // $Id: G4Sphere.icc,v 1.7 2006/10/19 15:33:37 gcosmo Exp $
    28 // GEANT4 tag $Name: HEAD $
     27// $Id: G4Sphere.icc,v 1.8 2008/11/21 09:50:05 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-02-cand-01 $
    2929//
    3030// --------------------------------------------------------------------
     
    4343
    4444inline
     45G4double G4Sphere::GetInnerRadius() const
     46{
     47  return fRmin;
     48}
     49
     50inline
    4551G4double G4Sphere::GetOuterRadius() const
    4652{
     
    7379inline
    7480void G4Sphere::SetInsideRadius(G4double newRmin)
     81{
     82  fRmin= newRmin;
     83  fCubicVolume= 0.;
     84  fSurfaceArea= 0.;
     85  fpPolyhedron = 0;
     86}
     87
     88inline
     89void G4Sphere::SetInnerRadius(G4double newRmin)
    7590{
    7691  fRmin= newRmin;
  • trunk/source/geometry/solids/CSG/include/G4Tubs.hh

    r850 r921  
    2525//
    2626//
    27 // $Id: G4Tubs.hh,v 1.17 2007/05/18 07:38:00 gcosmo Exp $
    28 // GEANT4 tag $Name: HEAD $
     27// $Id: G4Tubs.hh,v 1.21 2008/11/06 10:55:40 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-02-cand-01 $
    2929//
    3030//
     
    3939//   A tube or tube segment with curved sides parallel to
    4040//   the z-axis. The tube has a specified half-length along
    41 //   the z axis, about which it is centred, and a given
     41//   the z-axis, about which it is centered, and a given
    4242//   minimum and maximum radius. A minimum radius of 0
    43 //   signifies a filled tube /cylinder. The tube segment is
     43//   corresponds to filled tube /cylinder. The tube segment is
    4444//   specified by starting and delta angles for phi, with 0
    4545//   being the +x axis, PI/2 the +y axis.
     
    5757//
    5858//   fDPhi  Delta angle of the segment.
     59//
     60//   fPhiFullTube   Boolean variable used for indicate the Phi Section
    5961
    6062// History:
     
    103105    inline void SetStartPhiAngle (G4double newSPhi);
    104106    inline void SetDeltaPhiAngle (G4double newDPhi);
    105 
     107   
    106108    // Methods for solid
    107109
     
    144146
    145147    G4Tubs(__void__&);
     148      //
    146149      // Fake default constructor for usage restricted to direct object
    147150      // persistency for clients requiring preallocation of memory for
     
    164167      // for G4VSolid:: ClipCrossSection and ClipBetweenSections
    165168
    166     G4double fRMin,fRMax,fDz,fSPhi,fDPhi;
    167 
    168     // Used by distanceToOut
     169    G4double fRMin, fRMax, fDz, fSPhi, fDPhi;
     170    G4bool fPhiFullTube;
     171   
     172      // Used by distanceToOut
    169173
    170174    enum ESide {kNull,kRMin,kRMax,kSPhi,kEPhi,kPZ,kMZ};
    171175
    172     // used by normal
     176      // Used by normal
    173177
    174178    enum ENorm {kNRMin,kNRMax,kNSPhi,kNEPhi,kNZ};
     
    176180  private:
    177181
     182    inline void Initialize();
     183      //
     184      // Reset relevant values to zero
     185
     186    inline void InitializeTrigonometry();
     187      //
     188      // Recompute relevant trigonometric values and cache them
     189
    178190    G4ThreeVector ApproxSurfaceNormal( const G4ThreeVector& p ) const;
     191      //
    179192      // Algorithm for SurfaceNormal() following the original
    180193      // specification for points not on the surface
     
    183196
    184197    G4double kRadTolerance, kAngTolerance;
     198      //
    185199      // Radial and angular tolerances
     200
     201    G4double sinCPhi, cosCPhi, cosHDPhiOT, cosHDPhiIT,
     202             sinSPhi, cosSPhi, sinEPhi, cosEPhi;
     203      //
     204      // Cached trigonometric values
    186205};
    187206
  • trunk/source/geometry/solids/CSG/include/G4Tubs.icc

    r850 r921  
    2525//
    2626//
    27 // $Id: G4Tubs.icc,v 1.7 2006/10/19 15:33:37 gcosmo Exp $
    28 // GEANT4 tag $Name: HEAD $
     27// $Id: G4Tubs.icc,v 1.11 2008/11/06 10:55:40 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-02-cand-01 $
    2929//
    3030// --------------------------------------------------------------------
     
    6666}
    6767
     68inline
     69void G4Tubs::Initialize()
     70{
     71  fCubicVolume = 0.;
     72  fSurfaceArea = 0.;
     73  fpPolyhedron = 0;
     74}
     75
     76inline
     77void G4Tubs::InitializeTrigonometry()
     78{
     79  G4double hDPhi = 0.5*fDPhi;                       // half delta phi
     80  G4double cPhi  = fSPhi + hDPhi;
     81  G4double ePhi  = fSPhi + fDPhi;
     82
     83  sinCPhi    = std::sin(cPhi);
     84  cosCPhi    = std::cos(cPhi);
     85  cosHDPhiIT = std::cos(hDPhi - 0.5*kAngTolerance); // inner/outer tol half dphi
     86  cosHDPhiOT = std::cos(hDPhi + 0.5*kAngTolerance);
     87  sinSPhi = std::sin(fSPhi);
     88  cosSPhi = std::cos(fSPhi);
     89  sinEPhi = std::sin(ePhi);
     90  cosEPhi = std::cos(ePhi);
     91}
     92
    6893inline
    6994void G4Tubs::SetInnerRadius (G4double newRMin)
    7095{
    7196  fRMin= newRMin;
    72   fCubicVolume= 0.;
    73   fSurfaceArea= 0.;
    74   fpPolyhedron = 0;
     97  Initialize();
    7598}
    7699
     
    79102{
    80103  fRMax= newRMax;
    81   fCubicVolume= 0.;
    82   fSurfaceArea= 0.;
    83   fpPolyhedron = 0;
     104  Initialize();
    84105}
    85106
     
    88109{
    89110  fDz= newDz;
    90   fCubicVolume= 0.;
    91   fSurfaceArea= 0.;
    92   fpPolyhedron = 0;
     111  Initialize();
    93112}
    94113
     
    97116{
    98117  fSPhi= newSPhi;
    99   fCubicVolume= 0.;
    100   fSurfaceArea= 0.;
    101   fpPolyhedron = 0;
     118  Initialize();
     119  InitializeTrigonometry();
    102120}
    103121
     
    105123void G4Tubs::SetDeltaPhiAngle (G4double newDPhi)
    106124{
     125  if ( newDPhi >= twopi-kAngTolerance*0.5 )
     126  {
     127    fPhiFullTube = true;
     128  }
     129  else if ( newDPhi > 0 )
     130  {
     131    fPhiFullTube = false;
     132  }
     133  else
     134  {
     135     G4cerr << "ERROR - G4Tubs()::SetDeltaPhiAngle() : " << GetName() << G4endl
     136            << "        Negative delta-Phi ! - " << newDPhi << G4endl;
     137     G4Exception("G4Tubs::SetDeltaPhiAngle()", "InvalidSetup",
     138                  FatalException, "Invalid dphi.");
     139  }
    107140  fDPhi= newDPhi;
    108   fCubicVolume= 0.;
    109   fSurfaceArea= 0.;
    110   fpPolyhedron = 0;
     141  Initialize();
     142  InitializeTrigonometry();
    111143}
    112144
     
    158190  {
    159191    fSurfaceArea = fDPhi*(fRMin+fRMax)*(2*fDz+fRMax-fRMin);
    160     if (fDPhi < twopi)
     192    if (!fPhiFullTube)
    161193    {
    162194      fSurfaceArea = fSurfaceArea + 4*fDz*(fRMax-fRMin);
Note: See TracChangeset for help on using the changeset viewer.