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