CTL  0.6.1
Computed Tomography Library
Public Types | Public Member Functions | Protected Member Functions | Friends | List of all members
CTL::AbstractPrepareStep Class Referenceabstract

Base class for preparation steps used within an AcquisitionSetup. More...

#include <abstractpreparestep.h>

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

Public Types

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

Public Member Functions

int type () const override
 
virtual void prepare (SimpleCTSystem &system) const =0
 
virtual bool isApplicableTo (const CTSystem &system) const =0
 
void fromVariant (const QVariant &variant) override
 
QVariant toVariant () const override
 
 ~AbstractPrepareStep () override=default
 
- Public Member Functions inherited from CTL::SerializationInterface
virtual ~SerializationInterface ()=default
 

Protected Member Functions

 AbstractPrepareStep (const AbstractPrepareStep &)=default
 
 AbstractPrepareStep (AbstractPrepareStep &&)=default
 
AbstractPrepareStepoperator= (const AbstractPrepareStep &)=default
 
AbstractPrepareStepoperator= (AbstractPrepareStep &&)=default
 
- Protected Member Functions inherited from CTL::SerializationInterface
 SerializationInterface ()=default
 
 SerializationInterface (const SerializationInterface &)=default
 
 SerializationInterface (SerializationInterface &&)=default
 
SerializationInterfaceoperator= (const SerializationInterface &)=default
 
SerializationInterfaceoperator= (SerializationInterface &&)=default
 

Friends

template<class >
struct SerializationHelper::RegisterWithSerializationHelper
 

Detailed Description

Base class for preparation steps used within an AcquisitionSetup.

Preparation steps are used to bring certain components in the desired state for an upcoming image acquisition. This usually sets member variables to defined values.

Sub-classing of AbstractPrepareStep is recommended for each sub-class of SystemComponent to allow for the preparation of their state in an AcquisitionSetup. Any sub-class must implement the abstract interface methods prepare() and isApplicableTo().

To enable de-/serialization of objects of the new sub-class, reimplement the toVariant() and fromVariant() methods. These should take care of all newly introduced information of the sub-class. Additionally, call the macro DECLARE_SERIALIZABLE_TYPE(YourNewClassName) within the .cpp file of your new class (substitute "YourNewClassName" with the actual class name). Objects of the new class can then be de-/serialized with any of the serializer classes (see also AbstractSerializer). Note that proper de-/serializability of all individual prepare steps is a requirement to be able to de-/serialize an AcquisitionSetup.

The isApplicableTo() method shall serve as an option to verify whether a specific prepare step can be applied to a given CTSystem. This usually checks if the required components (which are to be prepared) are present in the system.

In the prepare() method, the actual preparation of the system state is performed. Note that this is not necessarily limited to changes to a single component within the system.

Constructor & Destructor Documentation

◆ ~AbstractPrepareStep()

CTL::AbstractPrepareStep::~AbstractPrepareStep ( )
overridedefault

Default (virtual) destructor.

Member Function Documentation

◆ fromVariant()

void CTL::AbstractPrepareStep::fromVariant ( const QVariant &  variant)
inlineoverridevirtual

◆ isApplicableTo()

CTL::AbstractPrepareStep::isApplicableTo ( const CTSystem system) const
pure virtual

Returns true if this prepare step can be applied to system.

Typically, this method will check whether system contains all components that shall be prepared by this instance.

Implemented in CTL::prepare::GenericDetectorParam, CTL::prepare::XrayTubeParam, CTL::prepare::XrayLaserParam, CTL::prepare::SourceParam, CTL::prepare::GantryDisplacementParam, CTL::prepare::GenericGantryParam, CTL::prepare::CarmGantryParam, and CTL::prepare::TubularGantryParam.

◆ prepare()

CTL::AbstractPrepareStep::prepare ( SimpleCTSystem system) const
pure virtual

This method performs the actual preparation of the state of system. This usually consists of setting member variables of certain components in system to defined values.

Note that this does not necessarily have to be limited to changes to a single component within the system.

Implemented in CTL::prepare::GenericDetectorParam, CTL::prepare::XrayTubeParam, CTL::prepare::XrayLaserParam, CTL::prepare::SourceParam, CTL::prepare::GantryDisplacementParam, CTL::prepare::GenericGantryParam, CTL::prepare::CarmGantryParam, and CTL::prepare::TubularGantryParam.

◆ toVariant()

QVariant CTL::AbstractPrepareStep::toVariant ( ) const
inlineoverridevirtual

◆ type()

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

Returns the type id of the prepare step.

List of all default types:

Type Type-ID
AbstractPrepareStep::Type 0
GenericDetectorParam::Type 101
GenericGantryParam::Type 201
CarmGantryParam::Type 210
TubularGantryParam::Type 220
GantryDisplacementParam::Type 230
SourceParam::Type 300
XrayLaserParam::Type 310
XrayTubeParam::Type 320

Reimplemented from CTL::SerializationInterface.

Reimplemented in CTL::prepare::GenericDetectorParam, CTL::prepare::XrayTubeParam, CTL::prepare::XrayLaserParam, CTL::prepare::SourceParam, CTL::prepare::GantryDisplacementParam, CTL::prepare::GenericGantryParam, CTL::prepare::CarmGantryParam, and CTL::prepare::TubularGantryParam.


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