RayZaler 0.1
The free opto-mechanical simulation framework
ConicMirror.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_MIRROR_H
20#define _CONIC_MIRROR_H
21
22#include <OpticalElement.h>
23#include <MediumBoundaries/ConicMirror.h>
24#include <GLHelpers.h>
25
26namespace RZ {
27 class TranslatedFrame;
28
29 class ConicMirror : public OpticalElement {
30 ConicMirrorBoundary *m_boundary = nullptr;
31 GLCappedCylinder m_cylinder;
32 GLCappedCylinder m_hole;
33 GLConicCap m_cap, m_rearCap;
34 TranslatedFrame *m_reflectiveSurfaceFrame = nullptr;
35 TranslatedFrame *m_aperturePort = nullptr;
36 TranslatedFrame *m_vertexPort = nullptr;
37
38 Real m_thickness = 1e-2;
39 Real m_radius = 1e-1;
40 Real m_K = 0;
41 Real m_rCurv = .5;
42 bool m_convex = false;
43 Real m_x0 = 0;
44 Real m_y0 = 0;
45 Real m_rHole = 0;
46
47 Real m_displacement = 0;
48
49 Real m_rHoleHeight = 0;
50 bool m_vertexRelative = false;
51
52 void recalcModel();
53
54 protected:
55 virtual bool propertyChanged(std::string const &, PropertyValue const &) override;
56
57 public:
60 std::string const &,
62 Element *parent = nullptr);
63
64 virtual ~ConicMirror() override;
65
66 virtual void nativeMaterialOpenGL(std::string const &) override;
67 virtual void renderOpenGL() override;
68 };
69
70 RZ_DECLARE_OPTICAL_ELEMENT(ConicMirror);
71}
72
73#endif // _CONIC_MIRROR_H
Definition: ConicMirror.h:27
Definition: ConicMirror.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