MTK++ Latest version: 0.2.0

Public Member Functions | Protected Member Functions | Protected Attributes
MTKpp::selection Class Reference

Allows for the selection of certain parts of the collection. More...

#include <mtkpp/src/Molecule/selection.h>

Collaboration diagram for MTKpp::selection:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 selection (collection *parent=0)
 selection Constructor
virtual ~selection ()
 selection Destructor
collectiongetParent ()
 Get collection.
int parse (std::string seln)
 parse the selection
moleculegetMol ()
 Get the molecule that's apart of the selection.
submoleculegetSMol ()
 Get the submolecule that's apart of the selection.
atomgetAtom ()
 Get the atom that's apart of the selection.
std::vector< atom * > getAtoms ()
 Return atoms in selection.
int getSelectionType ()
 Return Selection Type.
void splitString (std::string &s, const std::string s2, std::vector< std::string > &v, int i)
 Splits string.

Protected Member Functions

void setMol (molecule *m)
 Set molecule.
void setSMol (submolecule *s)
 Set submolecule.
void setAtom (atom *a)
 Set atom.

Protected Attributes

int selectionType
collectionpParent
 parent collection
moleculeselnMol
 seln molecule
submoleculeselnSMol
 seln submolecule
atomselnAtom
 seln atom
std::string itsName
 selection name
std::vector< atom * > itsAtoms
 selection atoms

Detailed Description

Allows for the selection of certain parts of the collection.

Author:
Martin Peters
Version:
0.1
Date:
2006

Constructor & Destructor Documentation

MTKpp::selection::selection ( collection parent = 0)

selection Constructor

Parameters:
parentcollection pointer

References itsName, selectionType, selnAtom, selnMol, and selnSMol.

MTKpp::selection::~selection ( ) [virtual]

selection Destructor


Member Function Documentation

collection * MTKpp::selection::getParent ( )

Get collection.

Returns:
collection pointer

References pParent.

int MTKpp::selection::parse ( std::string  seln)

parse the selection

Parameters:
selnstring to be parsed
Returns:
success
       The seln string should have the form:
       /col/mol/submol/atom
         ^    ^    ^     ^
         |    |    |     |++ atom name, number, or name-number
         |    |    |++ submolecule name, number, or name-number
         |    |++ molecule name, number, or name-number
         |++ collection name

       If seln begins with '/' it is assumed that the selection is starting from the 
       top of the structural hierarchy

       If seln doesn't begin with a '/' then it is assumed that the selection is from the
       bottom of the hierarchy up.

remove trailing /

References MTKpp::errorLogger, MTKpp::submolecule::getAtom(), MTKpp::submolecule::getAtomList(), MTKpp::molecule::getAtomList(), MTKpp::collection::getMolecule(), MTKpp::collection::getMoleculeList(), MTKpp::molecule::getName(), MTKpp::submolecule::getName(), MTKpp::atom::getName(), MTKpp::submolecule::getParent(), MTKpp::molecule::getSubMolecule(), MTKpp::molecule::getSubMoleculeList(), MTKpp::i2s(), itsAtoms, pParent, selectionType, selnAtom, selnMol, selnSMol, splitString(), and MTKpp::errorHandler::throwError().

Referenced by main().

molecule * MTKpp::selection::getMol ( )

Get the molecule that's apart of the selection.

Returns:
molecule pointer

References selnMol.

Referenced by main().

submolecule * MTKpp::selection::getSMol ( )

Get the submolecule that's apart of the selection.

Returns:
submolecule pointer

References selnSMol.

Referenced by main().

atom * MTKpp::selection::getAtom ( )

Get the atom that's apart of the selection.

Returns:
atom pointer

References selnAtom.

Referenced by main().

std::vector< atom * > MTKpp::selection::getAtoms ( )

Return atoms in selection.

Returns:
atoms in selection

References itsAtoms.

Referenced by main().

int MTKpp::selection::getSelectionType ( )

Return Selection Type.

Returns:
selection type: 0 == collection, 1 == molecule, 2 == submolecule

References selectionType.

Referenced by main().

void MTKpp::selection::splitString ( std::string &  s,
const std::string  s2,
std::vector< std::string > &  v,
int  i 
)

Splits string.

Parameters:
sstring to work on
s2separator
vvector of string that gets returned
istarting point

Referenced by parse().

void MTKpp::selection::setMol ( molecule m) [protected]

Set molecule.

Parameters:
mmolecule pointer

References selnMol.

void MTKpp::selection::setSMol ( submolecule s) [protected]

Set submolecule.

Parameters:
ssubmolecule pointer

References selnSMol.

void MTKpp::selection::setAtom ( atom a) [protected]

Set atom.

Parameters:
aatom pointer

References selnAtom.


Member Data Documentation

selection type definitions

  • 1 = molecule
  • 2 = submolecule
  • 3 = atom

Referenced by getSelectionType(), parse(), and selection().

parent collection

Referenced by getParent(), and parse().

seln molecule

Referenced by getMol(), parse(), selection(), and setMol().

seln submolecule

Referenced by getSMol(), parse(), selection(), and setSMol().

seln atom

Referenced by getAtom(), parse(), selection(), and setAtom().

std::string MTKpp::selection::itsName [protected]

selection name

Referenced by selection().

std::vector<atom*> MTKpp::selection::itsAtoms [protected]

selection atoms

Referenced by getAtoms(), and parse().


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

Generated on Fri Dec 23 2011 09:28:57 for MTK++ by Doxygen 1.7.5.1