MCPcopy Create free account
hub / github.com/computationalpathologygroup/ASAP / intersects

Method intersects

core/Box.cpp:55–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53}
54
55bool Box::intersects(const Box &b) const {
56 if (b.getSize().size() != _size.size() || b.getStart().size() != _start.size()) {
57 return false;
58 }
59 for (std::vector<unsigned long long>::const_iterator it = _size.begin(), itb = b.getSize().begin(); it != _size.end(); ++it, ++itb) {
60 if ((*it) <= 0 || (*itb) <= 0) {
61 return false;
62 }
63 }
64
65 for (int i = 0; i < _start.size(); ++i) {
66 if (_start[i] + _size[i] <= b.getStart()[i] || _start[i] >= b.getStart()[i] + b.getSize()[i]) {
67 return false;
68 }
69 }
70 return true;
71 }
72
73Box Box::intersection(const Box& b) const {
74 if (!intersects(b)) {

Callers 3

readDataFromImageMethod · 0.80
containsMethod · 0.80
containsMethod · 0.80

Calls 2

sizeMethod · 0.80
getSizeMethod · 0.80

Tested by

no test coverage detected