#include <G4Surface.hh>
Inheritance diagram for G4Surface:
Definition at line 50 of file G4Surface.hh.
G4Surface::G4Surface | ( | ) |
Definition at line 40 of file G4Surface.cc.
References G4GeometryTolerance::GetAngularTolerance(), G4GeometryTolerance::GetInstance(), G4GeometryTolerance::GetSurfaceTolerance(), kAngTolerance, and kCarTolerance.
00041 : G4STEPEntity(), 00042 bbox(0), next(0), Intersected(0), Type(0), AdvancedFace(0), 00043 active(1), distance(kInfinity), uhit(0.), vhit(0.), sameSense(0) 00044 { 00045 kCarTolerance = G4GeometryTolerance::GetInstance()->GetSurfaceTolerance(); 00046 kAngTolerance = G4GeometryTolerance::GetInstance()->GetAngularTolerance(); 00047 }
G4Surface::~G4Surface | ( | ) | [virtual] |
void G4Surface::CalcBBox | ( | ) | [virtual] |
Reimplemented in G4BezierSurface, G4BSplineSurface, G4ConicalSurface, G4FConicalSurface, G4FCylindricalSurface, G4FPlane, G4ProjectedSurface, G4RectangularTrimmedSurface, G4SphericalSurface, and G4ToroidalSurface.
Definition at line 146 of file G4Surface.cc.
References G4SurfaceBoundary::BBox(), bbox, G4BoundingBox3D::GetBoxMax(), G4BoundingBox3D::GetBoxMin(), and surfaceBoundary.
Referenced by G4RectangularTrimmedSurface::CalcBBox(), and G4BREPSolid::CalcBBoxes().
00147 { 00148 // Finds the bounds of the surface iow 00149 // calculates the bounds for a bounding box 00150 // to the surface. The bounding box is used 00151 // for a preliminary check of intersection. 00152 00153 bbox = new G4BoundingBox3D(surfaceBoundary.BBox().GetBoxMin(), 00154 surfaceBoundary.BBox().GetBoxMax()); 00155 // old implementation 00156 // G4Point3d BoundaryMax = OuterBoundary->GetBoundsMax(); 00157 // G4Point3d BoundaryMin = OuterBoundary->GetBoundsMin(); 00158 // bbox = new G4BoundingBox( BoundaryMin, BoundaryMax); 00159 // return; 00160 }
void G4Surface::CalcNormal | ( | ) | [virtual] |
Reimplemented in G4BSplineSurface, G4FPlane, and G4ToroidalSurface.
Definition at line 203 of file G4Surface.cc.
References G4SurfaceBoundary::GetBounds(), GetEntityType(), and surfaceBoundary.
Referenced by G4BREPSolidCone::Inside().
00204 { 00205 // in fact, a squared distance is returned 00206 00207 // a bit suspicious, this function 00208 // the distance is almost always an overestimate 00209 G4double pointDistance= kInfinity; 00210 G4double tmpDistance; 00211 const G4CurveVector& bounds= surfaceBoundary.GetBounds(); 00212 00213 G4int entr = bounds.size(); 00214 00215 for (G4int i=0; i<entr; i++) 00216 { 00217 G4Curve* c= bounds[i]; 00218 00219 if (c->GetEntityType() == "G4CompositeCurve") 00220 { 00221 G4CompositeCurve* cc= (G4CompositeCurve*)c; 00222 const G4CurveVector& segments= cc->GetSegments(); 00223 for (size_t j=0; j<segments.size(); j++) 00224 { 00225 G4Curve* ccc= segments[j]; 00226 tmpDistance= (G4Point3D(Pt.x(), Pt.y(), Pt.z())-ccc->GetEnd()).mag2(); 00227 if (pointDistance > tmpDistance) 00228 { 00229 pointDistance= tmpDistance; 00230 } 00231 } 00232 00233 } 00234 else 00235 { 00236 tmpDistance= (G4Point3D(Pt.x(), Pt.y(), Pt.z())-c->GetEnd()).mag2(); 00237 if (pointDistance > tmpDistance) 00238 { 00239 pointDistance= tmpDistance; 00240 } 00241 } 00242 } 00243 00244 // L. Broglia 00245 // Be carreful ! pointdistance is the squared distance 00246 return std::sqrt(pointDistance); 00247 00248 // G4double PointDistance=kInfinity; 00249 // G4double TmpDistance=0; 00250 // PointDistance = OuterBoundary->ClosestDistanceToPoint(Pt); 00251 // TmpDistance =0; 00252 // for(G4int a=0;a<NumberOfInnerBoundaries;a++) 00253 // { 00254 // TmpDistance = InnerBoundary[a]->ClosestDistanceToPoint(Pt); 00255 // if(PointDistance > TmpDistance) PointDistance = TmpDistance; 00256 // } 00257 // return PointDistance; 00258 00259 //G4double G4Boundary::ClosestDistanceToPoint(const G4ThreeVec& Pt) 00260 //{ 00261 // G4double PointDistance = kInfinity; 00262 // G4double TmpDistance = 0; 00263 // for(G4int a =0; a < NumberOfPoints;a++) 00264 // { 00265 // G4Point3d& Pt2 = GetPoint(a); 00266 // TmpDistance = Pt2.Distance(Pt); 00267 // if(PointDistance > TmpDistance)PointDistance = TmpDistance; 00268 // } 00269 // return PointDistance; 00270 //} 00271 }
void G4Surface::Deactivate | ( | ) | [inline] |
Reimplemented in G4FPlane.
Definition at line 68 of file G4Surface.icc.
References active.
Referenced by G4BREPSolid::Intersect(), G4BREPSolid::RemoveHiddenFaces(), and G4BREPSolid::TestSurfaceBBoxes().
00069 { 00070 active=0; 00071 }
Definition at line 123 of file G4Surface.cc.
References closest_hit.
00124 { 00125 return closest_hit; 00126 }
G4BoundingBox3D * G4Surface::GetBBox | ( | ) | [inline] |
Definition at line 86 of file G4Surface.icc.
References bbox.
Referenced by G4RectangularTrimmedSurface::CalcBBox(), G4BREPSolid::CalcBBoxes(), G4FCylindricalSurface::Intersect(), G4FConicalSurface::Intersect(), and G4BREPSolid::TestSurfaceBBoxes().
00087 { 00088 return bbox; 00089 }
const G4Point3D & G4Surface::GetClosestHit | ( | ) | const [inline] |
Definition at line 92 of file G4Surface.icc.
References closest_hit.
Referenced by G4RectangularTrimmedSurface::Intersect(), G4BREPSolid::Intersect(), and G4BREPSolidPCone::SurfaceNormal().
00093 { 00094 return closest_hit; 00095 }
G4int G4Surface::GetConvex | ( | ) | const [virtual] |
G4double G4Surface::GetDistance | ( | ) | const [inline] |
Definition at line 44 of file G4Surface.icc.
References distance.
Referenced by G4BREPSolidSphere::DistanceToIn(), G4BREPSolidPCone::DistanceToIn(), G4BREPSolidCone::DistanceToIn(), G4BREPSolidSphere::DistanceToOut(), G4BREPSolidPCone::DistanceToOut(), G4BREPSolidCone::DistanceToOut(), G4BREPSolidPolyhedra::Inside(), G4BSplineSurface::Intersect(), G4BREPSolid::Intersect(), G4SurfaceList::QuickG4Sort(), and G4BREPSolid::QuickSort().
00045 { 00046 return distance; 00047 }
G4String G4Surface::GetEntityType | ( | ) | const [virtual] |
Implements G4STEPEntity.
Reimplemented in G4ConicalSurface, G4CylindricalSurface, G4FConicalSurface, G4FCylindricalSurface, G4SphericalSurface, and G4ToroidalSurface.
Definition at line 92 of file G4Surface.cc.
Referenced by ClosestDistanceToPoint().
00093 { 00094 return G4String("Surface"); 00095 }
G4Surface * G4Surface::GetNextNode | ( | ) | [inline] |
Definition at line 98 of file G4Surface.icc.
References next.
Referenced by G4SurfaceList::AddSurface(), G4SurfaceList::EmptyList(), G4SurfaceList::G4SortList(), G4SurfaceList::RemovePointer(), G4SurfaceList::RemoveSurface(), and G4SurfaceList::Step().
00099 { 00100 return next; 00101 }
G4int G4Surface::GetNumberOfPoints | ( | ) | const [virtual] |
Reimplemented in G4FPlane.
Definition at line 309 of file G4Surface.cc.
Referenced by G4BREPSolid::CheckSurfaceNormals(), and G4BREPSolid::IsConvex().
G4Vector3D G4Surface::GetOrigin | ( | ) | const [inline] |
Definition at line 38 of file G4Surface.icc.
References origin.
Referenced by G4SphericalSurface::Intersect(), G4CylindricalSurface::Intersect(), and G4ConicalSurface::Intersect().
00039 { 00040 return origin; 00041 }
Reimplemented in G4FPlane.
Definition at line 314 of file G4Surface.cc.
Referenced by G4BREPSolid::CheckSurfaceNormals(), and G4BREPSolid::IsConvex().
G4int G4Surface::GetSameSense | ( | ) | const [inline] |
Definition at line 80 of file G4Surface.icc.
References sameSense.
Referenced by G4FPlane::CalcNormal().
00081 { 00082 return sameSense; 00083 }
G4double G4Surface::GetUHit | ( | ) | const [virtual] |
Reimplemented in G4BSplineSurface.
Definition at line 111 of file G4Surface.cc.
References uhit.
Referenced by G4RectangularTrimmedSurface::Intersect().
00112 { 00113 return uhit; 00114 }
G4double G4Surface::GetVHit | ( | ) | const [virtual] |
Reimplemented in G4BSplineSurface.
Definition at line 116 of file G4Surface.cc.
References vhit.
Referenced by G4RectangularTrimmedSurface::Intersect().
00117 { 00118 return vhit; 00119 }
G4double G4Surface::HowNear | ( | const G4Vector3D & | x | ) | const [virtual] |
Reimplemented in G4ConicalSurface, G4CylindricalSurface, G4FConicalSurface, G4FCylindricalSurface, G4FPlane, and G4SphericalSurface.
Definition at line 283 of file G4Surface.cc.
References origin.
Referenced by G4BREPSolidPCone::DistanceToIn(), G4BREPSolidPCone::DistanceToOut(), G4BREPSolidSphere::Inside(), and G4BREPSolidCone::Inside().
00284 { 00285 // Distance from the point x to a Surface. 00286 // The default for a Surface is the distance from the point to the origin. 00287 G4Vector3D p = G4Vector3D( x - origin ); 00288 return p.mag(); 00289 }
void G4Surface::InitBounded | ( | ) | [protected, virtual] |
Reimplemented in G4FPlane.
Definition at line 107 of file G4Surface.cc.
Referenced by SetBoundaries().
Reimplemented in G4BSplineSurface, G4ConicalSurface, G4CylindricalSurface, G4FConicalSurface, G4FCylindricalSurface, G4FPlane, G4RectangularTrimmedSurface, G4SphericalSurface, and G4ToroidalSurface.
Definition at line 170 of file G4Surface.cc.
References closest_hit, FatalException, G4Exception(), and Normal().
Referenced by G4BREPSolidSphere::DistanceToIn(), G4RectangularTrimmedSurface::Intersect(), G4BREPSolid::Intersect(), and G4BREPSolid::TestSurfaceBBoxes().
00171 { 00172 G4int Result = 0; 00173 00174 G4Exception("G4Surface::Intersect()", "GeomSolids0001", 00175 FatalException, "Sorry, not yet implemented."); 00176 00177 #ifdef NEW_IMPLEMENTATION 00178 // get the intersection 00179 // Result = Intersect(rayref); 00180 00181 // Check that the point is within the polyline 00182 // Get Normal at Hitpoint 00183 const G4Vector3D& Vec = Normal(closest_hit); 00184 G4Ray Normal(closest_hit, Vec); 00185 00186 // Project points & Hit 00187 // OuterBoundary->ProjectBoundaryTo2D(Normal.GetPlane(1), 00188 // Normal.GetPlane(2), 0); 00189 00190 00191 00192 00193 G4Point3D Hit = closest_hit.Project(Normal.GetPlane(1), 00194 Normal.GetPlane(2) ); 00195 // Check point in polygon 00196 // Result = OuterBoundary->Inside(Hit, rayref); 00197 00198 #endif 00199 return Result; 00200 }
G4int G4Surface::IsActive | ( | ) | const [inline] |
Definition at line 56 of file G4Surface.icc.
References active.
Referenced by G4BSplineSurface::Intersect(), G4BREPSolid::Intersect(), and G4BREPSolid::TestSurfaceBBoxes().
00057 { 00058 return active; 00059 }
G4int G4Surface::IsConvex | ( | ) | const [virtual] |
Reimplemented in G4FPlane.
Definition at line 299 of file G4Surface.cc.
Referenced by G4BREPSolid::IsConvex().
G4int G4Surface::MyType | ( | ) | const [virtual] |
Reimplemented in G4BSplineSurface, and G4FPlane.
Definition at line 102 of file G4Surface.cc.
References Type.
Referenced by G4BREPSolid::Intersect(), G4BREPSolid::RemoveHiddenFaces(), and G4BREPSolid::TestSurfaceBBoxes().
00103 { 00104 return Type; 00105 }
const char * G4Surface::Name | ( | ) | const [virtual] |
Reimplemented in G4FConicalSurface, G4FPlane, and G4RectangularTrimmedSurface.
Definition at line 97 of file G4Surface.cc.
G4Ray * G4Surface::Norm | ( | ) | [virtual] |
Reimplemented in G4FPlane.
Definition at line 320 of file G4Surface.cc.
Referenced by G4BREPSolid::CheckSurfaceNormals(), G4BREPSolid::IsConvex(), and G4BREPSolid::RemoveHiddenFaces().
00321 { 00322 return (G4Ray*)0; 00323 }
G4Vector3D G4Surface::Normal | ( | const G4Vector3D & | p | ) | const [virtual] |
Reimplemented in G4CylindricalSurface, and G4SphericalSurface.
Definition at line 162 of file G4Surface.cc.
Referenced by Intersect(), G4BREPSolidSphere::SurfaceNormal(), and G4BREPSolidCone::SurfaceNormal().
00163 { // return the Normal unit vector to a Surface at the point p on 00164 // (or nearly on) the Surface. 00165 // The default is not well defined, so return ( 0, 0, 0 ). 00166 return G4Vector3D( 0.0, 0.0, 0.0 ); 00167 }
Definition at line 87 of file G4Surface.cc.
References origin.
00088 { 00089 return origin == surf.origin; 00090 }
void G4Surface::Project | ( | ) | [virtual] |
Definition at line 325 of file G4Surface.cc.
References G4Plane::a, G4Plane::b, G4Plane::c, and G4Plane::d.
void G4Surface::Reset | ( | ) | [virtual] |
Reimplemented in G4BSplineSurface.
Definition at line 133 of file G4Surface.cc.
References active, distance, and Intersected.
00134 { 00135 Intersected = 0; 00136 active = 1; 00137 distance = kInfinity; 00138 }
void G4Surface::SetActive | ( | G4int | act | ) | [inline] |
Definition at line 62 of file G4Surface.icc.
References active.
Referenced by G4BSplineSurface::Intersect().
00063 { 00064 active=act; 00065 }
void G4Surface::SetBoundaries | ( | G4CurveVector * | ) |
Definition at line 140 of file G4Surface.cc.
References G4SurfaceBoundary::Init(), InitBounded(), and surfaceBoundary.
Referenced by G4FPlane::G4FPlane().
00141 { 00142 surfaceBoundary.Init(*boundaries); 00143 InitBounded(); 00144 }
void G4Surface::SetDistance | ( | G4double | Dist | ) | [inline] |
Definition at line 50 of file G4Surface.icc.
References distance.
Referenced by G4FPlane::Intersect(), and G4BREPSolid::TestSurfaceBBoxes().
00051 { 00052 distance=Dist; 00053 }
void G4Surface::SetNextNode | ( | G4Surface * | ) | [inline] |
Definition at line 104 of file G4Surface.icc.
References next.
Referenced by G4SurfaceList::AddSurface(), G4SurfaceList::G4SortList(), G4SurfaceList::MoveToFirst(), G4SurfaceList::RemovePointer(), and G4SurfaceList::RemoveSurface().
00105 { 00106 next = node; 00107 }
void G4Surface::SetSameSense | ( | G4int | sameSense0 | ) | [inline] |
Definition at line 74 of file G4Surface.icc.
References sameSense.
Referenced by G4FPlane::G4FPlane().
00075 { 00076 sameSense = sameSense0; 00077 }
virtual G4Vector3D G4Surface::SurfaceNormal | ( | const G4Point3D & | Pt | ) | const [pure virtual] |
Implemented in G4BezierSurface, G4ConicalSurface, G4CylindricalSurface, G4FConicalSurface, G4FCylindricalSurface, G4FPlane, G4ProjectedSurface, G4SphericalSurface, and G4ToroidalSurface.
Referenced by G4BREPSolidPolyhedra::DistanceToIn(), G4BREPSolid::DistanceToIn(), G4BREPSolidPCone::Inside(), G4BREPSolid::Intersect(), G4BREPSolidPCone::SurfaceNormal(), and G4BREPSolid::SurfaceNormal().
G4int G4Surface::active [protected] |
Definition at line 202 of file G4Surface.hh.
Referenced by Deactivate(), G4FPlane::Deactivate(), G4FPlane::G4FPlane(), G4FPlane::Intersect(), G4BSplineSurface::Intersect(), IsActive(), Reset(), G4BSplineSurface::Reset(), and SetActive().
G4int G4Surface::AdvancedFace [protected] |
Definition at line 201 of file G4Surface.hh.
G4BoundingBox3D* G4Surface::bbox [protected] |
Definition at line 185 of file G4Surface.hh.
Referenced by G4BezierSurface::BIntersect(), G4ToroidalSurface::CalcBBox(), CalcBBox(), G4SphericalSurface::CalcBBox(), G4RectangularTrimmedSurface::CalcBBox(), G4ProjectedSurface::CalcBBox(), G4FPlane::CalcBBox(), G4FCylindricalSurface::CalcBBox(), G4FConicalSurface::CalcBBox(), G4ConicalSurface::CalcBBox(), G4BSplineSurface::CalcBBox(), G4BezierSurface::CalcBBox(), GetBBox(), G4ToroidalSurface::Intersect(), G4BezierSurface::~G4BezierSurface(), and G4ProjectedSurface::~G4ProjectedSurface().
G4Point3D G4Surface::closest_hit [protected] |
Definition at line 186 of file G4Surface.hh.
Referenced by Evaluation(), GetClosestHit(), G4ToroidalSurface::Intersect(), Intersect(), G4SphericalSurface::Intersect(), G4RectangularTrimmedSurface::Intersect(), G4FPlane::Intersect(), G4FCylindricalSurface::Intersect(), G4FConicalSurface::Intersect(), G4CylindricalSurface::Intersect(), G4ConicalSurface::Intersect(), and G4BSplineSurface::Intersect().
G4double G4Surface::distance [protected] |
Definition at line 203 of file G4Surface.hh.
Referenced by G4BSplineSurface::G4BSplineSurface(), G4FPlane::G4FPlane(), G4ProjectedSurface::G4ProjectedSurface(), GetDistance(), G4ToroidalSurface::Intersect(), G4SphericalSurface::Intersect(), G4FPlane::Intersect(), G4FCylindricalSurface::Intersect(), G4FConicalSurface::Intersect(), G4CylindricalSurface::Intersect(), G4ConicalSurface::Intersect(), G4BSplineSurface::Intersect(), Reset(), G4BSplineSurface::Reset(), and SetDistance().
G4int G4Surface::Intersected [protected] |
Definition at line 194 of file G4Surface.hh.
Referenced by G4FPlane::Intersect(), G4BSplineSurface::Intersect(), Reset(), and G4BSplineSurface::Reset().
G4double G4Surface::kAngTolerance [protected] |
Definition at line 192 of file G4Surface.hh.
Referenced by G4Surface(), and G4SphericalSurface::resize().
G4double G4Surface::kCarTolerance [protected] |
Definition at line 192 of file G4Surface.hh.
Referenced by G4FCylindricalSurface::CalcBBox(), G4FConicalSurface::CalcBBox(), G4BezierSurface::ClipSurface(), G4Surface(), G4FCylindricalSurface::Inside(), G4FConicalSurface::Inside(), G4CylindricalSurface::Inside(), G4ConicalSurface::Inside(), G4ToroidalSurface::Intersect(), G4SphericalSurface::Intersect(), G4FPlane::Intersect(), G4FCylindricalSurface::Intersect(), G4FConicalSurface::Intersect(), G4CylindricalSurface::Intersect(), and G4ConicalSurface::Intersect().
G4Surface* G4Surface::next [protected] |
G4Vector3D G4Surface::origin [protected] |
Definition at line 197 of file G4Surface.hh.
Referenced by G4SphericalSurface::CalcBBox(), G4CylindricalSurface::G4CylindricalSurface(), G4FConicalSurface::G4FConicalSurface(), G4FCylindricalSurface::G4FCylindricalSurface(), GetOrigin(), HowNear(), G4SphericalSurface::HowNear(), G4FCylindricalSurface::HowNear(), G4FConicalSurface::HowNear(), G4CylindricalSurface::HowNear(), G4ConicalSurface::HowNear(), G4SphericalSurface::Normal(), G4CylindricalSurface::Normal(), operator==(), G4SphericalSurface::operator==(), G4FCylindricalSurface::operator==(), G4FConicalSurface::operator==(), G4CylindricalSurface::operator==(), G4ConicalSurface::operator==(), G4SphericalSurface::PrintOn(), G4FCylindricalSurface::PrintOn(), G4FConicalSurface::PrintOn(), G4CylindricalSurface::PrintOn(), G4ConicalSurface::PrintOn(), G4SphericalSurface::SurfaceNormal(), G4FConicalSurface::SurfaceNormal(), G4CylindricalSurface::SurfaceNormal(), G4ConicalSurface::SurfaceNormal(), and G4FConicalSurface::WithinBoundary().
G4int G4Surface::sameSense [protected] |
Definition at line 207 of file G4Surface.hh.
Referenced by G4FPlane::G4FPlane(), GetSameSense(), SetSameSense(), G4FCylindricalSurface::SurfaceNormal(), and G4FConicalSurface::SurfaceNormal().
G4SurfaceBoundary G4Surface::surfaceBoundary [protected] |
Definition at line 189 of file G4Surface.hh.
Referenced by CalcBBox(), G4FPlane::CalcBBox(), G4ConicalSurface::CalcBBox(), ClosestDistanceToPoint(), G4FPlane::GetNumberOfPoints(), G4FPlane::GetPoint(), G4FPlane::InitBounded(), and SetBoundaries().
G4int G4Surface::Type [protected] |
G4double G4Surface::uhit [protected] |
G4double G4Surface::vhit [protected] |