HyperspaceExplorer 0.7.1
|
00001 /* 00002 * File: SinglethreadedTransformation.h 00003 * Author: lene 00004 * 00005 * Created on March 30, 2012, 5:52 PM 00006 */ 00007 00008 #ifndef SINGLETHREADEDTRANSFORMATION_H 00009 #define SINGLETHREADEDTRANSFORMATION_H 00010 00011 #include "Transformation.h" 00012 00014 00027 template <unsigned N, unsigned P, typename NUM = double> 00028 class SinglethreadedTransformation: public TransformationImpl< N, P, NUM > { 00029 00030 public: 00031 00033 typedef typename FunctionValueGrid< N, P, NUM >::value_storage_type value_storage_type; 00034 00036 00040 SinglethreadedTransformation(const VecMath::Rotation<N, NUM> &rotation, 00041 const VecMath::Vector<N, NUM> &translation, 00042 const VecMath::Vector<N, NUM> &scale); 00043 00045 00049 virtual value_storage_type transform(const value_storage_type &operand) const; 00050 00051 private: 00052 00053 void perform_transformation(const VecMath::Vector<N, NUM>& x, const VecMath::Vector<N, NUM>& xtrans); 00054 00055 friend class TransformationFactory; 00056 friend class SinglethreadedTransformation<N, P+1, NUM>; 00057 }; 00058 00060 00067 template <unsigned N, typename NUM> 00068 class SinglethreadedTransformation<N, 1, NUM>: public TransformationImpl< N, 1, NUM > { 00069 00070 public: 00071 00073 typedef typename FunctionValueGrid< N, 1, NUM >::value_storage_type value_storage_type; 00074 00076 00080 SinglethreadedTransformation(const VecMath::Rotation<N, NUM> &rotation, 00081 const VecMath::Vector<N, NUM> &translation, 00082 const VecMath::Vector<N, NUM> &scale); 00083 00084 void perform_transformation(const VecMath::Vector<N, NUM>& x, const VecMath::Vector<N, NUM>& xtrans); 00085 00087 00091 virtual value_storage_type transform(const value_storage_type &operand) const; 00092 00093 private: 00094 00095 friend class TransformationFactory; 00096 friend class SinglethreadedTransformation<N, 2, NUM>; 00097 }; 00098 00099 #endif /* SINGLETHREADEDTRANSFORMATION_H */ 00100