BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
IFormFactor.h File Reference
Include dependency graph for IFormFactor.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  IFormFactor
 

Functions

IFormFactorcreateTransformedFormFactor (const IFormFactor &formfactor, const IRotation &rot, kvector_t translation)
 

Detailed Description

Defines and implements pure virtual interface IFormFactor.

Homepage:\n http://www.bornagainproject.org
License:\n GNU General Public License v3 or higher (see COPYING)
Authors
Scientific Computing Group at MLZ (see CITATION, AUTHORS)

Definition in file IFormFactor.h.

Function Documentation

◆ createTransformedFormFactor()

IFormFactor* createTransformedFormFactor ( const IFormFactor formfactor,
const IRotation rot,
kvector_t  translation 
)

Definition at line 77 of file IFormFactor.cpp.

79 {
80  std::unique_ptr<IFormFactor> P_fftemp, P_result;
81  if (!rot.isIdentity())
82  P_fftemp = std::make_unique<FormFactorDecoratorRotation>(formfactor, rot);
83  else
84  P_fftemp.reset(formfactor.clone());
85  if (translation != kvector_t())
86  P_result = std::make_unique<FormFactorDecoratorPositionFactor>(*P_fftemp, translation);
87  else
88  std::swap(P_fftemp, P_result);
89  return P_result.release();
90 }
void swap(OutputDataIterator< TValue, TContainer > &left, OutputDataIterator< TValue, TContainer > &right)
make Swappable
BasicVector3D< double > kvector_t
Definition: Vectors3D.h:21
IFormFactor * clone() const override=0
Returns a clone of this ISample object.
virtual bool isIdentity() const
Returns true if rotation matrix is identity matrix (no rotations)
Definition: Rotations.cpp:63

References IFormFactor::clone(), IRotation::isIdentity(), and swap().

Referenced by IFormFactor::createSlicedFormFactor(), FormFactorAnisoPyramid::sliceFormFactor(), FormFactorBox::sliceFormFactor(), FormFactorCone::sliceFormFactor(), FormFactorCone6::sliceFormFactor(), FormFactorCuboctahedron::sliceFormFactor(), FormFactorCylinder::sliceFormFactor(), FormFactorEllipsoidalCylinder::sliceFormFactor(), FormFactorFullSphere::sliceFormFactor(), FormFactorFullSpheroid::sliceFormFactor(), FormFactorLongBoxGauss::sliceFormFactor(), FormFactorLongBoxLorentz::sliceFormFactor(), FormFactorPrism3::sliceFormFactor(), FormFactorPrism6::sliceFormFactor(), FormFactorPyramid::sliceFormFactor(), FormFactorTetrahedron::sliceFormFactor(), FormFactorTruncatedSphere::sliceFormFactor(), and FormFactorTruncatedSpheroid::sliceFormFactor().

Here is the call graph for this function: