#include <G4ClippablePolygon.hh>
Definition at line 47 of file G4ClippablePolygon.hh.
◆ G4ClippablePolygon()
G4ClippablePolygon::G4ClippablePolygon |
( |
| ) |
|
Definition at line 38 of file G4ClippablePolygon.cc.
40{
42}
G4double GetSurfaceTolerance() const
static G4GeometryTolerance * GetInstance()
◆ ~G4ClippablePolygon()
G4ClippablePolygon::~G4ClippablePolygon |
( |
| ) |
|
|
virtualdefault |
◆ AddVertexInOrder()
void G4ClippablePolygon::AddVertexInOrder |
( |
const G4ThreeVector | vertex | ) |
|
|
virtual |
◆ BehindOf()
Definition at line 268 of file G4ClippablePolygon.cc.
270{
271
272
273
274 std::size_t noLeft =
vertices.size();
275 if (noLeft==0) return false;
276
277 if (other.
Empty())
return true;
278
279
280
281
283 const G4double maxOther = maxPointOther->operator()(axis);
284
285
286
287
290
291
292
293
295
297
298
299
300
301
302
303
304
307
308 if (std::fabs(normalOther(axis)) > std::fabs(
normal(axis)))
309 {
312
315 }
316 else
317 {
320
323 }
324 return answer;
325}
virtual G4bool GetPlanerExtent(const G4ThreeVector &pointOnPlane, const G4ThreeVector &planeNormal, G4double &min, G4double &max) const
const G4ThreeVector GetNormal() const
virtual const G4ThreeVector * GetMaxPoint(const EAxis axis) const
T max(const T t1, const T t2)
brief Return the largest of the two arguments
Referenced by G4SolidExtentList::AddSurface().
◆ ClearAllVertices()
void G4ClippablePolygon::ClearAllVertices |
( |
| ) |
|
|
virtual |
◆ Clip()
Definition at line 64 of file G4ClippablePolygon.cc.
65{
67 {
71 }
72
74}
virtual void ClipAlongOneAxis(const G4VoxelLimits &voxelLimit, const EAxis axis)
◆ ClipAlongOneAxis()
void G4ClippablePolygon::ClipAlongOneAxis |
( |
const G4VoxelLimits & | voxelLimit, |
|
|
const EAxis | axis ) |
|
virtual |
Definition at line 370 of file G4ClippablePolygon.cc.
372{
374
376
377
378
379
380
384
385
386
387
388
389 if (tempPolygon.empty())
390 {
392 return;
393 }
394
395
396
397
398
402
403
404
405
407}
std::vector< G4ThreeVector > G4ThreeVectorList
void ClipToSimpleLimits(G4ThreeVectorList &pPolygon, G4ThreeVectorList &outputPolygon, const G4VoxelLimits &pVoxelLimit)
G4double GetMinExtent(const EAxis pAxis) const
void AddLimit(const EAxis pAxis, const G4double pMin, const G4double pMax)
G4double GetMaxExtent(const EAxis pAxis) const
Referenced by Clip(), and PartialClip().
◆ ClipToSimpleLimits()
void G4ClippablePolygon::ClipToSimpleLimits |
( |
G4ThreeVectorList & | pPolygon, |
|
|
G4ThreeVectorList & | outputPolygon, |
|
|
const G4VoxelLimits & | pVoxelLimit ) |
|
protected |
Definition at line 414 of file G4ClippablePolygon.cc.
417{
418 std::size_t noVertices = pPolygon.size();
420
421 outputPolygon.clear();
422
423 for (std::size_t i=0; i<noVertices; ++i)
424 {
425 vStart=pPolygon[i];
426 if (i==noVertices-1)
427 {
428 vEnd=pPolygon[0];
429 }
430 else
431 {
432 vEnd=pPolygon[i+1];
433 }
434
435 if (pVoxelLimit.
Inside(vStart))
436 {
437 if (pVoxelLimit.
Inside(vEnd))
438 {
439
440
441 outputPolygon.push_back(vEnd);
442 }
443 else
444 {
445
446
448 outputPolygon.push_back(vEnd);
449 }
450 }
451 else
452 {
453 if (pVoxelLimit.
Inside(vEnd))
454 {
455
456
458 outputPolygon.push_back(vStart);
459 outputPolygon.push_back(vEnd);
460 }
461 else
462 {
463 }
464 }
465 }
466}
G4bool ClipToLimits(G4ThreeVector &pStart, G4ThreeVector &pEnd) const
G4bool Inside(const G4ThreeVector &pVec) const
Referenced by ClipAlongOneAxis().
◆ Empty()
G4bool G4ClippablePolygon::Empty |
( |
| ) |
const |
|
inline |
◆ GetExtent()
Definition at line 95 of file G4ClippablePolygon.cc.
98{
99
100
101
102 std::size_t noLeft =
vertices.size();
103
104
105
106
107 if (noLeft == 0) return false;
108
109
110
111
113
114
115
116
117 for( std::size_t i=1; i<noLeft; ++i )
118 {
120 if (component < min )
122 else if (component > max )
124 }
125
126 return true;
127}
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
Referenced by G4SolidExtentList::AddSurface(), and G4SolidExtentList::GetExtent().
◆ GetMaxPoint()
Definition at line 164 of file G4ClippablePolygon.cc.
165{
166 std::size_t noLeft =
vertices.size();
167 if (noLeft==0)
168 {
171 }
172
175
176 for( std::size_t i=1; i<noLeft; ++i )
177 {
179 if (component > max)
180 {
183 }
184 }
185
186 return answer;
187}
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Referenced by BehindOf().
◆ GetMinPoint()
Definition at line 134 of file G4ClippablePolygon.cc.
135{
136 std::size_t noLeft =
vertices.size();
137 if (noLeft==0)
138 {
141 }
142
145
146 for( std::size_t i=1; i<noLeft; ++i )
147 {
149 if (component < min)
150 {
153 }
154 }
155
156 return answer;
157}
Referenced by InFrontOf().
◆ GetNormal()
◆ GetNumVertices()
std::size_t G4ClippablePolygon::GetNumVertices |
( |
| ) |
const |
|
inline |
◆ GetPlanerExtent()
Definition at line 331 of file G4ClippablePolygon.cc.
335{
336
337
338
339 std::size_t noLeft =
vertices.size();
340
341
342
343
344 if (noLeft == 0) return false;
345
346
347
348
350
351
352
353
354 for( std::size_t i=1; i<noLeft; ++i )
355 {
357 if (component < min )
359 else if (component > max )
361 }
362
363 return true;
364}
double dot(const Hep3Vector &) const
Referenced by BehindOf(), and InFrontOf().
◆ InFrontOf()
Definition at line 204 of file G4ClippablePolygon.cc.
206{
207
208
209
210 std::size_t noLeft =
vertices.size();
211 if (noLeft==0) return false;
212
213 if (other.
Empty())
return true;
214
215
216
217
219 const G4double minOther = minPointOther->operator()(axis);
220
221
222
223
226
227
228
229
231
233
234
235
236
237
238
239
240
243
244 if (std::fabs(normalOther(axis)) > std::fabs(
normal(axis)))
245 {
248
251 }
252 else
253 {
256
259 }
260 return answer;
261}
virtual const G4ThreeVector * GetMinPoint(const EAxis axis) const
Referenced by G4SolidExtentList::AddSurface().
◆ PartialClip()
◆ SetNormal()
void G4ClippablePolygon::SetNormal |
( |
const G4ThreeVector & | newNormal | ) |
|
|
inline |
◆ kCarTolerance
G4double G4ClippablePolygon::kCarTolerance |
|
protected |
◆ normal
◆ vertices
G4ThreeVectorList G4ClippablePolygon::vertices |
|
protected |
Definition at line 113 of file G4ClippablePolygon.hh.
Referenced by AddVertexInOrder(), BehindOf(), ClearAllVertices(), Clip(), ClipAlongOneAxis(), GetExtent(), GetMaxPoint(), GetMinPoint(), GetPlanerExtent(), InFrontOf(), and PartialClip().
The documentation for this class was generated from the following files: