Avogadro::Core::LayerManager#

class LayerManager#

Subclassed by PluginLayerManager, RWLayerManager

Public Static Functions

static Layer &getMoleculeLayer()#
Returns:

active molecule Layer

static Layer &getMoleculeLayer(const Molecule *mol)#
Returns:

Layer from mol and creates MoleculeInfo if not exists

static std::shared_ptr<MoleculeInfo> getMoleculeInfo()#
Returns:

the MoleculeInfo from active molecule

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

the MoleculeInfo from mol

static size_t layerCount()#
Returns:

the layer quantity from activeMolecule

Protected Static Functions

static std::shared_ptr<MoleculeInfo> activeMoleculeInfo()#
Returns:

the layer state of the active molecule, or nullptr when there is no active molecule.

static std::shared_ptr<MoleculeInfo> findMoleculeInfo(const Molecule *mol)#
Returns:

the layer state of mol, or nullptr when mol is null.

static void setActiveMolecule(const Molecule *mol)#

Point the layer GUI and the render plugins at mol.

Protected Static Attributes

static std::weak_ptr<MoleculeInfo> m_activeInfo#

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 &#8212; reading it would then either fault or silently report whatever object had taken over that address. A weak_ptr simply stops resolving instead.