179 lines
3.9 KiB
Plaintext
179 lines
3.9 KiB
Plaintext
//
|
|
// ********************************************************************
|
|
// * License and Disclaimer *
|
|
// * *
|
|
// * The Geant4 software is copyright of the Copyright Holders of *
|
|
// * the Geant4 Collaboration. It is provided under the terms and *
|
|
// * conditions of the Geant4 Software License, included in the file *
|
|
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
|
// * include a list of copyright holders. *
|
|
// * *
|
|
// * 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. Please see the license in the file LICENSE and URL above *
|
|
// * for the full disclaimer and the limitation of liability. *
|
|
// * *
|
|
// * This code implementation is the result of the scientific and *
|
|
// * technical work of the GEANT4 collaboration. *
|
|
// * By using, copying, modifying or distributing the software (or *
|
|
// * any work based on the software) you agree to acknowledge its *
|
|
// * use in resulting scientific publications, and indicate your *
|
|
// * acceptance of all terms of the Geant4 Software license. *
|
|
// ********************************************************************
|
|
//
|
|
//
|
|
// $Id: G4Curve.icc,v 1.7 2006/06/29 18:38:58 gunter Exp $
|
|
// GEANT4 tag $Name: geant4-09-01 $
|
|
//
|
|
// --------------------------------------------------------------------
|
|
// 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;
|
|
}
|