Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4BSplineCurve.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 G4BSplineCurve
31 //
32 // Class description:
33 //
34 // Definition of a generic BSpline curve.
35 
36 // Authors: J.Sulkimo, P.Urban.
37 // Revisions by: L.Broglia, G.Cosmo.
38 // ----------------------------------------------------------------------
39 #ifndef __BSPLINECURVE_H
40 #define __BSPLINECURVE_H
41 
42 #include "G4Curve.hh"
43 #include "G4Point3DVector.hh"
44 
45 class G4ControlPoints;
46 class G4KnotVector;
47 
48 class G4BSplineCurve : public G4Curve
49 {
50 
51 public: // with description
52 
54  // Default constructor, must be followed by call to Init(...) method.
55 
56  virtual ~G4BSplineCurve();
57  // Virtual destructor.
58 
61  // Copy constructor and assignment operator.
62 
63  virtual G4Curve* Project(const G4Transform3D& tr=
65  // Transforms and projects all control points.
66 
67  virtual G4double GetPMax() const;
68  virtual G4Point3D GetPoint(G4double param) const;
69  virtual G4double GetPPoint(const G4Point3D& p) const;
70  // Accessors methods.
71 
72  void Init(G4int degree0, G4Point3DVector* controlPointsList0,
73  std::vector<G4double>* knots0, std::vector<G4double>* weightsData0);
74  G4int GetDegree() const;
76  const std::vector<G4double>* GetKnots() const;
77  const std::vector<G4double>* GetWeightsData() const;
78  // Get/Set methods for the geometric data.
79  // The "knots" vector contains each knot multiplicity Times.
80  // The object is responsible for deleting the containers passed
81  // to the Init method.
82 
83 public: // without description
84 
85  virtual G4bool Tangent(G4CurvePoint& cp, G4Vector3D& v);
86  // Returns false. Empty implementation.
87 
88  virtual G4int IntersectRay2D(const G4Ray& ray);
89  // Returns 0. Empty implementation.
90 
91  //virtual void IntersectRay2D(const G4Ray& ray, G4CurveRayIntersection& is);
92 
93 protected:
94 
95  virtual void InitBounded();
96 
97  //public:
98  //void ProjectCurve(const G4Plane&, const G4Plane&);
99  //int Inside(const G4Point3d&, const G4Ray&);
100  //void CalcCurvePlaneNormal();
101 
102 protected:
103 
104  // geometric data:
105  // knots - contains each knot multiplicity Times.
106  // knot_multiplicities is not needed, weightsData might be 0
107  // curve_form, closed_curve, self_intersect is not used,
108  // as they are unreliable sources of information.
109  //
112  std::vector<G4double>* knots;
113  std::vector<G4double>* weightsData;
114 
115 };
116 
117 #include "G4BSplineCurve.icc"
118 
119 #endif