| 1 |
/****************************************************************************** |
| 2 |
This source file is part of the Avogadro project. |
| 3 |
This source code is released under the 3-Clause BSD License, (see "LICENSE"). |
| 4 |
******************************************************************************/ |
| 5 |
|
| 6 |
#ifndef AVOGADRO_QTGUI_RWLAYERMANAGER_H |
| 7 |
#define AVOGADRO_QTGUI_RWLAYERMANAGER_H |
| 8 |
|
| 9 |
#include "avogadroqtguiexport.h" |
| 10 |
|
| 11 |
#include <avogadro/core/array.h> |
| 12 |
#include <avogadro/core/layermanager.h> |
| 13 |
|
| 14 |
namespace Avogadro { |
| 15 |
namespace Core { |
| 16 |
class Molecule; |
| 17 |
} |
| 18 |
namespace QtGui { |
| 19 |
|
| 20 |
class RWMolecule; |
| 21 |
|
| 22 |
/** |
| 23 |
* @class RWLayerManager rwlayermanager.h <avogadro/qtgui/rwlayermanager.h> |
| 24 |
* @brief The RWLayerManager do and undo for layer actions. |
| 25 |
*/ |
| 26 |
class AVOGADROQTGUI_EXPORT RWLayerManager : protected Core::LayerManager |
| 27 |
{ |
| 28 |
public: |
| 29 |
void removeLayer(size_t layer, RWMolecule* rwmolecule); |
| 30 |
void addLayer(RWMolecule* rwmolecule); |
| 31 |
void setActiveLayer(size_t layer, RWMolecule* rwmolecule); |
| 32 |
|
| 33 |
/** @return if @p layer is visible */ |
| 34 |
bool visible(size_t layer) const; |
| 35 |
|
| 36 |
protected: |
| 37 |
/** @return if @p layer is locked */ |
| 38 |
bool locked(size_t layer) const; |
| 39 |
/** flip the visible value in layer */ |
| 40 |
void flipVisible(size_t layer); |
| 41 |
/** flip the locked value in layer */ |
| 42 |
void flipLocked(size_t layer); |
| 43 |
|
| 44 |
/** set mol as active molecule and add it if not exist */ |
| 45 |
void addMolecule(const Core::Molecule* mol); |
| 46 |
|
| 47 |
/** @return a sorted array by layer ID, containing the ID and the key name */ |
| 48 |
Core::Array<std::pair<size_t, std::string>> activeMoleculeNames() const; |
| 49 |
}; |
| 50 |
|
| 51 |
} // namespace QtGui |
| 52 |
} // namespace Avogadro |
| 53 |
|
| 54 |
#endif |