#pragma once#include"itkLightObject.h"#include"itkObjectFactory.h"#include"itkParticleSystem.h"#include"itkWeakPointer.h"#include"vnl/vnl_vector_fixed.h"namespaceitk{template<unsignedintVDimension>classParticleVectorFunction:publicLightObject{public:typedefParticleVectorFunctionSelf;typedefSmartPointer<Self>Pointer;typedefSmartPointer<constSelf>ConstPointer;typedefLightObjectSuperclass;itkTypeMacro(ParticleVectorFunction,LightObject);typedefParticleSystemParticleSystemType;typedefvnl_vector_fixed<double,VDimension>VectorType;// itkNewMacro(Self);itkStaticConstMacro(Dimension,unsignedint,VDimension);virtualVectorTypeEvaluate(unsignedint,unsignedint,constParticleSystemType*,double&maxtimestep)const=0;virtualVectorTypeEvaluate(unsignedint,unsignedint,constParticleSystemType*,double&maxtimestep,double&energy)const=0;virtualdoubleEnergy(unsignedint,unsignedint,constParticleSystemType*)const=0;virtualvoidResetBuffers(){}virtualvoidAfterIteration(){}virtualvoidBeforeIteration(){}virtualvoidBeforeEvaluate(unsignedint,unsignedint,constParticleSystemType*){}virtualvoidSetParticleSystem(ParticleSystemType*p){m_ParticleSystem=p;}virtualParticleSystemType*GetParticleSystem()const{returnm_ParticleSystem;}virtualvoidSetDomainNumber(unsignedinti){m_DomainNumber=i;}virtualintGetDomainNumber()const{returnm_DomainNumber;}virtualtypenameParticleVectorFunction<VDimension>::PointerClone(){std::cerr<<"Error: base class ParticleVectorFunction Clone method called!\n";std::cerr<<"Threaded run of current parameters not supported!\n";returnnullptr;}protected:ParticleVectorFunction():m_ParticleSystem(0),m_DomainNumber(0){}virtual~ParticleVectorFunction(){}voidoperator=(constParticleVectorFunction&);ParticleVectorFunction(constParticleVectorFunction&);ParticleSystemType*m_ParticleSystem;unsignedintm_DomainNumber;};}// namespace itk