-
Notifications
You must be signed in to change notification settings - Fork 122
/
Projection.h
93 lines (73 loc) · 2.74 KB
/
Projection.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#ifndef MANTID_API_PROJECTION_H_
#define MANTID_API_PROJECTION_H_
#include "MantidKernel/V3D.h"
#include <stdexcept>
#include <boost/shared_ptr.hpp>
using namespace Mantid::Kernel;
namespace Mantid {
namespace API {
/** Represents 3 dimensional projections
@author Harry Jeffery
@date 2015-02-5
Copyright © 2015 ISIS Rutherford Appleton Laboratory, NScD Oak Ridge
National Laboratory & European Spallation Source
This file is part of Mantid.
Mantid is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
Mantid is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
File change history is stored at: <https://github.com/mantidproject/mantid>
Code Documentation is available at: <http://doxygen.mantidproject.org>
*/
/// The units for a given dimension
enum ProjectionUnit {
RLU, // r.l.u
INV_ANG // inverse angstroms
};
class DLLExport Projection {
public:
/// Default constructor builds identity projection
Projection();
/// Three dimensional value constructor, w is the cross product of u and v.
Projection(const V3D &u, const V3D &v);
/// Three dimensional value constructor
Projection(const V3D &u, const V3D &v, const V3D &w);
/// Copy constructor
Projection(const Projection &other);
/// Assignment operator
Projection &operator=(const Projection &other);
/// Destructor
virtual ~Projection();
/// Retrieves the offset for the given dimension
double getOffset(size_t nd);
/// Retrieves the axis vector for the given dimension
V3D getAxis(size_t nd);
/// Retrives the unit of the given dimension
ProjectionUnit getUnit(size_t nd);
/// Set the offset for a given dimension
void setOffset(size_t nd, double offset);
/// Set the axis vector for a given dimension
void setAxis(size_t nd, V3D axis);
/// Set the unit for a given dimension
void setUnit(size_t nd, ProjectionUnit unit);
V3D &U() { return m_dimensions[0]; }
V3D &V() { return m_dimensions[1]; }
V3D &W() { return m_dimensions[2]; }
protected:
/// The dimensions
V3D m_dimensions[3];
/// The offsets for each dimension
double m_offsets[3];
/// The units for each dimension
ProjectionUnit m_units[3];
};
typedef boost::shared_ptr<Projection> Projection_sptr;
} // namespace API
} // namespace Mantid
#endif /*MANTID_API_PROJECTION_H_*/