source: trunk/source/geometry/solids/BREPS/include/G4Curve.icc@ 1350

Last change on this file since 1350 was 1337, checked in by garnier, 15 years ago

tag geant4.9.4 beta 1 + modifs locales

File size: 3.9 KB
RevLine 
[831]1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
10// * *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
17// * *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
25//
26//
27// $Id: G4Curve.icc,v 1.7 2006/06/29 18:38:58 gunter Exp $
[1337]28// GEANT4 tag $Name: geant4-09-04-beta-01 $
[831]29//
30// --------------------------------------------------------------------
31// GEANT 4 inline definitions file
32//
33// G4Curve.icc
34//
35// Implementation of inline methods of G4Curve
36// --------------------------------------------------------------------
37
38inline G4bool G4Curve::operator==(const G4Curve& right) const
39{
40 return this == &right;
41}
42
43inline
44const G4BoundingBox3D* G4Curve::BBox() const
45{
46 return &bBox;
47}
48
49// bounds related
50
51inline
52const G4Point3D& G4Curve::GetStart() const
53{
54 return start;
55}
56
57inline
58const G4Point3D& G4Curve::GetEnd() const
59{
60 return end;
61}
62
63inline
64G4double G4Curve::GetPStart() const
65{
66 return pStart;
67}
68
69inline
70G4double G4Curve::GetPEnd() const
71{
72 return pEnd;
73}
74
75inline
76void G4Curve::SetStart(const G4Point3D& pt)
77{
78 start= pt;
79 pStart= GetPPoint(pt);
80}
81
82inline
83void G4Curve::SetStart(G4double p)
84{
85 pStart= p;
86 start= GetPoint(p);
87}
88
89inline
90void G4Curve::SetEnd(const G4Point3D& pt)
91{
92 end= pt;
93 pEnd= GetPPoint(pt);
94}
95
96inline
97void G4Curve::SetEnd(G4double p)
98{
99 pEnd= p;
100 end= GetPoint(p);
101}
102
103inline
104void G4Curve::SetBoundsRest()
105{
106 pRange= pEnd-pStart;
107 G4double pMax= GetPMax();
108 if (pMax>0)
109 {
110 // Find the range in the first determination
111 pRange-= (std::ceil(pRange/pMax)-1)*pMax;
112 }
113
114 bounded= true;
115 InitBounded();
116}
117
118inline
119void G4Curve::SetBounds(G4double p1, G4double p2)
120{
121 SetStart(p1);
122 SetEnd(p2);
123 SetBoundsRest();
124}
125
126inline
127void G4Curve::SetBounds(G4double p1, const G4Point3D& p2)
128{
129 SetStart(p1);
130 SetEnd(p2);
131 SetBoundsRest();
132}
133
134inline
135void G4Curve::SetBounds(const G4Point3D& p1, G4double p2)
136{
137 SetStart(p1);
138 SetEnd(p2);
139 SetBoundsRest();
140}
141
142inline
143void G4Curve::SetBounds(const G4Point3D& p1, const G4Point3D& p2)
144{
145 SetStart(p1);
146 SetEnd(p2);
147 SetBoundsRest();
148}
149
150inline
151G4bool G4Curve::IsPOn(G4double param) const
152{
153 G4double diff= param-pStart;
154 G4double pMax= GetPMax();
155
156 if (pMax>0)
157 diff-= std::floor(diff/pMax)*pMax;
158
159 return diff<=pRange;
160}
161
162inline
163G4bool G4Curve::IsBounded() const
164{
165 return bounded;
166}
167
168inline
169void G4Curve::SetSameSense(G4int sameSense0)
170{
171 sameSense= sameSense0;
172}
173
174inline
175G4int G4Curve::GetSameSense() const
176{
177 return sameSense;
178}
Note: See TracBrowser for help on using the repository browser.