Particle

A class meant to serve as a basis for particle types such as atoms, molecular surface points etc. This class's only property is position and operators to alter the Particle's position are supplied. Users of the class are encouraged to use the class as an inheritance base in creating their Particle types.

[ GAMB | Source | Keywords | Summary | Ancestors | All Members | Descendants ]

Quick Index

AUTHORS
CHANGES LOG
GOALS
USAGE

Class Summary

class Particle

{
public:
Particle();
explicit Particle(const Vector3& newPos);
explicit Particle(const char* const PDBrec);
Vector3 position() const;
void moveto(const Vector3 &);
operator Vector3() const;
operator const Vector3&() const;
Particle& operator*=(const Matrix3 &);
Particle& operator*=(const RigidTrans3 &);
Particle& operator+=(const Vector3 &);
Particle& operator-=(const Vector3 &);
Particle& operator*=(const float &);
Particle& operator/=(const float &);
protected:
}; // Particle

Back to the top of Particle


AUTHORS

Meir Fuchs. (meirfux@math.tau.ac.il)

Copyright: SAMBA group, Tel-Aviv Univ. Israel, 1997.

Back to the top of Particle


CHANGES LOG

Back to the top of Particle


GOALS

Class Particle is supposed to serve as a base-class for particle type classes such as atoms or surface points. The class may be constructed in the usual manner supplying the particle's position or it may be constructed using a PDB format ATOM record. The class hosts a set of operators used to shift particle positions.

Back to the top of Particle


USAGE

Below is a piece of code used to read in PDB atoms, shift their positions using a rigid transformation and print their new positions to the standard output.

    RigidTrans3 rt = ....;             // rigid transformation = whatever
    ifstream PDBfile("pdb1tpo.ent");   // open PDB file (e.g. 1TPO)
    char line[85];
    while (!PDBfile.eof()) {
      PDBfile.getline(line, 85);  // Get a PDB file record.
      if (PDB::isATOMrec(line)) {   // check that the PDB rec is an ATOM record
        Particle p(line);           // Construct a Particle using ATOM record.
        p*= rt;                     // Shift particle's position using a rigid
        cout << p.position << '\n'; // transformation and print new position.
      }
    } 

Back to the top of Particle


Particle();

Creates a Particle with 0-position.

  Particle();

Back to the top of Particle


explicit Particle(const Vector3& newPos);

Creates a particle with given position NewPos.

  explicit Particle(const Vector3& newPos);

Back to the top of Particle


explicit Particle(const char* const PDBrec);

Constructs a Particle using a PDB ATOM record. The constructor assumes that the given string is an ATOM record. If this is not so the object constructed may hold faulty data.

  explicit Particle(const char* const PDBrec);

Back to the top of Particle


Vector3 position() const;

Returns particle's position.

  Vector3 position() const;

Back to the top of Particle


void moveto(const Vector3 &);

Moves particle to a new position.

  void moveto(const Vector3 &);

Back to the top of Particle


operator Vector3() const;

Default Vector3 cast. When vector3 cast is used the particle's position is returned.

  operator Vector3() const;

Back to the top of Particle


operator const Vector3&() const;

Default Vector3 cast. When vector3 cast is used the particle's position is returned.

  operator const Vector3&() const;

Back to the top of Particle


Particle& operator*=(const Matrix3 &);

Shift particle's position using a linear transformation.

  Particle& operator*=(const Matrix3 &);

Back to the top of Particle


Particle& operator*=(const RigidTrans3 &);

Shift particle's position using a rigid transformation.

  Particle& operator*=(const RigidTrans3 &);

Back to the top of Particle


Particle& operator+=(const Vector3 &);

Shift particle's position using vector addition.

  Particle& operator+=(const Vector3 &);

Back to the top of Particle


Particle& operator-=(const Vector3 &);

Shift particle's position using vector subtraction.

  Particle& operator-=(const Vector3 &);

Back to the top of Particle


Particle& operator*=(const float &);

Shift particle's position using scalar multiplication.

  Particle& operator*=(const float &);

Back to the top of Particle


Particle& operator/=(const float &);

Shift particle's position using scalar division.

  Particle& operator/=(const float &);

Back to the top of Particle


All Members

public:
explicit Particle(const Vector3& newPos);
explicit Particle(const char* const PDBrec);
Vector3 position() const;
void moveto(const Vector3 &);
operator Vector3() const;
operator const Vector3&() const;
Particle& operator*=(const Matrix3 &);
Particle& operator*=(const RigidTrans3 &);
Particle& operator+=(const Vector3 &);
Particle& operator-=(const Vector3 &);
Particle& operator*=(const float &);
Particle& operator/=(const float &);
protected:

Back to the top of Particle


Ancestors

Class does not inherit from any other class.

Back to the top of Particle


Descendants

Class is not inherited by any others.

Back to the top of Particle


Generated from source by the Cocoon utilities on Sun Nov 15 13:35:26 2009 .

Report problems to jkotula@unimax.com