RayZaler 0.1
The free opto-mechanical simulation framework
ConicLens.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 _CONIC_LENS_H
20#define _CONIC_LENS_H
21
22#include <OpticalElement.h>
23#include <MediumBoundaries/ConicLens.h>
24#include <GLHelpers.h>
25
26namespace RZ {
27 class TranslatedFrame;
28
29 class ConicLens : public OpticalElement {
30 GLCappedCylinder m_cylinder;
31 GLConicCap m_frontCap, m_backCap;
32 ConicLensBoundary *m_inputBoundary = nullptr;
33 ConicLensBoundary *m_outputBoundary = nullptr;
34 TranslatedFrame *m_inputFrame = nullptr;
35 TranslatedFrame *m_outputFrame = nullptr;
36
37 TranslatedFrame *m_frontFocalPlane = nullptr;
38 TranslatedFrame *m_backFocalPlane = nullptr;
39
40 TranslatedFrame *m_objectPlane = nullptr;
41 TranslatedFrame *m_imagePlane = nullptr;
42
43 // Per-surface properties
44 Real m_K[2] = {0, 0};
45 Real m_focalLength[2] = {5e-2, 5e-2};
46 Real m_rCurv[2] = {1e-1, 1e-1};
47 bool m_fromFlen[2] = {false, false};
48
49 // Common properties
50 Real m_radius = 2.5e-2;
51 Real m_x0 = 0;
52 Real m_y0 = 0;
53 Real m_mu = 1.5;
54 Real m_thickness = 1e-2;
55
56 // Calculated properties
57 Real m_displacement[2];
58
59 void recalcModel();
60
61 protected:
62 virtual bool propertyChanged(std::string const &, PropertyValue const &) override;
63
64 public:
67 std::string const &,
69 Element *parent = nullptr);
70
71 virtual ~ConicLens() override;
72
73 virtual void nativeMaterialOpenGL(std::string const &) override;
74 virtual void renderOpenGL() override;
75 };
76
77 RZ_DECLARE_OPTICAL_ELEMENT(ConicLens);
78}
79
80#endif // _CONIC_LENS_H
Definition: ConicLens.h:27
Definition: ConicLens.h:29
Definition: Element.h:393
Definition: Element.h:173
Definition: GLHelpers.h:180
Definition: GLHelpers.h:366
Definition: OpticalElement.h:87
Definition: Element.h:58
Definition: ReferenceFrame.h:59
Definition: TranslatedFrame.h:25