// // ******************************************************************** // * DISCLAIMER * // * * // * The following disclaimer summarizes all the specific disclaimers * // * of contributors to this software. The specific disclaimers,which * // * govern, are listed with their locations in: * // * http://cern.ch/geant4/license * // * * // * Neither the authors of this software system, nor their employing * // * institutes,nor the agencies providing financial support for this * // * work make any representation or warranty, express or implied, * // * regarding this software system or assume any liability for its * // * use. * // * * // * 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: G4Curve.icc,v 1.6 2004/12/02 09:31:24 gcosmo Exp $ // GEANT4 tag $Name: geant4-08-00 $ // // -------------------------------------------------------------------- // GEANT 4 inline definitions file // // G4Curve.icc // // Implementation of inline methods of G4Curve // -------------------------------------------------------------------- inline G4bool G4Curve::operator==(const G4Curve& right) const { return this == &right; } inline const G4BoundingBox3D* G4Curve::BBox() const { return &bBox; } // bounds related inline const G4Point3D& G4Curve::GetStart() const { return start; } inline const G4Point3D& G4Curve::GetEnd() const { return end; } inline G4double G4Curve::GetPStart() const { return pStart; } inline G4double G4Curve::GetPEnd() const { return pEnd; } inline void G4Curve::SetStart(const G4Point3D& pt) { start= pt; pStart= GetPPoint(pt); } inline void G4Curve::SetStart(G4double p) { pStart= p; start= GetPoint(p); } inline void G4Curve::SetEnd(const G4Point3D& pt) { end= pt; pEnd= GetPPoint(pt); } inline void G4Curve::SetEnd(G4double p) { pEnd= p; end= GetPoint(p); } inline void G4Curve::SetBoundsRest() { pRange= pEnd-pStart; G4double pMax= GetPMax(); if (pMax>0) { // Find the range in the first determination pRange-= (std::ceil(pRange/pMax)-1)*pMax; } bounded= true; InitBounded(); } inline void G4Curve::SetBounds(G4double p1, G4double p2) { SetStart(p1); SetEnd(p2); SetBoundsRest(); } inline void G4Curve::SetBounds(G4double p1, const G4Point3D& p2) { SetStart(p1); SetEnd(p2); SetBoundsRest(); } inline void G4Curve::SetBounds(const G4Point3D& p1, G4double p2) { SetStart(p1); SetEnd(p2); SetBoundsRest(); } inline void G4Curve::SetBounds(const G4Point3D& p1, const G4Point3D& p2) { SetStart(p1); SetEnd(p2); SetBoundsRest(); } inline G4bool G4Curve::IsPOn(G4double param) const { G4double diff= param-pStart; G4double pMax= GetPMax(); if (pMax>0) diff-= std::floor(diff/pMax)*pMax; return diff<=pRange; } inline G4bool G4Curve::IsBounded() const { return bounded; } inline void G4Curve::SetSameSense(G4int sameSense0) { sameSense= sameSense0; } inline G4int G4Curve::GetSameSense() const { return sameSense; }