Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4VSolid.cc
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 //
27 // $Id: G4VSolid.cc 100906 2016-11-03 09:59:32Z gcosmo $
28 //
29 // class G4VSolid
30 //
31 // Implementation for solid base class
32 //
33 // History:
34 //
35 // 03.11.16 E.Tcherniaev, added Extent()
36 // 06.12.02 V.Grichine, restored original conditions in ClipPolygon()
37 // 10.05.02 V.Grichine, ClipPolygon(): clip only other axis and limited voxels
38 // 15.04.02 V.Grichine, bug fixed in ClipPolygon(): clip only one axis
39 // 13.03.02 V.Grichine, cosmetics of voxel limit functions
40 // 15.11.00 D.Williams, V.Grichine, fix in CalculateClippedPolygonExtent()
41 // 10.07.95 P.Kent, Added == operator, solid Store entry
42 // 30.06.95 P.Kent, Created.
43 // --------------------------------------------------------------------
44 
45 #include "G4VSolid.hh"
46 #include "G4SolidStore.hh"
47 #include "globals.hh"
48 #include "Randomize.hh"
49 #include "G4GeometryTolerance.hh"
50 
51 #include "G4VoxelLimits.hh"
52 #include "G4AffineTransform.hh"
53 #include "G4VisExtent.hh"
54 
56 //
57 // Constructor
58 // - Copies name
59 // - Add ourselves to solid Store
60 
62  : fshapeName(name)
63 {
65 
66  // Register to store
67  //
69 }
70 
72 //
73 // Copy constructor
74 //
75 
77  : kCarTolerance(rhs.kCarTolerance), fshapeName(rhs.fshapeName)
78 {
79  // Register to store
80  //
82 }
83 
85 //
86 // Fake default constructor - sets only member data and allocates memory
87 // for usage restricted to object persistency.
88 //
89 G4VSolid::G4VSolid( __void__& )
90  : fshapeName("")
91 {
92  // Register to store
93  //
95 }
96 
98 //
99 // Destructor (virtual)
100 // - Remove ourselves from solid Store
101 
103 {
105 }
106 
108 //
109 // Assignment operator
110 
112 {
113  // Check assignment to self
114  //
115  if (this == &rhs) { return *this; }
116 
117  // Copy data
118  //
120  fshapeName = rhs.fshapeName;
121 
122  return *this;
123 }
124 
126 //
127 // Streaming operator dumping solid contents
128 
129 std::ostream& operator<< ( std::ostream& os, const G4VSolid& e )
130 {
131  return e.StreamInfo(os);
132 }
133 
135 //
136 // Throw exception if ComputeDimensions called for illegal derived class
137 
139  const G4int,
140  const G4VPhysicalVolume*)
141 {
142  std::ostringstream message;
143  message << "Illegal call to G4VSolid::ComputeDimensions()" << G4endl
144  << "Method not overloaded by derived class !";
145  G4Exception("G4VSolid::ComputeDimensions()", "GeomMgt0003",
146  FatalException, message);
147 }
148 
150 //
151 // Throw exception (warning) for solids not implementing the method
152 
154 {
155  std::ostringstream message;
156  message << "Not implemented for solid: "
157  << this->GetEntityType() << " !" << G4endl
158  << "Returning origin.";
159  G4Exception("G4VSolid::GetPointOnSurface()", "GeomMgt1001",
160  JustWarning, message);
161  return G4ThreeVector(0,0,0);
162 }
163 
165 //
166 // Dummy implementations ...
167 
169 { return 0; }
170 
172 { return 0; }
173 
175 { return 0; }
176 
178 { return 0; }
179 
181 //
182 // Returns an estimation of the solid volume in internal units.
183 // The number of statistics and error accuracy is fixed.
184 // This method may be overloaded by derived classes to compute the
185 // exact geometrical quantity for solids where this is possible.
186 // or anyway to cache the computed value.
187 // This implementation does NOT cache the computed value.
188 
190 {
191  G4int cubVolStatistics = 1000000;
192  G4double cubVolEpsilon = 0.001;
193  return EstimateCubicVolume(cubVolStatistics, cubVolEpsilon);
194 }
195 
197 //
198 // Calculate cubic volume based on Inside() method.
199 // Accuracy is limited by the second argument or the statistics
200 // expressed by the first argument.
201 // Implementation is courtesy of Vasiliki Despoina Mitsou,
202 // University of Athens.
203 
205 {
206  G4int iInside=0;
207  G4double px,py,pz,minX,maxX,minY,maxY,minZ,maxZ,volume,halfepsilon;
209  EInside in;
210 
211  // values needed for CalculateExtent signature
212 
213  G4VoxelLimits limit; // Unlimited
214  G4AffineTransform origin;
215 
216  // min max extents of pSolid along X,Y,Z
217 
218  this->CalculateExtent(kXAxis,limit,origin,minX,maxX);
219  this->CalculateExtent(kYAxis,limit,origin,minY,maxY);
220  this->CalculateExtent(kZAxis,limit,origin,minZ,maxZ);
221 
222  // limits
223 
224  if(nStat < 100) nStat = 100;
225  if(epsilon > 0.01) epsilon = 0.01;
226  halfepsilon = 0.5*epsilon;
227 
228  for(G4int i = 0; i < nStat; i++ )
229  {
230  px = minX-halfepsilon+(maxX-minX+epsilon)*G4UniformRand();
231  py = minY-halfepsilon+(maxY-minY+epsilon)*G4UniformRand();
232  pz = minZ-halfepsilon+(maxZ-minZ+epsilon)*G4UniformRand();
233  p = G4ThreeVector(px,py,pz);
234  in = this->Inside(p);
235  if(in != kOutside) iInside++;
236  }
237  volume = (maxX-minX+epsilon)*(maxY-minY+epsilon)
238  * (maxZ-minZ+epsilon)*iInside/nStat;
239  return volume;
240 }
241 
243 //
244 // Returns an estimation of the solid surface area in internal units.
245 // The number of statistics and error accuracy is fixed.
246 // This method may be overloaded by derived classes to compute the
247 // exact geometrical quantity for solids where this is possible.
248 // or anyway to cache the computed value.
249 // This implementation does NOT cache the computed value.
250 
252 {
253  G4int stat = 1000000;
254  G4double ell = -1.;
255  return EstimateSurfaceArea(stat,ell);
256 }
257 
259 //
260 // Estimate surface area based on Inside(), DistanceToIn(), and
261 // DistanceToOut() methods. Accuracy is limited by the statistics
262 // defined by the first argument. Implemented by Mikhail Kosov.
263 
265 {
266  G4int inside=0;
267  G4double px,py,pz,minX,maxX,minY,maxY,minZ,maxZ,surf;
269  EInside in;
270 
271  // values needed for CalculateExtent signature
272 
273  G4VoxelLimits limit; // Unlimited
274  G4AffineTransform origin;
275 
276  // min max extents of pSolid along X,Y,Z
277 
278  this->CalculateExtent(kXAxis,limit,origin,minX,maxX);
279  this->CalculateExtent(kYAxis,limit,origin,minY,maxY);
280  this->CalculateExtent(kZAxis,limit,origin,minZ,maxZ);
281 
282  // limits
283 
284  if(nStat < 100) { nStat = 100; }
285 
286  G4double dX=maxX-minX;
287  G4double dY=maxY-minY;
288  G4double dZ=maxZ-minZ;
289  if(ell<=0.) // Automatic definition of skin thickness
290  {
291  G4double minval=dX;
292  if(dY<dX) { minval=dY; }
293  if(dZ<minval) { minval=dZ; }
294  ell=.01*minval;
295  }
296 
297  G4double dd=2*ell;
298  minX-=ell; minY-=ell; minZ-=ell; dX+=dd; dY+=dd; dZ+=dd;
299 
300  for(G4int i = 0; i < nStat; i++ )
301  {
302  px = minX+dX*G4UniformRand();
303  py = minY+dY*G4UniformRand();
304  pz = minZ+dZ*G4UniformRand();
305  p = G4ThreeVector(px,py,pz);
306  in = this->Inside(p);
307  if(in != kOutside)
308  {
309  if (DistanceToOut(p)<ell) { inside++; }
310  }
311  else if(DistanceToIn(p)<ell) { inside++; }
312  }
313  // @@ The conformal correction can be upgraded
314  surf = dX*dY*dZ*inside/dd/nStat;
315  return surf;
316 }
317 
319 //
320 // Returns a pointer of a dynamically allocated copy of the solid.
321 // Returns NULL pointer with warning in case the concrete solid does not
322 // implement this method. The caller has responsibility for ownership.
323 //
324 
326 {
327  std::ostringstream message;
328  message << "Clone() method not implemented for type: "
329  << GetEntityType() << "!" << G4endl
330  << "Returning NULL pointer!";
331  G4Exception("G4VSolid::Clone()", "GeomMgt1001", JustWarning, message);
332  return 0;
333 }
334 
336 //
337 // Calculate the maximum and minimum extents of the polygon described
338 // by the vertices: pSectionIndex->pSectionIndex+1->
339 // pSectionIndex+2->pSectionIndex+3->pSectionIndex
340 // in the List pVertices
341 //
342 // If the minimum is <pMin pMin is set to the new minimum
343 // If the maximum is >pMax pMax is set to the new maximum
344 //
345 // No modifications are made to pVertices
346 //
347 
349  const G4int pSectionIndex,
350  const G4VoxelLimits& pVoxelLimit,
351  const EAxis pAxis,
352  G4double& pMin, G4double& pMax) const
353 {
354 
355  G4ThreeVectorList polygon;
356  polygon.reserve(4);
357  polygon.push_back((*pVertices)[pSectionIndex]);
358  polygon.push_back((*pVertices)[pSectionIndex+1]);
359  polygon.push_back((*pVertices)[pSectionIndex+2]);
360  polygon.push_back((*pVertices)[pSectionIndex+3]);
361  // G4cout<<"ClipCrossSection: 0-1-2-3"<<G4endl;
362  CalculateClippedPolygonExtent(polygon,pVoxelLimit,pAxis,pMin,pMax);
363  return;
364 }
365 
367 //
368 // Calculate the maximum and minimum extents of the polygons
369 // joining the CrossSections at pSectionIndex->pSectionIndex+3 and
370 // pSectionIndex+4->pSectionIndex7
371 //
372 // in the List pVertices, within the boundaries of the voxel limits pVoxelLimit
373 //
374 // If the minimum is <pMin pMin is set to the new minimum
375 // If the maximum is >pMax pMax is set to the new maximum
376 //
377 // No modifications are made to pVertices
378 
380  const G4int pSectionIndex,
381  const G4VoxelLimits& pVoxelLimit,
382  const EAxis pAxis,
383  G4double& pMin, G4double& pMax) const
384 {
385  G4ThreeVectorList polygon;
386  polygon.reserve(4);
387  polygon.push_back((*pVertices)[pSectionIndex]);
388  polygon.push_back((*pVertices)[pSectionIndex+4]);
389  polygon.push_back((*pVertices)[pSectionIndex+5]);
390  polygon.push_back((*pVertices)[pSectionIndex+1]);
391  // G4cout<<"ClipBetweenSections: 0-4-5-1"<<G4endl;
392  CalculateClippedPolygonExtent(polygon,pVoxelLimit,pAxis,pMin,pMax);
393  polygon.clear();
394 
395  polygon.push_back((*pVertices)[pSectionIndex+1]);
396  polygon.push_back((*pVertices)[pSectionIndex+5]);
397  polygon.push_back((*pVertices)[pSectionIndex+6]);
398  polygon.push_back((*pVertices)[pSectionIndex+2]);
399  // G4cout<<"ClipBetweenSections: 1-5-6-2"<<G4endl;
400  CalculateClippedPolygonExtent(polygon,pVoxelLimit,pAxis,pMin,pMax);
401  polygon.clear();
402 
403  polygon.push_back((*pVertices)[pSectionIndex+2]);
404  polygon.push_back((*pVertices)[pSectionIndex+6]);
405  polygon.push_back((*pVertices)[pSectionIndex+7]);
406  polygon.push_back((*pVertices)[pSectionIndex+3]);
407  // G4cout<<"ClipBetweenSections: 2-6-7-3"<<G4endl;
408  CalculateClippedPolygonExtent(polygon,pVoxelLimit,pAxis,pMin,pMax);
409  polygon.clear();
410 
411  polygon.push_back((*pVertices)[pSectionIndex+3]);
412  polygon.push_back((*pVertices)[pSectionIndex+7]);
413  polygon.push_back((*pVertices)[pSectionIndex+4]);
414  polygon.push_back((*pVertices)[pSectionIndex]);
415  // G4cout<<"ClipBetweenSections: 3-7-4-0"<<G4endl;
416  CalculateClippedPolygonExtent(polygon,pVoxelLimit,pAxis,pMin,pMax);
417  return;
418 }
419 
420 
422 //
423 // Calculate the maximum and minimum extents of the convex polygon pPolygon
424 // along the axis pAxis, within the limits pVoxelLimit
425 //
426 
427 void
429  const G4VoxelLimits& pVoxelLimit,
430  const EAxis pAxis,
431  G4double& pMin,
432  G4double& pMax) const
433 {
434  G4int noLeft,i;
435  G4double component;
436  /*
437  G4cout<<G4endl;
438  for(i = 0 ; i < pPolygon.size() ; i++ )
439  {
440  G4cout << i << "\t"
441  << "p.x = " << pPolygon[i].operator()(pAxis) << "\t"
442  // << "p.y = " << pPolygon[i].y() << "\t"
443  // << "p.z = " << pPolygon[i].z() << "\t"
444  << G4endl;
445  }
446  G4cout<<G4endl;
447  */
448  ClipPolygon(pPolygon,pVoxelLimit,pAxis);
449  noLeft = pPolygon.size();
450 
451  if ( noLeft )
452  {
453  // G4cout<<G4endl;
454  for (i=0;i<noLeft;i++)
455  {
456  component = pPolygon[i].operator()(pAxis);
457  // G4cout <<i<<"\t"<<component<<G4endl;
458 
459  if (component < pMin)
460  {
461  // G4cout <<i<<"\t"<<"Pmin = "<<component<<G4endl;
462  pMin = component;
463  }
464  if (component > pMax)
465  {
466  // G4cout <<i<<"\t"<<"PMax = "<<component<<G4endl;
467  pMax = component;
468  }
469  }
470  // G4cout<<G4endl;
471  }
472  // G4cout<<"pMin = "<<pMin<<"\t"<<"pMax = "<<pMax<<G4endl;
473 }
474 
476 //
477 // Clip the convex polygon described by the vertices at
478 // pSectionIndex ->pSectionIndex+3 within pVertices to the limits pVoxelLimit
479 //
480 // Set pMin to the smallest
481 //
482 // Calculate the extent of the polygon along pAxis, when clipped to the
483 // limits pVoxelLimit. If the polygon exists after clippin, set pMin to
484 // the polygon's minimum extent along the axis if <pMin, and set pMax to
485 // the polygon's maximum extent along the axis if >pMax.
486 //
487 // The polygon is described by a set of vectors, where each vector represents
488 // a vertex, so that the polygon is described by the vertex sequence:
489 // 0th->1st 1st->2nd 2nd->... nth->0th
490 //
491 // Modifications to the polygon are made
492 //
493 // NOTE: Execessive copying during clipping
494 
496  const G4VoxelLimits& pVoxelLimit,
497  const EAxis ) const
498 {
499  G4ThreeVectorList outputPolygon;
500 
501  if ( pVoxelLimit.IsLimited() )
502  {
503  if (pVoxelLimit.IsXLimited() ) // && pAxis != kXAxis)
504  {
505  G4VoxelLimits simpleLimit1;
506  simpleLimit1.AddLimit(kXAxis,pVoxelLimit.GetMinXExtent(),kInfinity);
507  // G4cout<<"MinXExtent()"<<G4endl;
508  ClipPolygonToSimpleLimits(pPolygon,outputPolygon,simpleLimit1);
509 
510  pPolygon.clear();
511 
512  if ( !outputPolygon.size() ) return;
513 
514  G4VoxelLimits simpleLimit2;
515  // G4cout<<"MaxXExtent()"<<G4endl;
516  simpleLimit2.AddLimit(kXAxis,-kInfinity,pVoxelLimit.GetMaxXExtent());
517  ClipPolygonToSimpleLimits(outputPolygon,pPolygon,simpleLimit2);
518 
519  if ( !pPolygon.size() ) return;
520  else outputPolygon.clear();
521  }
522  if ( pVoxelLimit.IsYLimited() ) // && pAxis != kYAxis)
523  {
524  G4VoxelLimits simpleLimit1;
525  simpleLimit1.AddLimit(kYAxis,pVoxelLimit.GetMinYExtent(),kInfinity);
526  ClipPolygonToSimpleLimits(pPolygon,outputPolygon,simpleLimit1);
527 
528  // Must always clear pPolygon - for clip to simpleLimit2 and in case of
529  // early exit
530 
531  pPolygon.clear();
532 
533  if ( !outputPolygon.size() ) return;
534 
535  G4VoxelLimits simpleLimit2;
536  simpleLimit2.AddLimit(kYAxis,-kInfinity,pVoxelLimit.GetMaxYExtent());
537  ClipPolygonToSimpleLimits(outputPolygon,pPolygon,simpleLimit2);
538 
539  if ( !pPolygon.size() ) return;
540  else outputPolygon.clear();
541  }
542  if ( pVoxelLimit.IsZLimited() ) // && pAxis != kZAxis)
543  {
544  G4VoxelLimits simpleLimit1;
545  simpleLimit1.AddLimit(kZAxis,pVoxelLimit.GetMinZExtent(),kInfinity);
546  ClipPolygonToSimpleLimits(pPolygon,outputPolygon,simpleLimit1);
547 
548  // Must always clear pPolygon - for clip to simpleLimit2 and in case of
549  // early exit
550 
551  pPolygon.clear();
552 
553  if ( !outputPolygon.size() ) return;
554 
555  G4VoxelLimits simpleLimit2;
556  simpleLimit2.AddLimit(kZAxis,-kInfinity,pVoxelLimit.GetMaxZExtent());
557  ClipPolygonToSimpleLimits(outputPolygon,pPolygon,simpleLimit2);
558 
559  // Return after final clip - no cleanup
560  }
561  }
562 }
563 
565 //
566 // pVoxelLimits must be only limited along one axis, and either the maximum
567 // along the axis must be +kInfinity, or the minimum -kInfinity
568 
569 void
570 G4VSolid::ClipPolygonToSimpleLimits( G4ThreeVectorList& pPolygon,
571  G4ThreeVectorList& outputPolygon,
572  const G4VoxelLimits& pVoxelLimit ) const
573 {
574  G4int i;
575  G4int noVertices=pPolygon.size();
576  G4ThreeVector vEnd,vStart;
577 
578  for (i = 0 ; i < noVertices ; i++ )
579  {
580  vStart = pPolygon[i];
581  // G4cout << "i = " << i << G4endl;
582  if ( i == noVertices-1 ) vEnd = pPolygon[0];
583  else vEnd = pPolygon[i+1];
584 
585  if ( pVoxelLimit.Inside(vStart) )
586  {
587  if (pVoxelLimit.Inside(vEnd))
588  {
589  // vStart and vEnd inside -> output end point
590  //
591  outputPolygon.push_back(vEnd);
592  }
593  else
594  {
595  // vStart inside, vEnd outside -> output crossing point
596  //
597  // G4cout << "vStart inside, vEnd outside" << G4endl;
598  pVoxelLimit.ClipToLimits(vStart,vEnd);
599  outputPolygon.push_back(vEnd);
600  }
601  }
602  else
603  {
604  if (pVoxelLimit.Inside(vEnd))
605  {
606  // vStart outside, vEnd inside -> output inside section
607  //
608  // G4cout << "vStart outside, vEnd inside" << G4endl;
609  pVoxelLimit.ClipToLimits(vStart,vEnd);
610  outputPolygon.push_back(vStart);
611  outputPolygon.push_back(vEnd);
612  }
613  else // Both point outside -> no output
614  {
615  // outputPolygon.push_back(vStart);
616  // outputPolygon.push_back(vEnd);
617  }
618  }
619  }
620 }
621 
623 //
624 // Throw exception (warning) for solids not implementing the method
625 
627 {
628  std::ostringstream message;
629  message << "Not implemented for solid: "
630  << GetEntityType() << " !"
631  << "\nReturning infinite boundinx box.";
632  G4Exception("G4VSolid::Extent()", "GeomMgt1001", JustWarning, message);
633 
634  pMin.set(-kInfinity,-kInfinity,-kInfinity);
635  pMax.set( kInfinity, kInfinity, kInfinity);
636 }
637 
639 //
640 // Get G4VisExtent - bounding box for graphics
641 
643 {
644  G4VisExtent extent;
645  G4VoxelLimits voxelLimits; // Defaults to "infinite" limits.
646  G4AffineTransform affineTransform;
647  G4double vmin, vmax;
648  CalculateExtent(kXAxis,voxelLimits,affineTransform,vmin,vmax);
649  extent.SetXmin (vmin);
650  extent.SetXmax (vmax);
651  CalculateExtent(kYAxis,voxelLimits,affineTransform,vmin,vmax);
652  extent.SetYmin (vmin);
653  extent.SetYmax (vmax);
654  CalculateExtent(kZAxis,voxelLimits,affineTransform,vmin,vmax);
655  extent.SetZmin (vmin);
656  extent.SetZmax (vmax);
657  return extent;
658 }
659 
661 {
662  return 0;
663 }
664 
666 {
667  return 0;
668 }
void set(double x, double y, double z)
virtual G4Polyhedron * GetPolyhedron() const
Definition: G4VSolid.cc:665
const XML_Char * name
Definition: expat.h:151
void ClipCrossSection(G4ThreeVectorList *pVertices, const G4int pSectionIndex, const G4VoxelLimits &pVoxelLimit, const EAxis pAxis, G4double &pMin, G4double &pMax) const
Definition: G4VSolid.cc:348
virtual G4bool CalculateExtent(const EAxis pAxis, const G4VoxelLimits &pVoxelLimit, const G4AffineTransform &pTransform, G4double &pMin, G4double &pMax) const =0
static const G4double kInfinity
Definition: geomdefs.hh:42
G4double GetMinYExtent() const
static void Register(G4VSolid *pSolid)
CLHEP::Hep3Vector G4ThreeVector
static void DeRegister(G4VSolid *pSolid)
virtual void ComputeDimensions(G4VPVParameterisation *p, const G4int n, const G4VPhysicalVolume *pRep)
Definition: G4VSolid.cc:138
G4bool IsYLimited() const
const char * p
Definition: xmltok.h:285
G4double EstimateCubicVolume(G4int nStat, G4double epsilon) const
Definition: G4VSolid.cc:204
G4double GetSurfaceTolerance() const
virtual G4double GetCubicVolume()
Definition: G4VSolid.cc:189
void SetXmax(G4double xmax)
Definition: G4VisExtent.hh:102
G4bool IsXLimited() const
virtual G4GeometryType GetEntityType() const =0
int G4int
Definition: G4Types.hh:78
void SetYmax(G4double ymax)
Definition: G4VisExtent.hh:106
G4double GetMaxXExtent() const
void AddLimit(const EAxis pAxis, const G4double pMin, const G4double pMax)
G4double GetMinZExtent() const
virtual std::ostream & StreamInfo(std::ostream &os) const =0
#define G4UniformRand()
Definition: Randomize.hh:97
G4bool IsLimited() const
void CalculateClippedPolygonExtent(G4ThreeVectorList &pPolygon, const G4VoxelLimits &pVoxelLimit, const EAxis pAxis, G4double &pMin, G4double &pMax) const
Definition: G4VSolid.cc:428
virtual EInside Inside(const G4ThreeVector &p) const =0
G4bool Inside(const G4ThreeVector &pVec) const
static G4SolidStore * GetInstance()
virtual G4double DistanceToIn(const G4ThreeVector &p, const G4ThreeVector &v) const =0
const G4double kCarTolerance
virtual G4Polyhedron * CreatePolyhedron() const
Definition: G4VSolid.cc:660
std::vector< G4ThreeVector > G4ThreeVectorList
G4double EstimateSurfaceArea(G4int nStat, G4double ell) const
Definition: G4VSolid.cc:264
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
virtual ~G4VSolid()
Definition: G4VSolid.cc:102
G4double GetMinXExtent() const
virtual G4VisExtent GetExtent() const
Definition: G4VSolid.cc:642
G4double GetMaxZExtent() const
void SetZmin(G4double zmin)
Definition: G4VisExtent.hh:108
EInside
Definition: geomdefs.hh:58
EAxis
Definition: geomdefs.hh:54
virtual G4ThreeVector GetPointOnSurface() const
Definition: G4VSolid.cc:153
virtual const G4VSolid * GetConstituentSolid(G4int no) const
Definition: G4VSolid.cc:168
std::ostream & operator<<(std::ostream &, const BasicVector3D< float > &)
#define G4endl
Definition: G4ios.hh:61
G4VSolid(const G4String &name)
Definition: G4VSolid.cc:61
G4double GetMaxYExtent() const
G4VSolid & operator=(const G4VSolid &rhs)
Definition: G4VSolid.cc:111
G4double kCarTolerance
Definition: G4VSolid.hh:307
virtual G4VSolid * Clone() const
Definition: G4VSolid.cc:325
void SetZmax(G4double zmax)
Definition: G4VisExtent.hh:110
void SetXmin(G4double xmin)
Definition: G4VisExtent.hh:100
double G4double
Definition: G4Types.hh:76
virtual G4double DistanceToOut(const G4ThreeVector &p, const G4ThreeVector &v, const G4bool calcNorm=false, G4bool *validNorm=0, G4ThreeVector *n=0) const =0
void SetYmin(G4double ymin)
Definition: G4VisExtent.hh:104
G4bool IsZLimited() const
virtual G4double GetSurfaceArea()
Definition: G4VSolid.cc:251
virtual void Extent(G4ThreeVector &pMin, G4ThreeVector &pMax) const
Definition: G4VSolid.cc:626
void ClipBetweenSections(G4ThreeVectorList *pVertices, const G4int pSectionIndex, const G4VoxelLimits &pVoxelLimit, const EAxis pAxis, G4double &pMin, G4double &pMax) const
Definition: G4VSolid.cc:379
double epsilon(double density, double temperature)
virtual const G4DisplacedSolid * GetDisplacedSolidPtr() const
Definition: G4VSolid.cc:174
static G4GeometryTolerance * GetInstance()
void ClipPolygon(G4ThreeVectorList &pPolygon, const G4VoxelLimits &pVoxelLimit, const EAxis pAxis) const
Definition: G4VSolid.cc:495
G4bool ClipToLimits(G4ThreeVector &pStart, G4ThreeVector &pEnd) const