CTL  0.6.1
Computed Tomography Library
Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
CTL::GenericBeamModifier Class Reference

Base class for components that modify the X-ray beam. More...

#include <genericbeammodifier.h>

Inheritance diagram for CTL::GenericBeamModifier:
Inheritance graph
[legend]
Collaboration diagram for CTL::GenericBeamModifier:
Collaboration graph
[legend]

Public Types

enum  { Type = 401 }
 
- Public Types inherited from CTL::AbstractBeamModifier
enum  { Type = 400 }
 
- Public Types inherited from CTL::SystemComponent
enum  { Type = 0 }
 
- Public Types inherited from CTL::SerializationInterface
enum  { Type = -1, UserType = 65536 }
 

Public Member Functions

int type () const override
 
IntervalDataSeries modifiedSpectrum (const IntervalDataSeries &inputSpectrum) override
 
double modifiedFlux (double inputFlux, const IntervalDataSeries &inputSpectrum) override
 
 GenericBeamModifier (const QString &name=defaultName())
 
SystemComponentclone () const override
 
QString info () const override
 
void fromVariant (const QVariant &variant) override
 
QVariant toVariant () const override
 
- Public Member Functions inherited from CTL::SystemComponent
int type () const override
 
 SystemComponent (const QString &name=defaultName())
 
virtual int elementalType () const
 
void fromVariant (const QVariant &variant) override
 
QVariant toVariant () const override
 
const QString & name () const
 
void rename (QString name)
 
- Public Member Functions inherited from CTL::SerializationInterface
virtual ~SerializationInterface ()=default
 

Static Public Member Functions

static QString defaultName ()
 
- Static Public Member Functions inherited from CTL::SystemComponent
static QString defaultName ()
 

Friends

template<class >
struct SerializationHelper::RegisterWithSerializationHelper
 

Related Functions

(Note that these are not member functions.)

std::unique_ptr< GenericBeamModifiermakeModifier (ConstructorArguments &&... arguments)
 

Additional Inherited Members

- Protected Member Functions inherited from CTL::AbstractBeamModifier
 AbstractBeamModifier (const QString &name)
 
 AbstractBeamModifier (const AbstractBeamModifier &)=default
 
 AbstractBeamModifier (AbstractBeamModifier &&)=default
 
AbstractBeamModifieroperator= (const AbstractBeamModifier &)=default
 
AbstractBeamModifieroperator= (AbstractBeamModifier &&)=default
 
- Protected Member Functions inherited from CTL::SerializationInterface
 SerializationInterface ()=default
 
 SerializationInterface (const SerializationInterface &)=default
 
 SerializationInterface (SerializationInterface &&)=default
 
SerializationInterfaceoperator= (const SerializationInterface &)=default
 
SerializationInterfaceoperator= (SerializationInterface &&)=default
 
- Static Protected Member Functions inherited from CTL::SystemComponent
static QString typeInfoString (const std::type_info &type)
 

Detailed Description

Base class for components that modify the X-ray beam.

This is a placeholder class for a generic implementation of AbstractBeamModifier. Currently, this does not modify the incident spectrum at all.

Constructor & Destructor Documentation

◆ GenericBeamModifier()

CTL::GenericBeamModifier::GenericBeamModifier ( const QString &  name = defaultName())

Constructs a GenericBeamModifier object named name.

Member Function Documentation

◆ clone()

SystemComponent * CTL::GenericBeamModifier::clone ( ) const
overridevirtual

Creates a copy of this instance and returns a base-class pointer to the cloned object.

Reimplemented from CTL::SystemComponent.

◆ defaultName()

QString CTL::GenericBeamModifier::defaultName ( )
static

Returns the default name for the component: "Generic beam modifier".

◆ fromVariant()

void CTL::GenericBeamModifier::fromVariant ( const QVariant &  variant)
overridevirtual

Interface to read all member variables from the QVariant variant.

Reimplement this method such that it reads all newly introduced content when sub-classing. A typical reimplementation in sub-classes might look like this:

DirectBaseClass::fromVariant(variant);
// assuming our class has a member "double _myMemberVariable"
_myMemberVariable = variant.toMap().value("my member variable").toDouble();

Reimplemented from CTL::AbstractBeamModifier.

◆ info()

QString CTL::GenericBeamModifier::info ( ) const
overridevirtual

Returns a formatted string that contains information about the component.

Reimplemented from CTL::AbstractBeamModifier.

◆ toVariant()

QVariant CTL::GenericBeamModifier::toVariant ( ) const
overridevirtual

Interface to store all member variables in a QVariant.

Stores the object's type-id.

Reimplement this method such that it stores all newly introduced object data when sub-classing. This needs to cover everything that is necessary to fully determine the state of an object. Best practice is to invoke the base class version of this method to take care of all content originating from underlying base classes.

A typical reimplementation in sub-classes might look like this:

QVariantMap ret = DirectBaseClass::toVariant().toMap();
ret.insert("my member variable", _myMemberVariable);
return ret;

Reimplemented from CTL::AbstractBeamModifier.

◆ type()

int CTL::GenericBeamModifier::type ( ) const
inlineoverridevirtual

Returns the type-id of the serializable object. Used in deserialization to determine the proper object type.

Add derived classes to the enumeration using the CTL_TYPE_ID macro.

Reimplemented from CTL::AbstractBeamModifier.

Friends And Related Function Documentation

◆ makeModifier()

std::unique_ptr< GenericBeamModifier > makeModifier ( ConstructorArguments &&...  arguments)
related

Factory method to construct a GenericBeamModifier and wrap the object in a std::unique_ptr<GenericBeamModifier>.

This is similar to the more general method GenericComponent::makeComponent() with the difference that it returns a unique pointer to the GenericBeamModifier base type instead of GenericComponent.

See also
GenericComponent::makeComponent().

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