-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdivision_plane.h
46 lines (34 loc) · 1.08 KB
/
division_plane.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#ifndef DIVISIONPLANE_H
#define DIVISIONPLANE_H
#include <boost/serialization/split_member.hpp>
#include <boost/numeric/ublas/vector.hpp>
class DivisionPlane
{
public:
DivisionPlane();
DivisionPlane(boost::numeric::ublas::vector<double> point_,
boost::numeric::ublas::vector<double> vector_);
double rate(const boost::numeric::ublas::vector<double>& vec) const;
bool mirror(boost::numeric::ublas::vector<double>& vec, bool positive) const;
private:
boost::numeric::ublas::vector<double> point;
boost::numeric::ublas::vector<double> normal;
boost::numeric::ublas::vector<double> mirror_precalc;
void precalc();
private:
friend class boost::serialization::access;
template<class Archive>
void save(Archive& ar, const unsigned int version) const {
ar & point;
ar & normal;
//ar & mirror_precalc;
}
template<class Archive>
void load(Archive& ar, const unsigned int version) {
ar & point;
ar & normal;
precalc();
}
BOOST_SERIALIZATION_SPLIT_MEMBER()
};
#endif // DIVISIONPLANE_H