CTL
0.6.1
Computed Tomography Library
|
The RectFunctionModel class represents a rectangular (rect) function. More...
#include <datamodels1d.h>
Public Types | |
enum | { Type = 52 } |
![]() | |
enum | { Type = 0 } |
![]() | |
enum | { Type = -1, UserType = 65536 } |
Public Member Functions | |
int | type () const override |
float | valueAt (float position) const override |
Returns the value from the model at position. More... | |
AbstractDataModel * | clone () const override |
RectFunctionModel (float rectBegin=-0.5f, float rectEnd=0.5f, float amplitude=1.0f) | |
Constructs a RectFunctionModel with a rectangle of height amplitude covering the interval [rectBegin, rectEnd]. More... | |
QVariant | parameter () const override |
void | setParameter (const QVariant ¶meter) override |
![]() | |
void | fromVariant (const QVariant &variant) override |
QVariant | toVariant () const override |
bool | isIntegrable () const |
void | setName (const QString &name) |
const QString & | name () const |
![]() | |
virtual | ~SerializationInterface ()=default |
Private Attributes | |
float | _rectBegin |
float | _rectEnd |
float | _amplitude |
Friends | |
template<class > | |
struct | SerializationHelper::RegisterWithSerializationHelper |
Additional Inherited Members | |
![]() | |
AbstractDataModel (const AbstractDataModel &)=default | |
AbstractDataModel (AbstractDataModel &&)=default | |
AbstractDataModel & | operator= (const AbstractDataModel &)=default |
AbstractDataModel & | operator= (AbstractDataModel &&)=default |
![]() | |
SerializationInterface ()=default | |
SerializationInterface (const SerializationInterface &)=default | |
SerializationInterface (SerializationInterface &&)=default | |
SerializationInterface & | operator= (const SerializationInterface &)=default |
SerializationInterface & | operator= (SerializationInterface &&)=default |
![]() | |
DataModelPtr | |
Template alias name for CopyableUniquePtr<ModelType> to a suitable ModelType. | |
AbstractDataModelPtr | |
Alias name for DataModelPtr<AbstractDataModel>. More... | |
std::unique_ptr< ModelType > | makeDataModel (ConstructorArguments &&... arguments) |
using DataModelPtr | CopyableUniquePtr |
Alias name for CopyableUniquePtr<ModelType> to a suitable ModelType. | |
The RectFunctionModel class represents a rectangular (rect) function.
This model maps input values according to a rect function. The start and end point of the rectangle, as well as its height can be specified in the constructor of using setParameter().
|
explicit |
Constructs a RectFunctionModel with a rectangle of height amplitude covering the interval [rectBegin, rectEnd].
This creates a model representing a rect function specified by rectBegin, rectEnd, and amplitude.
|
overridevirtual |
Creates a copy of this instance and returns a base class pointer to the new object.
Implements CTL::AbstractDataModel.
|
overridevirtual |
Returns the parameters of this instance as QVariant.
This returns a QVariantMap with three key-value-pairs, representing start and end of the rect-interval as well as the amplitude.
Reimplemented from CTL::AbstractDataModel.
|
overridevirtual |
Sets the parameters of this instance based on the passed QVariant parameter.
Parameters can be passed by either of the following two options:
Reimplemented from CTL::AbstractDataModel.
|
inlineoverridevirtual |
Returns the type id of this instance.
Reimplemented from CTL::AbstractDataModel.
|
overridevirtual |
Returns the value from the model at position.
With the defining parameters of the rectanlge according to the constructor (see RectFunctionModel()), the resulting value \( f(x) \) is described by the follwoing relation:
\( f(x)=\begin{cases} 0 & x<rectBegin\\ amplitude & rectBegin \leq x < rectEnd\\ 0 & x \geq rectEnd \end{cases} \)
Implements CTL::AbstractDataModel.