Avogadro  1.1.0
Public Types | Signals | Public Member Functions | Protected Member Functions | Protected Attributes | Properties
Avogadro::Primitive Class Reference

Base class for all primitives (Molecule, Atom, Bond, Residue, ...). More...

#include <avogadro/primitive.h>

Inheritance diagram for Avogadro::Primitive:
Inheritance graph
[legend]

List of all members.

Public Types

enum  Type {
  OtherType = 0, MoleculeType, AtomType, BondType,
  ResidueType, ChainType, FragmentType, SurfaceType,
  MeshType, CubeType, PlaneType, GridType,
  PointType, LineType, VectorType, NonbondedType,
  TextType, LastType, FirstType = OtherType
}

Signals

void updated ()

Public Member Functions

 Primitive (QObject *parent=0)
 Primitive (Type type, QObject *parent=0)
virtual ~Primitive ()
void update ()
Type type () const
unsigned long id () const
unsigned long index () const

Protected Member Functions

void setId (unsigned long m_id)
void setIndex (unsigned long m_index)
 Primitive (PrimitivePrivate &dd, QObject *parent=0)
 Primitive (PrimitivePrivate &dd, Type type, QObject *parent=0)

Protected Attributes

PrimitivePrivate *const d_ptr
enum Primitive::Type m_type
unsigned long m_id
unsigned long m_index

Properties

Type type

Detailed Description

Base class for all primitives (Molecule, Atom, Bond, Residue, ...).


Member Enumeration Documentation

This enum allows us to iterate through the various types of primitives.

Holds the primitive type

Enumerator:
OtherType 

Untyped Primitive.

MoleculeType 

Molecule Primitive.

AtomType 

Atom Primitive.

BondType 

Bond Primitive.

ResidueType 

Residue Primitive.

ChainType 

Chain Primitive (i.e., a set of residues)

FragmentType 

Fragment Primitve.

SurfaceType 

Surface Primitive.

MeshType 

Surface Mesh Primitive.

CubeType 

Cube Primitive.

PlaneType 

Plane Primitive.

GridType 

Grid Primitive.

PointType 

Points (i.e., non-atoms)

LineType 

Lines.

VectorType 

Vectors (i.e., arrows, dipole moments)

NonbondedType 

Non-bonded interactions (i.e., non-bond connections)

TextType 

Text annoations.

LastType 

End Placeholder.

FirstType 

First Placeholder.

Reimplemented in Avogadro::Cube.


Constructor & Destructor Documentation

Default constructor.

Parameters:
parentthe object parent
Avogadro::Primitive::Primitive ( Type  type,
QObject parent = 0 
) [explicit]

Constructor

Parameters:
typethe primitive type
parentthe object parent

Destructor


Member Function Documentation

unsigned long Avogadro::Primitive::id ( ) const [inline]
unsigned long Avogadro::Primitive::index ( ) const [inline]
void Avogadro::Primitive::setId ( unsigned long  m_id) [protected]

Set the id of the primitive, used to uniquely indentify the primitive.

Note:
That this should only be set by the container class.

References id().

Referenced by Avogadro::Molecule::addAtom(), Avogadro::Molecule::addBond(), Avogadro::Molecule::addCube(), Avogadro::Molecule::addMesh(), Avogadro::Molecule::addResidue(), Avogadro::Molecule::addRing(), and Avogadro::Molecule::operator=().

void Avogadro::Primitive::setIndex ( unsigned long  m_index) [protected]
Type Avogadro::Primitive::type ( ) const
Returns:
The primitive type (one of Primitive::Type)

Function used to push changes to a primitive to the rest of the system. At this time there is no way (other than this) to generate a signal when properties of a primitive change.

In the case of the Atom primitive, this should be called when changes to coordinates have been made.

Reimplemented in Avogadro::Molecule.

References updated().

Referenced by Avogadro::Atom::setAtomicNumber(), and Avogadro::GLWidget::setSelected().

void Avogadro::Primitive::updated ( ) [signal]

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