]> git.tdb.fi Git - libs/math.git/blob - source/geometry/box.h
Add basic description for all classes
[libs/math.git] / source / geometry / box.h
1 #ifndef MSP_GEOMETRY_BOX_H_
2 #define MSP_GEOMETRY_BOX_H_
3
4 #include "hyperbox.h"
5
6 namespace Msp {
7 namespace Geometry {
8
9 /**
10 The three-dimensional special case of a HyperBox.  This class exists for
11 convenience only and does not provide any extra functionality over the base
12 class.
13 */
14 template<typename T>
15 class Box: public HyperBox<T, 3>
16 {
17 public:
18         Box() { }
19         explicit Box(const LinAl::Vector<T, 3> &d): HyperBox<T, 3>(d) { }
20         Box(T w, T h, T d): HyperBox<T, 3>(LinAl::Vector<T, 3>(w, h, d)) { }
21
22         T get_width() const { return this->get_dimension(0); }
23         T get_height() const { return this->get_dimension(1); }
24         T get_depth() const { return this->get_dimension(2); }
25 };
26
27 } // namespace Geometry
28 } // namespace Msp
29
30 #endif