RayZaler 0.1
The free opto-mechanical simulation framework
ParaxialZernikeEMInterface.h
1//
2// Copyright (c) 2024 Gonzalo José Carracedo Carballal
3//
4// This program is free software: you can redistribute it and/or modify
5// it under the terms of the GNU Lesser General Public License as
6// published by the Free Software Foundation, either version 3 of the
7// License, or (at your option) any later version.
8//
9// This program is distributed in the hope that it will be useful, but
10// WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU Lesser General Public License for more details.
13//
14// You should have received a copy of the GNU Lesser General Public
15// License along with this program. If not, see
16// <http://www.gnu.org/licenses/>
17//
18
19#ifndef _EM_INTERFACES_PARAXIAL_ZERNIKE_H
20#define _EM_INTERFACES_PARAXIAL_ZERNIKE_H
21
22#include <EMInterface.h>
23#include <Zernike.h>
24
25namespace RZ {
27 Real m_radius = .5;
28 std::vector<Zernike> m_poly;
29 std::vector<Real> m_coef;
30 std::vector<bool> m_nonz;
31 int m_firstNz = -1;
32 int m_lastNz = -1;
33
34 Real m_muOut = 1.5;
35 Real m_muIn = 1;
36 Real m_IOratio = 1 / 1.5;
37
38 Real dZdx(Real x, Real y) const;
39 Real dZdy(Real x, Real y) const;
40
41 public:
42 inline Real
43 coef(unsigned int ansi) const
44 {
45 if (ansi >= m_coef.size())
46 return 0;
47
48 return m_coef[ansi];
49 }
50
51 Real Z(Real x, Real y) const;
52 void setRadius(Real);
53 void setCoef(unsigned int ansi, Real value);
54 void setRefractiveIndex(Real, Real);
55
56 virtual std::string name() const override;
57 virtual void transmit(RayBeamSlice const &beam) override;
58 virtual ~ParaxialZernikeEMInterface() override;
59 };
60}
61
62#endif // _EM_INTERFACES_PARAXIAL_ZERNIKE_H
63
Definition: EMInterface.h:34
Definition: ParaxialZernikeEMInterface.h:26
Definition: RayBeam.h:261