/*========================================================================= Program: ShapeWorks: Particle-based Shape Correspondence & Visualization Module: $RCSfile: itkParticleVectorFunction.h,v $ Date: $Date: 2011/03/24 01:17:34 $ Version: $Revision: 1.2 $ Author: $Author: wmartin $ Copyright (c) 2009 Scientific Computing and Imaging Institute. See ShapeWorksLicense.txt for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information.=========================================================================*/#ifndef __itkParticleVectorFunction_h#define __itkParticleVectorFunction_h#include"itkLightObject.h"#include"itkObjectFactory.h"#include"itkWeakPointer.h"#include"itkParticleSystem.h"#include"vnl/vnl_vector_fixed.h"namespaceitk{template<unsignedintVDimension>classParticleVectorFunction:publicLightObject{public:typedefParticleVectorFunctionSelf;typedefSmartPointer<Self>Pointer;typedefSmartPointer<constSelf>ConstPointer;typedefLightObjectSuperclass;itkTypeMacro(ParticleVectorFunction,LightObject);typedefParticleSystem<VDimension>ParticleSystemType;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;};}//end namespace#if ITK_TEMPLATE_EXPLICIT//# include "Templates/itkParticleVectorFunction+-.h"#endif#if ITK_TEMPLATE_TXX//# include "itkParticleVectorFunction.txx"#endif#endif