Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4SurfaceBoundary.hh
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$
28 //
29 // ----------------------------------------------------------------------
30 // Class G4SurfaceBoundary
31 //
32 // Class description:
33 //
34 // Definition of a surface boundary.
35 
36 // Authors: J.Sulkimo, P.Urban.
37 // Revisions by: L.Broglia, G.Cosmo.
38 // ----------------------------------------------------------------------
39 #ifndef included_G4SurfaceBoundary
40 #define included_G4SurfaceBoundary
41 
42 #include "G4Point3D.hh"
43 #include "G4Point3DVector.hh"
44 #include "G4Vector3D.hh"
45 #include "G4Transform3D.hh"
46 #include "G4Curve.hh"
47 #include "G4CurveVector.hh"
49 
50 class G4Ray;
52 
54 {
55 
56 public: // with description
57 
58 
61  // Constructor & destructor.
62 
63  void Init(const G4CurveVector& bounds0);
64  // Initializes with a set of closed curves, each of which is an
65  // (inner or outer) boundary. No responsibility to delete the curves
66  // is taken.
67 
68  inline const G4CurveVector& GetBounds() const;
69  // Returns closed curve boundaries.
70 
71  inline const G4BoundingBox3D& BBox() const;
72  // Returns the bounding-box.
73 
75  // Projection onto the xy plane after transformation tr.
76  // The returned object is allocated dynamically; it is the caller's
77  // responsibility to delete it.
78  // In case the projection maps a line into a point, 0 is returned.
79 
80  G4int IntersectRay2D(const G4Ray& ray);
81  // Intersects a 2D boundary with a ray. The ray is projected onto the
82  // xy plane. If no intersection 0 is returned, otherwise 1 is returned.
83  // and the intersection set to intersection0.
84  // The intersection point is: ray.start+ray.dir*intersection0.
85 
87  // Tangent vector to a curve at the point with parameter u.
88  // Returns true if exists. The vector is stored in v.
89 
90 
91 public: // without description
92 
93  void SplitWithPlane(const G4Point3D& p0,
94  const G4Vector3D& n,
95  G4SurfaceBoundary*& new1,
96  G4SurfaceBoundary*& new2 );
97  // Splits a boundary with a plane containing p0 with normal n.
98  // Pointers to the resulting boundaries are put into new1 and new2.
99  // It is the caller's responsibility to delete them.
100  // To be implemented yet.
101 
103  G4SurfaceBoundary*& new1,
104  G4SurfaceBoundary*& new2 );
105  // Splits a boundary with a cylindrical surface.
106  // Pointers to the resulting boundaries are put into new1 and new2.
107  // It is the caller's responsibility to delete them.
108  // To be implemented yet.
109 
110  inline G4int GetNumberOfPoints() const;
111  inline const G4Point3D& GetPoint(G4int Count) const;
112  // Functions probably not used and should be removed in the future
113 
114  // void IntersectRay2D(const G4Ray& ray, G4CurveRayIntersection& is);
115 
116 private:
117 
119  G4SurfaceBoundary& operator=(const G4SurfaceBoundary&);
120  // Private copy constructor and assignment operator.
121 
122 private:
123 
124  G4Point3DVector points;
125  G4CurveVector bounds;
126  G4BoundingBox3D bBox;
127 
128  // to speed up the tangent computation
129  G4CurveRayIntersection lastIntersection;
130 
131 };
132 
133 #include "G4SurfaceBoundary.icc"
134 
135 #endif