Describes a post-load modification to a single volume.
More...
#include <gmodifier.h>
|
| | GModifier (std::string n, std::optional< std::string > s, std::optional< std::string > t, bool existence) |
| | Construct a modifier record.
|
| | GModifier (const GModifier &other)=default |
| | Default copy constructor (value-object semantics).
|
| const std::string & | getName () const |
| | Returns the modifier target volume name.
|
| const std::optional< std::string > & | getShift () const |
| | Returns the configured shift expression.
|
| const std::optional< std::string > & | getTilts () const |
| | Returns the configured tilt expression.
|
| bool | getExistence () const |
| | Returns whether the target volume should exist in the final world.
|
|
| std::ostream & | operator<< (std::ostream &stream, const GModifier &gm) |
| | Stream operator for logging/debug printing.
|
A GModifier is a small value-object that carries optional adjustments that will be applied to a target volume after it is loaded by a GSystemFactory and inserted into a GSystem.
Typical uses include:
- applying an additional translation ("shift") to a volume placement;
- applying an additional rotation ("tilts") to a volume placement;
- toggling the existence flag (remove a volume from the world).
- Note
- This class is intentionally minimal: it stores the modifier values and provides trivial getters. It does not apply the modifications itself.
Definition at line 26 of file gmodifier.h.
◆ GModifier() [1/2]
| GModifier::GModifier |
( |
std::string | n, |
|
|
std::optional< std::string > | s, |
|
|
std::optional< std::string > | t, |
|
|
bool | existence ) |
|
inline |
- Parameters
-
| n | The target volume name. This must match the key used to find the volume within the world (typically the volume name as stored in the geometry). |
| s | The optional shift expression to apply (e.g. "0*cm, 0*cm, 1*cm"). |
| t | The optional tilt expression to apply (e.g. "0*deg, 0*deg, -10*deg"). |
| existence | Existence toggle: true means the volume is present, false means it should be removed/disabled. |
Definition at line 39 of file gmodifier.h.
◆ GModifier() [2/2]
| GModifier::GModifier |
( |
const GModifier & | other | ) |
|
|
default |
◆ getExistence()
| bool GModifier::getExistence |
( |
| ) |
const |
|
inlinenodiscard |
◆ getName()
| const std::string & GModifier::getName |
( |
| ) |
const |
|
inlinenodiscard |
◆ getShift()
| const std::optional< std::string > & GModifier::getShift |
( |
| ) |
const |
|
inlinenodiscard |
◆ getTilts()
| const std::optional< std::string > & GModifier::getTilts |
( |
| ) |
const |
|
inlinenodiscard |
◆ operator<<
| std::ostream & operator<< |
( |
std::ostream & | stream, |
|
|
const GModifier & | gm ) |
|
friend |
Prints a compact representation of the modifier so that callers can include it in logger output.
Definition at line 61 of file gmodifier.h.
The documentation for this class was generated from the following file: