Debian Codegraph @

src/TriPatchSet.h

raw
1 /////////////////////////////////////////////////////////////
2 // //
3 // Copyright (c) 2007-2017 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.apache.org/licenses/LICENSE-2.0 //
10 // //
11 /////////////////////////////////////////////////////////////
12
13 #ifndef __TRIPATCHSET_H
14 #define __TRIPATCHSET_H
15
16 // project includes
17 #include "JointSet.h"
18 #include "geometry/Triangle3D.h"
19 #include "util/vector3.h"
20
21 // STL includes
22 #include <vector>
23 #include <utility>
24
25 using std::vector;
26 using std::pair;
27 using std::make_pair;
28
29 /*!
30 class to store joints as a collection of triangular patches and check if a bond crosses one of them
31 */
32 class TriPatchSet : public JointSet
33 {
34 private:
35 vector<Triangle3D> m_triangles;
36 Vector3 m_pmin;
37 Vector3 m_pmax;
38 bool m_bbx_set;
39
40 public:
41 TriPatchSet();
42 virtual ~TriPatchSet(){};
43
44
45 virtual int isCrossing(const Vector3&, const Vector3&) const;
46 void addTriangle(const Vector3&, const Vector3&, const Vector3&,int);
47 Vector3 getMinPoint() const {return m_pmin;};
48 Vector3 getMaxPoint() const {return m_pmax;};
49 vector<Triangle3D>::const_iterator triangles_begin() const {return m_triangles.begin();};
50 vector<Triangle3D>::const_iterator triangles_end() const {return m_triangles.end();};
51 pair<Vector3,Vector3> getBoundingBox() {return make_pair(m_pmin,m_pmax);};
52 };
53
54 #endif // __TRIPATCHSET_H