Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkCovariantVector.h

Go to the documentation of this file.
00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkCovariantVector.h,v $ 00005 Language: C++ 00006 Date: $Date: 2003/09/10 14:29:05 $ 00007 Version: $Revision: 1.26 $ 00008 00009 Copyright (c) Insight Software Consortium. All rights reserved. 00010 See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details. 00011 00012 This software is distributed WITHOUT ANY WARRANTY; without even 00013 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00014 PURPOSE. See the above copyright notices for more information. 00015 00016 =========================================================================*/ 00017 #ifndef __itkCovariantVector_h 00018 #define __itkCovariantVector_h 00019 00020 00021 #include "itkFixedArray.h" 00022 #include "vnl/vnl_vector_ref.h" 00023 #include "itkIndent.h" 00024 #include "itkVector.h" 00025 00026 00027 namespace itk 00028 { 00029 00063 template<class T, unsigned int NVectorDimension=3> 00064 class ITK_EXPORT CovariantVector : public FixedArray<T,NVectorDimension> 00065 { 00066 public: 00068 typedef CovariantVector Self; 00069 typedef FixedArray<T,NVectorDimension> Superclass; 00070 00073 typedef T ValueType; 00074 00076 itkStaticConstMacro(Dimension, unsigned int, NVectorDimension); 00077 00079 typedef Self CovariantVectorType; 00080 00082 typedef FixedArray<T, NVectorDimension> BaseArray; 00083 00085 static unsigned int GetCovariantVectorDimension() 00086 { return NVectorDimension; } 00087 00089 void Set_vnl_vector( const vnl_vector<T> & ); 00090 00092 vnl_vector_ref<T> Get_vnl_vector( void ); 00093 00095 vnl_vector<T> Get_vnl_vector( void ) const; 00096 00098 CovariantVector() {} 00099 00101 CovariantVector(const Self& r): BaseArray(r) {} 00102 CovariantVector(const ValueType r[Dimension]): BaseArray(r) {} 00103 00105 CovariantVector& operator= (const Self& r); 00106 CovariantVector& operator= (const ValueType r[Dimension]); 00107 00109 const Self& operator*=(const ValueType &value); 00110 00112 const Self& operator/=(const ValueType &value); 00113 00115 const Self& operator+=(const Self &vec); 00116 00118 const Self& operator-=(const Self &vec); 00119 00121 Self operator-() const; 00122 00124 Self operator+(const Self &vec) const; 00125 00127 Self operator-(const Self &vec) const; 00128 00131 Self operator*(const ValueType& val) const; 00132 00136 ValueType operator*(const Self &vec) const; 00137 00140 ValueType operator*(const Vector<T,NVectorDimension> &vec) const; 00141 00144 Self operator/(const ValueType& val) const; 00145 00147 ValueType GetNorm( void ) const; 00148 00150 ValueType GetSquaredNorm( void ) const; 00151 00153 void PrintSelf(std::ostream& os, Indent indent) const; 00154 00157 template < typename TCoordRepB > 00158 void CastFrom( const CovariantVector<TCoordRepB,NVectorDimension> & pa ) 00159 { 00160 for(unsigned int i=0; i<NVectorDimension; i++ ) 00161 { 00162 (*this)[i] = static_cast<T>( pa[i] ); 00163 } 00164 } 00165 00166 00167 }; 00168 00169 00170 } // end namespace itk 00171 00172 00173 #ifndef ITK_MANUAL_INSTANTIATION 00174 #include "itkCovariantVector.txx" 00175 #endif 00176 00177 00178 #endif

Generated at Sat Mar 31 02:16:27 2007 for ITK by doxygen 1.3.8 written by Dimitri van Heesch, © 1997-2000