forked from celeritas-project/celeritas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
VariantTransform.hh
41 lines (33 loc) · 1.55 KB
/
VariantTransform.hh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//----------------------------------*-C++-*----------------------------------//
// Copyright 2023-2024 UT-Battelle, LLC, and other Celeritas developers.
// See the top-level COPYRIGHT file for details.
// SPDX-License-Identifier: (Apache-2.0 OR MIT)
//---------------------------------------------------------------------------//
//! \file orange/transform/VariantTransform.hh
//---------------------------------------------------------------------------//
#pragma once
#include <variant>
#include "corecel/cont/VariantUtils.hh"
#include "NoTransformation.hh"
#include "SignedPermutation.hh"
#include "TransformTypeTraits.hh"
#include "Transformation.hh"
#include "Translation.hh"
namespace celeritas
{
template<class T>
class BoundingBox;
//---------------------------------------------------------------------------//
//! std::variant for all transforms.
using VariantTransform = EnumVariant<TransformType, TransformTypeTraits>;
//---------------------------------------------------------------------------//
// Apply the left "daughter-to-parent" transform to the right.
[[nodiscard]] VariantTransform
apply_transform(VariantTransform const& left, VariantTransform const& right);
//---------------------------------------------------------------------------//
// Dispatch "daughter-to-parent" transform to bounding box utilities
[[nodiscard]] BoundingBox<real_type>
apply_transform(VariantTransform const& transform,
BoundingBox<real_type> const& bbox);
//---------------------------------------------------------------------------//
} // namespace celeritas