ESyS-Particle
4.0.1
|
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 #ifndef __EDGE_H 00014 #define __EDGE_H 00015 00016 //-- Project includes -- 00017 #include "Foundation/vec3.h" 00018 #include "Geometry/Triangle.h" 00019 #include "Geometry/AEdge.h" 00020 00021 //-- STL includes -- 00022 #include <utility> 00023 00024 using std::pair; 00025 using std::make_pair; 00026 00035 class Edge : public AEdge 00036 { 00037 private: 00038 Triangle *m_t1,*m_t2; 00039 int m_id1,m_id2; 00040 00041 public: 00042 Edge(int,int,const Vec3&,const Vec3&); 00043 Edge(int,int,const Vec3&,const Vec3&,Triangle*); 00044 Edge(int,int,const Vec3&,const Vec3&,Triangle*,Triangle*); 00045 00046 bool isValidContact(const Vec3&) const; 00047 Vec3 getBoundingBoxMin() const; 00048 Vec3 getBoundingBoxMax() const; 00049 Vec3 getDirectionFromPoint(const Vec3&) const; 00050 void moveNode(int,const Vec3&); 00051 void move(const Vec3&); 00052 void applyForce(const Vec3 &f); 00053 00054 pair<int,int> getIDs() const {return make_pair(m_id1,m_id2);}; 00055 00056 friend ostream& operator << (ostream&,const Edge&); 00057 }; 00058 #endif // __EDGE_H