#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 |
( |
| ) |
|
|
virtual |
◆ AddVertexInOrder()
void G4ClippablePolygon::AddVertexInOrder |
( |
const G4ThreeVector |
vertex | ) |
|
|
virtual |
◆ BehindOf()
Definition at line 270 of file G4ClippablePolygon.cc.
272{
273
274
275
276 std::size_t noLeft =
vertices.size();
277 if (noLeft==0) return false;
278
279 if (other.
Empty())
return true;
280
281
282
283
285 const G4double maxOther = maxPointOther->operator()(axis);
286
287
288
289
292
293
294
295
297
299
300
301
302
303
304
305
306
309
310 if (std::fabs(normalOther(axis)) > std::fabs(
normal(axis)))
311 {
314
317 }
318 else
319 {
322
325 }
326 return answer;
327}
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 66 of file G4ClippablePolygon.cc.
67{
69 {
73 }
74
76}
virtual void ClipAlongOneAxis(const G4VoxelLimits &voxelLimit, const EAxis axis)
◆ ClipAlongOneAxis()
void G4ClippablePolygon::ClipAlongOneAxis |
( |
const G4VoxelLimits & |
voxelLimit, |
|
|
const EAxis |
axis |
|
) |
| |
|
virtual |
Definition at line 372 of file G4ClippablePolygon.cc.
374{
376
378
379
380
381
382
386
387
388
389
390
391 if (tempPolygon.size() == 0)
392 {
394 return;
395 }
396
397
398
399
400
404
405
406
407
409}
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 416 of file G4ClippablePolygon.cc.
419{
420 std::size_t noVertices = pPolygon.size();
422
423 outputPolygon.clear();
424
425 for (std::size_t i=0; i<noVertices; ++i)
426 {
427 vStart=pPolygon[i];
428 if (i==noVertices-1)
429 {
430 vEnd=pPolygon[0];
431 }
432 else
433 {
434 vEnd=pPolygon[i+1];
435 }
436
437 if (pVoxelLimit.
Inside(vStart))
438 {
439 if (pVoxelLimit.
Inside(vEnd))
440 {
441
442
443 outputPolygon.push_back(vEnd);
444 }
445 else
446 {
447
448
450 outputPolygon.push_back(vEnd);
451 }
452 }
453 else
454 {
455 if (pVoxelLimit.
Inside(vEnd))
456 {
457
458
460 outputPolygon.push_back(vStart);
461 outputPolygon.push_back(vEnd);
462 }
463 else
464 {
465 }
466 }
467 }
468}
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 97 of file G4ClippablePolygon.cc.
100{
101
102
103
104 std::size_t noLeft =
vertices.size();
105
106
107
108
109 if (noLeft == 0) return false;
110
111
112
113
115
116
117
118
119 for( std::size_t i=1; i<noLeft; ++i )
120 {
122 if (component < min )
124 else if (component > max )
126 }
127
128 return true;
129}
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 166 of file G4ClippablePolygon.cc.
167{
168 std::size_t noLeft =
vertices.size();
169 if (noLeft==0)
170 {
173 }
174
177
178 for( std::size_t i=1; i<noLeft; ++i )
179 {
181 if (component > max)
182 {
185 }
186 }
187
188 return answer;
189}
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Referenced by BehindOf().
◆ GetMinPoint()
Definition at line 136 of file G4ClippablePolygon.cc.
137{
138 std::size_t noLeft =
vertices.size();
139 if (noLeft==0)
140 {
143 }
144
147
148 for( std::size_t i=1; i<noLeft; ++i )
149 {
151 if (component < min)
152 {
155 }
156 }
157
158 return answer;
159}
Referenced by InFrontOf().
◆ GetNormal()
◆ GetNumVertices()
std::size_t G4ClippablePolygon::GetNumVertices |
( |
| ) |
const |
|
inline |
◆ GetPlanerExtent()
Definition at line 333 of file G4ClippablePolygon.cc.
337{
338
339
340
341 std::size_t noLeft =
vertices.size();
342
343
344
345
346 if (noLeft == 0) return false;
347
348
349
350
352
353
354
355
356 for( std::size_t i=1; i<noLeft; ++i )
357 {
359 if (component < min )
361 else if (component > max )
363 }
364
365 return true;
366}
double dot(const Hep3Vector &) const
Referenced by BehindOf(), and InFrontOf().
◆ InFrontOf()
Definition at line 206 of file G4ClippablePolygon.cc.
208{
209
210
211
212 std::size_t noLeft =
vertices.size();
213 if (noLeft==0) return false;
214
215 if (other.
Empty())
return true;
216
217
218
219
221 const G4double minOther = minPointOther->operator()(axis);
222
223
224
225
228
229
230
231
233
235
236
237
238
239
240
241
242
245
246 if (std::fabs(normalOther(axis)) > std::fabs(
normal(axis)))
247 {
250
253 }
254 else
255 {
258
261 }
262 return answer;
263}
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: