File indexing completed on 2025-01-18 10:05:56
0001
0002
0003
0004
0005
0006
0007
0008 #pragma once
0009
0010 #include <cmath>
0011
0012 #include "orange/surf/VariantSurface.hh"
0013
0014 namespace celeritas
0015 {
0016 namespace orangeinp
0017 {
0018 namespace detail
0019 {
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031 struct SurfaceHashPoint
0032 {
0033 template<Axis T>
0034 real_type operator()(PlaneAligned<T> const& s) const
0035 {
0036 return s.position();
0037 }
0038
0039 template<Axis T>
0040 real_type operator()(CylCentered<T> const& s) const
0041 {
0042 return std::sqrt(s.radius_sq());
0043 }
0044
0045 real_type operator()(SphereCentered const& s) const
0046 {
0047 return std::sqrt(s.radius_sq());
0048 }
0049
0050 template<Axis T>
0051 real_type operator()(CylAligned<T> const& s) const
0052 {
0053 return std::sqrt(s.radius_sq());
0054 }
0055
0056 real_type operator()(Plane const& p) const { return p.displacement(); }
0057
0058 real_type operator()(Sphere const& s) const
0059 {
0060 return std::sqrt(s.radius_sq());
0061 }
0062
0063 template<Axis T>
0064 real_type operator()(ConeAligned<T> const& s) const
0065 {
0066 return norm(s.origin());
0067 }
0068
0069 real_type operator()(Involute const& s) const
0070 {
0071 return s.displacement_angle();
0072 }
0073
0074 real_type operator()(SimpleQuadric const& s) const
0075 {
0076 return std::sqrt(s.zeroth());
0077 }
0078
0079 real_type operator()(GeneralQuadric const& s) const
0080 {
0081 return std::sqrt(s.zeroth());
0082 }
0083 };
0084
0085
0086 }
0087 }
0088 }