Geant4  10.00.p02
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 G4Tets 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", FatalErrorInArguments, 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 
132 
134 //
135 // Destructor
136 
138 {
139  ;
140 }
141 
143 //
144 // Copy constructor
145 
146 UTet::UTet(const UTet& rhs)
147  : VUSolid(rhs),
148  fCubicVolume(rhs.fCubicVolume), fSurfaceArea(rhs.fSurfaceArea),
149  fAnchor(rhs.fAnchor),
150  fP2(rhs.fP2), fP3(rhs.fP3), fP4(rhs.fP4), fMiddle(rhs.fMiddle),
151  fNormal123(rhs.fNormal123), fNormal142(rhs.fNormal142),
152  fNormal134(rhs.fNormal134), fNormal234(rhs.fNormal234),
153  warningFlag(rhs.warningFlag), fCdotN123(rhs.fCdotN123),
154  fCdotN142(rhs.fCdotN142), fCdotN134(rhs.fCdotN134),
155  fCdotN234(rhs.fCdotN234), fXMin(rhs.fXMin), fXMax(rhs.fXMax),
156  fYMin(rhs.fYMin), fYMax(rhs.fYMax), fZMin(rhs.fZMin), fZMax(rhs.fZMax),
157  fDx(rhs.fDx), fDy(rhs.fDy), fDz(rhs.fDz), fTol(rhs.fTol),
158  fMaxSize(rhs.fMaxSize)
159 {
160 }
161 
162 
164 //
165 // Assignment operator
166 
168 {
169  // Check assignment to self
170  //
171  if (this == &rhs)
172  {
173  return *this;
174  }
175 
176  // Copy base class data
177  //
178  VUSolid::operator=(rhs);
179 
180  // Copy data
181  //
184  fAnchor = rhs.fAnchor;
185  fP2 = rhs.fP2;
186  fP3 = rhs.fP3;
187  fP4 = rhs.fP4;
188  fMiddle = rhs.fMiddle;
189  fNormal123 = rhs.fNormal123;
190  fNormal142 = rhs.fNormal142;
191  fNormal134 = rhs.fNormal134;
192  fNormal234 = rhs.fNormal234;
193  warningFlag = rhs.warningFlag;
194  fCdotN123 = rhs.fCdotN123;
195  fCdotN142 = rhs.fCdotN142;
196  fCdotN134 = rhs.fCdotN134;
197  fCdotN234 = rhs.fCdotN234;
198  fXMin = rhs.fXMin;
199  fXMax = rhs.fXMax;
200  fYMin = rhs.fYMin;
201  fYMax = rhs.fYMax;
202  fZMin = rhs.fZMin;
203  fZMax = rhs.fZMax;
204  fDx = rhs.fDx;
205  fDy = rhs.fDy;
206  fDz = rhs.fDz;
207  fTol = rhs.fTol;
208  fMaxSize = rhs.fMaxSize;
209 
210  return *this;
211 }
212 
214 //
215 // Return whether point inside/outside/on surface, using tolerance
216 
218 {
219  double r123, r134, r142, r234;
220 
221  // this is written to allow if-statement truncation so the outside test
222  // (where most of the world is) can fail very quickly and efficiently
223 
224  if ((r123 = p.Dot(fNormal123) - fCdotN123) > fTol ||
225  (r134 = p.Dot(fNormal134) - fCdotN134) > fTol ||
226  (r142 = p.Dot(fNormal142) - fCdotN142) > fTol ||
227  (r234 = p.Dot(fNormal234) - fCdotN234) > fTol)
228  {
229  return eOutside; // at least one is out!
230  }
231  else if ((r123 < -fTol) && (r134 < -fTol) && (r142 < -fTol) && (r234 < -fTol))
232  {
233  return eInside; // all are definitively inside
234  }
235  else
236  {
237  return eSurface; // too close to tell
238  }
239 }
240 
242 //
243 // Calculate side nearest to p, and return normal
244 // If two sides are equidistant, normal of first side (x/y/z)
245 // encountered returned.
246 // This assumes that we are looking from the inside!
247 bool UTet::Normal(const UVector3& p, UVector3& n) const
248 {
249  double r123 = std::fabs(p.Dot(fNormal123) - fCdotN123);
250  double r134 = std::fabs(p.Dot(fNormal134) - fCdotN134);
251  double r142 = std::fabs(p.Dot(fNormal142) - fCdotN142);
252  double r234 = std::fabs(p.Dot(fNormal234) - fCdotN234);
253 
254  static const double delta = 0.5 * fTol;
255  UVector3 sumnorm(0., 0., 0.);
256  int noSurfaces = 0;
257 
258  if (r123 <= delta)
259  {
260  noSurfaces ++;
261  sumnorm = fNormal123;
262  }
263 
264  if (r134 <= delta)
265  {
266  noSurfaces ++;
267  sumnorm += fNormal134;
268  }
269 
270  if (r142 <= delta)
271  {
272  noSurfaces ++;
273  sumnorm += fNormal142;
274  }
275  if (r234 <= delta)
276  {
277  noSurfaces ++;
278  sumnorm += fNormal234;
279  }
280 
281  if (noSurfaces > 0)
282  {
283  if (noSurfaces == 1)
284  {
285  n = sumnorm;
286  return true;
287  }
288  else
289  {
290  n = sumnorm.Unit();
291  return true;
292  }
293  }
294  else // Approximative Surface Normal
295  {
296 
297  if ((r123 <= r134) && (r123 <= r142) && (r123 <= r234))
298  {
299  n = fNormal123;
300  }
301  else if ((r134 <= r142) && (r134 <= r234))
302  {
303  n = fNormal134;
304  }
305  else if (r142 <= r234)
306  {
307  n = fNormal142;
308  }
309  n = fNormal234;
310  return false;
311  }
312 
313 
314 }
315 
317 //
318 // Calculate distance to box from an outside point
319 // - return kInfinity if no intersection.
320 // All this is very unrolled, for speed.
321 
322 double UTet::DistanceToIn(const UVector3& p,
323  const UVector3& v, double /*aPstep*/) const
324 {
325  UVector3 vu(v.Unit()), hp;
326  double vdotn, t, tmin = UUtils::kInfinity;
327 
328  double extraDistance = 10.0 * fTol; // a little ways into the solid
329 
330  vdotn = -vu.Dot(fNormal123);
331  if (vdotn > 1e-12)
332  {
333  // this is a candidate face, since it is pointing at us
334  t = (p.Dot(fNormal123) - fCdotN123) / vdotn; // # distance to intersection
335  if ((t >= -fTol) && (t < tmin))
336  {
337  // if not true, we're going away from this face or it's not close
338  hp = p + vu * (t + extraDistance); // a little beyond point of intersection
339  if ((hp.Dot(fNormal134) - fCdotN134 < 0.0) &&
340  (hp.Dot(fNormal142) - fCdotN142 < 0.0) &&
341  (hp.Dot(fNormal234) - fCdotN234 < 0.0))
342  {
343  tmin = t;
344  }
345  }
346  }
347 
348  vdotn = -vu.Dot(fNormal134);
349  if (vdotn > 1e-12)
350  {
351  // # this is a candidate face, since it is pointing at us
352  t = (p.Dot(fNormal134) - fCdotN134) / vdotn; // # distance to intersection
353  if ((t >= -fTol) && (t < tmin))
354  {
355  // if not true, we're going away from this face
356  hp = p + vu * (t + extraDistance); // a little beyond point of intersection
357  if ((hp.Dot(fNormal123) - fCdotN123 < 0.0) &&
358  (hp.Dot(fNormal142) - fCdotN142 < 0.0) &&
359  (hp.Dot(fNormal234) - fCdotN234 < 0.0))
360  {
361  tmin = t;
362  }
363  }
364  }
365 
366  vdotn = -vu.Dot(fNormal142);
367  if (vdotn > 1e-12)
368  {
369  // # this is a candidate face, since it is pointing at us
370  t = (p.Dot(fNormal142) - fCdotN142) / vdotn; // # distance to intersection
371  if ((t >= -fTol) && (t < tmin))
372  {
373  // if not true, we're going away from this face
374  hp = p + vu * (t + extraDistance); // a little beyond point of intersection
375  if ((hp.Dot(fNormal123) - fCdotN123 < 0.0) &&
376  (hp.Dot(fNormal134) - fCdotN134 < 0.0) &&
377  (hp.Dot(fNormal234) - fCdotN234 < 0.0))
378  {
379  tmin = t;
380  }
381  }
382  }
383 
384  vdotn = -vu.Dot(fNormal234);
385  if (vdotn > 1e-12)
386  {
387  // # this is a candidate face, since it is pointing at us
388  t = (p.Dot(fNormal234) - fCdotN234) / vdotn; // # distance to intersection
389  if ((t >= -fTol) && (t < tmin))
390  {
391  // if not true, we're going away from this face
392  hp = p + vu * (t + extraDistance); // a little beyond point of intersection
393  if ((hp.Dot(fNormal123) - fCdotN123 < 0.0) &&
394  (hp.Dot(fNormal134) - fCdotN134 < 0.0) &&
395  (hp.Dot(fNormal142) - fCdotN142 < 0.0))
396  {
397  tmin = t;
398  }
399  }
400  }
401 
402  return std::max(0.0, tmin);
403 }
404 
406 //
407 // Approximate distance to tet.
408 // returns distance to sphere centered on bounding box
409 // - If inside return 0
410 double UTet::SafetyFromOutside(const UVector3& p, bool /*aAccurate*/) const
411 
412 {
413  double dd = (p - fMiddle).Mag() - fMaxSize - fTol;
414  return std::max(0.0, dd);
415 }
416 
418 //
419 // Calcluate distance to surface of box from inside
420 // by calculating distances to box's x/y/z planes.
421 // Smallest distance is exact distance to exiting.
422 double UTet::DistanceToOut(const UVector3& p, const UVector3& v,
423  UVector3& n, bool& convex, double /*aPstep*/) const
424 {
425  UVector3 vu(v.Unit());
426  double t1 = UUtils::kInfinity, t2 = UUtils::kInfinity, t3 = UUtils::kInfinity, t4 = UUtils::kInfinity, vdotn, tt;
427 
428  vdotn = vu.Dot(fNormal123);
429  if (vdotn > 1e-12) // #we're heading towards this face, so it is a candidate
430  {
431  t1 = (fCdotN123 - p.Dot(fNormal123)) / vdotn; // # distance to intersection
432  }
433 
434  vdotn = vu.Dot(fNormal134);
435  if (vdotn > 1e-12) // #we're heading towards this face, so it is a candidate
436  {
437  t2 = (fCdotN134 - p.Dot(fNormal134)) / vdotn; // # distance to intersection
438  }
439 
440  vdotn = vu.Dot(fNormal142);
441  if (vdotn > 1e-12) // #we're heading towards this face, so it is a candidate
442  {
443  t3 = (fCdotN142 - p.Dot(fNormal142)) / vdotn; // # distance to intersection
444  }
445 
446  vdotn = vu.Dot(fNormal234);
447  if (vdotn > 1e-12) // #we're heading towards this face, so it is a candidate
448  {
449  t4 = (fCdotN234 - p.Dot(fNormal234)) / vdotn; // # distance to intersection
450  }
451 
452  tt = std::min(std::min(std::min(t1, t2), t3), t4);
453 
454  if (warningFlag && (tt == UUtils::kInfinity || tt < -fTol))
455  {
456  // DumpInfo();
457  std::ostringstream message;
458  message << "No good intersection found or already outside!?" << std::endl
459  << "p = " << p << std::endl
460  << "v = " << v << std::endl
461  << "t1, t2, t3, t4 "
462  << t1 << ", " << t2 << ", " << t3 << ", " << t4;
463 
464  UUtils::Exception("UTet::DistanceToOut(p,v,...)", "GeomSolids1002",
465  Warning, 1, message.str().c_str());
466  if (convex)
467  {
468  convex = false; // flag normal as meaningless
469  }
470  }
471  else
472  {
473  static UVector3 normal;
474  if (tt == t1)
475  {
476  normal = fNormal123;
477  }
478  else if (tt == t2)
479  {
480  normal = fNormal134;
481  }
482  else if (tt == t3)
483  {
484  normal = fNormal142;
485  }
486  else if (tt == t4)
487  {
488  normal = fNormal234;
489  }
490  n = normal;
491  if (convex)
492  {
493  convex = true;
494  }
495  }
496 
497  return std::max(tt, 0.0); // avoid tt<0.0 by a tiny bit
498  // if we are right on a face
499 }
500 
502 //
503 // Calculate exact shortest distance to any boundary from inside
504 // - If outside return 0
505 double UTet::SafetyFromInside(const UVector3& p, bool /*aAccurate*/) const
506 {
507  double t1, t2, t3, t4;
508  t1 = fCdotN123 - p.Dot(fNormal123); // distance to plane, positive if inside
509  t2 = fCdotN134 - p.Dot(fNormal134); // distance to plane
510  t3 = fCdotN142 - p.Dot(fNormal142); // distance to plane
511  t4 = fCdotN234 - p.Dot(fNormal234); // distance to plane
512 
513  // if any one of these is negative, we are outside,
514  // so return zero in that case
515 
516  double tmin = std::min(std::min(std::min(t1, t2), t3), t4);
517  return (tmin < fTol) ? 0 : tmin;
518 }
519 
520 
522 //
523 // Stream object contents to an output stream
524 
525 std::ostream& UTet::StreamInfo(std::ostream& os) const
526 {
527  int oldprc = os.precision(16);
528  os << "-----------------------------------------------------------\n"
529  << " *** Dump for solid - " << GetName() << " ***\n"
530  << " ===================================================\n"
531  << " Solid type: UTet\n"
532  << " Parameters: \n"
533  << " anchor: " << fAnchor << " \n"
534  << " p2: " << fP2 << " \n"
535  << " p3: " << fP3 << " \n"
536  << " p4: " << fP4 << " \n"
537  << " normal123: " << fNormal123 << " \n"
538  << " normal134: " << fNormal134 << " \n"
539  << " normal142: " << fNormal142 << " \n"
540  << " normal234: " << fNormal234 << " \n"
541  << "-----------------------------------------------------------\n";
542  os.precision(oldprc);
543 
544  return os;
545 }
546 
547 
549 //
550 // GetPointOnFace
551 //
552 // Auxiliary method for get point on surface
553 
555  UVector3 p3, double& area) const
556 {
557  double lambda1, lambda2;
558  UVector3 v, w;
559 
560  v = p3 - p1;
561  w = p1 - p2;
562 
563  lambda1 = UUtils::Random(0., 1.);
564  lambda2 = UUtils::Random(0., lambda1);
565 
566  area = 0.5 * (v.Cross(w)).Mag();
567  return (p2 + lambda1 * w + lambda2 * v);
568 }
569 
571 //
572 // GetPointOnSurface
573 
575 {
576  double chose, aOne, aTwo, aThree, aFour;
577  UVector3 p1, p2, p3, p4;
578 
579  p1 = GetPointOnFace(fAnchor, fP2, fP3, aOne);
580  p2 = GetPointOnFace(fAnchor, fP4, fP3, aTwo);
581  p3 = GetPointOnFace(fAnchor, fP4, fP2, aThree);
582  p4 = GetPointOnFace(fP4, fP3, fP2, aFour);
583 
584  chose = UUtils::Random(0., aOne + aTwo + aThree + aFour);
585  if ((chose >= 0.) && (chose < aOne))
586  {
587  return p1;
588  }
589  else if ((chose >= aOne) && (chose < aOne + aTwo))
590  {
591  return p2;
592  }
593  else if ((chose >= aOne + aTwo) && (chose < aOne + aTwo + aThree))
594  {
595  return p3;
596  }
597  return p4;
598 }
599 
601 //
602 // GetVertices
603 
604 std::vector<UVector3> UTet::GetVertices() const
605 {
606  std::vector<UVector3> vertices(4);
607  vertices[0] = fAnchor;
608  vertices[1] = fP2;
609  vertices[2] = fP3;
610  vertices[3] = fP4;
611 
612  return vertices;
613 }
614 //______________________________________________________________________________
615 void UTet::Extent(UVector3& aMin, UVector3& aMax) const
616 {
617  // Returns the full 3D cartesian extent of the solid.
618  aMin.x = -fDx;
619  aMax.x = fDx;
620  aMin.y = -fDy;
621  aMax.y = fDy;
622  aMin.z = -fDz;
623  aMax.z = fDz;
624 }
625 //______________________________________________________________________________
626 void UTet::GetParametersList(int, double* aArray) const
627 {
628  aArray[0] = fAnchor.x;
629  aArray[1] = fAnchor.y;
630  aArray[2] = fAnchor.z;
631  aArray[3] = fP2.x;
632  aArray[4] = fP2.y;
633  aArray[5] = fP2.z;
634  aArray[6] = fP3.x;
635  aArray[7] = fP3.y;
636  aArray[8] = fP3.z;
637  aArray[9] = fP4.x;
638  aArray[10] = fP4.y;
639  aArray[11] = fP4.z;
640 }
641 //______________________________________________________________________________
643 {
644  return new UTet(*this);
645 }
646 //______________________________________________________________________________
648 {
649  return "Tet";
650 }
651 //______________________________________________________________________________
653 {
654  return fCubicVolume;
655 }
656 //______________________________________________________________________________
658 {
659  return fSurfaceArea;
660 }
double fSurfaceArea
Definition: UTet.hh:119
UVector3 GetPointOnSurface() const
Definition: UTet.cc:574
UVector3 fNormal234
Definition: UTet.hh:128
double fZMax
Definition: UTet.hh:133
double fMaxSize
Definition: UTet.hh:134
double fXMin
Definition: UTet.hh:133
double fZMin
Definition: UTet.hh:133
const std::string & GetName() const
Definition: VUSolid.hh:103
UVector3 Cross(const UVector3 &) const
Definition: UVector3.hh:262
G4String name
Definition: TRTMaterials.hh:40
UGeometryType GetEntityType() const
Definition: UTet.cc:647
UVector3 fP3
Definition: UTet.hh:127
UVector3 fP4
Definition: UTet.hh:127
double DistanceToIn(const UVector3 &aPoint, const UVector3 &aDirection, double aPstep=UUtils::kInfinity) const
Definition: UTet.cc:322
UVector3 fNormal123
Definition: UTet.hh:128
virtual ~UTet()
Definition: UTet.cc:137
double x
Definition: UVector3.hh:136
void Extent(UVector3 &aMin, UVector3 &aMax) const
Definition: UTet.cc:615
double fTol
Definition: UTet.hh:134
UVector3 fP2
Definition: UTet.hh:127
static double normal(HepRandomEngine *eptr)
Definition: RandPoisson.cc:77
double SurfaceArea()
Definition: UTet.cc:657
double fCdotN123
Definition: UTet.hh:132
bool Normal(const UVector3 &aPoint, UVector3 &aNormal) const
Definition: UTet.cc:247
static const double kInfinity
Definition: UUtils.hh:53
double fXMax
Definition: UTet.hh:133
UVector3 fAnchor
Definition: UTet.hh:127
double fCdotN234
Definition: UTet.hh:132
double SafetyFromOutside(const UVector3 &aPoint, bool aAccurate=false) const
Definition: UTet.cc:410
double Capacity()
Definition: UTet.cc:652
std::ostream & StreamInfo(std::ostream &os) const
Definition: UTet.cc:525
double fCdotN142
Definition: UTet.hh:132
double DistanceToOut(const UVector3 &aPoint, const UVector3 &aDirection, UVector3 &aNormalVector, bool &aConvex, double aPstep=UUtils::kInfinity) const
Definition: UTet.cc:422
UVector3 fNormal134
Definition: UTet.hh:128
double fYMin
Definition: UTet.hh:133
UVector3 fMiddle
Definition: UTet.hh:127
UVector3 fNormal142
Definition: UTet.hh:128
EnumInside
Definition: VUSolid.hh:23
UTet & operator=(const UTet &rhs)
Definition: UTet.cc:167
const G4int n
double Dot(const UVector3 &) const
Definition: UVector3.hh:257
double SafetyFromInside(const UVector3 &aPoint, bool aAccurate=false) const
Definition: UTet.cc:505
void GetParametersList(int aNumber, double *aArray) const
Definition: UTet.cc:626
double Mag() const
Definition: UVector3.cc:48
std::vector< UVector3 > GetVertices() const
Definition: UTet.cc:604
bool warningFlag
Definition: UTet.hh:130
double fDx
Definition: UTet.hh:134
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:554
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:133
std::string UGeometryType
Definition: UTypes.hh:70
double fDy
Definition: UTet.hh:134
VUSolid * Clone() const
Definition: UTet.cc:642
void Exception(const char *originOfException, const char *exceptionCode, ExceptionSeverity severity, int level, const char *description)
Definition: UUtils.cc:122
double z
Definition: UVector3.hh:138
double fDz
Definition: UTet.hh:134
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:217
double Random(double min=0.0, double max=1.0)
Definition: UUtils.cc:69
Definition: UTet.hh:27
double y
Definition: UVector3.hh:137
double fCubicVolume
Definition: UTet.hh:119
double fCdotN134
Definition: UTet.hh:132