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

Public Member Functions

 RippleCosine (double length, double width, double height)
 
 ~RippleCosine ()
 
virtual std::vector< kvector_tvertices () const
 

Static Public Attributes

static const size_t N_Circle = 24
 

Protected Attributes

std::vector< kvector_tm_vertices
 

Detailed Description

Definition at line 20 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 = IShape::N_Circle + 1;
22  double y_step = width / (IShape::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: MathConstants.h:39
BasicVector3D< double > kvector_t
Definition: Vectors3D.h:21
std::vector< kvector_t > m_vertices
List of vertices initialized during construction.
Definition: IShape.h:40
static const size_t N_Circle
Definition: IShape.h:36

References anonymous_namespace{BoxCompositionBuilder.cpp}::height, anonymous_namespace{BoxCompositionBuilder.cpp}::length, M_PI, IShape::m_vertices, IShape::N_Circle, and anonymous_namespace{BoxCompositionBuilder.cpp}::width.

◆ ~RippleCosine()

RippleCosine::~RippleCosine ( )
default

Member Function Documentation

◆ vertices()

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

Retrieves a list of the vertices constituting this concrete shape.

Definition at line 23 of file IShape.cpp.

24 {
25  return m_vertices;
26 }

References IShape::m_vertices.

Member Data Documentation

◆ N_Circle

const size_t IShape::N_Circle = 24
staticinherited

Definition at line 36 of file IShape.h.

Referenced by EllipseVertices(), RippleCosine(), and TruncatedEllipsoid::TruncatedEllipsoid().

◆ m_vertices

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

List of vertices initialized during construction.

Definition at line 40 of file IShape.h.

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


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