Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-22 10:47:12

0001 //----------------------------------*-C++-*----------------------------------//
0002 // Copyright 2023-2024 UT-Battelle, LLC, and other Celeritas developers.
0003 // See the top-level COPYRIGHT file for details.
0004 // SPDX-License-Identifier: (Apache-2.0 OR MIT)
0005 //---------------------------------------------------------------------------//
0006 //! \file orange/surf/detail/SurfaceTransformer.hh
0007 //---------------------------------------------------------------------------//
0008 #pragma once
0009 
0010 #include "geocel/Types.hh"
0011 #include "orange/transform/Transformation.hh"
0012 
0013 #include "../SurfaceFwd.hh"
0014 
0015 namespace celeritas
0016 {
0017 namespace detail
0018 {
0019 //---------------------------------------------------------------------------//
0020 /*!
0021  * Apply a transformation to a surface to get another surface.
0022  *
0023  * The transform gives the new origin and rotation for the surface: rotation is
0024  * applied first, then translation.
0025  */
0026 class SurfaceTransformer
0027 {
0028   public:
0029     //! Construct with the transformation to apply
0030     explicit SurfaceTransformer(Transformation const& trans) : tr_{trans} {}
0031 
0032     //// SURFACE FUNCTIONS ////
0033 
0034     template<Axis T>
0035     Plane operator()(PlaneAligned<T> const&) const;
0036 
0037     template<Axis T>
0038     GeneralQuadric operator()(CylCentered<T> const&) const;
0039 
0040     Sphere operator()(SphereCentered const&) const;
0041 
0042     template<Axis T>
0043     GeneralQuadric operator()(CylAligned<T> const&) const;
0044 
0045     Plane operator()(Plane const&) const;
0046 
0047     Sphere operator()(Sphere const&) const;
0048 
0049     template<Axis T>
0050     GeneralQuadric operator()(ConeAligned<T> const&) const;
0051 
0052     GeneralQuadric operator()(SimpleQuadric const&) const;
0053 
0054     GeneralQuadric operator()(GeneralQuadric const&) const;
0055 
0056     Involute operator()(Involute const&) const;
0057 
0058   private:
0059     Transformation tr_;
0060 };
0061 
0062 //---------------------------------------------------------------------------//
0063 }  // namespace detail
0064 }  // namespace celeritas