/* * Copyright (C) 2009 * Robert Bosch LLC * Research and Technology Center North America * Palo Alto, California * * All rights reserved. * *------------------------------------------------------------------------------ * project ....: Autonomous Technologies * file .......: rtcVec6.h * authors ....: Benjamin Pitzer * organization: Robert Bosch LLC * creation ...: 04/03/2008 * modified ...: $Date: 2009-01-21 18:19:16 -0800 (Wed, 21 Jan 2009) $ * changed by .: $Author: benjaminpitzer $ * revision ...: $Revision: 14 $ */ #ifndef RTC_VEC6_H #define RTC_VEC6_H //== INCLUDES ================================================================== #include "rtcMath.h" #include "rtcVec.h" //== NAMESPACES ================================================================ namespace rtc { // Forward declarations template class Vec; // M-d vector template class Vec6; // 6d Vector /** * A 6-D vector. */ template class Vec6: public Vec { public: // inherit member data and functions of parent using Vec::x; using Vec::set; // Constructors Vec6(); Vec6(const T* d); Vec6(const T a); Vec6(const T x0, const T x1, const T x2, const T x3, const T x4, const T x5); Vec6(const Vec& v); // Cast Operation template Vec6(const Vec& v); // Mutators void set(const T x0, const T x1, const T x2, const T x3, const T x4, const T x5); }; // Declare a few common typdefs typedef Vec6 Vec6b; typedef Vec6 Vec6c; typedef Vec6 Vec6uc; typedef Vec6 Vec6s; typedef Vec6 Vec6us; typedef Vec6 Vec6i; typedef Vec6 Vec6ui; typedef Vec6 Vec6f; typedef Vec6 Vec6d; //============================================================================== // Vec6 //============================================================================== // Constructors /** Ctor that doesn't initialize. */ template inline Vec6::Vec6() {} /** Ctor that intalizes from array. */ template inline Vec6::Vec6(const T* d) : Vec(d) {} /** Ctor that intalizes all elements from a scalar. */ template inline Vec6::Vec6(const T a) : Vec(a) {} /** Ctor that initializes vector with given values. */ template inline Vec6::Vec6(const T x0, const T x1, const T x2, const T x3, const T x4, const T x5) { set(x0,x1,x2,x3,x4,x5); } /** Ctor that initializes an Vec6 with an Vec. */ template inline Vec6::Vec6(const Vec& v) : Vec(v) {} // Casting Operation /** Casting Ctor that initializes an Vec6 with a Vec. */ template template inline Vec6::Vec6(const Vec& v) : Vec(v) {} // Mutators /** Set vector. */ template inline void Vec6::set(const T x0, const T x1, const T x2, const T x3, const T x4, const T x5) { x[0] = x0; x[1] = x1; x[2] = x2; x[3] = x3; x[4] = x4; x[5] = x5; } //============================================================================== } // NAMESPACE rtc //============================================================================== #endif // RTC_VEC6_H defined //==============================================================================