BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
RippleCosine Class Reference
Inheritance diagram for RippleCosine:
[legend]
Collaboration diagram for RippleCosine:
[legend]

Public Member Functions

 RippleCosine (double length, double width, double height)
 
 ~RippleCosine ()
 
virtual std::vector< kvector_tvertices () const
 Retrieves a list of the vertices constituting this concrete shape. More...
 

Static Public Attributes

static const size_t N_Circle = 24
 

Protected Attributes

std::vector< kvector_tm_vertices
 List of vertices initialized during construction. More...
 

Detailed Description

Definition at line 25 of file RippleCosine.h.

Constructor & Destructor Documentation

◆ RippleCosine()

RippleCosine::RippleCosine ( double  length,
double  width,
double  height 
)

Definition at line 19 of file RippleCosine.cpp.

20 {
21  size_t n_y = IShape3D::N_Circle + 1;
22  double y_step = width / (IShape3D::N_Circle);
23  m_vertices.resize(2 * n_y);
24  for (size_t i = 0; i < n_y; ++i) {
25  double y = i * y_step - width / 2.0;
26  double z = height * (1.0 + std::cos(2.0 * M_PI * y / width)) / 2.0;
27  m_vertices[i] = kvector_t(length / 2.0, y, z);
28  m_vertices[n_y + i] = kvector_t(-length / 2.0, y, z);
29  }
30 }
#define M_PI
Definition: Constants.h:44
BasicVector3D< double > kvector_t
Definition: Vectors3D.h:21
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

References M_PI, IShape3D::m_vertices, and IShape3D::N_Circle.

◆ ~RippleCosine()

RippleCosine::~RippleCosine ( )
default

Member Function Documentation

◆ vertices()

std::vector< kvector_t > IShape3D::vertices ( ) const
virtualinherited

Retrieves a list of the vertices constituting this concrete shape.

Definition at line 23 of file IShape3D.cpp.

24 {
25  return m_vertices;
26 }

References IShape3D::m_vertices.

Member Data Documentation

◆ m_vertices

std::vector<kvector_t> IShape3D::m_vertices
protectedinherited

List of vertices initialized during construction.

Definition at line 44 of file IShape3D.h.

Referenced by Box::Box(), DoubleEllipse::DoubleEllipse(), RippleCosine(), RippleSawtooth::RippleSawtooth(), TruncatedEllipsoid::TruncatedEllipsoid(), and IShape3D::vertices().

◆ N_Circle

const size_t IShape3D::N_Circle = 24
staticinherited

The documentation for this class was generated from the following files: