ESyS-Particle  2.3.2
SimpleParticle.h
Go to the documentation of this file.
1 
2 // //
3 // Copyright (c) 2003-2014 by The University of Queensland //
4 // Centre for Geoscience Computing //
5 // http://earth.uq.edu.au/centre-geoscience-computing //
6 // //
7 // Primary Business: Brisbane, Queensland, Australia //
8 // Licensed under the Open Software License version 3.0 //
9 // http://www.opensource.org/licenses/osl-3.0.php //
10 // //
12 
13 
14 #ifndef SIMPLEPARTICLE_H
15 #define SIMPLEPARTICLE_H
16 
17 #include "Foundation/console.h"
18 #include "Foundation/vec3.h"
20 
25 {
26 public:
27  static const SimpleParticle INVALID;
28 
29  inline SimpleParticle(const Vec3 &posn, double radius, int id=0, int tag=0);
30 
31  inline SimpleParticle(const SimpleParticle &p);
32 
33  inline SimpleParticle &operator=(const SimpleParticle &p);
34 
35  inline const Vec3 &getPos() const;
36  inline void setPos(const Vec3 &pos);
37  inline void moveTo(const Vec3 &v);
38  inline void translateBy(const Vec3 &v);
39  inline void moveBy(const Vec3 &v);
40  inline void rotate(const Vec3 &rotation, const Vec3 &posn);
41  inline double getRad() const;
42  inline void setRad(double r);
43 
44  inline bool isValid() const;
45 
46  template <typename TmplVisitor>
47  void visit(const TmplVisitor &visitor) const;
48 
49  template <typename TmplVisitor>
50  void visit(TmplVisitor &visitor);
51 };
52 
53 inline std::ostream& operator<<(std::ostream &oStream, const SimpleParticle &particle);
54 
63 {
64  private:
66  public:
72  inline ParticleComparer(const SimpleParticle&);
73  inline bool operator()(const SimpleParticle&, const SimpleParticle&) const;
74  inline bool operator()(const SimpleParticle*, const SimpleParticle*) const;
75 };
76 
78 
79 #endif