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 G4ControlPoints 00031 // 00032 // Class Description: 00033 // 00034 // G4ControlPoints defines an array of G4PointRat which in turn 00035 // are made of G4Point3D. 00036 00037 // Author: J.Sulkimo, P.Urban. 00038 // Revisions by: A.Floquet, L.Broglia, G.Cosmo. 00039 // ---------------------------------------------------------------------- 00040 #ifndef __G4ControlPoints_h 00041 #define __G4ControlPoints_h 1 00042 00043 #include "G4PointRat.hh" 00044 00045 class G4ControlPoints 00046 { 00047 public: // with description 00048 00049 G4ControlPoints(); 00050 G4ControlPoints( G4int, G4int); 00051 G4ControlPoints( G4int, G4int, G4int ); 00052 G4ControlPoints( const G4ControlPoints& ); 00053 // Constructors. 00054 00055 ~G4ControlPoints(); 00056 // Destructor. 00057 00058 G4ControlPoints& operator = ( const G4ControlPoints& ); 00059 // Assignment operator. 00060 00061 void SetWeights(G4double*); 00062 00063 void CalcValues(G4double k1, G4double param, G4Point3D& pts1, 00064 G4double k2, G4Point3D& pts2); 00065 void CalcValues(G4double k1, G4double param, G4PointRat& pts1, 00066 G4double k2, G4PointRat& pts2); 00067 00068 inline G4int GetRows() const; 00069 inline G4int GetCols() const; 00070 00071 inline void put(G4int i, G4int j, const G4Point3D &tmp); 00072 inline void put(G4int i, G4int j, const G4PointRat& tmp); 00073 // Put control point into matrix location (i,j). 00074 00075 inline G4Point3D Get3D(G4int i, G4int j) const; 00076 inline G4PointRat& GetRat(G4int i, G4int j) const; 00077 // Retrieve control point from matrix location (i,j); 00078 00079 G4double ClosestDistanceToPoint(const G4Point3D&); 00080 00081 00082 private: 00083 00084 inline G4double Calc(G4double k1, G4double par, G4double old_val, 00085 G4double k2, G4double new_val ); 00086 00087 G4PointRat** data; 00088 // G4PointRat datas are made of 00089 // - a point 3D 00090 // - an additional value: the scale factor which is set to 1 by default. 00091 00092 G4int nr, nc; 00093 }; 00094 00095 #include "G4ControlPoints.icc" 00096 00097 #endif