Files
geant4/source/geometry/solids/BREPS/include/G4Curve.icc
T
2016-06-08 16:57:27 +02:00

176 lines
3.6 KiB
Plaintext

//
// ********************************************************************
// * 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.5 2001/07/11 09:59:33 gunter Exp $
// GEANT4 tag $Name: geant4-05-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-= (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-= 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;
}