88#ifndef G4TESSELLATEDSOLID_HH
89#define G4TESSELLATEDSOLID_HH 1
93#if defined(G4GEOM_USE_USOLIDS)
94#define G4GEOM_USE_UTESSELLATEDSOLID 1
97#if defined(G4GEOM_USE_UTESSELLATEDSOLID)
98 #define G4UTessellatedSolid G4TessellatedSolid
164 G4bool aAccurate =
false)
const;
166 G4bool aAccurate =
false)
const;
169 virtual std::ostream&
StreamInfo(std::ostream& os)
const;
216 G4double DistanceToInCandidates(
const std::vector<G4int>& candidates,
219 void DistanceToOutCandidates(
const std::vector<G4int>& candidates,
224 G4int& minCandidate)
const;
228 void SetExtremeFacets();
235 void CreateVertexList();
237 void PrecalculateInsides();
239 void SetRandomVectors();
248 G4int SetAllUsingStack(
const std::vector<G4int>& voxel,
249 const std::vector<G4int>& max,
252 void DeleteObjects ();
255 static G4bool CompareSortedVoxel(
const std::pair<G4int, G4double>& l,
256 const std::pair<G4int, G4double>& r);
270 mutable G4bool fRebuildPolyhedron =
false;
273 std::vector<G4VFacet*> fFacets;
274 std::set<G4VFacet*> fExtremeFacets;
281 std::vector<G4ThreeVector> fVertexList;
283 std::set<G4VertexInfo,G4VertexComparator> fFacetList;
287 G4bool fSolidClosed =
false;
289 std::vector<G4ThreeVector> fRandir;
320 return ( p.
x() < fMinExtent.
x() - tolerance
321 || p.
x() > fMaxExtent.
x() + tolerance
322 || p.
y() < fMinExtent.
y() - tolerance
323 || p.
y() > fMaxExtent.
y() + tolerance
324 || p.
z() < fMinExtent.
z() - tolerance
325 || p.
z() > fMaxExtent.
z() + tolerance);
virtual G4bool Normal(const G4ThreeVector &p, G4ThreeVector &n) const
G4double GetMinYExtent() const
void BoundingLimits(G4ThreeVector &pMin, G4ThreeVector &pMax) const
virtual G4Polyhedron * GetPolyhedron() const
virtual G4double GetSurfaceArea()
G4double GetMinZExtent() const
virtual std::ostream & StreamInfo(std::ostream &os) const
G4TessellatedSolid & operator=(const G4TessellatedSolid &right)
G4double kCarToleranceHalf
G4TessellatedSolid & operator+=(const G4TessellatedSolid &right)
virtual G4double DistanceToIn(const G4ThreeVector &p, const G4ThreeVector &v) const
G4bool AddFacet(G4VFacet *aFacet)
void DisplayAllocatedMemory()
G4int GetNumberOfFacets() const
G4double GetMaxYExtent() const
G4double GetMaxZExtent() const
G4double GetMaxXExtent() const
G4bool GetSolidClosed() const
virtual G4double DistanceToOut(const G4ThreeVector &p) const
G4VFacet * GetFacet(G4int i) const
virtual G4double SafetyFromInside(const G4ThreeVector &p, G4bool aAccurate=false) const
G4double GetMinXExtent() const
virtual void DescribeYourselfTo(G4VGraphicsScene &scene) const
void SetSolidClosed(const G4bool t)
G4int AllocatedMemoryWithoutVoxels()
virtual G4ThreeVector SurfaceNormal(const G4ThreeVector &p) const
virtual G4VisExtent GetExtent() const
virtual G4Polyhedron * CreatePolyhedron() const
virtual G4bool CalculateExtent(const EAxis pAxis, const G4VoxelLimits &pVoxelLimit, const G4AffineTransform &pTransform, G4double &pMin, G4double &pMax) const
G4Voxelizer & GetVoxels()
virtual G4GeometryType GetEntityType() const
virtual EInside Inside(const G4ThreeVector &p) const
virtual G4double SafetyFromOutside(const G4ThreeVector &p, G4bool aAccurate=false) const
void SetMaxVoxels(G4int max)
virtual ~G4TessellatedSolid()
virtual G4double GetCubicVolume()
virtual G4VSolid * Clone() const
virtual G4ThreeVector GetPointOnSurface() const
G4bool operator()(const G4VertexInfo &l, const G4VertexInfo &r) const
void SetMaxVoxels(G4int max)