ESyS-Particle  4.0.1
SimpleParticle.h
00001 
00002 //                                                         //
00003 // Copyright (c) 2003-2011 by The University of Queensland //
00004 // Earth Systems Science Computational Centre (ESSCC)      //
00005 // http://www.uq.edu.au/esscc                              //
00006 //                                                         //
00007 // Primary Business: Brisbane, Queensland, Australia       //
00008 // Licensed under the Open Software License version 3.0    //
00009 // http://www.opensource.org/licenses/osl-3.0.php          //
00010 //                                                         //
00012 
00013 
00014 #ifndef SIMPLEPARTICLE_H
00015 #define SIMPLEPARTICLE_H
00016 
00017 #include "Foundation/console.h"
00018 #include "Foundation/vec3.h"
00019 #include "Geometry/SimpleParticleData.h"
00020 
00024 class SimpleParticle : public esys::lsm::SimpleParticleData
00025 {
00026 public:
00027   static const SimpleParticle INVALID;
00028 
00029   inline SimpleParticle(const Vec3 &posn, double radius, int id=0, int tag=0);
00030 
00031   inline SimpleParticle(const SimpleParticle &p);
00032 
00033   inline SimpleParticle &operator=(const SimpleParticle &p);
00034 
00035   inline const Vec3 &getPos() const;
00036   inline void setPos(const Vec3 &pos);
00037   inline void moveTo(const Vec3 &v);
00038   inline void translateBy(const Vec3 &v);
00039   inline void moveBy(const Vec3 &v);
00040   inline void rotate(const Vec3 &rotation, const Vec3 &posn);
00041   inline double getRad() const;
00042   inline void setRad(double r);
00043 
00044   inline bool isValid() const;
00045 
00046   template <typename TmplVisitor>
00047   void visit(const TmplVisitor &visitor) const;
00048 
00049   template <typename TmplVisitor>
00050   void visit(TmplVisitor &visitor);
00051 };
00052 
00053 inline std::ostream& operator<<(std::ostream &oStream, const SimpleParticle &particle);
00054 
00062 class ParticleComparer
00063 {
00064  private:
00065   const SimpleParticle *m_pParticle;
00066  public:
00072   inline ParticleComparer(const SimpleParticle&);
00073   inline bool operator()(const SimpleParticle&, const SimpleParticle&) const;
00074   inline bool operator()(const SimpleParticle*, const SimpleParticle*) const; 
00075 };
00076 
00077 #include "Geometry/SimpleParticle.hpp"
00078 
00079 #endif