00001 #if defined (_MSC_VER) && (_MSC_VER >= 1000) 00002 #pragma once 00003 #endif 00004 #ifndef _INC_BEH_TRANSLATEALL 00005 #define _INC_BEH_TRANSLATEALL 00006 00007 #include "Behavior.h" 00008 00009 00010 namespace mial{ 00011 00025 template<class Type, int nDims> 00026 class Beh_TranslateAll 00027 : public Behavior<Type, nDims> 00028 { 00029 public: 00030 //Smart pointers 00031 typedef Beh_TranslateAll Self; 00032 typedef itk::SmartPointer<Self> Pointer; 00033 typedef itk::SmartPointer<const Self> ConstPointer; 00034 typedef itk::WeakPointer<const Self> ConstWeakPointer; 00035 00036 itkNewMacro(Self); 00037 00038 typedef typename Behavior<Type,nDims>::Error Error; 00040 00043 struct behaviorIn: public Behavior<Type,nDims>::behaviorIn{ 00044 //Setup the smart pointer 00045 typedef behaviorIn Self; 00046 typedef itk::SmartPointer<Self> Pointer; 00047 typedef itk::SmartPointer<const Self> ConstPointer; 00048 typedef itk::WeakPointer<const Self> ConstWeakPointer; 00049 itkNewMacro(Self); 00050 00051 //Define all custom here 00053 double translateAmount[nDims]; 00055 int duration; 00056 00058 00061 bool fillFromStream(std::stringstream &args){ 00062 args>> duration; 00063 for(int i=0;i<nDims;i++){ 00064 args >> translateAmount[i];} 00065 return true;}; 00066 00067 protected: 00068 behaviorIn(){}; 00069 }; 00071 double startTime; 00073 double endTime; 00074 00075 virtual bool run(typename Behavior<Type,nDims>::behaviorIn * i, std::stringstream *s); 00076 bool isFinished(){return (this->physLayer->getTime()>endTime);}; 00077 00078 virtual bool update(); 00079 virtual void cleanUp(); 00080 00081 protected: 00082 Beh_TranslateAll(); 00083 00084 typename behaviorIn::Pointer input; 00085 }; 00086 }//end mial 00087 #include "Beh_TranslateAll.cxx" 00088 #endif /* _INC_BEH_TRANSLATEALL_42E452A7009C_INCLUDED */