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 // GEANT 4 inline definitions file 00031 // 00032 // G4Curve.icc 00033 // 00034 // Implementation of inline methods of G4Curve 00035 // -------------------------------------------------------------------- 00036 00037 inline G4bool G4Curve::operator==(const G4Curve& right) const 00038 { 00039 return this == &right; 00040 } 00041 00042 inline 00043 const G4BoundingBox3D* G4Curve::BBox() const 00044 { 00045 return &bBox; 00046 } 00047 00048 // bounds related 00049 00050 inline 00051 const G4Point3D& G4Curve::GetStart() const 00052 { 00053 return start; 00054 } 00055 00056 inline 00057 const G4Point3D& G4Curve::GetEnd() const 00058 { 00059 return end; 00060 } 00061 00062 inline 00063 G4double G4Curve::GetPStart() const 00064 { 00065 return pStart; 00066 } 00067 00068 inline 00069 G4double G4Curve::GetPEnd() const 00070 { 00071 return pEnd; 00072 } 00073 00074 inline 00075 void G4Curve::SetStart(const G4Point3D& pt) 00076 { 00077 start= pt; 00078 pStart= GetPPoint(pt); 00079 } 00080 00081 inline 00082 void G4Curve::SetStart(G4double p) 00083 { 00084 pStart= p; 00085 start= GetPoint(p); 00086 } 00087 00088 inline 00089 void G4Curve::SetEnd(const G4Point3D& pt) 00090 { 00091 end= pt; 00092 pEnd= GetPPoint(pt); 00093 } 00094 00095 inline 00096 void G4Curve::SetEnd(G4double p) 00097 { 00098 pEnd= p; 00099 end= GetPoint(p); 00100 } 00101 00102 inline 00103 void G4Curve::SetBoundsRest() 00104 { 00105 pRange= pEnd-pStart; 00106 G4double pMax= GetPMax(); 00107 if (pMax>0) 00108 { 00109 // Find the range in the first determination 00110 pRange-= (std::ceil(pRange/pMax)-1)*pMax; 00111 } 00112 00113 bounded= true; 00114 InitBounded(); 00115 } 00116 00117 inline 00118 void G4Curve::SetBounds(G4double p1, G4double p2) 00119 { 00120 SetStart(p1); 00121 SetEnd(p2); 00122 SetBoundsRest(); 00123 } 00124 00125 inline 00126 void G4Curve::SetBounds(G4double p1, const G4Point3D& p2) 00127 { 00128 SetStart(p1); 00129 SetEnd(p2); 00130 SetBoundsRest(); 00131 } 00132 00133 inline 00134 void G4Curve::SetBounds(const G4Point3D& p1, G4double p2) 00135 { 00136 SetStart(p1); 00137 SetEnd(p2); 00138 SetBoundsRest(); 00139 } 00140 00141 inline 00142 void G4Curve::SetBounds(const G4Point3D& p1, const G4Point3D& p2) 00143 { 00144 SetStart(p1); 00145 SetEnd(p2); 00146 SetBoundsRest(); 00147 } 00148 00149 inline 00150 G4bool G4Curve::IsPOn(G4double param) const 00151 { 00152 G4double diff= param-pStart; 00153 G4double pMax= GetPMax(); 00154 00155 if (pMax>0) 00156 diff-= std::floor(diff/pMax)*pMax; 00157 00158 return diff<=pRange; 00159 } 00160 00161 inline 00162 G4bool G4Curve::IsBounded() const 00163 { 00164 return bounded; 00165 } 00166 00167 inline 00168 void G4Curve::SetSameSense(G4int sameSense0) 00169 { 00170 sameSense= sameSense0; 00171 } 00172 00173 inline 00174 G4int G4Curve::GetSameSense() const 00175 { 00176 return sameSense; 00177 }