BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
DoubleEllipse.cpp
Go to the documentation of this file.
1 // ************************************************************************** //
2 //
3 // BornAgain: simulate and fit scattering at grazing incidence
4 //
5 //! @file Sample/Shapes/DoubleEllipse.cpp
6 //! @brief Implements class DoubleEllipse.
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2018
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************** //
14 
16 
17 #include <algorithm>
18 
19 DoubleEllipse::DoubleEllipse(double r0_x, double r0_y, double z, double rz_x, double rz_y)
20 {
21  auto bottom_face = EllipseVertices(r0_x, r0_y, 0.0);
22  size_t n_bottom = bottom_face.size();
23  auto top_face = EllipseVertices(rz_x, rz_y, z);
24  m_vertices.resize(n_bottom + top_face.size());
25  std::move(bottom_face.begin(), bottom_face.end(), m_vertices.begin());
26  std::move(top_face.begin(), top_face.end(), m_vertices.begin() + n_bottom);
27 }
28 
Defines class DoubleEllipse.
std::vector< kvector_t > EllipseVertices(double r_x, double r_y, double z)
Generate vertices of centered ellipse with given semi-axes at height z.
Definition: IShape.cpp:37
DoubleEllipse(double r0_x, double r0_y, double z, double rz_x, double rz_y)
std::vector< kvector_t > m_vertices
List of vertices initialized during construction.
Definition: IShape.h:40