diff options
author | Alexander Sulfrian <alexander@sulfrian.net> | 2012-03-21 12:00:36 +0100 |
---|---|---|
committer | Alexander Sulfrian <alexander@sulfrian.net> | 2013-01-05 17:17:51 +0100 |
commit | ddcaca8432c2caf57d1defade0c32e90c649554c (patch) | |
tree | 3fb4f8edfb3aac494bce9d858d32b1cbec09d82e /src/utils/point_3d.hpp | |
parent | 2aba7ea7a02f967efc40edb332ab42c56ed92ce6 (diff) | |
download | usdx-ddcaca8432c2caf57d1defade0c32e90c649554c.tar.gz usdx-ddcaca8432c2caf57d1defade0c32e90c649554c.tar.xz usdx-ddcaca8432c2caf57d1defade0c32e90c649554c.zip |
utils: templatized point, point_3d and rectangle
added template parameter for the geometry helper classes,
moved function definitions to hpp file to support templates
Diffstat (limited to 'src/utils/point_3d.hpp')
-rw-r--r-- | src/utils/point_3d.hpp | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/src/utils/point_3d.hpp b/src/utils/point_3d.hpp index 0087c08a..1ce2a313 100644 --- a/src/utils/point_3d.hpp +++ b/src/utils/point_3d.hpp @@ -32,15 +32,27 @@ namespace usdx { - class Point3D : public Point + template <class T> + class Point3D : public Point<T> { private: - float z; + T z; + public: - Point3D(float x, float y, float z); - Point3D(const Point3D& point); + Point3D(T x, T y, T z) : + Point<T>(x, y), z(z) + { + } + + Point3D(const Point3D<T>& point) : + Point<T>(point), z(point.z) + { + } - float get_z(void) const; + T get_z(void) const + { + return z; + } }; }; |