Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-17 09:07:47

0001 //------------------------------- -*- C++ -*- -------------------------------//
0002 // Copyright Celeritas contributors: see top-level COPYRIGHT file for details
0003 // SPDX-License-Identifier: (Apache-2.0 OR MIT)
0004 //---------------------------------------------------------------------------//
0005 //! \file orange/detail/BIHUtils.hh
0006 //---------------------------------------------------------------------------//
0007 #pragma once
0008 
0009 #include <vector>
0010 
0011 #include "../BoundingBoxUtils.hh"
0012 #include "../OrangeTypes.hh"
0013 
0014 namespace celeritas
0015 {
0016 //---------------------------------------------------------------------------//
0017 /*!
0018  * Calculate bounding box enclosing bounding boxes for specified indices.
0019  */
0020 inline FastBBox calc_union(std::vector<FastBBox> const& bboxes,
0021                            std::vector<LocalVolumeId> const& indices)
0022 {
0023     FastBBox result;
0024     for (auto const& id : indices)
0025     {
0026         CELER_ASSERT(id < bboxes.size());
0027         result = calc_union(result, bboxes[id.unchecked_get()]);
0028     }
0029 
0030     return result;
0031 }
0032 //---------------------------------------------------------------------------//
0033 }  // namespace celeritas