ESyS-Particle  2.3.2
Corner2D.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 #ifndef __CORNER2D_H
14 #define __CORNER2D_H
15 
16 //-- Project includes --
17 #include "Foundation/vec3.h"
18 #include "Geometry/Edge2D.h"
19 
20 //-- STL includes --
21 #include <vector>
22 
23 using std::vector;
24 
25 
34 class Corner2D
35 {
36  private:
38  vector<Edge2D*> m_edges;
39  int m_id;
40 
41  public:
42  Corner2D(const Vec3&,int);
43 
44  void addEdge(Edge2D*);
45  double sep(const Vec3&) const;
46  // pair<bool,double> dist(const Vec3&) const ; // signed separation according to direction of the normal
47  bool isValidContact(const Vec3&) const;
48  Vec3 getDirectionFromPoint(const Vec3&) const;
49  void move(const Vec3&);
50  Vec3 getPos()const {return m_p;};
51  int getID() const {return m_id;};
52  int getNEdges() const {return m_edges.size();};
53  Vec3 getEdgeNormal(int) const;
54  void applyForceToEdge(int,const Vec3&);
55 };
56 
57 #endif // __CORNER2D_H