/* * Copyright (C) 2009 * Robert Bosch LLC * Research and Technology Center North America * Palo Alto, California * * All rights reserved. * *------------------------------------------------------------------------------ * project ....: Autonomous Technologies * file .......: rtcVec5.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_VEC5_H #define RTC_VEC5_H //== INCLUDES ================================================================== #include "rtcMath.h" #include "rtcVec.h" //== NAMESPACES ================================================================ namespace rtc { // Forward declarations template class Vec; // M-d vector template class Vec5; // 5d Vector /** * A 5-D vector. */ template class Vec5: public Vec { public: // inherit member data and functions of parent using Vec::x; using Vec::set; // Constructors Vec5(); Vec5(const T* d); Vec5(const T a); Vec5(const T x0, const T x1, const T x2, const T x3, const T x4); Vec5(const Vec& v); // Cast Operation template Vec5(const Vec& v); // Mutators void set(const T x0, const T x1, const T x2, const T x3, const T x4); }; // Declare a few common typdefs typedef Vec5 Vec5b; typedef Vec5 Vec5c; typedef Vec5 Vec5uc; typedef Vec5 Vec5s; typedef Vec5 Vec5us; typedef Vec5 Vec5i; typedef Vec5 Vec5ui; typedef Vec5 Vec5f; typedef Vec5 Vec5d; //============================================================================== // Vec5 //============================================================================== // Constructors /** Ctor that doesn't initialize. */ template inline Vec5::Vec5() {} /** Ctor that intalizes from array. */ template inline Vec5::Vec5(const T* d) : Vec(d) {} /** Ctor that intalizes all elements from a scalar. */ template inline Vec5::Vec5(const T a) : Vec(a) {} /** Ctor that initializes vector with given values. */ template inline Vec5::Vec5(const T x0, const T x1, const T x2, const T x3, const T x4) { set(x0,x1,x2,x3,x4); } /** Ctor that initializes an Vec5 with an Vec. */ template inline Vec5::Vec5(const Vec& v) : Vec(v) {} // Casting Operation /** Casting Ctor that initializes an Vec5 with a Vec. */ template template inline Vec5::Vec5(const Vec& v) : Vec(v) {} // Mutators /** Set vector. */ template inline void Vec5::set(const T x0, const T x1, const T x2, const T x3, const T x4) { x[0] = x0; x[1] = x1; x[2] = x2; x[3] = x3; x[4] = x4; } //============================================================================== } // NAMESPACE puma //============================================================================== #endif // RTC_VEC5_H defined //==============================================================================