ESyS-Particle  2.3.2
Corner.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 __CORNER_H
14 #define __CORNER_H
15 
16 //-- Project includes --
17 #include "Foundation/vec3.h"
18 #include "Geometry/Triangle.h"
19 #include "Geometry/Edge.h"
20 
21 //-- STL includes --
22 #include <vector>
23 
24 using std::vector;
25 
34 class Corner
35 {
36  private:
39  vector<Edge*> m_edges;
40  vector<Triangle*> m_triangles;
41  int m_id;
42  int m_tag;
43 
44  public:
45  Corner(const Vec3&,int,int);
46 
47  void addEdge(Edge*);
48  void addTriangle(Triangle*);
49  double sep(const Vec3&) const;
50  // pair<bool,double> dist(const Vec3&) const ; // signed separation according to direction of the normal
51  bool isValidContact(const Vec3&) const;
52  Vec3 getDirectionFromPoint(const Vec3&) const;
53  void move(const Vec3&);
54  Vec3 getPos()const {return m_p;};
55  void setPos(const Vec3 &p) {m_p = p;}
56  void applyForce(const Vec3 &f);
57  int getID() const {return m_id;};
58  int getTag() const {return m_tag;};
59 
60  double getDistMoved() {return (m_old_pos-m_p).norm();};
62 };
63 
64 #endif // __CORNER_H