RayZaler 0.1
The free opto-mechanical simulation framework
FlatMirror.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 _FLAT_MIRROR_H
20#define _FLAT_MIRROR_H
21
22#include <OpticalElement.h>
23#include <MediumBoundaries/FlatMirror.h>
24#include <GLHelpers.h>
25
26namespace RZ {
27 class TranslatedFrame;
28 class RotatedFrame;
29
30 class FlatMirror : public OpticalElement {
31 GLCappedCylinder m_cylinder;
32 FlatMirrorBoundary *m_boundary;
33 TranslatedFrame *m_reflectiveSurfaceFrame = nullptr;
34 RotatedFrame *m_flipFrame = nullptr;
35 TranslatedFrame *m_baseFrame = nullptr;
36 bool m_vertexRelative = false;
37 Real m_thickness = 1e-2;
38 Real m_radius = 1e-2;
39 Real m_width = 2e-2;
40 Real m_height = 2e-2;
41 Real m_a = 1;
42 Real m_b = 1;
43
44 // Calculated members
45 Real m_ecc = 0;
46
47 void recalcModel();
48
49 protected:
50 virtual bool propertyChanged(std::string const &, PropertyValue const &) override;
51
52 public:
55 std::string const &,
57 Element *parent = nullptr);
58
59 virtual ~FlatMirror() override;
60
61 virtual void nativeMaterialOpenGL(std::string const &) override;
62 virtual void renderOpenGL() override;
63 };
64
65 RZ_DECLARE_OPTICAL_ELEMENT(FlatMirror);
66}
67
68#endif // _FLAT_MIRROR_H
Definition: Element.h:393
Definition: Element.h:173
Definition: FlatMirror.h:27
Definition: FlatMirror.h:30
Definition: GLHelpers.h:180
Definition: OpticalElement.h:87
Definition: Element.h:58
Definition: ReferenceFrame.h:59
Definition: RotatedFrame.h:25
Definition: TranslatedFrame.h:25