#include <G4ClippablePolygon.hh>
Definition at line 55 of file G4ClippablePolygon.hh.
◆ G4ClippablePolygon()
G4ClippablePolygon::G4ClippablePolygon |
( |
| ) |
|
Definition at line 48 of file G4ClippablePolygon.cc.
50{
52}
G4double GetSurfaceTolerance() const
static G4GeometryTolerance * GetInstance()
◆ ~G4ClippablePolygon()
G4ClippablePolygon::~G4ClippablePolygon |
( |
| ) |
|
|
virtual |
◆ AddVertexInOrder()
◆ BehindOf()
Definition at line 296 of file G4ClippablePolygon.cc.
298{
299
300
301
303 if (noLeft==0) return false;
304
305 if (other.
Empty())
return true;
306
307
308
309
311 const G4double maxOther = maxPointOther->operator()(axis);
312
313
314
315
317 const G4double max = maxPoint->operator()(axis);
318
319
320
321
323
325
326
327
328
329
330
331
332
335
336 if (std::fabs(normalOther(axis)) > std::fabs(
normal(axis)))
337 {
340
343 }
344 else
345 {
348
351 }
352 return answer;
353}
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
Referenced by G4SolidExtentList::AddSurface().
◆ ClearAllVertices()
void G4ClippablePolygon::ClearAllVertices |
( |
| ) |
|
|
virtual |
◆ Clip()
Definition at line 84 of file G4ClippablePolygon.cc.
85{
90 }
91
93}
virtual void ClipAlongOneAxis(const G4VoxelLimits &voxelLimit, const EAxis axis)
◆ ClipAlongOneAxis()
Definition at line 401 of file G4ClippablePolygon.cc.
403{
405
407
408
409
410
411
415
416
417
418
419
420 if (tempPolygon.size() == 0)
421 {
423 return;
424 }
425
426
427
428
429
433
434
435
436
438}
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 445 of file G4ClippablePolygon.cc.
448{
450 G4int noVertices=pPolygon.size();
452
453 outputPolygon.clear();
454
455 for (i=0;i<noVertices;i++)
456 {
457 vStart=pPolygon[i];
458 if (i==noVertices-1)
459 {
460 vEnd=pPolygon[0];
461 }
462 else
463 {
464 vEnd=pPolygon[i+1];
465 }
466
467 if (pVoxelLimit.
Inside(vStart))
468 {
469 if (pVoxelLimit.
Inside(vEnd))
470 {
471
472
473 outputPolygon.push_back(vEnd);
474 }
475 else
476 {
477
478
480 outputPolygon.push_back(vEnd);
481 }
482 }
483 else
484 {
485 if (pVoxelLimit.
Inside(vEnd))
486 {
487
488
490 outputPolygon.push_back(vStart);
491 outputPolygon.push_back(vEnd);
492 }
493 else
494 {
495 }
496 }
497 }
498}
G4bool ClipToLimits(G4ThreeVector &pStart, G4ThreeVector &pEnd) const
G4bool Inside(const G4ThreeVector &pVec) const
Referenced by ClipAlongOneAxis().
◆ Empty()
G4bool G4ClippablePolygon::Empty |
( |
| ) |
const |
|
inline |
◆ GetExtent()
◆ GetMaxPoint()
Definition at line 190 of file G4ClippablePolygon.cc.
191{
193 if (noLeft==0)
196
198 G4double max = answer->operator()(axis);
199
201 for( i=1; i<noLeft; i++ )
202 {
204 if (component > max)
205 {
207 max = component;
208 }
209 }
210
211 return answer;
212}
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Referenced by BehindOf().
◆ GetMinPoint()
Definition at line 159 of file G4ClippablePolygon.cc.
160{
162 if (noLeft==0)
165
167 G4double min = answer->operator()(axis);
168
170 for( i=1; i<noLeft; i++ )
171 {
173 if (component < min)
174 {
176 min = component;
177 }
178 }
179
180 return answer;
181}
Referenced by InFrontOf().
◆ GetNormal()
◆ GetNumVertices()
G4int G4ClippablePolygon::GetNumVertices |
( |
| ) |
const |
|
inline |
◆ GetPlanerExtent()
Definition at line 361 of file G4ClippablePolygon.cc.
365{
366
367
368
370
371
372
373
374 if (noLeft == 0) return false;
375
376
377
378
379 min = max = planeNormal.
dot(
vertices[0]-pointOnPlane);
380
381
382
383
385 for( i=1; i<noLeft; i++ )
386 {
388 if (component < min )
389 min = component;
390 else if (component > max )
391 max = component;
392 }
393
394 return true;
395}
double dot(const Hep3Vector &) const
Referenced by BehindOf(), and InFrontOf().
◆ InFrontOf()
Definition at line 231 of file G4ClippablePolygon.cc.
233{
234
235
236
238 if (noLeft==0) return false;
239
240 if (other.
Empty())
return true;
241
242
243
244
246 const G4double minOther = minPointOther->operator()(axis);
247
248
249
250
252 const G4double min = minPoint->operator()(axis);
253
254
255
256
258
260
261
262
263
264
265
266
267
270
271 if (std::fabs(normalOther(axis)) > std::fabs(
normal(axis)))
272 {
275
278 }
279 else
280 {
283
286 }
287 return answer;
288}
virtual const G4ThreeVector * GetMinPoint(const EAxis axis) const
Referenced by G4SolidExtentList::AddSurface().
◆ PartialClip()
◆ SetNormal()
◆ kCarTolerance
G4double G4ClippablePolygon::kCarTolerance |
|
protected |
◆ normal
◆ vertices
G4ThreeVectorList G4ClippablePolygon::vertices |
|
protected |
Definition at line 121 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: