63 lines
1.4 KiB
Plaintext
63 lines
1.4 KiB
Plaintext
// This code implementation is the intellectual property of
|
|
// the GEANT4 collaboration.
|
|
//
|
|
// By copying, distributing or modifying the Program (or any work
|
|
// based on the Program) you indicate your acceptance of this statement,
|
|
// and all its terms.
|
|
//
|
|
// $Id: G4ControlPoints.icc,v 1.1 2000/08/28 08:57:44 gcosmo Exp $
|
|
// GEANT4 tag $Name: geant4-03-00 $
|
|
//
|
|
// --------------------------------------------------------------------
|
|
// GEANT 4 inline definitions file
|
|
//
|
|
// G4ControlPoints.icc
|
|
//
|
|
// Implementation of inline methods of G4ControlPoints
|
|
// --------------------------------------------------------------------
|
|
|
|
inline
|
|
G4int G4ControlPoints::GetRows() const
|
|
{
|
|
return nr;
|
|
}
|
|
|
|
inline
|
|
G4int G4ControlPoints::GetCols() const
|
|
{
|
|
return nc;
|
|
}
|
|
|
|
inline
|
|
void G4ControlPoints::put(G4int i, G4int j, const G4Point3D &tmp)
|
|
{
|
|
*data[i*nc+j]=tmp; // tmp is converted to a PointRat
|
|
// by the member affectation function
|
|
// of the G4PointRat class
|
|
}
|
|
|
|
inline
|
|
void G4ControlPoints::put(G4int i, G4int j, const G4PointRat& tmp)
|
|
{
|
|
*data[i*nc+j]=tmp;
|
|
}
|
|
|
|
inline
|
|
G4Point3D G4ControlPoints::Get3D(G4int i, G4int j) const
|
|
{
|
|
return (data[i*nc+j])->pt();
|
|
}
|
|
|
|
inline
|
|
G4PointRat& G4ControlPoints::GetRat(G4int i, G4int j) const
|
|
{
|
|
return *data[i*nc+j];
|
|
}
|
|
|
|
inline
|
|
G4double G4ControlPoints::Calc(G4double k1, G4double par, G4double old_val,
|
|
G4double k2, G4double new_val)
|
|
{
|
|
return (((k1 - par) * old_val +(par - k2) * new_val) / (k1-k2));
|
|
}
|