Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

atom.cpp

Go to the documentation of this file.
00001 /***************************************************************************************************
00002 *****           Copyright (C) 2005 John Schneiderman <JohnMS@member.fsf.org>                   *****
00003 *****                                                                                          *****
00004 *****           This program is free software; you can redistribute it and/or modify           *****
00005 *****           it under the terms of the GNU General Public License as published by           *****
00006 *****           the Free Software Foundation; either version 2 of the License, or              *****
00007 *****           (at your option) any later version.                                            *****
00008 *****                                                                                          *****
00009 *****           This program is distributed in the hope that it will be useful,                *****
00010 *****           but WITHOUT ANY WARRANTY; without even the implied warranty of                 *****
00011 *****           MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                  *****
00012 *****           GNU General Public License for more details.                                   *****
00013 *****                                                                                          *****
00014 *****           You should have received a copy of the GNU General Public License              *****
00015 *****           along with this program; if not, write to the Free Software                    *****
00016 *****           Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA     *****
00017 ***************************************************************************************************/
00018 #include "atom.h"
00019 
00020 Atom::Atom()
00021 {
00022     properties.acceleration = 0.0;
00023     properties.position = 0.0;
00024     properties.velocity = 0.0;
00025     properties.kineticEnergy = 0.0;
00026     properties.potentialEnergy = 0.0;
00027 }
00028 
00029 Atom::Atom(const Atom &atom)
00030 {
00031     *this=atom;
00032 }
00033 
00034 Atom& Atom::operator=(const Atom &rhs)
00035 {
00036     if (this != &rhs)
00037     {
00038         properties.position = rhs.properties.position;
00039         properties.velocity = rhs.properties.velocity;
00040         properties.acceleration = rhs.properties.acceleration;
00041         properties.kineticEnergy = rhs.properties.kineticEnergy;
00042         properties.potentialEnergy = rhs.properties.potentialEnergy;
00043     }
00044     return *this;
00045 }
00046 
00047 bool Atom::operator==(const Atom &rhs) const
00048 {
00049     if (properties.position == rhs.properties.position)
00050         return true;
00051     else
00052         return false;
00053 }
00054 
00055 bool Atom::operator!=(const Atom &rhs) const
00056 {
00057     if (*this == rhs)
00058         return false;
00059     else
00060         return true;
00061 }

Generated on Tue Mar 28 23:28:03 2006 for ClusterSim by  doxygen 1.4.4