RayZaler 0.1
The free opto-mechanical simulation framework
Rectangular.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 _SURFACES_RECTANGULAR_H
20#define _SURFACES_RECTANGULAR_H
21
22#include <SurfaceShape.h>
23
24namespace RZ {
26 Real m_width = 100e-3;
27 Real m_height = 100e-3;
28 void updateEdges();
29 std::vector<std::vector<Real>> m_edges;
30
31 public:
32 inline Real
33 width() const
34 {
35 return m_width;
36 }
37
38 inline Real
39 height() const
40 {
41 return m_height;
42 }
43
46
47 void setWidth(Real);
48 void setHeight(Real);
49 virtual std::vector<std::vector<Real>> const &edges() const override;
50
51 virtual bool intercept(
52 Vec3 &coord,
53 Vec3 &n,
54 Real &tIgnore,
55 Vec3 const &origin,
56 Vec3 const &direction) const override;
57
58 virtual Real area() const override;
59 virtual std::string name() const override;
60
61 virtual void generatePoints(
62 const ReferenceFrame *,
63 Real *pointArr,
64 Real *normals,
65 unsigned int N) override;
66
67 virtual void renderOpenGL() override;
68 };
69}
70
71#endif // _SURFACES_RECTANGULAR_H
Definition: Rectangular.h:25
Definition: ReferenceFrame.h:59
Definition: SurfaceShape.h:31
Definition: Vector.h:66