CTL  0.6.1
Computed Tomography Library
Public Member Functions | Private Member Functions | Private Attributes | List of all members
CTL::AcquisitionSetup::View Class Reference

Holds the information about the system settings for a particular view. More...

#include <acquisitionsetup.h>

Inheritance diagram for CTL::AcquisitionSetup::View:
Inheritance graph
[legend]
Collaboration diagram for CTL::AcquisitionSetup::View:
Collaboration graph
[legend]

Public Member Functions

 View (double time)
 
void setTimeStamp (double timeStamp)
 
double timeStamp () const
 
void addPrepareStep (PrepareStep step)
 
void clearPrepareSteps ()
 
size_t nbPrepareSteps () const
 
const std::vector< PrepareStep > & prepareSteps () const
 
const PrepareStepprepareStep (int prepareStepType, bool searchFromBack=true) const
 
int indexOfPrepareStep (int prepareStepType, bool searchFromBack=true) const
 
bool hasPrepareStep (int prepareStepType) const
 Returns true if this view has any prepare step of type prepareStepType; returns false otherwise. More...
 
bool replacePrepareStep (int index, PrepareStep newPrepareStep)
 
bool replacePrepareStep (PrepareStep newPrepareStep, bool searchFromBack=true)
 
void removeAllPrepareSteps (int prepareStepType)
 
void removeLastPrepareStep ()
 
void removePrepareStep (int prepareStepType, bool searchFromBack=true)
 
void fromVariant (const QVariant &variant) override
 
QVariant toVariant () const override
 
- Public Member Functions inherited from CTL::SerializationInterface
virtual int type () const
 
virtual ~SerializationInterface ()=default
 

Private Member Functions

PrepareStepprepareStep (int prepareStepType, bool searchFromBack)
 

Private Attributes

double _timeStamp
 Time stamp of the view.
 
std::vector< PrepareStep_prepareSteps
 List of prepare steps to configure the view.
 

Additional Inherited Members

- Public Types inherited from CTL::SerializationInterface
enum  { Type = -1, UserType = 65536 }
 
- Protected Member Functions inherited from CTL::SerializationInterface
 SerializationInterface ()=default
 
 SerializationInterface (const SerializationInterface &)=default
 
 SerializationInterface (SerializationInterface &&)=default
 
SerializationInterfaceoperator= (const SerializationInterface &)=default
 
SerializationInterfaceoperator= (SerializationInterface &&)=default
 

Detailed Description

Holds the information about the system settings for a particular view.

Constructor & Destructor Documentation

◆ View()

CTL::AcquisitionSetup::View::View ( double  time)
explicit

Creates a View object and sets its time stamp to time.

Member Function Documentation

◆ addPrepareStep()

void CTL::AcquisitionSetup::View::addPrepareStep ( PrepareStep  step)

Adds the PrepareStep step to the vector of prepare steps of this View. Prepare steps will be applied in the same order as they have been added to the View.

◆ clearPrepareSteps()

void CTL::AcquisitionSetup::View::clearPrepareSteps ( )

Removes all prepare steps from this instance. This keeps the time stamp of this instance untouched.

◆ fromVariant()

void CTL::AcquisitionSetup::View::fromVariant ( const QVariant &  variant)
overridevirtual

Reads all member variables from the QVariant variant.

Reimplemented from CTL::SerializationInterface.

◆ hasPrepareStep()

bool CTL::AcquisitionSetup::View::hasPrepareStep ( int  prepareStepType) const

Returns true if this view has any prepare step of type prepareStepType; returns false otherwise.

Convenience method; same as prepareStep(prepareStepType) != nullptr.

◆ indexOfPrepareStep()

int CTL::AcquisitionSetup::View::indexOfPrepareStep ( int  prepareStepType,
bool  searchFromBack = true 
) const

Returns the index of the first PrepareStep of type prepareStepType that occurs in the vector of prepare steps in this instance. The prepareStepType refers to the type-id provided by AbstractPrepareStep::type().

If searchFromBack = true, the vector of prepare steps will be scanned through in reverse order, thus, providing the index of the PrepareStep of type prepareStepType occurring last in this instance.

Returns -1 if no PrepareStep of type prepareStepType exists in this instance.

See also
AbstractPrepareStep::type().

◆ nbPrepareSteps()

size_t CTL::AcquisitionSetup::View::nbPrepareSteps ( ) const

Returns the number of prepare steps in this instance.

◆ prepareStep() [1/2]

const AcquisitionSetup::PrepareStep & CTL::AcquisitionSetup::View::prepareStep ( int  prepareStepType,
bool  searchFromBack = true 
) const

Returns a constant reference to the first PrepareStep of type prepareStepType that occurs in the vector of prepare steps in this instance. The prepareStepType refers to the type-id provided by AbstractPrepareStep::type().

If searchFromBack = true, the vector of prepare steps will be scanned through in reverse order, thus, providing the PrepareStep of type prepareStepType occurring last in this instance.

Returns a reference to an invalid PrepareStep (wrapping a nullptr) if no PrepareStep of type prepareStepType exists in this instance.

◆ prepareStep() [2/2]

AcquisitionSetup::PrepareStep & CTL::AcquisitionSetup::View::prepareStep ( int  prepareStepType,
bool  searchFromBack 
)
private

private helper; non-const version of prepareStep(int, bool) const

◆ prepareSteps()

const std::vector< AcquisitionSetup::PrepareStep > & CTL::AcquisitionSetup::View::prepareSteps ( ) const

Returns a constant reference to the vector of prepare steps of this instance.

◆ removeAllPrepareSteps()

void CTL::AcquisitionSetup::View::removeAllPrepareSteps ( int  prepareStepType)

Removes all prepare steps of type prepareStepType from this instance.

See also
AbstractPrepareStep::type().

◆ removeLastPrepareStep()

void CTL::AcquisitionSetup::View::removeLastPrepareStep ( )

Removes the last prepare step from this instance.

◆ removePrepareStep()

void CTL::AcquisitionSetup::View::removePrepareStep ( int  prepareStepType,
bool  searchFromBack = true 
)

Removes one prepare step of type prepareStepType from this instance.

This removes the last occurrence of a corresponding PrepareStep. If searchFromBack = false, the first matching element is removed.

See also
AbstractPrepareStep::type().

◆ replacePrepareStep() [1/2]

bool CTL::AcquisitionSetup::View::replacePrepareStep ( int  index,
PrepareStep  newPrepareStep 
)

Replaces the prepare step at position index in the vector of prepare steps by newPrepareStep. Returns true if the prepare step has been replaced.

The index must not exceed the range of the prepare step vector.

Does nothing (and returns false) if index < 0 and/or newPrepareStep is nullptr.

◆ replacePrepareStep() [2/2]

bool CTL::AcquisitionSetup::View::replacePrepareStep ( PrepareStep  newPrepareStep,
bool  searchFromBack = true 
)

Replaces a prepare step of the same type as newPrepareStep by newPrepareStep. Returns true if a prepare step has been replaced.

This replaces the last occurrence of a corresponding PrepareStep. If searchFromBack = false, the first matching element is replaced.

Does nothing (and returns false) if no prepare step of matching type is found and/or newPrepareStep is nullptr.

◆ setTimeStamp()

void CTL::AcquisitionSetup::View::setTimeStamp ( double  timeStamp)

Sets the time stamp of this instance to timeStamp.

◆ timeStamp()

double CTL::AcquisitionSetup::View::timeStamp ( ) const

Returns the time stamp of this instance.

◆ toVariant()

QVariant CTL::AcquisitionSetup::View::toVariant ( ) const
overridevirtual

Stores all member variables in a QVariant.

Reimplemented from CTL::SerializationInterface.


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