BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
IShape.h
Go to the documentation of this file.
1 // ************************************************************************** //
2 //
3 // BornAgain: simulate and fit scattering at grazing incidence
4 //
5 //! @file Sample/Shapes/IShape.h
6 //! @brief Defines interface IShape.
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 #ifndef BORNAGAIN_CORE_SHAPES_ISHAPE_H
16 #define BORNAGAIN_CORE_SHAPES_ISHAPE_H
17 
18 #include "Base/Vector/Vectors3D.h"
19 #include <vector>
20 
21 //! Pure virtual base class for different shapes.
22 //!
23 //! In contrast to the form factors, these shapes only provide an intereface
24 //! for returning a set of vertices.
25 
26 //! @ingroup shapes_internal
27 
28 class IShape
29 {
30 public:
31  IShape() {}
32  virtual ~IShape() {}
33 
34  //! Retrieves a list of the vertices constituting this concrete shape
35  virtual std::vector<kvector_t> vertices() const;
36  static const size_t N_Circle;
37 
38 protected:
39  //! List of vertices initialized during construction
40  std::vector<kvector_t> m_vertices;
41 };
42 
43 //! Helper functions to construct lists of vertices
44 //!
45 //! Generate vertices of centered rectangle at height z
46 std::vector<kvector_t> RectangleVertices(double length, double width, double z);
47 
48 //! Generate vertices of centered ellipse with given semi-axes at height z
49 std::vector<kvector_t> EllipseVertices(double r_x, double r_y, double z);
50 
51 #endif // BORNAGAIN_CORE_SHAPES_ISHAPE_H
std::vector< kvector_t > RectangleVertices(double length, double width, double z)
Helper functions to construct lists of vertices.
Definition: IShape.cpp:28
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
Defines basic vectors in R^3 and C^3.
Pure virtual base class for different shapes.
Definition: IShape.h:29
std::vector< kvector_t > m_vertices
List of vertices initialized during construction.
Definition: IShape.h:40
virtual std::vector< kvector_t > vertices() const
Retrieves a list of the vertices constituting this concrete shape.
Definition: IShape.cpp:23
IShape()
Definition: IShape.h:31
static const size_t N_Circle
Definition: IShape.h:36
virtual ~IShape()
Definition: IShape.h:32