#if defined (_MSC_VER) && (_MSC_VER >= 1000) #pragma once #endif #ifndef _INC_BEH_UniformScale_42E452A7009C_INCLUDED #define _INC_BEH_UniformScale_42E452A7009C_INCLUDED #include "Behavior.h" namespace mial{ /*! A derived class of the behavioral ABC this class performs a uniform scaling of the deformable organism with user provided duration and magnitude. The power of the framework is demonstrated here in that by eliciting its attached physics layer's scale deformation this behavior may be performed on any physics layer providing that deformation. This behavior does not have any sub-behaviors. \param Type the internal type used for storage \param nDims the number of dimensions */ template class Beh_UniformScale : public Behavior { public: //Smart pointers typedef Beh_UniformScale Self; typedef itk::SmartPointer Pointer; typedef itk::SmartPointer ConstPointer; typedef itk::WeakPointer ConstWeakPointer; itkNewMacro(Self); typedef typename Behavior::Error Error; //! A structure defining the inputs for the behavior. /*! Since structures support public inheritance derived class must inherit from this class in their definitions of behaviorIn. */ struct behaviorIn: public Behavior::behaviorIn{ //Setup the smart pointer typedef behaviorIn Self; typedef itk::SmartPointer Pointer; typedef itk::SmartPointer ConstPointer; typedef itk::WeakPointer ConstWeakPointer; itkNewMacro(Self); //Define all custom here //! The amount to scale the deformable organism by (passed onto the deformation). double scaleAmount; //! The duration of the translation in deformable organism time. int duration; //! A method for converting stream-based arguments into the structures members (marshalling). /*! Stream is expected as "duration amount" */ bool fillFromStream(std::stringstream &args){ args >> duration; args >> scaleAmount; return true;}; protected: behaviorIn(){}; }; //! Internal recording of when the behavior started running. double startTime; //! Internal recording of when the behavior is set to end. double endTime; //! Example run method that scales the organism. virtual bool run(typename Behavior::behaviorIn * i, std::stringstream *s); bool isFinished(){return (this->physLayer->getTime()>endTime);}; virtual bool update(){return false;}; virtual void cleanUp(); protected: Beh_UniformScale(); }; }//end mial #include "Beh_UniformScale.cxx" #endif /* _INC_BEH_UniformScale*/