AvogadroLibs 2.1.0-20261111
Loading...
Searching...
No Matches
LayerManager Class Reference
Inheritance diagram for LayerManager:
PluginLayerManager RWLayerManager LayerModel

Static Public Member Functions

static Layer & getMoleculeLayer ()
static Layer & getMoleculeLayer (const Molecule *mol)
static std::shared_ptr< MoleculeInfo > getMoleculeInfo ()
static std::shared_ptr< MoleculeInfo > getMoleculeInfo (const Molecule *mol)
static size_t layerCount ()

Static Protected Member Functions

static std::shared_ptr< MoleculeInfo > activeMoleculeInfo ()
static std::shared_ptr< MoleculeInfo > findMoleculeInfo (const Molecule *mol)
static void setActiveMolecule (const Molecule *mol)

Static Protected Attributes

static std::weak_ptr< MoleculeInfo > m_activeInfo

Member Function Documentation

◆ getMoleculeLayer() [1/2]

Layer & getMoleculeLayer ( )
static
Returns
active molecule Layer

◆ getMoleculeLayer() [2/2]

Layer & getMoleculeLayer ( const Molecule * mol)
static
Returns
Layer from mol and creates MoleculeInfo if not exists

◆ getMoleculeInfo() [1/2]

std::shared_ptr< MoleculeInfo > getMoleculeInfo ( )
static
Returns
the MoleculeInfo from active molecule

◆ getMoleculeInfo() [2/2]

std::shared_ptr< MoleculeInfo > getMoleculeInfo ( const Molecule * mol)
static
Returns
the MoleculeInfo from mol

◆ layerCount()

size_t layerCount ( )
static
Returns
the layer quantity from activeMolecule

◆ activeMoleculeInfo()

std::shared_ptr< MoleculeInfo > activeMoleculeInfo ( )
staticprotected
Returns
the layer state of the active molecule, or nullptr when there is no active molecule.

◆ findMoleculeInfo()

std::shared_ptr< MoleculeInfo > findMoleculeInfo ( const Molecule * mol)
staticprotected
Returns
the layer state of mol, or nullptr when mol is null.

◆ setActiveMolecule()

void setActiveMolecule ( const Molecule * mol)
staticprotected

Point the layer GUI and the render plugins at mol.

Member Data Documentation

◆ m_activeInfo

std::weak_ptr<MoleculeInfo> m_activeInfo
staticprotected

The layer state of the molecule the GUI is acting on, held weakly.

Deliberately not a const Molecule*. Layer state is owned by each Molecule, so nothing here keeps one alive, and a raw pointer would dangle the moment the active molecule was destroyed – reading it would then either fault or silently report whatever object had taken over that address. A weak_ptr simply stops resolving instead.


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