00001 // 00002 // ******************************************************************** 00003 // * License and Disclaimer * 00004 // * * 00005 // * The Geant4 software is copyright of the Copyright Holders of * 00006 // * the Geant4 Collaboration. It is provided under the terms and * 00007 // * conditions of the Geant4 Software License, included in the file * 00008 // * LICENSE and available at http://cern.ch/geant4/license . These * 00009 // * include a list of copyright holders. * 00010 // * * 00011 // * Neither the authors of this software system, nor their employing * 00012 // * institutes,nor the agencies providing financial support for this * 00013 // * work make any representation or warranty, express or implied, * 00014 // * regarding this software system or assume any liability for its * 00015 // * use. Please see the license in the file LICENSE and URL above * 00016 // * for the full disclaimer and the limitation of liability. * 00017 // * * 00018 // * This code implementation is the result of the scientific and * 00019 // * technical work of the GEANT4 collaboration. * 00020 // * By using, copying, modifying or distributing the software (or * 00021 // * any work based on the software) you agree to acknowledge its * 00022 // * use in resulting scientific publications, and indicate your * 00023 // * acceptance of all terms of the Geant4 Software license. * 00024 // ******************************************************************** 00025 // 00026 // 00027 // $Id$ 00028 // 00029 // ---------------------------------------------------------------------- 00030 // Class G4BSplineCurve 00031 // 00032 // Class description: 00033 // 00034 // Definition of a generic BSpline curve. 00035 00036 // Authors: J.Sulkimo, P.Urban. 00037 // Revisions by: L.Broglia, G.Cosmo. 00038 // ---------------------------------------------------------------------- 00039 #ifndef __BSPLINECURVE_H 00040 #define __BSPLINECURVE_H 00041 00042 #include "G4Curve.hh" 00043 #include "G4Point3DVector.hh" 00044 00045 class G4ControlPoints; 00046 class G4KnotVector; 00047 00048 class G4BSplineCurve : public G4Curve 00049 { 00050 00051 public: // with description 00052 00053 G4BSplineCurve(); 00054 // Default constructor, must be followed by call to Init(...) method. 00055 00056 virtual ~G4BSplineCurve(); 00057 // Virtual destructor. 00058 00059 G4BSplineCurve(const G4BSplineCurve& right); 00060 G4BSplineCurve& operator=(const G4BSplineCurve& right); 00061 // Copy constructor and assignment operator. 00062 00063 virtual G4Curve* Project(const G4Transform3D& tr= 00064 G4Transform3D::Identity); 00065 // Transforms and projects all control points. 00066 00067 virtual G4double GetPMax() const; 00068 virtual G4Point3D GetPoint(G4double param) const; 00069 virtual G4double GetPPoint(const G4Point3D& p) const; 00070 // Accessors methods. 00071 00072 void Init(G4int degree0, G4Point3DVector* controlPointsList0, 00073 std::vector<G4double>* knots0, std::vector<G4double>* weightsData0); 00074 G4int GetDegree() const; 00075 const G4Point3DVector* GetControlPointsList() const; 00076 const std::vector<G4double>* GetKnots() const; 00077 const std::vector<G4double>* GetWeightsData() const; 00078 // Get/Set methods for the geometric data. 00079 // The "knots" vector contains each knot multiplicity Times. 00080 // The object is responsible for deleting the containers passed 00081 // to the Init method. 00082 00083 public: // without description 00084 00085 virtual G4bool Tangent(G4CurvePoint& cp, G4Vector3D& v); 00086 // Returns false. Empty implementation. 00087 00088 virtual G4int IntersectRay2D(const G4Ray& ray); 00089 // Returns 0. Empty implementation. 00090 00091 //virtual void IntersectRay2D(const G4Ray& ray, G4CurveRayIntersection& is); 00092 00093 protected: 00094 00095 virtual void InitBounded(); 00096 00097 //public: 00098 //void ProjectCurve(const G4Plane&, const G4Plane&); 00099 //int Inside(const G4Point3d&, const G4Ray&); 00100 //void CalcCurvePlaneNormal(); 00101 00102 protected: 00103 00104 // geometric data: 00105 // knots - contains each knot multiplicity Times. 00106 // knot_multiplicities is not needed, weightsData might be 0 00107 // curve_form, closed_curve, self_intersect is not used, 00108 // as they are unreliable sources of information. 00109 // 00110 G4int degree; 00111 G4Point3DVector* controlPointsList; 00112 std::vector<G4double>* knots; 00113 std::vector<G4double>* weightsData; 00114 00115 }; 00116 00117 #include "G4BSplineCurve.icc" 00118 00119 #endif