Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4SolidExtentList Class Reference

#include <G4SolidExtentList.hh>

Collaboration diagram for G4SolidExtentList:

Public Member Functions

 G4SolidExtentList ()
 
 G4SolidExtentList (const EAxis targetAxis, const G4VoxelLimits &voxelLimits)
 
 ~G4SolidExtentList ()
 
void AddSurface (const G4ClippablePolygon &surface)
 
G4bool GetExtent (G4double &min, G4double &max) const
 

Protected Attributes

EAxis axis
 
G4bool limited
 
G4double minLimit
 
G4double maxLimit
 
G4ClippablePolygon minSurface
 
G4ClippablePolygon maxSurface
 
G4ClippablePolygon minAbove
 
G4ClippablePolygon maxBelow
 

Detailed Description

Definition at line 54 of file G4SolidExtentList.hh.

Constructor & Destructor Documentation

G4SolidExtentList::G4SolidExtentList ( )

Definition at line 48 of file G4SolidExtentList.cc.

49 {
50  axis = kZAxis;
51  limited = false;
52  minLimit = -INT_MAX/2;
53  maxLimit = INT_MAX/2;
54 }
#define INT_MAX
Definition: templates.hh:111
G4SolidExtentList::G4SolidExtentList ( const EAxis  targetAxis,
const G4VoxelLimits voxelLimits 
)

Definition at line 60 of file G4SolidExtentList.cc.

62 {
63  axis = targetAxis;
64 
65  limited = voxelLimits.IsLimited( axis );
66  if (limited)
67  {
68  minLimit = voxelLimits.GetMinExtent( axis );
69  maxLimit = voxelLimits.GetMaxExtent( axis );
70  }
71  else
72  {
73  minLimit = -INT_MAX/2;
74  maxLimit = INT_MAX/2;
75  }
76 }
G4bool IsLimited() const
#define INT_MAX
Definition: templates.hh:111
G4double GetMaxExtent(const EAxis pAxis) const
G4double GetMinExtent(const EAxis pAxis) const

Here is the call graph for this function:

G4SolidExtentList::~G4SolidExtentList ( )

Definition at line 82 of file G4SolidExtentList.cc.

83 {
84 }

Member Function Documentation

void G4SolidExtentList::AddSurface ( const G4ClippablePolygon surface)

Definition at line 91 of file G4SolidExtentList.cc.

92 {
93  //
94  // Keep track of four surfaces
95  //
96  G4double min, max;
97 
98  surface.GetExtent( axis, min, max );
99 
100  if (min > maxLimit)
101  {
102  //
103  // Nearest surface beyond maximum limit
104  //
105  if (surface.InFrontOf(minAbove,axis)) minAbove = surface;
106  }
107  else if (max < minLimit)
108  {
109  //
110  // Nearest surface below minimum limit
111  //
112  if (surface.BehindOf(maxBelow,axis)) maxBelow = surface;
113  }
114  else
115  {
116  //
117  // Max and min surfaces inside
118  //
119  if (surface.BehindOf(maxSurface,axis)) maxSurface = surface;
120  if (surface.InFrontOf(minSurface,axis)) minSurface = surface;
121  }
122 }
virtual G4bool InFrontOf(const G4ClippablePolygon &other, EAxis axis) const
G4ClippablePolygon maxBelow
virtual G4bool BehindOf(const G4ClippablePolygon &other, EAxis axis) const
virtual G4bool GetExtent(const EAxis axis, G4double &min, G4double &max) const
T max(const T t1, const T t2)
brief Return the largest of the two arguments
G4ClippablePolygon minSurface
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
G4ClippablePolygon maxSurface
double G4double
Definition: G4Types.hh:76
G4ClippablePolygon minAbove

Here is the call graph for this function:

Here is the caller graph for this function:

G4bool G4SolidExtentList::GetExtent ( G4double min,
G4double max 
) const

Definition at line 131 of file G4SolidExtentList.cc.

132 {
135  //
136  // Did we have any surfaces within the limits?
137  //
138  if (minSurface.Empty())
139  {
140  //
141  // Nothing! Do we have anything above?
142  //
143  if (minAbove.Empty()) return false;
144 
145  //
146  // Yup. Is it facing inwards?
147  //
148  if (minAbove.GetNormal().operator()(axis) < 0) return false;
149 
150  //
151  // No. We must be entirely within the solid
152  //
155  return true;
156  }
157 
158  //
159  // Check max surface
160  //
161  if (maxSurface.GetNormal().operator()(axis) < 0)
162  {
163  //
164  // Inward facing: max limit must be embedded within solid
165  //
167  }
168  else
169  {
170  G4double sMin, sMax;
171  maxSurface.GetExtent( axis, sMin, sMax );
172  max = ( (sMax > maxLimit) ? maxLimit : sMax ) + kCarTolerance;
173  }
174 
175  //
176  // Check min surface
177  //
178  if (minSurface.GetNormal().operator()(axis) > 0)
179  {
180  //
181  // Inward facing: max limit must be embedded within solid
182  //
184  }
185  else
186  {
187  G4double sMin, sMax;
188  minSurface.GetExtent( axis, sMin, sMax );
189  min = ( (sMin < minLimit) ? minLimit : sMin ) - kCarTolerance;
190  }
191 
192  return true;
193 }
G4double GetSurfaceTolerance() const
const G4ThreeVector GetNormal() const
virtual G4bool GetExtent(const EAxis axis, G4double &min, G4double &max) const
const G4double kCarTolerance
T max(const T t1, const T t2)
brief Return the largest of the two arguments
G4ClippablePolygon minSurface
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
G4bool Empty() const
G4ClippablePolygon maxSurface
double G4double
Definition: G4Types.hh:76
G4ClippablePolygon minAbove
static G4GeometryTolerance * GetInstance()

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

EAxis G4SolidExtentList::axis
protected

Definition at line 70 of file G4SolidExtentList.hh.

G4bool G4SolidExtentList::limited
protected

Definition at line 71 of file G4SolidExtentList.hh.

G4ClippablePolygon G4SolidExtentList::maxBelow
protected

Definition at line 75 of file G4SolidExtentList.hh.

G4double G4SolidExtentList::maxLimit
protected

Definition at line 73 of file G4SolidExtentList.hh.

G4ClippablePolygon G4SolidExtentList::maxSurface
protected

Definition at line 75 of file G4SolidExtentList.hh.

G4ClippablePolygon G4SolidExtentList::minAbove
protected

Definition at line 75 of file G4SolidExtentList.hh.

G4double G4SolidExtentList::minLimit
protected

Definition at line 72 of file G4SolidExtentList.hh.

G4ClippablePolygon G4SolidExtentList::minSurface
protected

Definition at line 75 of file G4SolidExtentList.hh.


The documentation for this class was generated from the following files: