BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
Box.cpp
Go to the documentation of this file.
1 // ************************************************************************** //
2 //
3 // BornAgain: simulate and fit scattering at grazing incidence
4 //
5 //! @file Sample/Shapes/Box.cpp
6 //! @brief Implements class Box.
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 
15 #include "Sample/Shapes/Box.h"
16 
17 #include <algorithm>
18 
19 Box::Box(double length, double width, double height)
20 {
21  m_vertices.resize(8);
22  auto bottom_face = RectangleVertices(length, width, 0.0);
23  auto top_face = RectangleVertices(length, width, height);
24  std::move(bottom_face.begin(), bottom_face.end(), m_vertices.begin());
25  std::move(top_face.begin(), top_face.end(), m_vertices.begin() + 4);
26 }
27 
28 Box::~Box() = default;
Defines class Box.
std::vector< kvector_t > RectangleVertices(double length, double width, double z)
Helper functions to construct lists of vertices.
Definition: IShape.cpp:28
~Box()
Box(double length, double width, double height)
Definition: Box.cpp:19
std::vector< kvector_t > m_vertices
List of vertices initialized during construction.
Definition: IShape.h:40