#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 266 of file G4ClippablePolygon.cc.
268{
269
270
271
273 if (noLeft==0) return false;
274
275 if (other.
Empty())
return true;
276
277
278
279
281 const G4double maxOther = maxPointOther->operator()(axis);
282
283
284
285
288
289
290
291
293
295
296
297
298
299
300
301
302
305
306 if (std::fabs(normalOther(axis)) > std::fabs(
normal(axis)))
307 {
310
313 }
314 else
315 {
318
321 }
322 return answer;
323}
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 368 of file G4ClippablePolygon.cc.
370{
372
374
375
376
377
378
382
383
384
385
386
387 if (tempPolygon.size() == 0)
388 {
390 return;
391 }
392
393
394
395
396
400
401
402
403
405}
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 412 of file G4ClippablePolygon.cc.
415{
416 G4int noVertices = pPolygon.size();
418
419 outputPolygon.clear();
420
421 for (
G4int i=0; i<noVertices; ++i)
422 {
423 vStart=pPolygon[i];
424 if (i==noVertices-1)
425 {
426 vEnd=pPolygon[0];
427 }
428 else
429 {
430 vEnd=pPolygon[i+1];
431 }
432
433 if (pVoxelLimit.
Inside(vStart))
434 {
435 if (pVoxelLimit.
Inside(vEnd))
436 {
437
438
439 outputPolygon.push_back(vEnd);
440 }
441 else
442 {
443
444
446 outputPolygon.push_back(vEnd);
447 }
448 }
449 else
450 {
451 if (pVoxelLimit.
Inside(vEnd))
452 {
453
454
456 outputPolygon.push_back(vStart);
457 outputPolygon.push_back(vEnd);
458 }
459 else
460 {
461 }
462 }
463 }
464}
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 164 of file G4ClippablePolygon.cc.
165{
167 if (noLeft==0)
170
173
174 for(
G4int i=1; i<noLeft; ++i )
175 {
177 if (component > max)
178 {
181 }
182 }
183
184 return answer;
185}
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{
139 if (noLeft==0)
142
145
146 for(
G4int i=1; i<noLeft; ++i )
147 {
149 if (component < min)
150 {
153 }
154 }
155
156 return answer;
157}
Referenced by InFrontOf().
◆ GetNormal()
◆ GetNumVertices()
G4int G4ClippablePolygon::GetNumVertices |
( |
| ) |
const |
|
inline |
◆ GetPlanerExtent()
Definition at line 329 of file G4ClippablePolygon.cc.
333{
334
335
336
338
339
340
341
342 if (noLeft == 0) return false;
343
344
345
346
348
349
350
351
352 for(
G4int i=1; i<noLeft; ++i )
353 {
355 if (component < min )
357 else if (component > max )
359 }
360
361 return true;
362}
double dot(const Hep3Vector &) const
Referenced by BehindOf(), and InFrontOf().
◆ InFrontOf()
Definition at line 202 of file G4ClippablePolygon.cc.
204{
205
206
207
209 if (noLeft==0) return false;
210
211 if (other.
Empty())
return true;
212
213
214
215
217 const G4double minOther = minPointOther->operator()(axis);
218
219
220
221
224
225
226
227
229
231
232
233
234
235
236
237
238
241
242 if (std::fabs(normalOther(axis)) > std::fabs(
normal(axis)))
243 {
246
249 }
250 else
251 {
254
257 }
258 return answer;
259}
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: