CTL
0.6.1
Computed Tomography Library
|
Holds the information about the system settings for a particular view. More...
#include <acquisitionsetup.h>
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 PrepareStep & | prepareStep (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 |
![]() | |
virtual int | type () const |
virtual | ~SerializationInterface ()=default |
Private Member Functions | |
PrepareStep & | prepareStep (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 | |
![]() | |
enum | { Type = -1, UserType = 65536 } |
![]() | |
SerializationInterface ()=default | |
SerializationInterface (const SerializationInterface &)=default | |
SerializationInterface (SerializationInterface &&)=default | |
SerializationInterface & | operator= (const SerializationInterface &)=default |
SerializationInterface & | operator= (SerializationInterface &&)=default |
Holds the information about the system settings for a particular view.
|
explicit |
Creates a View object and sets its time stamp to time.
void CTL::AcquisitionSetup::View::addPrepareStep | ( | PrepareStep | step | ) |
void CTL::AcquisitionSetup::View::clearPrepareSteps | ( | ) |
Removes all prepare steps from this instance. This keeps the time stamp of this instance untouched.
|
overridevirtual |
Reads all member variables from the QVariant variant.
Reimplemented from CTL::SerializationInterface.
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
.
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.
size_t CTL::AcquisitionSetup::View::nbPrepareSteps | ( | ) | const |
Returns the number of prepare steps in this instance.
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.
|
private |
private helper; non-const version of prepareStep(int, bool) const
const std::vector< AcquisitionSetup::PrepareStep > & CTL::AcquisitionSetup::View::prepareSteps | ( | ) | const |
Returns a constant reference to the vector of prepare steps of this instance.
void CTL::AcquisitionSetup::View::removeAllPrepareSteps | ( | int | prepareStepType | ) |
Removes all prepare steps of type prepareStepType from this instance.
void CTL::AcquisitionSetup::View::removeLastPrepareStep | ( | ) |
Removes the last prepare step from this instance.
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.
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.
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.
void CTL::AcquisitionSetup::View::setTimeStamp | ( | double | timeStamp | ) |
Sets the time stamp of this instance to timeStamp.
double CTL::AcquisitionSetup::View::timeStamp | ( | ) | const |
Returns the time stamp of this instance.
|
overridevirtual |
Stores all member variables in a QVariant.
Reimplemented from CTL::SerializationInterface.