Geant4  10.01.p03
UTet.cc
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * This Software is part of the AIDA Unified Solids Library package *
4 // * See: https://aidasoft.web.cern.ch/USolids *
5 // ********************************************************************
6 //
7 // $Id:$
8 //
9 // --------------------------------------------------------------------
10 //
11 // UTet
12 //
13 // 19.07.13 Tatiana Nikitina
14 // Created from original implementation in Geant4
15 // --------------------------------------------------------------------
16 
17 #include <cmath>
18 #include <iostream>
19 #include <sstream>
20 #include "UTet.hh"
21 #include "UUtils.hh"
22 
23 using namespace std;
24 
25 
27 //
28 // Constructor - create a tetrahedron
29 // This class is implemented separately from general polyhedra,
30 // because the simplex geometry can be computed very quickly,
31 // which may become important in situations imported from mesh generators,
32 // in which a very large number of UTets are created.
33 // A Tet has all of its geometrical information precomputed
34 
35 UTet::UTet(const std::string& name,
36  UVector3 anchor,
37  UVector3 p2,
38  UVector3 p3,
39  UVector3 p4, bool* degeneracyFlag)
40  : VUSolid(name), warningFlag(0)
41 {
42  // fV<x><y> is vector from vertex <y> to vertex <x>
43  //
44  UVector3 fV21 = p2 - anchor;
45  UVector3 fV31 = p3 - anchor;
46  UVector3 fV41 = p4 - anchor;
47 
48  // make sure this is a correctly oriented set of points for the tetrahedron
49  //
50  double signed_vol = fV21.Cross(fV31).Dot(fV41);
51  if (signed_vol < 0.0)
52  {
53  UVector3 temp(p4);
54  p4 = p3;
55  p3 = temp;
56  temp = fV41;
57  fV41 = fV31;
58  fV31 = temp;
59  }
60  fCubicVolume = std::fabs(signed_vol) / 6.;
61 
62  //UVector3 fV24=p2-p4;
63  UVector3 fV43 = p4 - p3;
64  UVector3 fV32 = p3 - p2;
65 
66  fXMin = std::min(std::min(std::min(anchor.x(), p2.x()), p3.x()), p4.x());
67  fXMax = std::max(std::max(std::max(anchor.x(), p2.x()), p3.x()), p4.x());
68  fYMin = std::min(std::min(std::min(anchor.y(), p2.y()), p3.y()), p4.y());
69  fYMax = std::max(std::max(std::max(anchor.y(), p2.y()), p3.y()), p4.y());
70  fZMin = std::min(std::min(std::min(anchor.z(), p2.z()), p3.z()), p4.z());
71  fZMax = std::max(std::max(std::max(anchor.z(), p2.z()), p3.z()), p4.z());
72 
73  fDx = (fXMax - fXMin) * 0.5;
74  fDy = (fYMax - fYMin) * 0.5;
75  fDz = (fZMax - fZMin) * 0.5;
76 
77  fMiddle = UVector3(fXMax + fXMin, fYMax + fYMin, fZMax + fZMin) * 0.5;
78  fMaxSize = std::max(std::max(std::max((anchor - fMiddle).Mag(),
79  (p2 - fMiddle).Mag()),
80  (p3 - fMiddle).Mag()),
81  (p4 - fMiddle).Mag());
82 
83  bool degenerate = std::fabs(signed_vol) < 1e-9 * fMaxSize * fMaxSize * fMaxSize;
84 
85  if (degeneracyFlag) *degeneracyFlag = degenerate;
86  else if (degenerate)
87  {
88  UUtils::Exception("UTet::UTet()", "GeomSolids0002", UFatalErrorInArguments, 1,
89  "Degenerate tetrahedron not allowed.");
90  }
91 
92  fTol = 1e-9 * (std::fabs(fXMin) + std::fabs(fXMax) + std::fabs(fYMin)
93  + std::fabs(fYMax) + std::fabs(fZMin) + std::fabs(fZMax));
94  //fTol=kCarTolerance;
95 
96  fAnchor = anchor;
97  fP2 = p2;
98  fP3 = p3;
99  fP4 = p4;
100 
101  UVector3 fCenter123 = (anchor + p2 + p3) * (1.0 / 3.0); // face center
102  UVector3 fCenter134 = (anchor + p4 + p3) * (1.0 / 3.0);
103  UVector3 fCenter142 = (anchor + p4 + p2) * (1.0 / 3.0);
104  UVector3 fCenter234 = (p2 + p3 + p4) * (1.0 / 3.0);
105 
106  // compute area of each triangular face by cross product
107  // and sum for total surface area
108 
109  UVector3 normal123 = fV31.Cross(fV21);
110  UVector3 normal134 = fV41.Cross(fV31);
111  UVector3 normal142 = fV21.Cross(fV41);
112  UVector3 normal234 = fV32.Cross(fV43);
113 
114  fSurfaceArea = (
115  normal123.Mag() +
116  normal134.Mag() +
117  normal142.Mag() +
118  normal234.Mag()
119  ) / 2.0;
120 
121  fNormal123 = normal123.Unit();
122  fNormal134 = normal134.Unit();
123  fNormal142 = normal142.Unit();
124  fNormal234 = normal234.Unit();
125 
126  fCdotN123 = fCenter123.Dot(fNormal123);
127  fCdotN134 = fCenter134.Dot(fNormal134);
128  fCdotN142 = fCenter142.Dot(fNormal142);
129  fCdotN234 = fCenter234.Dot(fNormal234);
130 }
131 
133 //
134 // Fake default constructor - sets only member data and allocates memory
135 // for usage restricted to object persistency.
136 //
137 UTet::UTet( __void__&)
138  : VUSolid(""), fCubicVolume(0.), fSurfaceArea(0.),
139  fAnchor(0,0,0), fP2(0,0,0), fP3(0,0,0), fP4(0,0,0), fMiddle(0,0,0),
140  fNormal123(0,0,0), fNormal142(0,0,0), fNormal134(0,0,0),
141  fNormal234(0,0,0), warningFlag(0),
142  fCdotN123(0.), fCdotN142(0.), fCdotN134(0.), fCdotN234(0.),
143  fXMin(0.), fXMax(0.), fYMin(0.), fYMax(0.), fZMin(0.), fZMax(0.),
144  fDx(0.), fDy(0.), fDz(0.), fTol(0.), fMaxSize(0.)
145 {
146 }
147 
149 //
150 // Destructor
151 
153 {
154 }
155 
157 //
158 // Copy constructor
159 
160 UTet::UTet(const UTet& rhs)
161  : VUSolid(rhs),
162  fCubicVolume(rhs.fCubicVolume), fSurfaceArea(rhs.fSurfaceArea),
163  fAnchor(rhs.fAnchor),
164  fP2(rhs.fP2), fP3(rhs.fP3), fP4(rhs.fP4), fMiddle(rhs.fMiddle),
165  fNormal123(rhs.fNormal123), fNormal142(rhs.fNormal142),
166  fNormal134(rhs.fNormal134), fNormal234(rhs.fNormal234),
167  warningFlag(rhs.warningFlag), fCdotN123(rhs.fCdotN123),
168  fCdotN142(rhs.fCdotN142), fCdotN134(rhs.fCdotN134),
169  fCdotN234(rhs.fCdotN234), fXMin(rhs.fXMin), fXMax(rhs.fXMax),
170  fYMin(rhs.fYMin), fYMax(rhs.fYMax), fZMin(rhs.fZMin), fZMax(rhs.fZMax),
171  fDx(rhs.fDx), fDy(rhs.fDy), fDz(rhs.fDz), fTol(rhs.fTol),
172  fMaxSize(rhs.fMaxSize)
173 {
174 }
175 
176 
178 //
179 // Assignment operator
180 
182 {
183  // Check assignment to self
184  //
185  if (this == &rhs)
186  {
187  return *this;
188  }
189 
190  // Copy base class data
191  //
192  VUSolid::operator=(rhs);
193 
194  // Copy data
195  //
198  fAnchor = rhs.fAnchor;
199  fP2 = rhs.fP2;
200  fP3 = rhs.fP3;
201  fP4 = rhs.fP4;
202  fMiddle = rhs.fMiddle;
203  fNormal123 = rhs.fNormal123;
204  fNormal142 = rhs.fNormal142;
205  fNormal134 = rhs.fNormal134;
206  fNormal234 = rhs.fNormal234;
207  warningFlag = rhs.warningFlag;
208  fCdotN123 = rhs.fCdotN123;
209  fCdotN142 = rhs.fCdotN142;
210  fCdotN134 = rhs.fCdotN134;
211  fCdotN234 = rhs.fCdotN234;
212  fXMin = rhs.fXMin;
213  fXMax = rhs.fXMax;
214  fYMin = rhs.fYMin;
215  fYMax = rhs.fYMax;
216  fZMin = rhs.fZMin;
217  fZMax = rhs.fZMax;
218  fDx = rhs.fDx;
219  fDy = rhs.fDy;
220  fDz = rhs.fDz;
221  fTol = rhs.fTol;
222  fMaxSize = rhs.fMaxSize;
223 
224  return *this;
225 }
226 
228 //
229 // Return whether point inside/outside/on surface, using tolerance
230 
232 {
233  double r123, r134, r142, r234;
234 
235  // this is written to allow if-statement truncation so the outside test
236  // (where most of the world is) can fail very quickly and efficiently
237 
238  if ((r123 = p.Dot(fNormal123) - fCdotN123) > fTol ||
239  (r134 = p.Dot(fNormal134) - fCdotN134) > fTol ||
240  (r142 = p.Dot(fNormal142) - fCdotN142) > fTol ||
241  (r234 = p.Dot(fNormal234) - fCdotN234) > fTol)
242  {
243  return eOutside; // at least one is out!
244  }
245  else if ((r123 < -fTol) && (r134 < -fTol) && (r142 < -fTol) && (r234 < -fTol))
246  {
247  return eInside; // all are definitively inside
248  }
249  else
250  {
251  return eSurface; // too close to tell
252  }
253 }
254 
256 //
257 // Calculate side nearest to p, and return normal
258 // If two sides are equidistant, normal of first side (x/y/z)
259 // encountered returned.
260 // This assumes that we are looking from the inside!
261 
262 bool UTet::Normal(const UVector3& p, UVector3& n) const
263 {
264  double r123 = std::fabs(p.Dot(fNormal123) - fCdotN123);
265  double r134 = std::fabs(p.Dot(fNormal134) - fCdotN134);
266  double r142 = std::fabs(p.Dot(fNormal142) - fCdotN142);
267  double r234 = std::fabs(p.Dot(fNormal234) - fCdotN234);
268 
269  static const double delta = 0.5 * fTol;
270  UVector3 sumnorm(0., 0., 0.);
271  int noSurfaces = 0;
272 
273  if (r123 <= delta)
274  {
275  noSurfaces ++;
276  sumnorm = fNormal123;
277  }
278 
279  if (r134 <= delta)
280  {
281  noSurfaces ++;
282  sumnorm += fNormal134;
283  }
284 
285  if (r142 <= delta)
286  {
287  noSurfaces ++;
288  sumnorm += fNormal142;
289  }
290  if (r234 <= delta)
291  {
292  noSurfaces ++;
293  sumnorm += fNormal234;
294  }
295 
296  if (noSurfaces > 0)
297  {
298  if (noSurfaces == 1)
299  {
300  n = sumnorm;
301  return true;
302  }
303  else
304  {
305  n = sumnorm.Unit();
306  return true;
307  }
308  }
309  else // Approximative Surface Normal
310  {
311 
312  if ((r123 <= r134) && (r123 <= r142) && (r123 <= r234))
313  {
314  n = fNormal123;
315  }
316  else if ((r134 <= r142) && (r134 <= r234))
317  {
318  n = fNormal134;
319  }
320  else if (r142 <= r234)
321  {
322  n = fNormal142;
323  }
324  n = fNormal234;
325  return false;
326  }
327 
328 
329 }
330 
332 //
333 // Calculate distance to box from an outside point
334 // - return kInfinity if no intersection.
335 // All this is very unrolled, for speed.
336 
337 double UTet::DistanceToIn(const UVector3& p,
338  const UVector3& v, double /*aPstep*/) const
339 {
340  UVector3 vu(v.Unit()), hp;
341  double vdotn, t, tmin = UUtils::kInfinity;
342 
343  double extraDistance = 10.0 * fTol; // a little ways into the solid
344 
345  vdotn = -vu.Dot(fNormal123);
346  if (vdotn > 1e-12)
347  {
348  // this is a candidate face, since it is pointing at us
349  t = (p.Dot(fNormal123) - fCdotN123) / vdotn; // # distance to intersection
350  if ((t >= -fTol) && (t < tmin))
351  {
352  // if not true, we're going away from this face or it's not close
353  hp = p + vu * (t + extraDistance); // a little beyond point of intersection
354  if ((hp.Dot(fNormal134) - fCdotN134 < 0.0) &&
355  (hp.Dot(fNormal142) - fCdotN142 < 0.0) &&
356  (hp.Dot(fNormal234) - fCdotN234 < 0.0))
357  {
358  tmin = t;
359  }
360  }
361  }
362 
363  vdotn = -vu.Dot(fNormal134);
364  if (vdotn > 1e-12)
365  {
366  // # this is a candidate face, since it is pointing at us
367  t = (p.Dot(fNormal134) - fCdotN134) / vdotn; // # distance to intersection
368  if ((t >= -fTol) && (t < tmin))
369  {
370  // if not true, we're going away from this face
371  hp = p + vu * (t + extraDistance); // a little beyond point of intersection
372  if ((hp.Dot(fNormal123) - fCdotN123 < 0.0) &&
373  (hp.Dot(fNormal142) - fCdotN142 < 0.0) &&
374  (hp.Dot(fNormal234) - fCdotN234 < 0.0))
375  {
376  tmin = t;
377  }
378  }
379  }
380 
381  vdotn = -vu.Dot(fNormal142);
382  if (vdotn > 1e-12)
383  {
384  // # this is a candidate face, since it is pointing at us
385  t = (p.Dot(fNormal142) - fCdotN142) / vdotn; // # distance to intersection
386  if ((t >= -fTol) && (t < tmin))
387  {
388  // if not true, we're going away from this face
389  hp = p + vu * (t + extraDistance); // a little beyond point of intersection
390  if ((hp.Dot(fNormal123) - fCdotN123 < 0.0) &&
391  (hp.Dot(fNormal134) - fCdotN134 < 0.0) &&
392  (hp.Dot(fNormal234) - fCdotN234 < 0.0))
393  {
394  tmin = t;
395  }
396  }
397  }
398 
399  vdotn = -vu.Dot(fNormal234);
400  if (vdotn > 1e-12)
401  {
402  // # this is a candidate face, since it is pointing at us
403  t = (p.Dot(fNormal234) - fCdotN234) / vdotn; // # distance to intersection
404  if ((t >= -fTol) && (t < tmin))
405  {
406  // if not true, we're going away from this face
407  hp = p + vu * (t + extraDistance); // a little beyond point of intersection
408  if ((hp.Dot(fNormal123) - fCdotN123 < 0.0) &&
409  (hp.Dot(fNormal134) - fCdotN134 < 0.0) &&
410  (hp.Dot(fNormal142) - fCdotN142 < 0.0))
411  {
412  tmin = t;
413  }
414  }
415  }
416 
417  return std::max(0.0, tmin);
418 }
419 
421 //
422 // Approximate distance to tet.
423 // returns distance to sphere centered on bounding box
424 // - If inside return 0
425 double UTet::SafetyFromOutside(const UVector3& p, bool /*aAccurate*/) const
426 
427 {
428  double dd = (p - fMiddle).Mag() - fMaxSize - fTol;
429  return std::max(0.0, dd);
430 }
431 
433 //
434 // Calcluate distance to surface of box from inside
435 // by calculating distances to box's x/y/z planes.
436 // Smallest distance is exact distance to exiting.
437 double UTet::DistanceToOut(const UVector3& p, const UVector3& v,
438  UVector3& n, bool& convex, double /*aPstep*/) const
439 {
440  UVector3 vu(v.Unit());
441  double t1 = UUtils::kInfinity, t2 = UUtils::kInfinity, t3 = UUtils::kInfinity, t4 = UUtils::kInfinity, vdotn, tt;
442 
443  vdotn = vu.Dot(fNormal123);
444  if (vdotn > 1e-12) // #we're heading towards this face, so it is a candidate
445  {
446  t1 = (fCdotN123 - p.Dot(fNormal123)) / vdotn; // # distance to intersection
447  }
448 
449  vdotn = vu.Dot(fNormal134);
450  if (vdotn > 1e-12) // #we're heading towards this face, so it is a candidate
451  {
452  t2 = (fCdotN134 - p.Dot(fNormal134)) / vdotn; // # distance to intersection
453  }
454 
455  vdotn = vu.Dot(fNormal142);
456  if (vdotn > 1e-12) // #we're heading towards this face, so it is a candidate
457  {
458  t3 = (fCdotN142 - p.Dot(fNormal142)) / vdotn; // # distance to intersection
459  }
460 
461  vdotn = vu.Dot(fNormal234);
462  if (vdotn > 1e-12) // #we're heading towards this face, so it is a candidate
463  {
464  t4 = (fCdotN234 - p.Dot(fNormal234)) / vdotn; // # distance to intersection
465  }
466 
467  tt = std::min(std::min(std::min(t1, t2), t3), t4);
468 
469  if (warningFlag && (tt == UUtils::kInfinity || tt < -fTol))
470  {
471  // DumpInfo();
472  std::ostringstream message;
473  message << "No good intersection found or already outside!?" << std::endl
474  << "p = " << p << std::endl
475  << "v = " << v << std::endl
476  << "t1, t2, t3, t4 "
477  << t1 << ", " << t2 << ", " << t3 << ", " << t4;
478 
479  UUtils::Exception("UTet::DistanceToOut(p,v,...)", "GeomSolids1002",
480  UWarning, 1, message.str().c_str());
481  if (convex)
482  {
483  convex = false; // flag normal as meaningless
484  }
485  }
486  else
487  {
488  static UVector3 normal;
489  if (tt == t1)
490  {
491  normal = fNormal123;
492  }
493  else if (tt == t2)
494  {
495  normal = fNormal134;
496  }
497  else if (tt == t3)
498  {
499  normal = fNormal142;
500  }
501  else if (tt == t4)
502  {
503  normal = fNormal234;
504  }
505  n = normal;
506  if (convex)
507  {
508  convex = true;
509  }
510  }
511 
512  return std::max(tt, 0.0); // avoid tt<0.0 by a tiny bit
513  // if we are right on a face
514 }
515 
517 //
518 // Calculate exact shortest distance to any boundary from inside
519 // - If outside return 0
520 double UTet::SafetyFromInside(const UVector3& p, bool /*aAccurate*/) const
521 {
522  double t1, t2, t3, t4;
523  t1 = fCdotN123 - p.Dot(fNormal123); // distance to plane, positive if inside
524  t2 = fCdotN134 - p.Dot(fNormal134); // distance to plane
525  t3 = fCdotN142 - p.Dot(fNormal142); // distance to plane
526  t4 = fCdotN234 - p.Dot(fNormal234); // distance to plane
527 
528  // if any one of these is negative, we are outside,
529  // so return zero in that case
530 
531  double tmin = std::min(std::min(std::min(t1, t2), t3), t4);
532  return (tmin < fTol) ? 0 : tmin;
533 }
534 
535 
537 //
538 // Stream object contents to an output stream
539 
540 std::ostream& UTet::StreamInfo(std::ostream& os) const
541 {
542  int oldprc = os.precision(16);
543  os << "-----------------------------------------------------------\n"
544  << " *** Dump for solid - " << GetName() << " ***\n"
545  << " ===================================================\n"
546  << " Solid type: UTet\n"
547  << " Parameters: \n"
548  << " anchor: " << fAnchor << " \n"
549  << " p2: " << fP2 << " \n"
550  << " p3: " << fP3 << " \n"
551  << " p4: " << fP4 << " \n"
552  << " normal123: " << fNormal123 << " \n"
553  << " normal134: " << fNormal134 << " \n"
554  << " normal142: " << fNormal142 << " \n"
555  << " normal234: " << fNormal234 << " \n"
556  << "-----------------------------------------------------------\n";
557  os.precision(oldprc);
558 
559  return os;
560 }
561 
562 
564 //
565 // GetPointOnFace
566 //
567 // Auxiliary method for get point on surface
568 
570  UVector3 p3, double& area) const
571 {
572  double lambda1, lambda2;
573  UVector3 v, w;
574 
575  v = p3 - p1;
576  w = p1 - p2;
577 
578  lambda1 = UUtils::Random(0., 1.);
579  lambda2 = UUtils::Random(0., lambda1);
580 
581  area = 0.5 * (v.Cross(w)).Mag();
582  return (p2 + lambda1 * w + lambda2 * v);
583 }
584 
586 //
587 // GetPointOnSurface
588 
590 {
591  double chose, aOne, aTwo, aThree, aFour;
592  UVector3 p1, p2, p3, p4;
593 
594  p1 = GetPointOnFace(fAnchor, fP2, fP3, aOne);
595  p2 = GetPointOnFace(fAnchor, fP4, fP3, aTwo);
596  p3 = GetPointOnFace(fAnchor, fP4, fP2, aThree);
597  p4 = GetPointOnFace(fP4, fP3, fP2, aFour);
598 
599  chose = UUtils::Random(0., aOne + aTwo + aThree + aFour);
600  if ((chose >= 0.) && (chose < aOne))
601  {
602  return p1;
603  }
604  else if ((chose >= aOne) && (chose < aOne + aTwo))
605  {
606  return p2;
607  }
608  else if ((chose >= aOne + aTwo) && (chose < aOne + aTwo + aThree))
609  {
610  return p3;
611  }
612  return p4;
613 }
614 
616 //
617 // GetVertices
618 
619 std::vector<UVector3> UTet::GetVertices() const
620 {
621  std::vector<UVector3> vertices(4);
622  vertices[0] = fAnchor;
623  vertices[1] = fP2;
624  vertices[2] = fP3;
625  vertices[3] = fP4;
626 
627  return vertices;
628 }
629 //______________________________________________________________________________
630 void UTet::Extent(UVector3& aMin, UVector3& aMax) const
631 {
632  // Returns the full 3D cartesian extent of the solid.
633  aMin.x() = fXMin;
634  aMax.x() = fXMax;
635  aMin.y() = fYMin;
636  aMax.y() = fYMax;
637  aMin.z() = fZMin;
638  aMax.z() = fZMax;
639 }
640 //______________________________________________________________________________
641 void UTet::GetParametersList(int, double* aArray) const
642 {
643  aArray[0] = fAnchor.x();
644  aArray[1] = fAnchor.y();
645  aArray[2] = fAnchor.z();
646  aArray[3] = fP2.x();
647  aArray[4] = fP2.y();
648  aArray[5] = fP2.z();
649  aArray[6] = fP3.x();
650  aArray[7] = fP3.y();
651  aArray[8] = fP3.z();
652  aArray[9] = fP4.x();
653  aArray[10] = fP4.y();
654  aArray[11] = fP4.z();
655 }
656 //______________________________________________________________________________
658 {
659  return new UTet(*this);
660 }
661 //______________________________________________________________________________
663 {
664  return "Tet";
665 }
666 //______________________________________________________________________________
668 {
669  return fCubicVolume;
670 }
671 //______________________________________________________________________________
673 {
674  return fSurfaceArea;
675 }
double & z()
Definition: UVector3.hh:352
double fSurfaceArea
Definition: UTet.hh:104
UVector3 GetPointOnSurface() const
Definition: UTet.cc:589
double & y()
Definition: UVector3.hh:348
UVector3 fNormal234
Definition: UTet.hh:113
double fZMax
Definition: UTet.hh:118
double fMaxSize
Definition: UTet.hh:119
double fXMin
Definition: UTet.hh:118
double fZMin
Definition: UTet.hh:118
const std::string & GetName() const
Definition: VUSolid.hh:103
UVector3 Cross(const UVector3 &) const
Definition: UVector3.hh:281
G4String name
Definition: TRTMaterials.hh:40
UGeometryType GetEntityType() const
Definition: UTet.cc:662
UVector3 fP3
Definition: UTet.hh:112
UVector3 fP4
Definition: UTet.hh:112
double DistanceToIn(const UVector3 &aPoint, const UVector3 &aDirection, double aPstep=UUtils::kInfinity) const
Definition: UTet.cc:337
UVector3 fNormal123
Definition: UTet.hh:113
virtual ~UTet()
Definition: UTet.cc:152
void Extent(UVector3 &aMin, UVector3 &aMax) const
Definition: UTet.cc:630
double fTol
Definition: UTet.hh:119
UVector3 fP2
Definition: UTet.hh:112
static double normal(HepRandomEngine *eptr)
Definition: RandPoisson.cc:77
double SurfaceArea()
Definition: UTet.cc:672
double fCdotN123
Definition: UTet.hh:117
bool Normal(const UVector3 &aPoint, UVector3 &aNormal) const
Definition: UTet.cc:262
static const double kInfinity
Definition: UUtils.hh:54
double fXMax
Definition: UTet.hh:118
UVector3 fAnchor
Definition: UTet.hh:112
double fCdotN234
Definition: UTet.hh:117
double SafetyFromOutside(const UVector3 &aPoint, bool aAccurate=false) const
Definition: UTet.cc:425
double Capacity()
Definition: UTet.cc:667
double & x()
Definition: UVector3.hh:344
std::ostream & StreamInfo(std::ostream &os) const
Definition: UTet.cc:540
double fCdotN142
Definition: UTet.hh:117
const G4double p2
const G4double p1
double DistanceToOut(const UVector3 &aPoint, const UVector3 &aDirection, UVector3 &aNormalVector, bool &aConvex, double aPstep=UUtils::kInfinity) const
Definition: UTet.cc:437
UVector3 fNormal134
Definition: UTet.hh:113
double fYMin
Definition: UTet.hh:118
UVector3 fMiddle
Definition: UTet.hh:112
UVector3 fNormal142
Definition: UTet.hh:113
EnumInside
Definition: VUSolid.hh:23
UTet & operator=(const UTet &rhs)
Definition: UTet.cc:181
const G4int n
double Dot(const UVector3 &) const
Definition: UVector3.hh:276
double SafetyFromInside(const UVector3 &aPoint, bool aAccurate=false) const
Definition: UTet.cc:520
void GetParametersList(int aNumber, double *aArray) const
Definition: UTet.cc:641
double Mag() const
Definition: UVector3.cc:48
std::vector< UVector3 > GetVertices() const
Definition: UTet.cc:619
bool warningFlag
Definition: UTet.hh:115
void Exception(const char *originOfException, const char *exceptionCode, UExceptionSeverity severity, int level, const char *description)
Definition: UUtils.cc:122
double fDx
Definition: UTet.hh:119
T max(const T t1, const T t2)
brief Return the largest of the two arguments
UVector3 GetPointOnFace(UVector3 p1, UVector3 p2, UVector3 p3, double &area) const
Definition: UTet.cc:569
UVector3 Unit() const
Definition: UVector3.cc:80
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
double fYMax
Definition: UTet.hh:118
std::string UGeometryType
Definition: UTypes.hh:39
double fDy
Definition: UTet.hh:119
VUSolid * Clone() const
Definition: UTet.cc:657
double fDz
Definition: UTet.hh:119
UTet(const std::string &name, UVector3 anchor, UVector3 p2, UVector3 p3, UVector3 p4, bool *degeneracyFlag=0)
Definition: UTet.cc:35
EnumInside Inside(const UVector3 &p) const
Definition: UTet.cc:231
double Random(double min=0.0, double max=1.0)
Definition: UUtils.cc:69
Definition: UTet.hh:27
double fCubicVolume
Definition: UTet.hh:104
double fCdotN134
Definition: UTet.hh:117