71 if ( pMin > fxAxisMin ) fxAxisMin = pMin ;
72 if ( pMax < fxAxisMax ) fxAxisMax = pMax ;
74 else if ( pAxis ==
kYAxis )
76 if ( pMin > fyAxisMin ) fyAxisMin = pMin ;
77 if ( pMax < fyAxisMax ) fyAxisMax = pMax ;
81 assert( pAxis ==
kZAxis ) ;
83 if ( pMin > fzAxisMin ) fzAxisMin = pMin ;
84 if ( pMax < fzAxisMax ) fzAxisMax = pMax ;
118 remainsAfterClip =
false;
120 else if ( sCode == 0 && eCode == 0 )
124 remainsAfterClip = true ;
154 while ( sCode != eCode )
164 z1 += (fxAxisMin-x1)*(z2-z1)/(x2-x1);
165 y1 += (fxAxisMin-x1)*(y2-y1)/(x2-x1);
168 else if ( sCode & 0x02 )
170 z1 += (fxAxisMax-x1)*(z2-z1)/(x2-x1);
171 y1 += (fxAxisMax-x1)*(y2-y1)/(x2-x1);
174 else if ( sCode & 0x04 )
176 x1 += (fyAxisMin-y1)*(x2-x1)/(y2-y1);
177 z1 += (fyAxisMin-y1)*(z2-z1)/(y2-y1);
180 else if ( sCode & 0x08 )
182 x1 += (fyAxisMax-y1)*(x2-x1)/(y2-y1);
183 z1 += (fyAxisMax-y1)*(z2-z1)/(y2-y1);
186 else if ( sCode & 0x10 )
188 x1 += (fzAxisMin-z1)*(x2-x1)/(z2-z1);
189 y1 += (fzAxisMin-z1)*(y2-y1)/(z2-z1);
192 else if ( sCode & 0x20 )
194 x1 += (fzAxisMax-z1)*(x2-x1)/(z2-z1);
195 y1 += (fzAxisMax-z1)*(y2-y1)/(z2-z1);
203 z2 += (fxAxisMin-x2)*(z1-z2)/(x1-x2);
204 y2 += (fxAxisMin-x2)*(y1-y2)/(x1-x2);
207 else if ( eCode & 0x02 )
209 z2 += (fxAxisMax-x2)*(z1-z2)/(x1-x2);
210 y2 += (fxAxisMax-x2)*(y1-y2)/(x1-x2);
213 else if ( eCode & 0x04 )
215 x2 += (fyAxisMin-y2)*(x1-x2)/(y1-y2);
216 z2 += (fyAxisMin-y2)*(z1-z2)/(y1-y2);
221 x2 += (fyAxisMax-y2)*(x1-x2)/(y1-y2);
222 z2 += (fyAxisMax-y2)*(z1-z2)/(y1-y2);
225 else if ( eCode & 0x10 )
227 x2 += (fzAxisMin-z2)*(x1-x2)/(z1-z2);
228 y2 += (fzAxisMin-z2)*(y1-y2)/(z1-z2);
231 else if ( eCode & 0x20 )
233 x2 += (fzAxisMax-z2)*(x1-x2)/(z1-z2);
234 y2 += (fzAxisMax-z2)*(y1-y2)/(z1-z2);
244 if ( sCode == 0 && eCode == 0 ) remainsAfterClip =
true;
245 else remainsAfterClip =
false;
247 return remainsAfterClip;
268 if ( pVec.
x() < fxAxisMin ) code |= 0x01 ;
269 if ( pVec.
x() > fxAxisMax ) code |= 0x02 ;
273 if ( pVec.
y() < fyAxisMin ) code |= 0x04 ;
274 if ( pVec.
y() > fyAxisMax ) code |= 0x08 ;
278 if ( pVec.
z() < fzAxisMin ) code |= 0x10 ;
279 if ( pVec.
z() > fzAxisMax ) code |= 0x20 ;
static const G4double kInfinity
G4double GetMinYExtent() const
CLHEP::Hep3Vector G4ThreeVector
G4bool IsYLimited() const
G4bool IsXLimited() const
G4double GetMaxXExtent() const
void AddLimit(const EAxis pAxis, const G4double pMin, const G4double pMax)
G4double GetMinZExtent() const
G4int OutCode(const G4ThreeVector &pVec) const
G4double GetMinXExtent() const
G4double GetMaxZExtent() const
std::ostream & operator<<(std::ostream &, const BasicVector3D< float > &)
G4double GetMaxYExtent() const
G4bool IsZLimited() const
G4bool ClipToLimits(G4ThreeVector &pStart, G4ThreeVector &pEnd) const