Avogadro
1.1.0
|
Class which set of Primitives. More...
#include <primitivelist.h>
Classes | |
class | const_iterator |
Public Member Functions | |
PrimitiveList () | |
PrimitiveList (const PrimitiveList &other) | |
PrimitiveList (const QList< Primitive * > &other) | |
PrimitiveList & | operator= (const PrimitiveList &other) |
PrimitiveList & | operator= (const QList< Primitive * > &other) |
~PrimitiveList () | |
QList< Primitive * > | subList (Primitive::Type type) const |
QList< Primitive * > | list () const |
bool | contains (const Primitive *p) const |
void | append (Primitive *p) |
void | removeAll (Primitive *p) |
int | size () const |
bool | isEmpty () const |
int | count (Primitive::Type type) const |
int | count () const |
void | clear () |
const_iterator | begin () const |
const_iterator | end () const |
Class which set of Primitives.
The PrimitiveList class is designed to hold a set of Primitive objects and keep them organized by type allowing groups of them to be retrieved in constant time.
Constructor(s)
References Avogadro::Primitive::LastType.
Deconstructor
void Avogadro::PrimitiveList::append | ( | Primitive * | p | ) |
Add a primitive to the queue.
p | primitive to add |
References Avogadro::Primitive::FirstType, and Avogadro::Primitive::LastType.
Referenced by Avogadro::Engine::addPrimitive(), Avogadro::Molecule::copyAtomsAndBonds(), and Avogadro::GLWidget::namedSelectionPrimitives().
void Avogadro::PrimitiveList::clear | ( | ) |
Removes every primitive from the queue.
Referenced by Avogadro::Engine::clearPrimitives(), and Avogadro::Engine::setMolecule().
bool Avogadro::PrimitiveList::contains | ( | const Primitive * | p | ) | const |
p | the primitive to check if it is in any list |
Referenced by Avogadro::Engine::addPrimitive().
int Avogadro::PrimitiveList::count | ( | Primitive::Type | type | ) | const |
type | the type of primitives we're interested in |
References Avogadro::Primitive::LastType.
int Avogadro::PrimitiveList::count | ( | ) | const |
bool Avogadro::PrimitiveList::isEmpty | ( | ) | const |
References size().
QList< Primitive * > Avogadro::PrimitiveList::list | ( | ) | const |
void Avogadro::PrimitiveList::removeAll | ( | Primitive * | p | ) |
Remove a primitive from the queue. If the parameter does not exist in the queue, nothing is removed.
p | primitive to remove |
Referenced by Avogadro::Engine::removePrimitive().
int Avogadro::PrimitiveList::size | ( | ) | const |
QList< Primitive * > Avogadro::PrimitiveList::subList | ( | Primitive::Type | type | ) | const |
Returns a list of primitives for a given type.
type | the type of primitives to retrieve, one of Primitive::Type |
References Avogadro::Primitive::LastType.
Referenced by Avogadro::Molecule::copyAtomsAndBonds(), and Avogadro::Engine::setPrimitives().