CTL
0.6.1
Computed Tomography Library
|
The CTSystem class manages the list of all components of a system. More...
#include <ctsystem.h>
Public Types | |
typedef std::unique_ptr< SystemComponent > | ComponentPtr |
Alias for unique pointer to SystemComponent. | |
![]() | |
enum | { Type = -1, UserType = 65536 } |
Public Member Functions | |
CTSystem (QString name=defaultName()) | |
CTSystem (const CTSystem &other) | |
CTSystem (CTSystem &&other)=default | |
CTSystem & | operator= (CTSystem &&other)=default |
CTSystem & | operator= (const CTSystem &other) |
virtual | ~CTSystem () override=default |
virtual CTSystem * | clone () const & |
virtual CTSystem * | clone () && |
virtual QString | info () const |
virtual QString | overview () const |
void | fromVariant (const QVariant &variant) override |
QVariant | toVariant () const override |
std::vector< AbstractDetector * > | detectors () const |
std::vector< AbstractGantry * > | gantries () const |
std::vector< AbstractSource * > | sources () const |
std::vector< AbstractBeamModifier * > | modifiers () const |
const std::vector< ComponentPtr > & | components () const |
const QString & | name () const |
uint | nbComponents () const |
void | addComponent (ComponentPtr component) |
void | addComponent (SystemComponent *component) |
void | clear () |
bool | isEmpty () const |
bool | isValid () const |
bool | isSimple () const |
void | rename (QString name) |
void | removeComponent (SystemComponent *component) |
CTSystem & | operator<< (ComponentPtr component) |
CTSystem & | operator<< (SystemComponent *component) |
![]() | |
virtual int | type () const |
virtual | ~SerializationInterface ()=default |
Static Public Member Functions | |
static QString | defaultName () |
Private Attributes | |
QString | _name |
The name of the system. | |
std::vector< ComponentPtr > | _componentList |
The list of components. | |
Additional Inherited Members | |
![]() | |
SerializationInterface ()=default | |
SerializationInterface (const SerializationInterface &)=default | |
SerializationInterface (SerializationInterface &&)=default | |
SerializationInterface & | operator= (const SerializationInterface &)=default |
SerializationInterface & | operator= (SerializationInterface &&)=default |
The CTSystem class manages the list of all components of a system.
This class is used to manage the list of system components. System components can be added using addComponent() or the "stream" operator<<(). The full component list can by filtered by the components' base types in order to assess, for example all detector components in the system.
CTL::CTSystem::CTSystem | ( | QString | name = defaultName() | ) |
Constructs a CTSystem object named name.
CTL::CTSystem::CTSystem | ( | const CTSystem & | other | ) |
Constructs a copy of other.
|
default |
Default move constructor.
|
overridevirtualdefault |
Default destructor.
void CTL::CTSystem::addComponent | ( | CTSystem::ComponentPtr | component | ) |
Adds component to the system. Does nothing if component is null
.
void CTL::CTSystem::addComponent | ( | SystemComponent * | component | ) |
Adds component to the system. This CTSystem instance takes ownership of component.
Does nothing if component is null
.
void CTL::CTSystem::clear | ( | ) |
Removes all components from the system.
|
virtual |
Constructs a copy of the system and returns a base-class pointer to the new object.
Reimplemented in CTL::SimpleCTSystem.
|
virtual |
Constructs a new CTSystem object and moves the content of this instance into the new object. Returns a base class pointer to the new instance.
Reimplemented in CTL::SimpleCTSystem.
const std::vector< CTSystem::ComponentPtr > & CTL::CTSystem::components | ( | ) | const |
Returns a constant reference to the list of components.
|
static |
Returns the default name for the component: "Generic CT-system".
std::vector< AbstractDetector * > CTL::CTSystem::detectors | ( | ) | const |
Returns a list of all components of elementary type AbstractDetector in the system.
|
overridevirtual |
Reads all member variables from the QVariant variant.
Reimplemented from CTL::SerializationInterface.
std::vector< AbstractGantry * > CTL::CTSystem::gantries | ( | ) | const |
Returns a list of all components of elementary type AbstractGantry in the system.
|
virtual |
Returns a string that contains full information about all components in the system.
bool CTL::CTSystem::isEmpty | ( | ) | const |
Returns true if the number of compontents is zero, otherwise it returns false.
bool CTL::CTSystem::isSimple | ( | ) | const |
Returns true if the system is simple. To be simple, a system must have exactly one component of each of the following base types (or their derived classes):
The system may have an arbitrary number of AbstractBeamModifier components ans still be simple.
bool CTL::CTSystem::isValid | ( | ) | const |
Returns true if the system is valid. To be valid, a system must have at least one component of each of the following base types (or their derived classes):
The system may have an arbitrary number of AbstractBeamModifier components and still be valid.
std::vector< AbstractBeamModifier * > CTL::CTSystem::modifiers | ( | ) | const |
Returns a list of all components of elementary type AbstractBeamModifier in the system.
const QString & CTL::CTSystem::name | ( | ) | const |
Returns the name of the system.
uint CTL::CTSystem::nbComponents | ( | ) | const |
Returns the number of components in the system.
Same as components().size().
CTSystem & CTL::CTSystem::operator<< | ( | CTSystem::ComponentPtr | component | ) |
Operator style alternative to add component to the system.
Similar to addComponent() but also returns a reference to this instance.
CTSystem & CTL::CTSystem::operator<< | ( | SystemComponent * | component | ) |
Operator style alternative to add component to the system. This CTSystem instance takes ownership of component.
Similar to addComponent() but also returns a reference to this instance.
Assigns the content of other to this system and returns a reference to this instance.
|
virtual |
Returns a string that gives an overview over this system. This contains the system's name and the number of components as well as their names. Additionally, is shows whether the system is valid and simple or not.
void CTL::CTSystem::removeComponent | ( | SystemComponent * | component | ) |
Removes the component component from the system.
void CTL::CTSystem::rename | ( | QString | name | ) |
Sets the system's name to name.
std::vector< AbstractSource * > CTL::CTSystem::sources | ( | ) | const |
Returns a list of all components of elementary type AbstractSource in the system.
|
overridevirtual |
Writes all components to a QVariant. This uses SerializationInterface::toVariant() of individual components in the system.
Reimplemented from CTL::SerializationInterface.