Loading...
Searching...
No Matches
Layer Class Reference

The Layer class represents a relation one to one between atoms ID and layer ID, and stores the unique active layer. Layer's ID are consecutively and there can't be a ID bigger than `m_maxLayer`.

`#include <avogadro/core/layer.h>`

## Public Member Functions

void | addAtom (size_t layer)
void | addAtom (size_t layer, Index atom)
void | addAtomToActiveLayer (Index atom)
void | removeAtom (Index atom)
void | removeLayer (size_t layer)
size_t | getLayerID (Index atom) const
size_t | activeLayer () const
size_t | maxLayer () const
size_t | layerCount () const
size_t | atomCount () const
void | clear ()
void | resize (size_t count)
void | addLayer ()
void | addLayer (size_t layer)
void | setActiveLayer (size_t layer)
void | swapLayer (Index a, Index b)

## Member Function Documentation

## getLayerID()

size_t getLayerID | ( | Index | atom | ) | const

Returns
  the layer ID from the `atom`.

## activeLayer()

size_t activeLayer | ( |  | ) | const

Returns
  the active Layer.

## maxLayer()

size_t maxLayer | ( |  | ) | const

Returns
  the maximum layer allowed.

## layerCount()

size_t layerCount | ( |  | ) | const

Returns
  the number of layers.

## atomCount()

size_t atomCount | ( |  | ) | const

Returns
  The number of atoms.

## clear()

void clear | ( |  | ) |

remove all IDs.

## resize()

void resize | ( | size_t | count | ) |

resize the atom-layer array to `count` atoms, removing any excess.

## addLayer() [1/2]

void addLayer | ( |  | ) |

increase the maximum layer allowed .

## addLayer() [2/2]

void addLayer | ( | size_t | layer | ) |

insert a layer at `layer`, equal or bigger previous layers will be shifted.

## setActiveLayer()

void setActiveLayer | ( | size_t | layer | ) |

change `m_activeLayer`.

## swapLayer()

void swapLayer | ( | Index | a,
|  | Index | b )

swap the layer ID from `a` and `b`.

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

- layer.h