• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

openmc-dev / openmc / 13546000884

26 Feb 2025 02:19PM UTC coverage: 85.015% (-0.2%) from 85.186%
13546000884

Pull #3328

github

web-flow
Merge 67a173195 into e060534ff
Pull Request #3328: NCrystal becomes runtime rather than buildtime dependency

81 of 108 new or added lines in 6 files covered. (75.0%)

467 existing lines in 21 files now uncovered.

51062 of 60062 relevant lines covered (85.02%)

32488887.43 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/include/openmc/bounding_box.h
1
#ifndef OPENMC_BOUNDING_BOX_H
2
#define OPENMC_BOUNDING_BOX_H
3

4
#include <algorithm> // for min, max
5

6
#include "openmc/constants.h"
7
#include "openmc/position.h"
8

9
namespace openmc {
10

11
//==============================================================================
12
//! Coordinates for an axis-aligned cuboid that bounds a geometric object.
13
//==============================================================================
14

15
struct BoundingBox {
16
  double xmin = -INFTY;
17
  double xmax = INFTY;
18
  double ymin = -INFTY;
19
  double ymax = INFTY;
20
  double zmin = -INFTY;
21
  double zmax = INFTY;
22

23
  inline BoundingBox operator&(const BoundingBox& other)
24
  {
25
    BoundingBox result = *this;
26
    return result &= other;
27
  }
28

29
  inline BoundingBox operator|(const BoundingBox& other)
30
  {
31
    BoundingBox result = *this;
32
    return result |= other;
33
  }
34

35
  // intersect operator
36
  inline BoundingBox& operator&=(const BoundingBox& other)
37
  {
38
    xmin = std::max(xmin, other.xmin);
39
    xmax = std::min(xmax, other.xmax);
40
    ymin = std::max(ymin, other.ymin);
41
    ymax = std::min(ymax, other.ymax);
42
    zmin = std::max(zmin, other.zmin);
43
    zmax = std::min(zmax, other.zmax);
44
    return *this;
45
  }
46

47
  // union operator
48
  inline BoundingBox& operator|=(const BoundingBox& other)
49
  {
50
    xmin = std::min(xmin, other.xmin);
×
51
    xmax = std::max(xmax, other.xmax);
×
52
    ymin = std::min(ymin, other.ymin);
×
53
    ymax = std::max(ymax, other.ymax);
×
54
    zmin = std::min(zmin, other.zmin);
×
55
    zmax = std::max(zmax, other.zmax);
×
UNCOV
56
    return *this;
×
57
  }
58

59
  inline Position min() const { return {xmin, ymin, zmin}; }
60
  inline Position max() const { return {xmax, ymax, zmax}; }
61
};
62

63
} // namespace openmc
64

65
#endif
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc