Debian Codegraph @

src/LineSet.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 __LINESET_H
14 #define __LINESET_H
15
16 // project includes
17 #include "JointSet.h"
18 #include "geometry/LineSegment2D.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 a collection of line segments and check if a line crosses one of them
31 */
32 class LineSet : public JointSet
33 {
34 private:
35 vector<LineSegment2D> m_segments;
36 Vector3 m_pmin;
37 Vector3 m_pmax;
38 bool m_bbx_set;
39
40 public:
41 LineSet();
42 virtual ~LineSet(){};
43
44
45 virtual int isCrossing(const Vector3&, const Vector3&) const;
46 void addLineSegment(const Vector3&, const Vector3&,int);
47 Vector3 getMinPoint() const {return m_pmin;};
48 Vector3 getMaxPoint() const {return m_pmax;};
49 vector<LineSegment2D>::const_iterator segments_begin() const {return m_segments.begin();};
50 vector<LineSegment2D>::const_iterator segments_end() const {return m_segments.end();};
51 pair<Vector3,Vector3> getBoundingBox() {return make_pair(m_pmin,m_pmax);};
52 };
53
54 #endif // __LINESET_H