Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4ProjectedSurface.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 G4ProjectedSurface
31 //
32 // Class description:
33 //
34 // Definition of a projected surface.
35 
36 // Authors: J.Sulkimo, P.Urban.
37 // Revisions by: L.Broglia, G.Cosmo.
38 // ----------------------------------------------------------------------
39 #ifndef __G4ProjectedSurface_h
40 #define __G4ProjectedSurface_h 1
41 
42 #include "G4BezierSurface.hh"
43 
45 {
46  friend class G4BSplineSurface;
47  friend void CopySurface(G4ProjectedSurface& proj);
48 
49  public: // with description
50 
52  virtual ~G4ProjectedSurface();
53  // Default constructor and destructor.
54 
55  void CalcBBox();
56  // Finds the bounds of the 2D-projected nurb, it
57  // calculates the bounds for a bounding rectangle
58  // to the surface. The bounding rectangle is used
59  // for a preliminary check of intersection.
60 
61  public: // without description
62 
63  inline G4Vector3D SurfaceNormal(const G4Point3D& Pt) const;
64  // Returns normal to surface (G4Vector3D(0,0,0)).
65 
66  private:
67 
69  G4ProjectedSurface& operator=(const G4ProjectedSurface&);
70  // Private copy constructor and assignment operator.
71 
72  void CopySurface();
73  // Copies the projected surface into a bezier surface
74  // and adds it to the List of bezier surfaces.
75 
76  void ConvertToBezier (G4SurfaceList& p, G4SurfaceList& b);
77  // Converts surface into a Bezier surface to b.
78 
79  inline G4int GetOrder(G4int direction) const;
80  inline void PutOrder(G4int direction, G4int value);
81 
82  void SplitNURBSurface();
83  // Divides the surface in two parts. Uses the oslo-algorithm to calculate
84  // the new knot-vectors and control-points for the subsurfaces.
85 
86  G4int CheckBezier();
87  // Checks if the surface is a Bezier surface by verifying
88  // if internal knots exist. If no internal knots exist the quantity
89  // of knots is 2*order of the surface. Returns 1 if the surface
90  // is a Bezier.
91 
92  void CalcOsloMatrix();
93  // Calculates the oslo-matrix, which is used in mapping the new
94  // knot-vector and the control-point values.
95  // This algorithm is described in the paper "Making the Oslo-algorithm
96  // more efficient" in SIAM J.NUMER.ANAL. Vol.23, No. 3, June '86.
97 
98  void MapSurface(G4ProjectedSurface* srf);
99  // Maps the new control-points into the new surface.
100  // This algorithm is described in the paper "Making the Oslo-algorithm
101  // more efficient" in SIAM J.NUMER.ANAL. Vol.23, No. 3, June '86.
102 
103  inline G4int Amax(G4int i, G4int j) const;
104  inline G4int Amin(G4int i, G4int j) const;
105  inline G4int AhIndex(G4int j, G4int t, G4int iorder) const;
106 
107  protected:
108 
109  static G4int Splits;
111  // Test variables
112 
113  private:
114 
115  short dir;
116  G4KnotVector *u_knots;
117  G4KnotVector *v_knots;
118 
119  G4SurfaceList* projected_list;
120  G4SurfaceList* bezier_list;
121 
122  G4int order[2];
123  G4KnotVector *new_knots;
124  G4int ord;
125  G4int lower,upper;
126 
127  G4OsloMatrix* oslo_m;
128  G4Point3D vmin;
129  G4Point3D vmax;
130 };
131 
132 #include "G4ProjectedSurface.icc"
133 
134 #endif