MCPcopy Create free account
hub / github.com/Kitware/VTK / Intersects

Method Intersects

Common/DataModel/vtkBoundingBox.cxx:248–277  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

246
247//------------------------------------------------------------------------------
248int vtkBoundingBox::Intersects(const vtkBoundingBox& bbox) const
249{
250 // if either box is not valid they don't intersect
251 if (!(this->IsValid() && bbox.IsValid()))
252 {
253 return 0;
254 }
255 int i;
256 for (i = 0; i < 3; i++)
257 {
258 if ((bbox.MinPnt[i] >= this->MinPnt[i]) && (bbox.MinPnt[i] <= this->MaxPnt[i]))
259 {
260 continue;
261 }
262 if ((this->MinPnt[i] >= bbox.MinPnt[i]) && (this->MinPnt[i] <= bbox.MaxPnt[i]))
263 {
264 continue;
265 }
266 if ((bbox.MaxPnt[i] >= this->MinPnt[i]) && (bbox.MaxPnt[i] <= this->MaxPnt[i]))
267 {
268 continue;
269 }
270 if ((this->MaxPnt[i] >= bbox.MinPnt[i]) && (this->MaxPnt[i] <= bbox.MaxPnt[i]))
271 {
272 continue;
273 }
274 return 0;
275 }
276 return 1;
277}
278
279//------------------------------------------------------------------------------
280int vtkBoundingBox::Contains(const vtkBoundingBox& bbox) const

Callers 4

ContainsMethod · 0.95
IntersectWithCellMethod · 0.45
FindCellsWithinBoundsMethod · 0.45
InitializeMethod · 0.45

Calls 2

IsValidMethod · 0.95
IsValidMethod · 0.45

Tested by

no test coverage detected