Geant4 Cross Reference

Cross-Referencing   Geant4
Geant4/geometry/solids/specific/include/G4VTwistSurface.hh

Version: [ ReleaseNotes ] [ 1.0 ] [ 1.1 ] [ 2.0 ] [ 3.0 ] [ 3.1 ] [ 3.2 ] [ 4.0 ] [ 4.0.p1 ] [ 4.0.p2 ] [ 4.1 ] [ 4.1.p1 ] [ 5.0 ] [ 5.0.p1 ] [ 5.1 ] [ 5.1.p1 ] [ 5.2 ] [ 5.2.p1 ] [ 5.2.p2 ] [ 6.0 ] [ 6.0.p1 ] [ 6.1 ] [ 6.2 ] [ 6.2.p1 ] [ 6.2.p2 ] [ 7.0 ] [ 7.0.p1 ] [ 7.1 ] [ 7.1.p1 ] [ 8.0 ] [ 8.0.p1 ] [ 8.1 ] [ 8.1.p1 ] [ 8.1.p2 ] [ 8.2 ] [ 8.2.p1 ] [ 8.3 ] [ 8.3.p1 ] [ 8.3.p2 ] [ 9.0 ] [ 9.0.p1 ] [ 9.0.p2 ] [ 9.1 ] [ 9.1.p1 ] [ 9.1.p2 ] [ 9.1.p3 ] [ 9.2 ] [ 9.2.p1 ] [ 9.2.p2 ] [ 9.2.p3 ] [ 9.2.p4 ] [ 9.3 ] [ 9.3.p1 ] [ 9.3.p2 ] [ 9.4 ] [ 9.4.p1 ] [ 9.4.p2 ] [ 9.4.p3 ] [ 9.4.p4 ] [ 9.5 ] [ 9.5.p1 ] [ 9.5.p2 ] [ 9.6 ] [ 9.6.p1 ] [ 9.6.p2 ] [ 9.6.p3 ] [ 9.6.p4 ] [ 10.0 ] [ 10.0.p1 ] [ 10.0.p2 ] [ 10.0.p3 ] [ 10.0.p4 ] [ 10.1 ] [ 10.1.p1 ] [ 10.1.p2 ] [ 10.1.p3 ] [ 10.2 ] [ 10.2.p1 ] [ 10.2.p2 ] [ 10.2.p3 ] [ 10.3 ] [ 10.3.p1 ] [ 10.3.p2 ] [ 10.3.p3 ] [ 10.4 ] [ 10.4.p1 ] [ 10.4.p2 ] [ 10.4.p3 ] [ 10.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

Diff markup

Differences between /geometry/solids/specific/include/G4VTwistSurface.hh (Version 11.3.0) and /geometry/solids/specific/include/G4VTwistSurface.hh (Version 8.0)


  1 //                                                  1 //
  2 // *******************************************      2 // ********************************************************************
  3 // * License and Disclaimer                    <<   3 // * DISCLAIMER                                                       *
  4 // *                                                4 // *                                                                  *
  5 // * The  Geant4 software  is  copyright of th <<   5 // * The following disclaimer summarizes all the specific disclaimers *
  6 // * the Geant4 Collaboration.  It is provided <<   6 // * of contributors to this software. The specific disclaimers,which *
  7 // * conditions of the Geant4 Software License <<   7 // * govern, are listed with their locations in:                      *
  8 // * LICENSE and available at  http://cern.ch/ <<   8 // *   http://cern.ch/geant4/license                                  *
  9 // * include a list of copyright holders.      << 
 10 // *                                                9 // *                                                                  *
 11 // * Neither the authors of this software syst     10 // * Neither the authors of this software system, nor their employing *
 12 // * institutes,nor the agencies providing fin     11 // * institutes,nor the agencies providing financial support for this *
 13 // * work  make  any representation or  warran     12 // * work  make  any representation or  warranty, express or implied, *
 14 // * regarding  this  software system or assum     13 // * regarding  this  software system or assume any liability for its *
 15 // * use.  Please see the license in the file  <<  14 // * use.                                                             *
 16 // * for the full disclaimer and the limitatio << 
 17 // *                                               15 // *                                                                  *
 18 // * This  code  implementation is the result  <<  16 // * This  code  implementation is the  intellectual property  of the *
 19 // * technical work of the GEANT4 collaboratio <<  17 // * GEANT4 collaboration.                                            *
 20 // * By using,  copying,  modifying or  distri <<  18 // * By copying,  distributing  or modifying the Program (or any work *
 21 // * any work based  on the software)  you  ag <<  19 // * based  on  the Program)  you indicate  your  acceptance of  this *
 22 // * use  in  resulting  scientific  publicati <<  20 // * statement, and all its terms.                                    *
 23 // * acceptance of all terms of the Geant4 Sof << 
 24 // *******************************************     21 // ********************************************************************
 25 //                                                 22 //
                                                   >>  23 //
                                                   >>  24 // $Id: G4VTwistSurface.hh,v 1.3 2005/12/06 09:22:13 gcosmo Exp $
                                                   >>  25 // GEANT4 tag $Name: geant4-08-00 $
                                                   >>  26 //
                                                   >>  27 // 
                                                   >>  28 // --------------------------------------------------------------------
                                                   >>  29 // GEANT 4 class header file
                                                   >>  30 //
                                                   >>  31 //
 26 // G4VTwistSurface                                 32 // G4VTwistSurface
 27 //                                                 33 //
 28 // Class description:                              34 // Class description:
 29 //                                                 35 //
 30 // Abstract base class for boundary surface of <<  36 //  Abstract base class for boundary surface of G4VSolid.
 31                                                    37 
 32 // 01-Aug-2002 - Kotoyo Hoshina (hoshina@hepbu <<  38 // Author: 
 33 // 13-Nov-2003 - O.Link (Oliver.Link@cern.ch), <<  39 //   01-Aug-2002 - Kotoyo Hoshina (hoshina@hepburn.s.chiba-u.ac.jp)
 34 //               from original version in Jupi <<  40 //
                                                   >>  41 // History:
                                                   >>  42 //   13-Nov-2003 - O.Link (Oliver.Link@cern.ch), Integration in Geant4
                                                   >>  43 //                 from original version in Jupiter-2.5.02 application.
 35 // -------------------------------------------     44 // --------------------------------------------------------------------
 36 #ifndef G4VTWISTSURFACE_HH                     <<  45 #ifndef __G4VTWISTSURFACE__
 37 #define G4VTWISTSURFACE_HH                     <<  46 #define __G4VTWISTSURFACE__
 38                                                << 
 39 #include <CLHEP/Units/SystemOfUnits.h>         << 
 40                                                    47 
 41 #include "G4VSolid.hh"                             48 #include "G4VSolid.hh"
 42 #include "geomdefs.hh"                             49 #include "geomdefs.hh"
 43                                                    50 
 44 #include "G4RotationMatrix.hh"                     51 #include "G4RotationMatrix.hh"
 45                                                    52 
 46 #define G4VSURFACENXX 10                           53 #define G4VSURFACENXX 10
 47                                                    54 
 48 class G4VTwistSurface                              55 class G4VTwistSurface
 49 {                                                  56 {
 50  public:                                       <<  57  public:  // without description
                                                   >>  58 
                                                   >>  59    enum EValidate      {kDontValidate = 0, kValidateWithTol = 1, 
                                                   >>  60                         kValidateWithoutTol = 2, kUninitialized = 3};
 51                                                    61 
 52    enum EValidate { kDontValidate = 0, kValida <<  62  public:  // with description
 53                     kValidateWithoutTol = 2, k << 
 54                                                    63 
 55    G4VTwistSurface (const G4String& name);     <<  64    G4VTwistSurface (const G4String &name);
 56    G4VTwistSurface (const G4String& name,      <<  65    G4VTwistSurface (const G4String &name,
 57                     const G4RotationMatrix& ro <<  66                const G4RotationMatrix &rot,
 58                     const G4ThreeVector&    tl <<  67                const G4ThreeVector    &tlate,
 59                           G4int             ha <<  68                      G4int             handedness,
 60                     const EAxis             ax <<  69                const EAxis             axis1,
 61                     const EAxis             ax <<  70                const EAxis             axis2,
 62                           G4double          ax <<  71                      G4double          axis0min = -kInfinity,
 63                           G4double          ax <<  72                      G4double          axis1min = -kInfinity,
 64                           G4double          ax <<  73                      G4double          axis0max = kInfinity,
 65                           G4double          ax <<  74                      G4double          axis1max = kInfinity);
 66                                                    75 
 67    virtual ~G4VTwistSurface() = default;       <<  76    virtual ~G4VTwistSurface();
 68                                                    77 
 69    virtual G4int     AmIOnLeftSide(const G4Thr <<  78    virtual G4int     AmIOnLeftSide(const G4ThreeVector &me, 
 70                                    const G4Thr <<  79                                    const G4ThreeVector &vec, 
 71                                          G4boo     80                                          G4bool withTol = true);
 72                                                    81 
 73    virtual G4double  DistanceToBoundary(           82    virtual G4double  DistanceToBoundary(      G4int areacode,
 74                                                <<  83                                               G4ThreeVector &xx,
 75                                         const  <<  84                                         const G4ThreeVector &p) ;
 76                                                    85 
 77    virtual G4double  DistanceToIn(const G4Thre <<  86 
 78                                   const G4Thre <<  87    virtual G4double  DistanceToIn(const G4ThreeVector &gp,
 79                                         G4Thre <<  88                                   const G4ThreeVector &gv,
 80    virtual G4double  DistanceToOut(const G4Thr <<  89                                         G4ThreeVector &gxxbest);
 81                                    const G4Thr <<  90    virtual G4double  DistanceToOut(const G4ThreeVector &gp,
 82                                          G4Thr <<  91                                    const G4ThreeVector &gv,
 83    virtual G4double  DistanceTo(const G4ThreeV <<  92                                          G4ThreeVector &gxxbest);
 84                                       G4ThreeV <<  93    virtual G4double  DistanceTo(const G4ThreeVector &gp,
                                                   >>  94                                       G4ThreeVector &gxx);
 85                                                    95       
 86    virtual G4int     DistanceToSurface(const G <<  96    virtual G4int     DistanceToSurface(const G4ThreeVector &gp,
 87                                        const G <<  97                                        const G4ThreeVector &gv,
 88                                              G     98                                              G4ThreeVector gxx[],
 89                                              G     99                                              G4double      distance[],
 90                                              G    100                                              G4int         areacode[],
 91                                              G    101                                              G4bool        isvalid[],
 92                                        EValida    102                                        EValidate validate=kValidateWithTol) = 0;
 93                                                   103 
 94    virtual G4int     DistanceToSurface(const G << 104    virtual G4int     DistanceToSurface(const G4ThreeVector &gp,
 95                                              G    105                                              G4ThreeVector gxx[],
 96                                              G    106                                              G4double      distance[],
 97                                              G    107                                              G4int         areacode[]) = 0;
 98                                                   108                                              
 99    void              DebugPrint() const;          109    void              DebugPrint() const;
100                                                   110 
101    virtual G4ThreeVector GetNormal(const G4Thr << 111    // get methods
                                                   >> 112 
                                                   >> 113    virtual G4ThreeVector GetNormal(const G4ThreeVector &xx,G4bool isGlobal) = 0;
102                                                   114    
103    virtual G4String      GetName() const { ret    115    virtual G4String      GetName() const { return fName; }
104    virtual void          GetBoundaryParameters << 116    virtual void          GetBoundaryParameters(const G4int   &areacode,
105                                                << 117                                                G4ThreeVector &d,
106                                                << 118                                                G4ThreeVector &x0,
107                                                << 119                                                G4int &boundarytype) const;
108    virtual G4ThreeVector GetBoundaryAtPZ(G4int    120    virtual G4ThreeVector GetBoundaryAtPZ(G4int areacode,
109                                          const << 121                                          const G4ThreeVector &p) const;
110                                                   122 
111    inline  G4double DistanceToPlaneWithV(const << 123    inline  G4double      DistanceToPlaneWithV(const G4ThreeVector &p,
112                                          const << 124                                               const G4ThreeVector &v,
113                                          const << 125                                               const G4ThreeVector &x0,
114                                          const << 126                                               const G4ThreeVector &n0,
115                                                << 127                                                     G4ThreeVector &xx);
116                                                << 128 
117    inline  G4double DistanceToPlane(const G4Th << 129    inline  G4double      DistanceToPlane(const G4ThreeVector &p,
118                                     const G4Th << 130                                          const G4ThreeVector &x0,
119                                     const G4Th << 131                                          const G4ThreeVector &n0,
120                                           G4Th << 132                                                G4ThreeVector &xx);
121                                                   133    
122    inline  G4double DistanceToPlane(const G4Th << 134    inline  G4double      DistanceToPlane(const G4ThreeVector &p,
123                                     const G4Th << 135                                          const G4ThreeVector &x0,
124                                     const G4Th << 136                                          const G4ThreeVector &t1,
125                                     const G4Th << 137                                          const G4ThreeVector &t2,
126                                           G4Th << 138                                                G4ThreeVector &xx,
127                                           G4Th << 139                                                G4ThreeVector &n);
128                                                << 140 
129    inline  G4double DistanceToLine (const G4Th << 141    inline  G4double      DistanceToLine (const G4ThreeVector &p,
130                                     const G4Th << 142                                          const G4ThreeVector &x0,
131                                     const G4Th << 143                                          const G4ThreeVector &d,
132                                           G4Th << 144                                                G4ThreeVector &xx);
133                                                << 145                                                
134    inline G4bool IsAxis0    (G4int areacode) c << 146    inline  G4bool IsAxis0    (G4int areacode) const;
135    inline G4bool IsAxis1    (G4int areacode) c << 147    inline  G4bool IsAxis1    (G4int areacode) const;
136    inline G4bool IsOutside  (G4int areacode) c << 148    inline  G4bool IsOutside  (G4int areacode) const;
137    inline G4bool IsInside   (G4int areacode, G << 149    inline  G4bool IsInside   (G4int areacode, G4bool testbitmode = false) const;
138    inline G4bool IsBoundary (G4int areacode, G << 150    inline  G4bool IsBoundary (G4int areacode, G4bool testbitmode = false) const;
139    inline G4bool IsCorner   (G4int areacode, G << 151    inline  G4bool IsCorner   (G4int areacode, G4bool testbitmode = false) const;
140    inline G4bool IsValidNorm() const { return  << 152    inline  G4bool IsValidNorm() const { return fIsValidNorm; }
141    G4bool IsSameBoundary (G4VTwistSurface* sur << 153            G4bool IsSameBoundary (G4VTwistSurface *surface1, G4int areacode1,
142                           G4VTwistSurface* sur << 154                                   G4VTwistSurface *surface2, G4int areacode2 ) const;
143    inline G4int  GetAxisType(G4int areacode, G << 155    inline  G4int  GetAxisType(G4int areacode, G4int whichaxis) const;
144                                                << 156 
145    inline G4ThreeVector ComputeGlobalPoint     << 157    inline  G4ThreeVector ComputeGlobalPoint     (const G4ThreeVector &lp) const;
146    inline G4ThreeVector ComputeLocalPoint      << 158    inline  G4ThreeVector ComputeLocalPoint      (const G4ThreeVector &gp) const;
147    inline G4ThreeVector ComputeGlobalDirection << 159    inline  G4ThreeVector ComputeGlobalDirection (const G4ThreeVector &lp) const;
148    inline G4ThreeVector ComputeLocalDirection  << 160    inline  G4ThreeVector ComputeLocalDirection  (const G4ThreeVector &gp) const;
149                                                   161   
150    // set methods                                 162    // set methods
151                                                   163 
152    inline void SetAxis(G4int i, const EAxis ax    164    inline void SetAxis(G4int i, const EAxis axis)  { fAxis[i] = axis; }
153    inline void SetNeighbours(G4VTwistSurface*  << 165    inline void SetNeighbours(G4VTwistSurface* axis0min, G4VTwistSurface* axis1min, 
154                              G4VTwistSurface*  << 166                              G4VTwistSurface* axis0max, G4VTwistSurface* axis1max);
155                                                   167 
156    virtual G4ThreeVector SurfacePoint(G4double << 168    virtual G4ThreeVector SurfacePoint(G4double , G4double,
157                                       G4bool i    169                                       G4bool isGlobal = false ) = 0 ;
158    virtual G4double GetBoundaryMin(G4double) =    170    virtual G4double GetBoundaryMin(G4double) = 0 ;
159    virtual G4double GetBoundaryMax(G4double) =    171    virtual G4double GetBoundaryMax(G4double) = 0 ;
160    virtual G4double GetSurfaceArea() = 0 ;        172    virtual G4double GetSurfaceArea() = 0 ;
161    virtual void GetFacets(G4int m, G4int n, G4    173    virtual void GetFacets(G4int m, G4int n, G4double xyz[][3],
162                           G4int faces[][4], G4    174                           G4int faces[][4], G4int iside) = 0 ;
163    G4int GetNode( G4int i, G4int j, G4int m, G << 175    G4int GetNode( G4int i, G4int j, G4int m, G4int n, G4int iside )  ;
164    G4int GetFace( G4int i, G4int j, G4int m, G << 176    G4int GetFace( G4int i, G4int j, G4int m, G4int n, G4int iside )  ;
165    G4int GetEdgeVisibility( G4int i, G4int j,  << 177 
166                             G4int number, G4in << 178 
                                                   >> 179  public:  // without description
167                                                   180 
168    G4VTwistSurface(__void__&);                    181    G4VTwistSurface(__void__&);
169      // Fake default constructor for usage res    182      // Fake default constructor for usage restricted to direct object
170      // persistency for clients requiring prea    183      // persistency for clients requiring preallocation of memory for
171      // persistifiable objects.                   184      // persistifiable objects.
172                                                   185 
173  protected:                                    << 186  protected:  // with description
174                                                   187  
175    inline G4VTwistSurface** GetNeighbours() {  << 188    // get methods
176    inline G4int GetNeighbours(G4int areacode,  << 189 
177    inline G4ThreeVector GetCorner(G4int areaco << 190    inline  G4VTwistSurface**  GetNeighbours() { return fNeighbours; } 
178    void GetBoundaryAxis(G4int areacode, EAxis  << 191    inline  G4int GetNeighbours(G4int areacode, G4VTwistSurface* surfaces[]);
179    void GetBoundaryLimit(G4int areacode, G4dou << 192    inline  G4ThreeVector GetCorner(G4int areacode) const;
180    virtual G4int GetAreaCode(const G4ThreeVect << 193            void GetBoundaryAxis(G4int areacode, EAxis axis[]) const;
181                                                << 194            void GetBoundaryLimit(G4int areacode, G4double limit[]) const;
182    virtual void SetBoundary(const G4int&       << 195    virtual G4int GetAreaCode(const G4ThreeVector &xx, G4bool withtol=true) = 0;
183                             const G4ThreeVecto << 196       
184                             const G4ThreeVecto << 197    // set methods
185                             const G4int&       << 198 
                                                   >> 199    virtual void SetBoundary(const G4int         &axiscode, 
                                                   >> 200                             const G4ThreeVector &direction,
                                                   >> 201                             const G4ThreeVector &x0, 
                                                   >> 202                             const G4int         &boundarytype);
186      // areacode must be one of them:             203      // areacode must be one of them:
187      // sAxis0 & sAxisMin, sAxis0 & sAxisMax,     204      // sAxis0 & sAxisMin, sAxis0 & sAxisMax,
188      // sAxis1 & sAxisMin, sAxis1 & sAxisMax.     205      // sAxis1 & sAxisMin, sAxis1 & sAxisMax.
189      // boundarytype represents the shape of l    206      // boundarytype represents the shape of locus
190      // from the start point to end point of b    207      // from the start point to end point of boundary.
191      // ex.                                       208      // ex.
192      // sAxisRho = linear line which start poi    209      // sAxisRho = linear line which start point is fixed at origin.
193      // sAxisPhi = part of circle which center    210      // sAxisPhi = part of circle which center placed at the origin.
194                                                   211                             
195    void SetCorner(G4int areacode, G4double x,     212    void SetCorner(G4int areacode, G4double x, G4double y, G4double z);
196                                                   213 
197  private:                                         214  private:
198                                                   215 
199    virtual void SetBoundaries() = 0;              216    virtual void SetBoundaries() = 0;
200    virtual void SetCorners()    = 0;              217    virtual void SetCorners()    = 0;
201                                                   218    
202  // data members -----------------------------    219  // data members ---------------------------------------------------------
203                                                   220 
204  public:                                          221  public:
205                                                   222 
206    static const G4int sOutside ;                  223    static const G4int sOutside ;
207    static const G4int sInside  ;                  224    static const G4int sInside  ;
208    static const G4int sBoundary;                  225    static const G4int sBoundary;
209    static const G4int sCorner;                    226    static const G4int sCorner;
210    static const G4int sC0Min1Min;                 227    static const G4int sC0Min1Min;
211    static const G4int sC0Max1Min;                 228    static const G4int sC0Max1Min;
212    static const G4int sC0Max1Max;                 229    static const G4int sC0Max1Max;
213    static const G4int sC0Min1Max;                 230    static const G4int sC0Min1Max;
214    static const G4int sAxisMin;                   231    static const G4int sAxisMin;
215    static const G4int sAxisMax;                   232    static const G4int sAxisMax;
216    static const G4int sAxisX;                     233    static const G4int sAxisX;
217    static const G4int sAxisY;                     234    static const G4int sAxisY;
218    static const G4int sAxisZ;                     235    static const G4int sAxisZ;
219    static const G4int sAxisRho;                   236    static const G4int sAxisRho;
220    static const G4int sAxisPhi;                   237    static const G4int sAxisPhi;
221    static const G4int sAxis0;                     238    static const G4int sAxis0;
222    static const G4int sAxis1;                     239    static const G4int sAxis1;
223    static const G4int sSizeMask;                  240    static const G4int sSizeMask;
224    static const G4int sAxisMask;                  241    static const G4int sAxisMask;
225    static const G4int sAreaMask;                  242    static const G4int sAreaMask;
226                                                   243 
227  protected:                                       244  protected:
228                                                   245  
229    class CurrentStatus                            246    class CurrentStatus 
230    {                                              247    {
231      public:                                   << 248     public:
232                                                   249 
233       CurrentStatus();                            250       CurrentStatus();
234       virtual ~CurrentStatus();                   251       virtual ~CurrentStatus();
235                                                   252       
236       inline G4ThreeVector GetXX(G4int i)         253       inline G4ThreeVector GetXX(G4int i)       const { return fXX[i];       }
237       inline G4double      GetDistance(G4int i    254       inline G4double      GetDistance(G4int i) const { return fDistance[i]; }
238       inline G4int         GetAreacode(G4int i    255       inline G4int         GetAreacode(G4int i) const { return fAreacode[i]; }
239       inline G4int         GetNXX()               256       inline G4int         GetNXX()             const { return fNXX;         }
240       inline G4bool        IsDone()               257       inline G4bool        IsDone()             const { return fDone;        }
241       inline G4bool        IsValid(G4int i)       258       inline G4bool        IsValid(G4int i)     const { return fIsValid[i];  }
242                                                   259 
243       void SetCurrentStatus(G4int                 260       void SetCurrentStatus(G4int                i, 
244                             G4ThreeVector&     << 261                             G4ThreeVector       &xx, 
245                             G4double&          << 262                             G4double            &dist, 
246                             G4int&             << 263                             G4int               &areacode, 
247                             G4bool&            << 264                             G4bool              &isvalid,
248                             G4int                 265                             G4int                nxx,
249                             EValidate             266                             EValidate            validate,
250                       const G4ThreeVector* p,  << 267                       const G4ThreeVector *p, 
251                       const G4ThreeVector* v = << 268                       const G4ThreeVector *v = 0);
252                                                   269 
253       void ResetfDone(EValidate validate,      << 270       void ResetfDone(EValidate            validate,
254                 const G4ThreeVector* p,        << 271                 const G4ThreeVector *p, 
255                 const G4ThreeVector* v = nullp << 272                 const G4ThreeVector *v = 0);
256                                                   273 
257                                                   274 
258       void DebugPrint() const;                    275       void DebugPrint() const;
259                                                   276 
260      private:                                  << 277     private:
261                                                   278 
262       G4double             fDistance[G4VSURFAC    279       G4double             fDistance[G4VSURFACENXX];
263       G4ThreeVector        fXX[G4VSURFACENXX];    280       G4ThreeVector        fXX[G4VSURFACENXX];
264       G4int                fAreacode[G4VSURFAC    281       G4int                fAreacode[G4VSURFACENXX];
265       G4bool               fIsValid[G4VSURFACE    282       G4bool               fIsValid[G4VSURFACENXX];
266       G4int                fNXX;                  283       G4int                fNXX;
267       G4ThreeVector        fLastp;                284       G4ThreeVector        fLastp;
268       G4ThreeVector        fLastv;                285       G4ThreeVector        fLastv;
269       EValidate            fLastValidate;         286       EValidate            fLastValidate;
270       G4bool               fDone;                 287       G4bool               fDone;
271    };                                             288    };
272                                                   289       
273    class Boundary                                 290    class Boundary 
274    {                                              291    {
275      public:                                   << 292     public:
276                                                << 293       Boundary();
277       Boundary() = default;                    << 294       virtual ~Boundary();
278       virtual ~Boundary() = default;           << 
279                                                   295       
280       void SetFields(const G4int&        areac << 296       void SetFields(const G4int         &areacode, 
281                      const G4ThreeVector& d,   << 297                      const G4ThreeVector &d, 
282                      const G4ThreeVector& x0,  << 298                      const G4ThreeVector &x0, 
283                      const G4int&         boun << 299                      const G4int         &boundarytype);
284                                                   300       
285       G4bool IsEmpty() const;                     301       G4bool IsEmpty() const;
286                                                   302       
287       G4bool GetBoundaryParameters(const G4int << 303       G4bool GetBoundaryParameters(const G4int         &areacode, 
288                                          G4Thr << 304                                          G4ThreeVector &d,
289                                          G4Thr << 305                                          G4ThreeVector &x0, 
290                                          G4int << 306                                          G4int         &boundarytype) const;
291                                                   307 
292      private:                                  << 308     private:
293                                                << 309       G4int          fBoundaryAcode;
294       G4int          fBoundaryAcode{-1};       << 
295       G4ThreeVector  fBoundaryDirection;          310       G4ThreeVector  fBoundaryDirection;
296       G4ThreeVector  fBoundaryX0;                 311       G4ThreeVector  fBoundaryX0;
297       G4int          fBoundaryType{0};         << 312       G4int          fBoundaryType;
298    };                                             313    };
299                                                   314 
300    EAxis               fAxis[2];                  315    EAxis               fAxis[2];
301    G4double            fAxisMin[2];               316    G4double            fAxisMin[2];
302    G4double            fAxisMax[2];               317    G4double            fAxisMax[2];
303    CurrentStatus       fCurStatWithV;             318    CurrentStatus       fCurStatWithV;
304    CurrentStatus       fCurStat;                  319    CurrentStatus       fCurStat;
305    G4RotationMatrix    fRot;                      320    G4RotationMatrix    fRot;
306    G4ThreeVector       fTrans;                    321    G4ThreeVector       fTrans;
307    G4int               fHandedness;               322    G4int               fHandedness;
308    class G4SurfCurNormal                          323    class G4SurfCurNormal
309    {                                              324    {
310      public:                                      325      public:
311                                                << 
312        G4ThreeVector p;                           326        G4ThreeVector p;
313        G4ThreeVector normal;                      327        G4ThreeVector normal;
314    };                                             328    };
315    G4SurfCurNormal     fCurrentNormal;            329    G4SurfCurNormal     fCurrentNormal;
316    G4bool              fIsValidNorm;              330    G4bool              fIsValidNorm;
317    G4double            kCarTolerance;          << 
318                                                   331                         
319  private:                                         332  private:
320                                                   333                      
321    G4VTwistSurface* fNeighbours[4]; // {0,1,2, << 334    G4VTwistSurface    *fNeighbours[4]; // {0,1,2,3} = sAxis0min, sAxis1min, 
322                                     //         << 335                                   //             sAxis0max, sAxis1max
323    G4ThreeVector fCorners[4];     // corners o    336    G4ThreeVector fCorners[4];     // corners of the surface in local coordinate
324    Boundary      fBoundaries[4];  // boundarie    337    Boundary      fBoundaries[4];  // boundaries of the surface.
325    G4String      fName;                           338    G4String      fName;
326                                                   339    
327    class G4SurfSideQuery                          340    class G4SurfSideQuery
328    {                                              341    {
329      public:                                      342      public:
330                                                << 
331        G4ThreeVector me;                          343        G4ThreeVector me;
332        G4ThreeVector vec;                         344        G4ThreeVector vec;
333        G4bool        withTol;                     345        G4bool        withTol;
334        G4int         amIOnLeftSide;               346        G4int         amIOnLeftSide;
335    };                                             347    };
336    G4SurfSideQuery fAmIOnLeftSide;                348    G4SurfSideQuery fAmIOnLeftSide;
337 };                                                349 };
338                                                   350 
339 //============================================    351 //========================================================
340 // inline functions                               352 // inline functions
341 //============================================    353 //========================================================
342                                                   354 
343 struct Intersection                               355 struct Intersection
344 {                                                 356 {    
345   G4double phi ;  // parameter phi                357   G4double phi ;  // parameter phi
346   G4double u ;    // parameter u                  358   G4double u ;    // parameter u
347   G4ThreeVector xx ;   // intersection point i    359   G4ThreeVector xx ;   // intersection point in cartesian
348   G4double distance ;  // distance to intersec    360   G4double distance ;  // distance to intersection
349   G4int areacode ;     // the areacode of the  << 361   G4int areacode;      // the areacode of the intersection
350   G4bool isvalid ;     // valid intersection ?    362   G4bool isvalid ;     // valid intersection ??
351                                                   363 
352 };                                                364 };
353                                                   365 
354 inline                                            366 inline
355 G4bool DistanceSort( const Intersection& a, co << 367 G4bool DistanceSort( const Intersection &a, const Intersection &b) 
356 {                                                 368 {
357   return a.distance < b.distance ;                369   return a.distance < b.distance ;
358 }                                                 370 }
359                                                   371 
360 inline                                            372 inline
361 G4bool EqualIntersection( const Intersection&  << 373 G4bool EqualIntersection( const Intersection &a, const Intersection &b)
362 {                                                 374 {
363   return ( ( a.xx - b.xx ).mag() < 1E-9*CLHEP: << 375   return ( ( a.xx - b.xx ).mag() < kCarTolerance ) ;
364 }                                                 376 }
365                                                   377 
366 #include "G4VTwistSurface.icc"                    378 #include "G4VTwistSurface.icc"
367                                                   379 
368 #endif                                            380 #endif
369                                                   381