gsystem
Loading...
Searching...
No Matches
GModifier Class Reference

Describes a post-load modification to a single volume. More...

#include <gmodifier.h>

Public Member Functions

 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.

Friends

std::ostream & operator<< (std::ostream &stream, const GModifier &gm)
 Stream operator for logging/debug printing.

Detailed Description

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.

Constructor & Destructor Documentation

◆ GModifier() [1/2]

GModifier::GModifier ( std::string n,
std::optional< std::string > s,
std::optional< std::string > t,
bool existence )
inline
Parameters
nThe 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).
sThe optional shift expression to apply (e.g. "0*cm, 0*cm, 1*cm").
tThe optional tilt expression to apply (e.g. "0*deg, 0*deg, -10*deg").
existenceExistence 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

Member Function Documentation

◆ getExistence()

bool GModifier::getExistence ( ) const
inlinenodiscard

Definition at line 78 of file gmodifier.h.

◆ getName()

const std::string & GModifier::getName ( ) const
inlinenodiscard

Definition at line 69 of file gmodifier.h.

◆ getShift()

const std::optional< std::string > & GModifier::getShift ( ) const
inlinenodiscard

Definition at line 72 of file gmodifier.h.

◆ getTilts()

const std::optional< std::string > & GModifier::getTilts ( ) const
inlinenodiscard

Definition at line 75 of file gmodifier.h.

◆ 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: