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;
CLHEP::Hep3Vector G4ThreeVector
G4int OutCode(const G4ThreeVector &pVec) const